Skip to content

Commit

Permalink
🎨 more instructions, better X, track example fruits (WIP #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillForan committed May 26, 2020
1 parent f6deef9 commit 02476e6
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@

function init(){
//fdbktl(1);
showInstructions('ID_wf');
showInstructions('OD_wf');
//trials(fullTL);

}
Expand Down
10 changes: 5 additions & 5 deletions static/css/task.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
.box.open {background: url('../images/box_open_sm.gif')}
.box.closed {background: url('../images/box_closed_sm.gif')}
/*x over devalued*/
.disabled::after {
content: url('../images/devalue.png');
.disabled::before {
content: url('../images/X.png');
position: absolute;
opacity: 50%;
margin-left: -100px;
margin-top: -50px;
opacity: 90%;
margin-left: -70px;
margin-top: -77px;
}
.feedback {text-align: center;} /* unnecessary */
.feedback>.score {
Expand Down
Binary file added static/images/X.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/blueberry.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/images/olive.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 11 additions & 5 deletions static/js/instructions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions static/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function mkBoxTrial(b, soa_block, block) {
type: 'html-keyboard-response',
stimulus: b.S.render(false),
choices: accept_keys,
//post_trial_gap: ITI,
post_trial_gap: ITI,
trial_duration: dur,
prompt: "<p>left or right</p>",
on_finish: function (data) {
Expand All @@ -252,7 +252,8 @@ function mkIDFbk() {
stimulus: function (trial) {
// setup win vs nowin feedback color and message
var prev = jsPsych.data.get().last().values()[0];
return (FRTS[prev.outcome].feedback(prev.score));
var frt = FRTS[prev.outcome];
return (frt.feedback(prev.score));
},
//update
//on_load: save_data(),
Expand Down
7 changes: 4 additions & 3 deletions static/js/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare var jsPsych: any;
declare var FRTS: {[key: string]: Fruit; }[]; // e.g. 'apple' => Fruit. see fruits()
declare var FRTS: {[key: string]: Fruit; }; // e.g. 'apple' => Fruit. see fruits()
declare var uniqueId: any;
declare var psiturk: any;
//declare var $: any; //jquery
Expand Down Expand Up @@ -241,7 +241,7 @@ function mkBoxTrial(b: Box, soa_block: number, block: string): PsychEvent {
type: 'html-keyboard-response',
stimulus: b.S.render(false),
choices: accept_keys,
//post_trial_gap: ITI,
post_trial_gap: ITI, // 20200526 - ITI helpful for knowning when fruit changed
trial_duration: dur,
prompt: "<p>left or right</p>",
on_finish: function(data) {
Expand All @@ -268,7 +268,8 @@ function mkIDFbk(): PsychEvent {
stimulus: function(trial) {
// setup win vs nowin feedback color and message
let prev = jsPsych.data.get().last().values()[0];
return (FRTS[prev.outcome].feedback(prev.score))
let frt : Fruit = FRTS[prev.outcome]
return (frt.feedback(prev.score))
},
//update
//on_load: save_data(),
Expand Down

0 comments on commit 02476e6

Please sign in to comment.