comparison ape.js @ 687:f602b19b20fd

Added mandatory pre/post test questions
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Tue, 21 Apr 2015 21:15:12 +0100
parents 820805ac7326
children 8babb8c22d59
comparison
equal deleted inserted replaced
686:fe18710dae70 687:f602b19b20fd
581 // Check if current state is a question! 581 // Check if current state is a question!
582 if (preTest.children[index].nodeName == 'question') { 582 if (preTest.children[index].nodeName == 'question') {
583 var questionId = preTest.children[index].attributes['id'].value; 583 var questionId = preTest.children[index].attributes['id'].value;
584 var questionHold = document.createElement('comment'); 584 var questionHold = document.createElement('comment');
585 var questionResponse = document.getElementById(questionId + 'response'); 585 var questionResponse = document.getElementById(questionId + 'response');
586 var mandatory = preTest.children[index].attributes['mandatory'];
587 if (mandatory != undefined){
588 if (mandatory.value == 'true') {mandatory = true;}
589 else {mandatory = false;}
590 } else {mandatory = false;}
591 if (mandatory == true && questionResponse.value.length == 0) {
592 return index;
593 }
586 questionHold.id = questionId; 594 questionHold.id = questionId;
587 questionHold.innerHTML = questionResponse.value; 595 questionHold.innerHTML = questionResponse.value;
588 postPopupResponse(questionHold); 596 postPopupResponse(questionHold);
589 } 597 }
590 index++; 598 index++;