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

_

parent 2d44fecd
......@@ -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, 5)&amp;#10;feedback_list_2 = cur_items_shuffle.slice(5, 10)&amp;#10;feedback_list_3 = cur_items_shuffle.slice(10, 15)" 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 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"/>
......@@ -449,7 +449,7 @@
<Param name="Each JS Frame" updates="constant" val="" valType="extendedCode"/>
<Param name="End Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Experiment" updates="constant" val="" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="&amp;#10;feedback_items = [];&amp;#10;if (Prime == 1) {&amp;#10; feeback_items = items_list_1;&amp;#10;}&amp;#10;if (Prime == 2) {&amp;#10; feedback_items = items_list_2;&amp;#10;}&amp;#10;if (Prime == 3) {&amp;#10; feedback_items = items_list_3;&amp;#10;}" valType="extendedCode"/>
<Param name="End JS Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="End Routine" updates="constant" val="" valType="extendedCode"/>
<Param name="disabled" updates="None" val="False" valType="bool"/>
<Param name="name" updates="None" val="code_3" valType="code"/>
......
......@@ -383,9 +383,9 @@ function introRoutineBegin() {
cur_items_shuffle = shuffle(cur_items)
feedback_list_1 = cur_items_shuffle.slice(0, 5)
feedback_list_2 = cur_items_shuffle.slice(5, 10)
feedback_list_3 = cur_items_shuffle.slice(10, 15)
feedback_list_1 = cur_items_shuffle.slice(0, 3)
feedback_list_2 = cur_items_shuffle.slice(0, 3)
feedback_list_3 = cur_items_shuffle.slice(0, 3)
// keep track of which components have finished
introComponents = [];
introComponents.push(text_3);
......@@ -1367,7 +1367,7 @@ function Instruction_for_FeedbackRoutineEachFrame() {
}
}
var feeback_items;
function Instruction_for_FeedbackRoutineEnd() {
//------Ending Routine 'Instruction_for_Feedback'-------
for (const thisComponent of Instruction_for_FeedbackComponents) {
......@@ -1382,17 +1382,6 @@ function Instruction_for_FeedbackRoutineEnd() {
}
key_resp_8.stop();
feedback_items = [];
if (Prime == 1) {
feeback_items = items_list_1;
}
if (Prime == 2) {
feedback_items = items_list_2;
}
if (Prime == 3) {
feedback_items = items_list_3;
}
// the Routine "Instruction_for_Feedback" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
......
......@@ -375,9 +375,9 @@ function introRoutineBegin() {
cur_items_shuffle = shuffle(cur_items)
feedback_list_1 = cur_items_shuffle.slice(0, 5)
feedback_list_2 = cur_items_shuffle.slice(5, 10)
feedback_list_3 = cur_items_shuffle.slice(10, 15)
feedback_list_1 = cur_items_shuffle.slice(0, 3)
feedback_list_2 = cur_items_shuffle.slice(0, 3)
feedback_list_3 = cur_items_shuffle.slice(0, 3)
// keep track of which components have finished
introComponents = [];
introComponents.push(text_3);
......@@ -1368,7 +1368,7 @@ function Instruction_for_FeedbackRoutineEachFrame() {
}
}
var feeback_items;
function Instruction_for_FeedbackRoutineEnd() {
//------Ending Routine 'Instruction_for_Feedback'-------
Instruction_for_FeedbackComponents.forEach( function(thisComponent) {
......@@ -1382,17 +1382,6 @@ function Instruction_for_FeedbackRoutineEnd() {
}
key_resp_8.stop();
feedback_items = [];
if (Prime == 1) {
feeback_items = items_list_1;
}
if (Prime == 2) {
feedback_items = items_list_2;
}
if (Prime == 3) {
feedback_items = items_list_3;
}
// the Routine "Instruction_for_Feedback" was not non-slip safe, so reset the non-slip timer
routineTimer.reset();
......
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