# HG changeset patch # User Nicholas Jillings # Date 1429647312 -3600 # Node ID c943465de196b513fce3410f680466109c491783 # Parent fcd6eaa4f2fa7dd0567618ac6c91a0f5c46d19ab Added mandatory pre/post test questions diff -r fcd6eaa4f2fa -r c943465de196 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 fcd6eaa4f2fa -r c943465de196 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 @@