# HG changeset patch # User Giulio Moro # Date 1457835150 0 # Node ID fef9f13bec0a58ce18c1974509bf38cbc9dc6754 # Parent babcc4ac48eb5102159a1e90d16fb91bdba93be0 Workaround for #1658: in order to obtain a test with zero pages, set attribute hidden='true' in the one and only page diff -r babcc4ac48eb -r fef9f13bec0a core.js --- a/core.js Sat Mar 12 16:30:56 2016 +0000 +++ b/core.js Sun Mar 13 02:12:30 2016 +0000 @@ -1067,7 +1067,7 @@ buffer_ptr[n] = waveObj.decoded_data[c][n]; } } - + delete waveObj; } else { audioContext.decodeAudioData(bufferObj.xmlRequest.response, function(decodedData) { @@ -1475,10 +1475,16 @@ this.exportXMLDOM = function() { var file = storage.document.createElement('file'); - file.setAttribute('sampleRate',this.buffer.buffer.sampleRate); - file.setAttribute('channels',this.buffer.buffer.numberOfChannels); - file.setAttribute('sampleCount',this.buffer.buffer.length); - file.setAttribute('duration',this.buffer.buffer.duration); + var buf; + if(typeof(this.buffer) !== "undefined"){ + buf = this.buffer.buffer; + } else { + buf = {}; + } + file.setAttribute('sampleRate', buf.sampleRate); + file.setAttribute('channels', buf.numberOfChannels); + file.setAttribute('sampleCount', buf.length); + file.setAttribute('duration', buf.duration); this.storeDOM.appendChild(file); if (this.specification.type != 'outside-reference') { var interfaceXML = this.interfaceDOM.exportXMLDOM(this); @@ -2438,6 +2444,11 @@ interfaceContext.commentBoxes.deleteCommentBoxes(); interfaceContext.deleteCommentQuestions(); loadTest(audioHolderObject,store); + if(audioHolderObject.hidden === true){ + // work-around to have zero pages: set the attribute hidden=true and + // it will automatically skip over. + testState.advanceState(); + } }; // Bounded by interface!! diff -r babcc4ac48eb -r fef9f13bec0a example_eval/post_survey.xml --- a/example_eval/post_survey.xml Sat Mar 12 16:30:56 2016 +0000 +++ b/example_eval/post_survey.xml Sun Mar 13 02:12:30 2016 +0000 @@ -1,6 +1,6 @@ - + Please enter your location. (example mandatory text question) @@ -15,7 +15,7 @@ - + Thank you for taking this listening test. May God be with you. @@ -37,12 +37,13 @@ - + + + \ No newline at end of file diff -r babcc4ac48eb -r fef9f13bec0a example_eval/pre_survey.xml --- a/example_eval/pre_survey.xml Sat Mar 12 16:30:56 2016 +0000 +++ b/example_eval/pre_survey.xml Sun Mar 13 02:12:30 2016 +0000 @@ -13,7 +13,7 @@ - + This is a preliminary test for a study on the Hammond organ. You will be presented with pairs of stimuli. For each pair you will be asked to single out the one note that was produced by a heavier touch. Feel free to add any comments on the stimuli in the boxes at the bottom of each page of the test. @@ -40,12 +40,10 @@ - - Comment on fragment + \ No newline at end of file diff -r babcc4ac48eb -r fef9f13bec0a test-schema.xsd --- a/test-schema.xsd Sat Mar 12 16:30:56 2016 +0000 +++ b/test-schema.xsd Sun Mar 13 02:12:30 2016 +0000 @@ -73,6 +73,7 @@ +