comparison core.js @ 1369:ebe6c10bd52d

Bug #1395: Test timer is reset on each new test page.
author Nicholas Jillings <nickjillings@users.noreply.github.com>
date Tue, 02 Feb 2016 11:03:01 +0000
parents c277da1e89ca
children 2cd9f09455a5
comparison
equal deleted inserted replaced
1368:c277da1e89ca 1369:ebe6c10bd52d
1157 } 1157 }
1158 buffer.registerAudioObject(this.audioObjects[audioObjectId]); 1158 buffer.registerAudioObject(this.audioObjects[audioObjectId]);
1159 return this.audioObjects[audioObjectId]; 1159 return this.audioObjects[audioObjectId];
1160 }; 1160 };
1161 1161
1162 this.newTestPage = function(store) { 1162 this.newTestPage = function(audioHolderObject,store) {
1163 this.pageStore = store; 1163 this.pageStore = store;
1164 this.state = 0; 1164 this.state = 0;
1165 this.audioObjectsReady = false; 1165 this.audioObjectsReady = false;
1166 this.metric.reset(); 1166 this.metric.reset();
1167 for (var i=0; i < this.buffers.length; i++) 1167 for (var i=0; i < this.buffers.length; i++)
1168 { 1168 {
1169 this.buffers[i].users = []; 1169 this.buffers[i].users = [];
1170 } 1170 }
1171 this.audioObjects = []; 1171 this.audioObjects = [];
1172 this.timer = new timer();
1173 this.loopPlayback = audioHolderObject.loop;
1172 }; 1174 };
1173 1175
1174 this.checkAllPlayed = function() { 1176 this.checkAllPlayed = function() {
1175 arr = []; 1177 arr = [];
1176 for (var id=0; id<this.audioObjects.length; id++) { 1178 for (var id=0; id<this.audioObjects.length; id++) {
2307 this.specification = specificationObject; 2309 this.specification = specificationObject;
2308 this.insertPoint = document.getElementById("topLevelBody"); 2310 this.insertPoint = document.getElementById("topLevelBody");
2309 2311
2310 this.newPage = function(audioHolderObject,store) 2312 this.newPage = function(audioHolderObject,store)
2311 { 2313 {
2312 audioEngineContext.newTestPage(store); 2314 audioEngineContext.newTestPage(audioHolderObject,store);
2313 audioEngineContext.loopPlayback = audioHolderObject.loop;
2314 // Delete any previous audioObjects associated with the audioEngine
2315 audioEngineContext.audioObjects = [];
2316 interfaceContext.deleteCommentBoxes(); 2315 interfaceContext.deleteCommentBoxes();
2317 interfaceContext.deleteCommentQuestions(); 2316 interfaceContext.deleteCommentQuestions();
2318 loadTest(audioHolderObject,store); 2317 loadTest(audioHolderObject,store);
2319 }; 2318 };
2320 2319