# HG changeset patch # User Nicholas Jillings # Date 1429647312 -3600 # Node ID f602b19b20fd52fb5b67004cfa43f66dafd98beb # Parent fe18710dae70b90f0283cd561ccfc3bfb7331a09 Added mandatory pre/post test questions diff -r fe18710dae70 -r f602b19b20fd ape.js --- a/ape.js Tue Apr 21 16:50:10 2015 +0100 +++ b/ape.js Tue Apr 21 21:15:12 2015 +0100 @@ -583,6 +583,14 @@ var questionId = preTest.children[index].attributes['id'].value; var questionHold = document.createElement('comment'); var questionResponse = document.getElementById(questionId + 'response'); + var mandatory = preTest.children[index].attributes['mandatory']; + if (mandatory != undefined){ + if (mandatory.value == 'true') {mandatory = true;} + else {mandatory = false;} + } else {mandatory = false;} + if (mandatory == true && questionResponse.value.length == 0) { + return index; + } questionHold.id = questionId; questionHold.innerHTML = questionResponse.value; postPopupResponse(questionHold); diff -r fe18710dae70 -r f602b19b20fd apeTool.html --- a/apeTool.html Tue Apr 21 16:50:10 2015 +0100 +++ b/apeTool.html Tue Apr 21 21:15:12 2015 +0100 @@ -33,7 +33,7 @@