Skip to content

Commit

Permalink
Merge pull request #117 from levante-framework/Save-trialIndex-proper…
Browse files Browse the repository at this point in the history
…ty-and-all-required-fields-with-trial-data

Save trial index property and all required fields with trial data
  • Loading branch information
kachergis authored Jun 1, 2024
2 parents 6b1721c + 5463077 commit e5fc23b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions task-launcher/src/tasks/math/trials/sliderStimulus.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export const slider = {
response: _toNumber(response),
responseType: responseType,
distractors: stimulus.distractors,
corpusTrialType: stim.trialType,
// slider_start: stimulus.item[1] === 1 ? sliderStart / 100 : sliderStart,
slider_start: sliderStart,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const afcMatch = {
// save data
jsPsych.data.addDataToLastTrial({
corpusTrialType: stim.trialType,
answer: stim.answer || "No answer provided",
answer: stim.answer || null,
response: selectedCards,
distractors: stim.distractors,
item: stim.item,
Expand Down
3 changes: 2 additions & 1 deletion task-launcher/src/tasks/shared/helpers/initTrialSaving.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ export const initTrialSaving = (config) => {
delete dataCopy.keyboard_response;
delete dataCopy.response_source;
dataCopy.responseSource = data.response_source;
delete dataCopy.trial_index;
delete dataCopy.trial_type;
dataCopy.trialIndex = dataCopy.trial_index;
delete dataCopy.trial_index;

if (config.isRoarApp) {
config.firekit.writeTrial(dataCopy, computedScoreCallback);
Expand Down

0 comments on commit e5fc23b

Please sign in to comment.