Commit ca66d128 authored by Dasoo Milton Yoon's avatar Dasoo Milton Yoon

fda

parent 33fd0df4
......@@ -207,7 +207,7 @@
<CodeComponent name="code">
<Param name="Begin Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="Begin JS Experiment" updates="constant" val="function getRandomIntInclusive(min, max) {&amp;#10; min = Math.ceil(min);&amp;#10; max = Math.floor(max);&amp;#10; return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive &amp;#10;}&amp;#10;&amp;#10;&amp;#10;&amp;#10;" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="used_items = []&amp;#10;available_items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];&amp;#10;&amp;#10;&amp;#10;&amp;#10;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;available_items_shuffle = shuffle(available_items)&amp;#10;&amp;#10;items_list_1 = available_items_shuffle.slice(0, 5)&amp;#10;items_list_2 = available_items_shuffle.slice(5, 10)&amp;#10;items_list_3 = available_items_shuffle.slice(10, 15)&amp;#10;&amp;#10;#cur_items_shuffle = shuffle(cur_items)&amp;#10;&amp;#10;#feedback_list_1 = cur_items_shuffle.slice(0, 3)&amp;#10;#feedback_list_2 = cur_items_shuffle.slice(0, 3)&amp;#10;#feedback_list_3 = cur_items_shuffle.slice(0, 3)" valType="extendedCode"/>
<Param name="Begin JS Routine" updates="constant" val="used_items = []&amp;#10;available_items = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];&amp;#10;&amp;#10;&amp;#10;&amp;#10;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;available_items_shuffle = shuffle(available_items)&amp;#10;&amp;#10;items_list_1 = available_items_shuffle.slice(0, 5)&amp;#10;items_list_2 = available_items_shuffle.slice(5, 10)&amp;#10;items_list_3 = available_items_shuffle.slice(10, 15)" valType="extendedCode"/>
<Param name="Begin Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="Code Type" updates="None" val="JS" valType="str"/>
<Param name="Each Frame" updates="constant" val="" valType="extendedCode"/>
......
This diff is collapsed.
This diff is collapsed.
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