Skip to content

Commit

Permalink
feat(taskUtils): have option to return subset to achieve random 54 in…
Browse files Browse the repository at this point in the history
…stead of fully counterbalanced 72 trials; chore: bump version from v1.3.2 to v1.3.3
  • Loading branch information
wasita mahaphanit committed Feb 22, 2021
1 parent f2aad7d commit 5ed83cb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "effort-v1.3.2",
"name": "effort-v1.3.3",
"description": "all-in-one app with jsPsych + React + Electron + psiTurk",
"author": {
"name": "Wasita Mahaphanit (Brown) & Rashi Dhar (Brown CCV)",
"email": "[email protected]",
"url": "https://lnccbrown.com"
},
"version": "1.3.2",
"version": "1.3.3",
"license": "MIT",
"private": true,
"main": "public/electron.js",
Expand Down
1 change: 1 addition & 0 deletions src/config/experiment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let exptBlock1 = deepCopy(defaultBlockSettings);

exptBlock1.probs = ["100%", "100%", "50%", "50%"];
exptBlock1.counterbalance = true;
exptBlock1.get_subset = true;
exptBlock1.value = [3, 5, 7];
exptBlock1.effort = [50, 100, 200]; // default vals were: 100, 120, 150
exptBlock1.keys = ["q", "p", "m"];
Expand Down
2 changes: 1 addition & 1 deletion src/language/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"task": {
"name": "Effort Task",
"end": "This experiment has ended.",
"version": "v1.3.2"
"version": "v1.3.3"
},
"prompt": {
"continue": {
Expand Down
13 changes: 12 additions & 1 deletion src/lib/taskUtils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// utilities specific to this app/task
import _ from "lodash";
import { ONLINE } from "../config/main";

// initialize starting conditions for each trial within a block
const generateStartingOpts = (blockSettings) => {
Expand Down Expand Up @@ -39,8 +40,18 @@ const generateStartingOpts = (blockSettings) => {
}
}
}
opts = _.shuffle(opts)

return _.shuffle(opts);
// if get_subset is set to true,
// means that it's partial counterbalance,
// as we won't fully represent all
// trial type combos and thus throw out random 25% of trials
if (ONLINE) {
if (blockSettings.get_subset) {
opts = _.slice(opts, 0, 54)
}
}
return opts
}
};

Expand Down

0 comments on commit 5ed83cb

Please sign in to comment.