changeset 949:48e05b7a16e0

Fixed Bug #1233: Failure to correctly give IDs to text entry if a question was the first option on the statement.
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Mon, 25 May 2015 10:06:28 +0100
parents 46eca4a8ad43
children 05e7edb032b9
files ape.js example_eval/project.xml
diffstat 2 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/ape.js	Sun May 24 11:45:35 2015 +0100
+++ b/ape.js	Mon May 25 10:06:28 2015 +0100
@@ -566,12 +566,14 @@
 		preTestOption.innerHTML = '<span>'+child.textContent+'</span>';
 	} else if (child.nodeName == 'question')
 	{
-		var questionId = child.attributes['id'].value;
 		var textHold = document.createElement('span');
 		textHold.innerHTML = child.textContent;
-		textHold.id = questionId + 'response';
 		var textEnter = document.createElement('textarea');
+		textEnter.id = child.attributes['id'].value + 'response';
+		var br = document.createElement('br');
+		preTestOption.innerHTML = null;
 		preTestOption.appendChild(textHold);
+		preTestOption.appendChild(br);
 		preTestOption.appendChild(textEnter);
 	}
 	var nextButton = document.createElement('button');
--- a/example_eval/project.xml	Sun May 24 11:45:35 2015 +0100
+++ b/example_eval/project.xml	Mon May 25 10:06:28 2015 +0100
@@ -3,7 +3,10 @@
 	<setup interface="APE" projectReturn="null" randomiseOrder='true' collectMetrics='true'>
 		<PreTest>
 			<statement>Please listen to all mixes</statement>
-			<question id="location" mandatory="true">Please enter your listening location</question>
+			<question id="SessionID">Please enter your name.</question>
+			<question id="location" mandatory="true">Please enter your listening location (Yellow Room/SSL Duality or Red Room/Neve VR). </question>
+			<question id="SessionID">Please enter your name.</question>
+			<question id="location" mandatory="true">Please enter your listening location (Yellow Room/SSL Duality or Red Room/Neve VR). </question>
 		</PreTest>
 		<PostTest>
 			<statement>Thank you for taking this listening test.</statement>
@@ -18,7 +21,7 @@
 			<metricEnable>elementFlagMoved</metricEnable>
 		</Metric>
 	</setup>
-	<audioHolder id='0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='1' loop='false' elementComments='true'>
+	<audioHolder id='0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='0' loop='false' elementComments='true'>
 		<interface>
 			<title>Example Test Question</title>
 			<scale position="0">Min</scale>
@@ -42,8 +45,8 @@
 			<statement>Start the Test 3</statement>
 		</PreTest>
 		<PostTest>
-			<statement>Please take a break before the next test</statement>
 			<question id="testComment" mandatory="true">How did you find the test</question>
+			<question id="songGenre" mandatory="true">How would you describe the genre of this song? Multiple answers possible. </question>
 	</PostTest>
 	</audioHolder>
 </BrowserEvalProjectDocument>
\ No newline at end of file