# HG changeset patch # User Nicholas Jillings # Date 1428676244 -3600 # Node ID 2cc25941c433b18dc9aefd18207e3b769ec64b96 # Parent 2c25ca4d7ec604b71731c95ab21abb39d45f85a2 Completed more pre-test/post-test popup functions. Presents save and locks test on completion diff -r 2c25ca4d7ec6 -r 2cc25941c433 ape.js --- a/ape.js Fri Apr 10 15:21:49 2015 +0100 +++ b/ape.js Fri Apr 10 15:30:44 2015 +0100 @@ -89,10 +89,7 @@ // Create Submit (save) button var submit = document.createElement("button"); submit.innerHTML = 'Submit'; - submit.onclick = function() { - // TODO: Update this for postTest tags - createProjectSave(projectReturn) - }; + submit.onclick = buttonSubmitClick; // Append the interface buttons into the interfaceButtons object. interfaceButtons.appendChild(playback); interfaceButtons.appendChild(submit); @@ -330,7 +327,11 @@ var questionResponse = document.getElementById(questionId + 'response'); questionHold.id = questionId; questionHold.innerHTML = questionResponse.value; - preTestQuestions.appendChild(questionHold); + if (currentState == 'preTest') { + preTestQuestions.appendChild(questionHold); + } else if (currentState = 'postTest') { + postTestQuestions.appendChild(questionHold); + } } index++; if (index < preTest.children.length) @@ -355,9 +356,14 @@ } else { // Time to clear preTestOption.innerHTML = null; - hidePopup(); - // Progress the state! - advanceState(); + if (currentState != 'postTest') { + hidePopup(); + // Progress the state! + advanceState(); + } else { + a = createProjectSave(projectReturn); + preTestOption.appendChild(a); + } } return index; } diff -r 2c25ca4d7ec6 -r 2cc25941c433 core.js --- a/core.js Fri Apr 10 15:21:49 2015 +0100 +++ b/core.js Fri Apr 10 15:30:44 2015 +0100 @@ -100,6 +100,7 @@ var submitDiv = document.getElementById('download-point'); submitDiv.appendChild(a); } + return submitDiv; } function AudioEngine() {