Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Despite thinking about it for a long time, I, however, don't see a way to pull this off reliably other than the one I outlined above. But perhaps Katja can seen another (less "invasive") way to get rid of the overlap problem in the existing codebase -- she is certainly vastly more familiar with the script as-is than I am. Hope this helps.
|
|
|
wsly
|
|
Group: Forum Members
Posts: 10,
Visits: 61
|
Forget the previous one, I managed to modify the script myself.
thank you very much indeed, I have modified the script and now we are close to what we aimed to achieve. Slight issue: if I click on a corner that DOES discriminate a specific solution, i.e.: - 1st click = corner C3 in common with solutions 1,2,3 --> all are still clickable solutions -2nd click = corner C5 belonging to just solution 2 --> solutions 1 and 3 are now incorrect how can I mark the other solutions as wrong?
smth like / ontrialend = [if (trial.complexII_4.response = "a corner which is committed to only one solution") the only clickable corners are those belonging to that solution, all the other corners being marked as wrong..
In few words, if I click on a corner that identify solution 2, then solutions 3,4 and 1 are all wrong. Hope this makes sense....
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
I don't know where the specific mistake is in your modified code (which I don't have). In the example where I outlined the solution, the part relevant to your question is this:
<trial clicktrial> ... / ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1; values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2; values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; ] ... </trial>
You multiple the "applicable solutions* by the solutions tied to the response. This will always give you the *most restricted* version. Suppose you start with all three solutions available and select a response that applies to solutions #1 and #3:
Trial #1 Start: 1 - 1 - 1 Response: 1 - 0 - 1 Result: 1 - 0 - 1
Now, in the next trial, only solutions #1 and #3 are still in the cards:
Trial #2: Start: 1 - 0 - 1 Response: 0 - 1 - 0 Result: 0 - 0 - 0
and if you select any response option that does not apply to either solution, the response will be judged as wrong (as it should be). This approach should extend straightforwardly to as many solutions as you need. For the case you mention
> In few words, if I click on a corner that identify solution 2, then solutions 3,4 and 1 are all wrong.
Trial #1 Start: 1 - 1 - 1 - 1 Response: 0 - 1 - 0 - 0 Result: 0 - 1 - 0 - 0
And in the next trial, any response that *does not* apply to solution #2 would be marked as wrong:
Trial #2: Start: 0 - 1 - 0 - 0 Response: 1 - 0 - 1 - 1 Result: 0 - 0 - 0 - 0
|
|
|
wsly
|
|
Group: Forum Members
Posts: 10,
Visits: 61
|
#1: as soon as I click on just one corner , the "well done" message appears (while it should appear once all corners of just 1 solutions have been clicked) #2: anyway, as you can see from the photo, all the corners are clickable, without any discrimination. If I click on a corner that belongs just to solution1, I can as well click on corners that belongs to solution 4 or 3, which should be marked incorrect because once I choose solution 1, then the other solutions are wrong and I shouldn't be able to click on them. Attached there's the code modified according to your reply
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
#1: The two below /ontrialend statements are in the wrong order: ... / ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable || values.solution_3_applicable || values.solution_4_applicable) values.correctii_4 = 1 else values.correctii_4 = 0; ]
/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1; values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2; values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; values.solution_4_applicable = values.solution_4_applicable * values.response_applies_to_solution_4; ]
The multiplication step (2nd /ontrialend above) ought to happen *before* the correctness evaluation (1st /ontrialend above), i.e.
/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1; values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2; values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; values.solution_4_applicable = values.solution_4_applicable * values.response_applies_to_solution_4; ]
/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable || values.solution_3_applicable || values.solution_4_applicable) values.correctii_4 = 1 else values.correctii_4 = 0; ]
#2: The below /branch is wrong:
/ branch = [ if (values.correctii_4 == 1) { trial.positiveFeedback; ...
values.correctii_4 only indicates whether the *current* response (single object clicked) is correct. It does *not* indicate that the entire *problem* composed of *multiple* clicks on multiple objects was solved correctly. Thus you do not want to branch to trial.positiveFeedback when values.correctii_4 == 1, but invoke trial.negativefeedbackii_4 if the current response was wrong.
branch = [ if (values.correctii_4 == 0) { trial.negativefeedbackii_4; ...
As for logic that determines if / when the *entire* problem has been solved, you still need to implement that, I think.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Perhaps a slight extension of the previous example will help with the rest (such as implementing the "full solution completed" logic):
<values> / c1_applies_to_solution_1 = true / c1_applies_to_solution_2 = false / c1_applies_to_solution_3 = false
/ c2_applies_to_solution_1 = true / c2_applies_to_solution_2 = false / c2_applies_to_solution_3 = false
/ c3_applies_to_solution_1 = true / c3_applies_to_solution_2 = true / c3_applies_to_solution_3 = false
/ c4_applies_to_solution_1 = true / c4_applies_to_solution_2 = true / c4_applies_to_solution_3 = false
/ c5_applies_to_solution_1 = false / c5_applies_to_solution_2 = true / c5_applies_to_solution_3 = true
/ c6_applies_to_solution_1 = false / c6_applies_to_solution_2 = true / c6_applies_to_solution_3 = true
/ c7_applies_to_solution_1 = false / c7_applies_to_solution_2 = false / c7_applies_to_solution_3 = true
/ c8_applies_to_solution_1 = false / c8_applies_to_solution_2 = false / c8_applies_to_solution_3 = true
/ c1_set = 0 / c2_set = 0 / c3_set = 0 / c4_set = 0 / c5_set = 0 / c6_set = 0 / c7_set = 0 / c8_set = 0
/ c1_x = 40% / c1_y = 20% / c2_x = 60% / c2_y = 20% / c3_x = 40% / c3_y = 40% / c4_x = 60% / c4_y = 40% / c5_x = 40% / c5_y = 60% / c6_x = 60% / c6_y = 60% / c7_x = 40% / c7_y = 80% / c8_x = 60% / c8_y = 80%
/ solution_1_applicable = true / solution_2_applicable = true / solution_3_applicable = true
/ response_applies_to_solution_1 = true / response_applies_to_solution_2 = true / response_applies_to_solution_3 = true
/ correctcorner_size = 3%
/ number_of_possible_solutions = 0 / responsestorage = "" / response_correct = 0 / committed = false / committedsolutionnumber = 0 </values>
<expressions> / solution_1 = (values.c1_set * values.c2_set * values.c3_set * values.c4_set) / solution_2 = (values.c3_set * values.c4_set * values.c5_set * values.c6_set) / solution_3 = (values.c5_set * values.c6_set * values.c7_set * values.c8_set) </expressions>
<block myblock> / trials = [1=starttrial] </block>
<trial starttrial> / ontrialbegin = [values.solution_1_applicable = true; values.solution_2_applicable = true; values.solution_3_applicable = true; values.response_applies_to_solution_1 = true; values.response_applies_to_solution_2 = true; values.response_applies_to_solution_3 = true; values.committed = false; values.committedsolutionnumber = 0; values.c1_set = 0; values.c2_set = 0; values.c3_set = 0; values.c4_set = 0; values.c5_set = 0; values.c6_set = 0; values.c7_set = 0; values.c8_set = 0; values.responsestorage = ""; values.number_of_possible_solutions = values.solution_1_applicable + values.solution_2_applicable + values.solution_3_applicable; shape.selectedcorner.hposition = -10%; shape.selectedcorner.vposition = -10%; ] / stimulusframes = [1=c1,c2,c3,c4,c5,c6,c7,c8,done,debug] / trialduration = 1000 / branch = [trial.clicktrial] </trial>
<text debug> / items = ("Solution #1 applicable: <%values.solution_1_applicable%> | Solution #2 applicable: <%values.solution_2_applicable%> | Solution #3 applicable: <%values.solution_3_applicable%> Number of possible solutions: <%values.number_of_possible_solutions%> Committed to solution: <%values.committed%> | Committed to solution # <%values.committedsolutionnumber%> Response <%trial.clicktrial.response%> applies to #1: <%values.response_applies_to_solution_1%> #2: <%values.response_applies_to_solution_2%> #3: <%values.response_applies_to_solution_3%> Responses: <%values.responsestorage%>") / fontstyle = ("Arial", 2%) / position = (50%, 10%) / size = (90%, 10%) / erase = false </text>
<text done> / items = ("DONE") / position = (50%, 90%) / erase = false </text>
<trial clicktrial> / stimulusframes = [1=selectedcorner, debug] / validresponse = (c1,c2,c3,c4,c5,c6,c7,c8,done) / isvalidresponse = [!contains(values.responsestorage, trial.clicktrial.response)] / inputdevice = mouse / ontrialend = [values.responsestorage = concat(values.responsestorage, trial.clicktrial.response)] / ontrialend = [ if (trial.clicktrial.response == "c1") { values.c1_set = 1; values.response_applies_to_solution_1 = values.c1_applies_to_solution_1; values.response_applies_to_solution_2 = values.c1_applies_to_solution_2; values.response_applies_to_solution_3 = values.c1_applies_to_solution_3; shape.selectedcorner.hposition = values.c1_x; shape.selectedcorner.vposition = values.c1_y; }
else if (trial.clicktrial.response == "c2") { values.c2_set = 1; values.response_applies_to_solution_1 = values.c2_applies_to_solution_1; values.response_applies_to_solution_2 = values.c2_applies_to_solution_2; values.response_applies_to_solution_3 = values.c2_applies_to_solution_3; shape.selectedcorner.hposition = values.c2_x; shape.selectedcorner.vposition = values.c2_y; }
else if (trial.clicktrial.response == "c3") { values.c3_set = 1; values.response_applies_to_solution_1 = values.c3_applies_to_solution_1; values.response_applies_to_solution_2 = values.c3_applies_to_solution_2; values.response_applies_to_solution_3 = values.c3_applies_to_solution_3; shape.selectedcorner.hposition = values.c3_x; shape.selectedcorner.vposition = values.c3_y; }
else if (trial.clicktrial.response == "c4") { values.c4_set = 1; values.response_applies_to_solution_1 = values.c4_applies_to_solution_1; values.response_applies_to_solution_2 = values.c4_applies_to_solution_2; values.response_applies_to_solution_3 = values.c4_applies_to_solution_3; shape.selectedcorner.hposition = values.c4_x; shape.selectedcorner.vposition = values.c4_y; }
else if (trial.clicktrial.response == "c5") { values.c5_set = 1; values.response_applies_to_solution_1 = values.c5_applies_to_solution_1; values.response_applies_to_solution_2 = values.c5_applies_to_solution_2; values.response_applies_to_solution_3 = values.c5_applies_to_solution_3; shape.selectedcorner.hposition = values.c5_x; shape.selectedcorner.vposition = values.c5_y; }
else if (trial.clicktrial.response == "c6") { values.c6_set = 1; values.response_applies_to_solution_1 = values.c6_applies_to_solution_1; values.response_applies_to_solution_2 = values.c6_applies_to_solution_2; values.response_applies_to_solution_3 = values.c6_applies_to_solution_3; shape.selectedcorner.hposition = values.c6_x; shape.selectedcorner.vposition = values.c6_y; }
else if (trial.clicktrial.response == "c7") { values.c7_set = 1; values.response_applies_to_solution_1 = values.c7_applies_to_solution_1; values.response_applies_to_solution_2 = values.c7_applies_to_solution_2; values.response_applies_to_solution_3 = values.c7_applies_to_solution_3; shape.selectedcorner.hposition = values.c7_x; shape.selectedcorner.vposition = values.c7_y; }
else if (trial.clicktrial.response == "c8") { values.c8_set = 1; values.response_applies_to_solution_1 = values.c8_applies_to_solution_1; values.response_applies_to_solution_2 = values.c8_applies_to_solution_2; values.response_applies_to_solution_3 = values.c8_applies_to_solution_3; shape.selectedcorner.hposition = values.c8_x; shape.selectedcorner.vposition = values.c8_y; }; ]
/ ontrialend = [values.solution_1_applicable = values.solution_1_applicable * values.response_applies_to_solution_1; values.solution_2_applicable = values.solution_2_applicable * values.response_applies_to_solution_2; values.solution_3_applicable = values.solution_3_applicable * values.response_applies_to_solution_3; ]
/ ontrialend = [if (values.solution_1_applicable || values.solution_2_applicable || values.solution_3_applicable) values.response_correct = 1 else values.response_correct = 0; ]
/ ontrialend = [values.number_of_possible_solutions = values.solution_1_applicable + values.solution_2_applicable + values.solution_3_applicable; ]
/ ontrialend = [if (values.number_of_possible_solutions == 1) {values.committed = true; values.committedsolutionnumber = 1*values.solution_1_applicable + 2*values.solution_2_applicable + 3*values.solution_3_applicable; }; ]
/ branch = [if (expressions.solution_1 || expressions.solution_2 || expressions.solution_3) trial.successtrial; ] / branch = [if (values.response_correct == 1) trial.clicktrial else trial.errortrial] </trial>
<trial errortrial> / ontrialbegin = [text.redx.hposition = shape.selectedcorner.hposition; text.redx.vposition = shape.selectedcorner.vposition; ] / stimulusframes = [1=redx] / trialduration = 500 / branch = [trial.starttrial] </trial>
<trial successtrial> / stimulusframes = [1=successtext] / trialduration = 500 </trial>
<text successtext> / items = ("Solution # <%values.committedsolutionnumber%> completed successfully.") </text>
<text redx> / items = ("X") / fontstyle = ("Arial", 5%, true) / txcolor = red / txbgcolor = transparent / erase = true(white) </text>
<shape c1> / shape = circle / color = blue / hposition = values.c1_x / vposition = values.c1_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c2> / shape = circle / color = blue / hposition = values.c2_x / vposition = values.c2_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c3> / shape = circle / color = blue / hposition = values.c3_x / vposition = values.c3_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c4> / shape = circle / color = blue / hposition = values.c4_x / vposition = values.c4_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c5> / shape = circle / color = blue / hposition = values.c5_x / vposition = values.c5_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c6> / shape = circle / color = blue / hposition = values.c6_x / vposition = values.c6_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c7> / shape = circle / color = blue / hposition = values.c7_x / vposition = values.c7_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape c8> / shape = circle / color = blue / hposition = values.c8_x / vposition = values.c8_y / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false </shape>
<shape selectedCorner> / shape = circle / color = yellow / size = (values.correctcorner_size * 0.75, values.correctcorner_size) / erase = false / hposition = -10% / vposition = -10% </shape>
|
|
|
wsly
|
|
Group: Forum Members
Posts: 10,
Visits: 61
|
You're amazing!!! It works now!! Still...
#1 it seems to keep memory of all the corner clicked from the beginning of trial and so, I can't click on corners I have already clicked I mean smth like if (trial.mytrial.response == "background" || trial.mytrial.response == "back" || values.correct_response = 0 <<<that are all conditions that lead to the simple figure again>> reset all the corners clicked so far. I tried smth like /ontrialend = [trial.test.resetstimulusframes()] but of course :/ it does not work. [[ I'm hopeless I know ]] #why can't I click on the background even though it is listed in the /stimulusframes and /validresponse???
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
Re. #1: I'm guessing, but if at any point you need to make all responses available again, you ought to reset values.responsestorage (see my example code in the previous reply).
Re. #2: Possibly related to #1 above.
|
|
|
Inquisit1234
|
|
Group: Forum Members
Posts: 13,
Visits: 31
|
Hello,
I am trying to record the amount of times a participant clicks each dropdown box (and possibly each latency) when solving a math equation. Currently I have the script set up for a <surveypage>, but I imagine that may not be the best approach when compared to a <block> structure.
Here's what I have:
<caption caption> / caption = "Please answer the question below" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (37%, 20%) </caption>
<caption caption1> / caption = "6 is" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (40%, 40%) </caption>
<dropdown option1> / options = (">", "<", "=") / optionvalues = ("1","2","3") / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (45%, 40%) / required = true </dropdown>
<caption caption2> / caption = "7 is " / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (50%, 40%) </caption>
<dropdown option2> / options = (">", "<", "=") / optionvalues = ("1","2","3") / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (55%, 40%) / required = true </dropdown>
<caption caption3> / caption = "8" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (60%, 40%) </caption>
<surveypage math> / fontstyle = ("Verdana", 3%, true, false, false, false, 5, 1) / questions = [1=caption; 2=caption1; 3=option1; 4=caption2; 5=option2; 6=caption3] / nextbuttonposition = (60%, 60%) </surveypage>
<survey math> / pages = [1=math] / responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0) / itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0) / itemspacing = 1% / showpagenumbers = false </survey>
Any help would be appreciated.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 104K
|
+xHello, I am trying to record the amount of times a participant clicks each dropdown box (and possibly each latency) when solving a math equation. Currently I have the script set up for a <surveypage>, but I imagine that may not be the best approach when compared to a <block> structure. Here's what I have: <caption caption> / caption = "Please answer the question below" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (37%, 20%) </caption> <caption caption1> / caption = "6 is" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (40%, 40%) </caption> <dropdown option1> / options = (">", "<", "=") / optionvalues = ("1","2","3") / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (45%, 40%) / required = true </dropdown> <caption caption2> / caption = "7 is " / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (50%, 40%) </caption> <dropdown option2> / options = (">", "<", "=") / optionvalues = ("1","2","3") / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (55%, 40%) / required = true </dropdown> <caption caption3> / caption = "8" / fontstyle = ("Verdana", 3%, false, false, false, false, 5, 1) / position = (60%, 40%) </caption> <surveypage math> / fontstyle = ("Verdana", 3%, true, false, false, false, 5, 1) / questions = [1=caption; 2=caption1; 3=option1; 4=caption2; 5=option2; 6=caption3] / nextbuttonposition = (60%, 60%) </surveypage> <survey math> / pages = [1=math] / responsefontstyle = ("Verdana", -12, false, false, false, false, 5, 0) / itemfontstyle = ("Verdana", -13, false, false, false, false, 5, 0) / itemspacing = 1% / showpagenumbers = false </survey> Any help would be appreciated. It's not possible to collect that kind of data (times a certain survey-type question was clicked) with surveypages -- whether you use a <block> or a <survey> doesn't matter in this case, it wouldn't work in either case.
|
|
|