Commit 0827f355 authored by Dasoo Milton Yoon's avatar Dasoo Milton Yoon

fa

parent 7840d1d1
......@@ -441,7 +441,7 @@
</KeyboardComponent>
<CodeComponent name="code_3">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="curr_items_shuffle = shuffle(curr_items)&amp;#10;&amp;#10;feedback_list = curr_items_shuffle.slice(0, 2)" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="function shuffle(a) {&amp;#10; var j, x, i;&amp;#10; for (i = a.length - 1; i &gt; 0; i--) {&amp;#10; j = Math.floor(Math.random() * (i + 1));&amp;#10; x = a[i];&amp;#10; a[i] = a[j];&amp;#10; a[j] = x;&amp;#10; }&amp;#10; return a;&amp;#10;}&amp;#10;&amp;#10;&amp;#10;curr_items_shuffle = shuffle(curr_items)&amp;#10;&amp;#10;feedback_list = curr_items_shuffle.slice(0, 2)" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="JS" valType="str"/>
......
......@@ -260,6 +260,18 @@ function experimentInit() {
key_resp_8 = new core.Keyboard({psychoJS, clock: new util.Clock(), waitForStart: true});
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}
curr_items_shuffle = shuffle(curr_items)
feedback_list = curr_items_shuffle.slice(0, 2)
......
......@@ -252,6 +252,18 @@ function experimentInit() {
key_resp_8 = new core.Keyboard({psychoJS, clock: new util.Clock(), waitForStart: true});
function shuffle(a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}
curr_items_shuffle = shuffle(curr_items)
feedback_list = curr_items_shuffle.slice(0, 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment