-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calculating the number of correct responses of a survey-multi-select #3321
Comments
Hi Fateme, While you could access the entire data, for this particular use case for simplicity it would be easier to get data from the last trial (which is the multi-select) and iterate through that data scoring the answers. Replicating the code and experiment you had above, I could correctly score the experiments by changing the debrief block as shown below. When you implement this in your experiment you should adjust the correct answers to include the correct answers in your case. I would be happy to send my entire HTML experiment file if this isn't working for you. `
` |
Thanks a lot for the great help. The math does not seem to work correctly. I show 16 words in the presentation part; in the memory task, they should choose those 16 words from the 32 words given. If respondents choose from the 16 words given in the correctAnswers, they should get a plus score; otherwise (if the correct answer is not chosen or the incorrect answer is chosen) it should be counted as an incorrect response. We have a total of responses from which the number of correct answers should be calculated. Here is how I completed the code with your kind suggestion.
|
If I'm understanding you correctly the code should be working because that was also how I had in mind. Is there a specific number that is failing for you?
When the user doesn't put in answers, they should get 50% because they correctly selected the answers not displayed. When I tested it does return as 50%. When there are no answers can skip the for loop and calculate the answers correct as "var correct = total - correctAnswers.length = 16". Same when testing the selection of all the answers. If the user selects all answers they start with 16 points before the responses are tallied. Then after going through each answer because 16 of the selections are correct or plus points and the 16 incorrect selections are negative points, the user should end up with 16 points which is being correctly represented when testing. |
Hi Fatemene, If you would like to calculate the number of correct responses within the test-page trial itself, you can use a higher-level function inside the on_finish parameter:
(side-note: it might be a good idea to replace the 'correct' variable with a reference to a timelineVariable and adjust the implementation of the test-page trial appropriately) The reduce function here would fold the list of responses into a number representing the number of correct responses. You can then access this value in the debrief_block trial by calling an expression like
|
Thanks for the illuminating explanation. That was quite clear. |
Thanks for the alternative solution. unfortunately the code didn't work; most probably because I didn't know to use it. |
Dear all,
<title>Memory Experiment</title> <script src="jatos.js"></script> <script src="lib/jspsych.js"></script> <script src="lib/plugin-html-button-response.js"></script> <script src="lib/plugin-html-keyboard-response.js"></script> <script src="lib/plugin-survey-text.js"></script> <script src="lib/plugin-survey-multi-select.js"></script> <script>I want to both give feedback to respondents and save the data for the number of correct responses when the participant chooses the correct response from a multi-select survey, but I do not know how. Can anybody help? Thanks in advance.
`
The text was updated successfully, but these errors were encountered: