From f6deef954daa439716ccc00f194524959fbf0c0e Mon Sep 17 00:00:00 2001 From: Will Foran Date: Tue, 26 May 2020 09:46:58 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20examples=20in=20instructions=20(WIP?= =?UTF-8?q?=20#1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 6 ++++-- static/js/instructions.js | 38 +++++++++++++++++++++++++++++++++----- static/js/utils.ts | 2 +- templates/exp.html | 2 +- 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 916651c..bc495ab 100644 --- a/index.html +++ b/index.html @@ -21,8 +21,8 @@ - + diff --git a/static/js/instructions.js b/static/js/instructions.js index 446c0cb..56dfbe0 100644 --- a/static/js/instructions.js +++ b/static/js/instructions.js @@ -1,3 +1,21 @@ +var inst_o = new Fruit('olive'); +var inst_b = new Fruit('blueberry'); +var inst_box = mkBox(inst_o, inst_b, Dir.Left, [2]); + +function IDexample(leftin, rightin){ + const empty="?" + const left = (leftin===null)?empty:leftin + const right = (rightin===null)?empty:rightin + return( + ""+ + ""+ + ""+ + "" + + ""+ + "" + + "
"+left+" 🠘 "+inst_o.render(false) + " 🠚 "+right+"
"); +} + const INSTRUCTIONS_DATA = { "ID": [ "In this game, you will get the chance to earn points by collecting fruit from inside a box on the screen by opening the box by pressing either the right '←' or left 'β†’' key. If you press the correct key, the box will open to reveal fruit inside and points will be added to you total score. However, if you press the incorrect key, the box will be empty and no points will be added to your total.
Your task is to learn which is the correct key to press. Sometimes it will be the left-hand one and sometimes it will be the right-hand one. The fruit picture on the front of the door should give you a clue about which is the correct response.", @@ -22,12 +40,22 @@ const INSTRUCTIONS_DATA = { "Obviously the idea is to earn as many points as possible. If the fruit inside is valuable and you press the correct key, you will gain points. If the fruit inside is valuable and you press the incorrect key or you fail to press a key, you neither gain nor lose points. You won’t receive feedback during the test, but you will be shown your final score at the end." ], "ID_wf": [ - "In this game, you will open secret fruit boxes. They open from both the left and right.
But the boxes have a trick to hide what's inside. If you pick the wrong side, the box will appear empty.", - "You will get points for picking the correct side to open.
You will get more points the faster you pick the correct side.", - "Boxes labeled with the same fruit on the outside always open from the same side.", - "The boxes have another trick. The fruit on the inside is different from fruit label on the outside.
Pay attention to this! Later you will get points for knowing what outside fruit label gives you the inside fruit."], + "In this game, you will open tricky fruit boxes.
The boxes look like this:
" + + inst_o.render(false), + // http://xahlee.info/comp/unicode_arrows.html + "All boxes open from both the left and right.
You can pick which way to open the box using the left (🠘) or right (🠚) arrow keys
" + IDexample(null,null), + "
But the boxes have a trick to hide what's inside.
If you pick the wrong side, the box will appear empty and have no points.
" + IDexample(null, inst_b.feedback(0)), + "You will get points for picking the correct side to open."+ + // "
You will get more points the faster you pick the correct side." + + "
Boxes labeled with the same fruit on the outside always open from the same side.", + "The boxes have another trick. The fruit on the inside is different from fruit label on the outside.
Pay attention to this! Later you will get points for knowing what outside fruit label gives you the inside fruit." + + IDexample(inst_b.feedback(1),inst_b.feedback(0)), + "Learn how to open all the boxes and get the most points!
Remember what fruits are inside the boxes too.
Ready to play!?
We'll start when you hit next." + ], "OD_wf": [ - "You opened all the boxes we have! But we have too many of some of the inside fruits. You can get now get points by picking only the inside fruits without an X over them.
Pick a fruit by using the same side that opened the box
Go faster for more points."], + "You opened all the boxes we have! But we have too many of some of the inside fruits. You can get now get points by picking only the inside fruits without an X over them.
Pick a fruit by using the same side that opened the box" + //
Go faster for more points." + ], "SOA_wf": [ "We are getting new box shipments from all over, but some of the fruits on the inside have gone bad.", "For each shipment, we will get a chart showing good and bad fruits.
Only open boxes with unspoiled fruits in them. Don't pick those with an X on them.", diff --git a/static/js/utils.ts b/static/js/utils.ts index ab8308e..d8dd1ad 100644 --- a/static/js/utils.ts +++ b/static/js/utils.ts @@ -1,5 +1,5 @@ declare var jsPsych: any; -declare var FRTS: any; // fruits as they were ordered +declare var FRTS: {[key: string]: Fruit; }[]; // e.g. 'apple' => Fruit. see fruits() declare var uniqueId: any; declare var psiturk: any; //declare var $: any; //jquery diff --git a/templates/exp.html b/templates/exp.html index 878aea2..0f2e932 100644 --- a/templates/exp.html +++ b/templates/exp.html @@ -33,8 +33,8 @@ - +