diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/basics.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/basics.jade
index c0b1d13d..077754f4 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/basics.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/basics.jade
@@ -12,7 +12,7 @@ block content
.row.m-t-1
.col-xs-10.col-xs-offset-1.entity_tag
- #basics
+ #er-training-basics
p Biomedical research literature is growing rapidly around the world, making it hard for researchers to acquire all new relevant information . By joining Mark2Cure I am helping to tag research articles so that they are readily searchable and can be linked to find new relationships, new discoveries, and hopefully new treatment strategies. I contribute to Mark2Cure because I am ready to help .
.col-md-8.col-md-offset-2
@@ -21,5 +21,3 @@ block content
.row.m-t-1
a(href='{% url "training:introduction" step_num=2 %}', id='next', disabled).btn.btn-primary.pull-right.disabled Next
-block post-footer
- script(src='/static/js/pages/training/entity-recognition/basic.js')
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-1.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-1.jade
index 8521aeff..28dbf33b 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-1.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-1.jade
@@ -20,5 +20,6 @@ block next-link
block answers
script.
+ var key = '0-1';
var help = [{text: '*', msg: 'The concept is the word, "help". Just mark the word, "help"'}];
var answers = [{text:'help', start: 68}, {text:'help', start: 174}];
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-2.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-2.jade
index 457f158a..28ea94c5 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-2.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-2.jade
@@ -18,6 +18,7 @@ block next-link
block answers
script.
+ var key = '0-2';
var help = [
{text: 'help', msg: 'The concept has changed. Mark the phrases mentioned above.'},
{text: 'can read , is willing to learn , and wants to help', msg: 'Mark each phrase in a separate span. (ie- leave out the commas)'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-3.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-3.jade
index cafea88c..f53dca0d 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-3.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-3.jade
@@ -21,8 +21,9 @@ block next-link
block answers
script.
+ var key = '0-3';
var help = [
/* (TODO) This first one isn't being triggered */
{text: 'Mark2Cure ( M2C )', msg: 'Whenever possible, do NOT mark abbreviations together with the term they represent (ie- exclude the parenthesis)'},
{text: 'abbreviations', msg: 'Mark the actual abbreviation of Mark2Cure, NOT the word, "abbreviations"'}];
- var answers = [{text: 'Mark2Cure', start: 3}, {text: 'M2C', start: 15}];
+ var answers = [{text: 'Mark2Cure', start: 3}, {text: 'M2C', start: 15}];
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-base.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-base.jade
index 9c17e7ba..5dd05164 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-base.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-0/step-base.jade
@@ -55,6 +55,7 @@ block post-footer
block answers
script.
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
var validation_check = function(collection) {
if(validate(collection, answers)) { correct(); }
};
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-1.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-1.jade
index 6e762898..72823df5 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-1.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-1.jade
@@ -18,6 +18,7 @@ block next-link
block answers
script.
$('#Training1Modal').modal('show');
+ var key = '1-1';
var help = [
{text: 'patients', msg: 'Do not mark general terms such as ‘patients’. Just mark the disease'},
{text: 'diabetes patients', msg: 'Almost! Do not mark general terms such as ‘patients’. Just mark the disease'}
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-2.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-2.jade
index 0334df5e..241af9bc 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-2.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-2.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '1-2';
var help = [
{text: 'diabetes', msg: 'You can be more specific, try again!'},
{text: 'diabetes mellitus', msg: 'Almost, but you can still be more specific than that. Try again!'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-3.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-3.jade
index 22ea16c7..e936edef 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-3.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-3.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '1-3';
var help = [
{text: 'diabetes', msg: 'You can be more specific, try again!'},
{text: 'diabetes mellitus', msg: 'Almost, but you can still be more specific than that. Try again!'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-4.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-4.jade
index ba32affd..6637555f 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-4.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-4.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '1-4';
var help = [
{text: 'type 2 diabetes mellitus patients ( ie- T2DM patients', msg: 'Do not mark generic terms like, "patients." Whenever possible, do NOT mark abbreviations together with the term they represent'},
{text: 'type 2 diabetes mellitus patients ( ie- T2DM', msg: 'Do not mark generic terms like, "patients." Whenever possible, do NOT mark abbreviations together with the term they represent'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-5.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-5.jade
index 46a9eb08..3607a8ea 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-5.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-5.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '1-5';
var help = [
{text: 'arthritis', msg: 'You can be more specific, try again!'},
{text: 'disease', msg: 'You can be more specific, try again!'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-6.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-6.jade
index 85973a36..b83d9d3b 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-6.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-6.jade
@@ -18,6 +18,7 @@ block next-link
block answers
script.
+ var key = '1-6';
var help = [
{text: 'symptoms', msg: 'Do not mark generic terms such as "symptoms" or "disease" unless it is part of the name of the disease or disease class'},
{text: 'diseases', msg: 'Do not mark generic terms such as "symptoms" or "disease" unless it is part of the name of the disease or disease class'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-7.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-7.jade
index e5231bdf..caf02c30 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-7.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-7.jade
@@ -18,6 +18,7 @@ block next-link
block answers
script.
+ var key = '1-7';
var help = [
{text: 'blood glucose levels', msg: 'That\'s just a test result anyone could have. Mark all the terms needed for it to be a sign'},
{text: 'abnormal blood glucose', msg: 'Almost, mark all the terms needed for it to be understood as a sign'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-8.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-8.jade
index f83322f7..bd3ef180 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-8.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-8.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '1-8';
var help = [
{text: 'tingling', msg: '"tingling" alone is not a symptom of this disease. be more specific, mark all the terms needed for it to be a symptom'},
{text: 'tingling and/or numbness', msg: '"tingling and/or numbness" alone is not a symptom of this disease. be more specific, mark all the terms needed for it to be a symptom'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-base.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-base.jade
index de2706d7..fac1cf61 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-base.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-1/step-base.jade
@@ -67,6 +67,7 @@ block post-footer
block answers
script.
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
var validation_check = function(collection) {
if(validate(collection, answers)) { correct(); }
};
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-1.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-1.jade
index bf189b79..3966514f 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-1.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-1.jade
@@ -16,6 +16,7 @@ block next-link
block answers
script.
$('#Training2Modal').modal('show');
+ var key = '2-1';
var help = [
{text: 'Cystic Fibrosis', msg: 'Do NOT mark disease concepts in this module. This module is ONLY about genes and gene products'},
{text: 'CF', msg: 'Do NOT mark disease concepts in this module. This module is ONLY about genes and gene products'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-2.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-2.jade
index c096d540..6e5d8d3e 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-2.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-2.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '2-2';
var help = [
{text: 'protein', msg: 'Do not mark generic terms such as ‘gene’ or ‘protein’. Use them as hints to find the actual gene or protein and mark that instead'},
{text: 'perturbations in mucosal viscosity', msg: 'Remember, the concept in this tutorial is genes and gene products, don’t mark disease concepts'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-3.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-3.jade
index ee866fca..36d9005a 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-3.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-3.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '2-3';
var help = [
{text: 'increased mucosal viscosity', msg: 'Remember, the concept in this tutorial is genes and gene products, don’t mark disease concepts'},
{text: 'CF', msg: 'Remember, the concept in this tutorial is genes and gene products, don’t mark disease concepts'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-4.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-4.jade
index 2beeadf8..4a8b17a4 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-4.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-4.jade
@@ -21,6 +21,7 @@ block next-link
block answers
script.
+ var key = '2-4';
var help = [
{text: 'family', msg: 'Don\'t mark generic terms like family'},
{text: 'MIR199 family', msg: 'Almost! Don\'t mark generic terms like family. Try again!'}];
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-base.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-base.jade
index 911fef48..4989350c 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-base.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-2/step-base.jade
@@ -66,6 +66,7 @@ block post-footer
block answers
script.
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
var validation_check = function(collection) {
if(validate(collection, answers)) { correct(); }
};
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-1.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-1.jade
index f4ca9e15..7e0d1e8f 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-1.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-1.jade
@@ -18,6 +18,7 @@ block next-link
block answers
script.
$('#Training3Modal').modal('show');
+ var key = '3-1';
var help = [
{text: '110140', msg: 'Be sure to include the entire name of the experimental drug'},
{text: 'pain', msg: 'Mark only treatment concepts in this tutorial. Do NOT mark disease or gene concepts'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-2.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-2.jade
index 2cb29d10..c0ccfcfc 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-2.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-2.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '3-2';
var help = [
{text: 'depression', msg: 'Mark only treatment concepts in this tutorial. Do NOT mark disease or gene concepts'},
{text: 'fluoxetine', msg: 'Mark the full name of the drug or treatment as specifically as possible'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-3.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-3.jade
index 4e1fa6c5..210af4d4 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-3.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-3.jade
@@ -22,6 +22,7 @@ block next-link
block answers
script.
+ var key = '3-3';
var help = [
{text: 'serotonin', msg: 'Nice try, but serotonin is not a drug – it\'s a neurotransmitter. Try again!'},
{text: 'selective serotonin', msg: 'Include the entire name of the drug class'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-4.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-4.jade
index ca3e448a..28df9f81 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-4.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-4.jade
@@ -21,6 +21,7 @@ block next-link
block answers
script.
+ var key = '3-4';
var help = [
{text: 'SSRI regiments', msg: 'When marking drug-based therapies, do not include general terms such as ‘therapy’ or ‘regiment’, unless it’s part of the drug name'},
{text: 'Paxil therapy', msg: 'When marking drug-based therapies, do not include general terms such as ‘therapy’ or ‘regiment’, unless it’s part of the drug name'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-5.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-5.jade
index 4f765d29..49637a21 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-5.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-5.jade
@@ -17,6 +17,7 @@ block next-link
block answers
script.
+ var key = '3-5';
var help = [
{text: 'Obsessive-compulsive disorders', msg: 'Remember, the concept in this tutorial is treatments, don’t mark disease concepts'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-base.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-base.jade
index 0c2028a2..353bbfef 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-base.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-3/step-base.jade
@@ -61,6 +61,7 @@ block post-footer
block answers
script.
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
var validation_check = function(collection) {
if(validate(collection, answers)) { correct(); }
};
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-1.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-1.jade
index c86ae94d..bd3eb013 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-1.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-1.jade
@@ -26,6 +26,7 @@ block highlightkey
block answers
script.
$('#Training4Modal').modal('show');
+ var key = '4-1';
var help = [
{text: 'Ehlers–Danlos syndrome ( EDS', msg: 'Whenever possible, don\'t mark disease abbreviations in the same span as the disease.'},
{text: 'Ehlers–Danlos', msg: 'Almost, mark the entire name of the disease.'},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-2.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-2.jade
index 39309086..b2f3db26 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-2.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-2.jade
@@ -49,6 +49,7 @@ block ypet
}) );
});
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
YPet[0].currentView.collection.parentDocument.get('annotations').on('add', function(model, collection) { validation_check(collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('change', function(model) { validation_check(model.collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('remove', function(model, collection) { validation_check(collection); });
@@ -67,6 +68,7 @@ block ypet
script.
+ var key = '4-2';
var answers = [
{text: "Ehlers–Danlos syndrome", start: 0, type_id: 0},
{text: "EDS", start: 25, type_id: 0},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-3.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-3.jade
index 7455e8cf..47519285 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-3.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-3.jade
@@ -47,6 +47,7 @@ block ypet
}) );
});
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
YPet[0].currentView.collection.parentDocument.get('annotations').on('add', function(model, collection) { validation_check(collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('change', function(model) { validation_check(model.collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('remove', function(model, collection) { validation_check(collection); });
@@ -65,6 +66,7 @@ block ypet
script.
+ var key = '4-3';
var answers = [
{text: "Ehlers–Danlos syndrome", start: 0, type_id: 0},
{text: "EDS", start: 25, type_id: 0},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-4.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-4.jade
index 4ddb9532..f8970dc6 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-4.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-4.jade
@@ -50,6 +50,7 @@ block ypet
}) );
});
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
YPet[0].currentView.collection.parentDocument.get('annotations').on('add', function(model, collection) { validation_check(collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('change', function(model) { validation_check(model.collection); });
YPet[0].currentView.collection.parentDocument.get('annotations').on('remove', function(model, collection) { validation_check(collection); });
@@ -66,9 +67,11 @@ block ypet
setTimeout(function() {
$('#TrainingHelpModal').modal('show');
+ if(ga) { ga('send', 'event', 'ER Training', 'help-modal', key); }
}, 75 * 1000);
$('#hint-trigger').click(function() {
+ if(ga) { ga('send', 'event', 'ER Training', 'hint', key); }
$('#hint').slideDown();
});
@@ -79,6 +82,7 @@ block ypet
}, 75 * 1000);
});
+ var key = '4-4';
var answers = [
{text: "Ehlers–Danlos syndrome", start: 0, type_id: 0},
{text: "EDS", start: 25, type_id: 0},
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-5.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-5.jade
index 748dfd91..30ce05ea 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-5.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-5.jade
@@ -59,6 +59,7 @@ block ypet
});
});
YPet.start();
+ if(ga) { ga('send', 'event', 'ER Training', 'start', '4-5'); }
$('#next').one('click', function(evt) {
evt.preventDefault();
diff --git a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-base.jade b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-base.jade
index c8cf7678..f9365747 100644
--- a/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-base.jade
+++ b/mark2cure/training/templates/training/entity-recognition/exp-2-intro-4/step-base.jade
@@ -58,6 +58,7 @@ block post-footer
block answers
script.
+ if(ga) { ga('send', 'event', 'ER Training', 'start', key); }
var validation_check = function(collection) {
if(validate(collection, answers)) { correct(); }
};
diff --git a/mark2cure/training/templates/training/entity-recognition/includes/intro-1-js.jade b/mark2cure/training/templates/training/entity-recognition/includes/intro-1-js.jade
index 3fd9d241..4b9abc89 100644
--- a/mark2cure/training/templates/training/entity-recognition/includes/intro-1-js.jade
+++ b/mark2cure/training/templates/training/entity-recognition/includes/intro-1-js.jade
@@ -73,6 +73,7 @@ script.
model_json['help_message'] = '';
model_json['instructions_link'] = '';
incorrect_counter++;
+ if(ga) { ga('send', 'event', 'ER Training', 'error', key); }
/*
* Overlaps (start or before) check
diff --git a/static/js-src/pages/training/entity-recognition/basic.js b/static/js-src/pages/training/entity-recognition/basic.js
index 5b1aebcd..9ba92d43 100644
--- a/static/js-src/pages/training/entity-recognition/basic.js
+++ b/static/js-src/pages/training/entity-recognition/basic.js
@@ -1,106 +1,115 @@
-YPet.addInitializer(function(options) {
- var p = new Paragraph({'text': $('#basics').text().trim()});
- YPet.AnnotationTypes = new AnnotationTypeList([{name: 'Disease', color: '#d1f3ff'}]);
- YPet.addRegions({'basics': '#basics'});
- YPet['basics'].show(new WordCollectionView({collection: p.get('words')}))
-});
-YPet.start();
-
-
-$('a').on('click', function(evt) {
- if( $(this).hasClass('disabled') ) {
- evt.preventDefault();
- }
-});
-
-$('#next-container').popover({
- trigger: "hover",
- title: "Keep Going!",
- content: "Please complete the task before moving forward.",
- placement: "top",
- container: "body"
-});
-
-var step_function = function() {
- switch (step_idx) {
- case 0:
- case 1:
- $biomedical_el.popover({
- container: 'body',
- html: true,
- animation: false,
- content: function() {
- if(step_idx==0) {
- return 'Highlight words by clicking on them. Highlight the word \“Biomedical\”.';
- } else {
- return 'Remove the highlight by clicking again. Un-highlight the word \“Biomedical\”.';
- }
- },
- placement: 'bottom'
- });
- $biomedical_el.popover('show');
- break;
-
- case 2:
- $biomedical_el.popover('hide');
- $because_el.popover({
- container: 'body',
- html: true,
- animation: false,
- content: 'Highlight blocks of text by holding down your mouse button until you reach the end of the text you wish to highlight. Highlight the phrase \“because I am ready to help\”.',
- placement: 'top'
- });
- $because_el.popover('show');
- break;
-
- case 3:
- $biomedical_el.popover('hide');
- $because_el.popover('hide');
- $next_el.popover({
- container: 'body',
- html: true,
- animation: false,
- content: 'Click Next to continue!',
- placement: 'top'
- });
- $next_el.popover('show');
- $next_el.attr('disabled', false).removeClass('disabled');
- $('#next-container').popover('disable');
- break;
+if($('#er-training-basics').length) {
+
+ if(ga) { ga('send', 'event', 'ER Training', 'start', 'basics-0'); }
+
+ YPet.addInitializer(function(options) {
+ var p = new Paragraph({'text': $('#er-training-basics').text().trim()});
+ YPet.AnnotationTypes = new AnnotationTypeList([{name: 'Disease', color: '#d1f3ff'}]);
+ YPet.addRegions({'basics': '#er-training-basics'});
+ YPet['basics'].show(new WordCollectionView({collection: p.get('words')}))
+ });
+ YPet.start();
+
+
+ $('a').on('click', function(evt) {
+ if( $(this).hasClass('disabled') ) {
+ evt.preventDefault();
+ }
+ });
+
+ $('#next-container').popover({
+ trigger: "hover",
+ title: "Keep Going!",
+ content: "Please complete the task before moving forward.",
+ placement: "top",
+ container: "body"
+ });
+
+ var step_function = function() {
+ switch (step_idx) {
+ case 0:
+ case 1:
+ $biomedical_el.popover({
+ container: 'body',
+ html: true,
+ animation: false,
+ content: function() {
+ if(step_idx==0) {
+ return 'Highlight words by clicking on them. Highlight the word \“Biomedical\”.';
+ } else {
+ if(ga) { ga('send', 'event', 'ER Training', 'start', 'basics-1'); }
+ return 'Remove the highlight by clicking again. Un-highlight the word \“Biomedical\”.';
+ }
+ },
+ placement: 'bottom'
+ });
+ $biomedical_el.popover('show');
+ break;
+
+ case 2:
+ $biomedical_el.popover('hide');
+ $because_el.popover({
+ container: 'body',
+ html: true,
+ animation: false,
+ content: 'Highlight blocks of text by holding down your mouse button until you reach the end of the text you wish to highlight. Highlight the phrase \“because I am ready to help\”.',
+ placement: 'top'
+ });
+ $because_el.popover('show');
+ if(ga) { ga('send', 'event', 'ER Training', 'start', 'basics-2'); }
+ break;
+
+ case 3:
+ $biomedical_el.popover('hide');
+ $because_el.popover('hide');
+ $next_el.popover({
+ container: 'body',
+ html: true,
+ animation: false,
+ content: 'Click Next to continue!',
+ placement: 'top'
+ });
+ $next_el.popover('show');
+ $next_el.attr('disabled', false).removeClass('disabled');
+ $('#next-container').popover('disable');
+ if(ga) { ga('send', 'event', 'ER Training', 'start', 'basics-3'); }
+ break;
+ };
+
};
-};
+ var step_idx = 0;
+ $('body').ready(function() {
+ $biomedical_el = $('p.paragraph span:nth(0)');
+ $because_el = $('p.paragraph span:nth(56)');
+ $help_el = $('p.paragraph span:nth(61)');
+ same_line = $because_el.position().top == $help_el.position().top;
+ $next_el = $('#next');
-var step_idx = 0;
-$('body').ready(function() {
- $biomedical_el = $('p.paragraph span:nth(0)');
- $because_el = $('p.paragraph span:nth(56)');
- $help_el = $('p.paragraph span:nth(61)');
- same_line = $because_el.position().top == $help_el.position().top;
- $next_el = $('#next');
+ step_function();
+ });
- step_function();
-});
+ YPet['basics'].currentView.collection.parentDocument.get('annotations').on('add', function(model, collection) {
+ var model_json = model.toJSON();
-YPet['basics'].currentView.collection.parentDocument.get('annotations').on('add', function(model, collection) {
- var model_json = model.toJSON();
+ /* Unselect wrong answers */
+ if( !_.contains(['Biomedical', 'because I am ready to help'], model_json.text) && model.get('words').first() ) {
- /* Unselect wrong answers */
- if( !_.contains(['Biomedical', 'because I am ready to help'], model_json.text) && model.get('words').first() ) {
+ setTimeout(function() {
+ var first_word = model.get('words').first();
+ first_word.trigger('unclick');
+ }, 50);
- setTimeout(function() {
- var first_word = model.get('words').first();
- first_word.trigger('unclick');
- }, 50);
+ collection.drawAnnotations(model);
+ }
- collection.drawAnnotations(model);
- }
+ if(model_json.text == "Biomedical" && collection.length == 1) { step_idx = 1; step_function(); }
+ if(model_json.text == "because I am ready to help" && collection.length == 1) { step_idx = 3; step_function(); }
+ });
- if(model_json.text == "Biomedical" && collection.length == 1) { step_idx = 1; step_function(); }
- if(model_json.text == "because I am ready to help" && collection.length == 1) { step_idx = 3; step_function(); }
-});
+ YPet['basics'].currentView.collection.parentDocument.get('annotations').on('remove', function(model, collection) {
+ var model_json = model.toJSON();
+ if(model_json.text == "Biomedical" && collection.length == 0) { step_idx = 2; step_function(); }
+ });
-YPet['basics'].currentView.collection.parentDocument.get('annotations').on('remove', function(model, collection) {
- var model_json = model.toJSON();
- if(model_json.text == "Biomedical" && collection.length == 0) { step_idx = 2; step_function(); }
-});
+}
diff --git a/templates/base.jade b/templates/base.jade
index 5d2285ba..9766a89c 100644
--- a/templates/base.jade
+++ b/templates/base.jade
@@ -69,8 +69,7 @@ head
block footer
include includes/footer
- block js-libs
- script(src='#{STATIC_URL}js/mark2cure.min.js')
+
a#support-icon(data-toggle="modal", data-target="#support-modal")
img(src='#{STATIC_URL}images/support-icon.png')
@@ -98,6 +97,20 @@ head
button(type="button", data-dismiss="modal").btn.btn-primary Cancel
button(type="button").btn.btn-primary.modal-form-submit Submit
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-43341013-1', 'auto');
+ ga('send', 'pageview');
+
+ - if debug
+ script.
+ ga('set', 'sendHitTask', null);
+
+ script(src='#{STATIC_URL}js/mark2cure.min.js')
+
script.
var raven_options = {
logger: 'js-logger',
@@ -111,17 +124,6 @@ head
id: "{{ request.user.pk }}"
});
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-43341013-1', 'auto');
- ga('send', 'pageview');
-
- - if debug
- script.
- ga('set', 'sendHitTask', null);
-
block post-footer
block modals