Skip to content

Commit

Permalink
ER Training JS Updates (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
x0xMaximus committed Apr 25, 2017
1 parent 78114b5 commit ab85e94
Show file tree
Hide file tree
Showing 34 changed files with 158 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Original file line number Diff line number Diff line change
Expand Up @@ -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}];
Original file line number Diff line number Diff line change
Expand Up @@ -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)'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}];
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!'}];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
Expand All @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
Expand All @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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); });
Expand All @@ -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();
});

Expand All @@ -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},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(); }
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit ab85e94

Please sign in to comment.