changeset 1031:d4eecacc6558

Keep track of randomisation in console log; multipage example XML.
author Brecht De Man <BrechtDeMan@users.noreply.github.com>
date Mon, 15 Jun 2015 16:54:39 +0100
parents 057c6b039f4e
children 86a8ad38c414
files core.js example_eval/project.xml index.html
diffstat 3 files changed, 58 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/core.js	Mon Jun 15 13:09:46 2015 +0100
+++ b/core.js	Mon Jun 15 16:54:39 2015 +0100
@@ -1069,8 +1069,14 @@
 {
 	// This takes an array of information and randomises the order
 	var N = input.length;
-	var K = N;
+	
+	var inputSequence = []; // For safety purposes: keep track of randomisation
+	for (var counter = 0; counter < N; ++counter) 
+		inputSequence.push(counter) // Fill array
+	var inputSequenceClone = inputSequence.slice(0);
+	
 	var holdArr = [];
+	var outputSequence = [];
 	for (var n=0; n<N; n++)
 	{
 		// First pick a random number
@@ -1079,7 +1085,11 @@
 		r = Math.floor(r*input.length);
 		// Pick out that element and delete from the array
 		holdArr.push(input.splice(r,1)[0]);
+		// Do the same with sequence
+		outputSequence.push(inputSequence.splice(r,1)[0]);
 	}
+	console.log(inputSequenceClone.toString()); // print original array to console
+	console.log(outputSequence.toString()); 	// print randomised array to console
 	return holdArr;
 }
 
--- a/example_eval/project.xml	Mon Jun 15 13:09:46 2015 +0100
+++ b/example_eval/project.xml	Mon Jun 15 16:54:39 2015 +0100
@@ -12,7 +12,7 @@
 				<option id="player">Play an instrument</option>
 			</checkbox>
 			<number id="age" min="0">Please enter your age</number>
-			<statement>Please listen to all mixes</statement>
+			<statement>Please listen to all fragments</statement>
 		</PreTest>
 		<PostTest>
 			<question id="SessionID" mandatory="true">Please enter your name.</question>
@@ -35,7 +35,7 @@
 			<metricEnable>elementListenTracker</metricEnable>
 		</Metric>
 	</setup>
-	<audioHolder id='0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='0' loop='true' elementComments='true'>
+	<audioHolder id='test-0' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='0' loop='true' elementComments='true'>
 		<interface>
 			<title>Example Test Question</title>
 			<scale position="0">Min</scale>
@@ -69,12 +69,53 @@
 			<option name="bright">Bright</option>
 			<option name="punchy">Punchy</option>
 			<option name="dark">Dark</option>
-			<option name="moody">Moody</option>
-			<option name="dull">Dull</option>
+			<option name="muddy">Muddy</option>
+			<option name="thin">Thin</option>
 		</CommentQuestion>
 		<PreTest/>
 		<PostTest>
-			<question id="genre" mandatory="true">Please enter the genre</question>
+			<question id="genre" mandatory="true">Please enter the genre.</question>
 		</PostTest>
 	</audioHolder>
+    <audioHolder id='test-1' hostURL="example_eval/" sampleRate="44100" randomiseOrder='true' repeatCount='0' loop='true' elementComments='true'>
+        <interface>
+            <title>Example Test Question</title>
+            <scale position="0">Min</scale>
+            <scale position="100">Max</scale>
+            <scale position="50">Middle</scale>
+            <scale position="75">75</scale>
+            <commentBoxPrefix>Comment on fragment</commentBoxPrefix>
+        </interface>
+        <audioElements url="0.wav" id="0"/>
+        <audioElements url="1.wav" id="1"/>
+        <audioElements url="2.wav" id="2"/>
+        <audioElements url="3.wav" id="3"/>
+        <audioElements url="4.wav" id="4"/>
+        <audioElements url="5.wav" id="5"/>
+        <audioElements url="6.wav" id="6"/>
+        <!-- <audioElements url="7.wav" id="7"/>
+         <audioElements url="8.wav" id="8"/>
+         <audioElements url="9.wav" id="9"/>
+         <audioElements url="10.wav" id="10"/>-->
+        <CommentQuestion id='mixingExperience' type="text">What is your mixing experience?</CommentQuestion>
+        <CommentQuestion id="preference" type="radio">
+            <statement>Please enter your ranking preference on this song.</statement>
+            <option name="worst">Very Bad</option>
+            <option name="bad"></option>
+            <option name="OK">OK</option>
+            <option name="Good"></option>
+            <option name="Great">Great</option>
+        </CommentQuestion>
+        <CommentQuestion id="preference" type="checkbox">
+            <statement>Describe this song</statement>
+            <option name="funky">Funky</option>
+            <option name="mellow">Mellow</option>
+            <option name="laidback">Laid back</option>
+            <option name="heavy">Heavy</option>
+        </CommentQuestion>
+        <PreTest/>
+        <PostTest>
+            <question id="genre" mandatory="true">Please enter the genre.</question>
+        </PostTest>
+    </audioHolder>
 </BrowserEvalProjectDocument>
\ No newline at end of file
--- a/index.html	Mon Jun 15 13:09:46 2015 +0100
+++ b/index.html	Mon Jun 15 16:54:39 2015 +0100
@@ -25,7 +25,7 @@
 		</script>
 		<!-- Uncomment the following script for automatic loading of projects -->
 		<script>
-			url = 'example_eval/RealismEvaluation.xml'; //Project XML document location
+			url = 'example_eval/project.xml'; //Project XML document location
 			loadProjectSpec(url);
 		</script>