comparison ape.js @ 43:2fd137d891a7 Dev_main

Completed more pre-test/post-test popup functions. Presents save and locks test on completion
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Fri, 10 Apr 2015 15:30:44 +0100
parents b163842c6002
children c57aba852764
comparison
equal deleted inserted replaced
42:b163842c6002 43:2fd137d891a7
87 } 87 }
88 }; 88 };
89 // Create Submit (save) button 89 // Create Submit (save) button
90 var submit = document.createElement("button"); 90 var submit = document.createElement("button");
91 submit.innerHTML = 'Submit'; 91 submit.innerHTML = 'Submit';
92 submit.onclick = function() { 92 submit.onclick = buttonSubmitClick;
93 // TODO: Update this for postTest tags
94 createProjectSave(projectReturn)
95 };
96 // Append the interface buttons into the interfaceButtons object. 93 // Append the interface buttons into the interfaceButtons object.
97 interfaceButtons.appendChild(playback); 94 interfaceButtons.appendChild(playback);
98 interfaceButtons.appendChild(submit); 95 interfaceButtons.appendChild(submit);
99 interfaceButtons.appendChild(downloadPoint); 96 interfaceButtons.appendChild(downloadPoint);
100 97
328 var questionId = preTest.children[index].attributes['id'].value; 325 var questionId = preTest.children[index].attributes['id'].value;
329 var questionHold = document.createElement('comment'); 326 var questionHold = document.createElement('comment');
330 var questionResponse = document.getElementById(questionId + 'response'); 327 var questionResponse = document.getElementById(questionId + 'response');
331 questionHold.id = questionId; 328 questionHold.id = questionId;
332 questionHold.innerHTML = questionResponse.value; 329 questionHold.innerHTML = questionResponse.value;
333 preTestQuestions.appendChild(questionHold); 330 if (currentState == 'preTest') {
331 preTestQuestions.appendChild(questionHold);
332 } else if (currentState = 'postTest') {
333 postTestQuestions.appendChild(questionHold);
334 }
334 } 335 }
335 index++; 336 index++;
336 if (index < preTest.children.length) 337 if (index < preTest.children.length)
337 { 338 {
338 // More to process 339 // More to process
353 preTestOption.appendChild(textEnter); 354 preTestOption.appendChild(textEnter);
354 } 355 }
355 } else { 356 } else {
356 // Time to clear 357 // Time to clear
357 preTestOption.innerHTML = null; 358 preTestOption.innerHTML = null;
358 hidePopup(); 359 if (currentState != 'postTest') {
359 // Progress the state! 360 hidePopup();
360 advanceState(); 361 // Progress the state!
362 advanceState();
363 } else {
364 a = createProjectSave(projectReturn);
365 preTestOption.appendChild(a);
366 }
361 } 367 }
362 return index; 368 return index;
363 } 369 }
364 370
365 function showPopup() 371 function showPopup()