Skip to content

Commit

Permalink
simulation bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jadeddelta committed Oct 25, 2022
1 parent 10ca06c commit d2be99f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/plugin-cloze/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ class ClozePlugin implements JsPsychPlugin<Info> {
private create_simulation_data(trial: TrialType<Info>, simulation_options) {
const solutions = this.getSolutions(trial.text, trial.case_sensitivity);
const responses = [];
for (const word of solutions) {
if (word.includes("")) {
for (const wordList of solutions) {
if (wordList.includes("")) {
responses.push(this.jsPsych.randomization.randomWords({ exactly: 1 }));
} else {
responses.push(word);
for (const word of wordList) {
responses.push(word);
}
}
}

Expand Down

0 comments on commit d2be99f

Please sign in to comment.