diff --git a/_config.yml b/_config.yml index 5b0b75b..ade639c 100644 --- a/_config.yml +++ b/_config.yml @@ -55,6 +55,9 @@ collections: how-to-guides: output: true permalink: /:collection/:name/ + list-of-templates: + output: true + permalink: /:collection/:name/ posts: output: true permalink: /announcements/:name/ @@ -219,6 +222,12 @@ defaults: layout: "how-to-guide" parent: "How-to guides" # grand_parent: "Support" + - scope: + path: "reference/_list-of-templates" + values: + layout: "list-of-templates" + parent: "List of templates" + # grand_parent: "Support" - scope: path: "reference/_global-commands" values: diff --git a/_includes/head_custom.html b/_includes/head_custom.html index dc45a08..14bd24a 100644 --- a/_includes/head_custom.html +++ b/_includes/head_custom.html @@ -7,11 +7,6 @@ -
- The new PCIbex Farm is here! - Be sure to check out all of its - new features and changes. -
{%- if page.numbered_headings -%} diff --git a/advanced-tutorial/8_creating-trial-template.md b/advanced-tutorial/8_creating-trial-template.md index 94f6473..a88ed82 100644 --- a/advanced-tutorial/8_creating-trial-template.md +++ b/advanced-tutorial/8_creating-trial-template.md @@ -203,7 +203,7 @@ PennController.ResetPrefix(null) @ .wait() @ , @ getAudio("audio") -@ .wait("first) +@ .wait("first") @ ) +) diff --git a/assets/images/prolific2.png b/assets/images/prolific2.png new file mode 100644 index 0000000..9d38a6c Binary files /dev/null and b/assets/images/prolific2.png differ diff --git a/reference/_controller/controller-callback.md b/reference/_controller/controller-callback.md new file mode 100644 index 0000000..ada6627 --- /dev/null +++ b/reference/_controller/controller-callback.md @@ -0,0 +1,32 @@ +--- +title: controller.callback +command_type: "action" +syntax: .callback() +description: "Will execute the command(s) whenever the Controller is there." +--- + + + +
+@newButton("Start reading")
+@ .print()
+@ .wait()
+@ .remove()
+@,
+@newController("DashedSentence", {s: "The mouse is happy"} )
+@ .print()
+@ .log()
+@ .wait()
+@ .remove()
+$ .callback(
+$ getVideo("skate")
+$ .stop()
+$ .play()
+$ )
+@,
+@newText("Good job!")
+@ .print()
+
+
+
+
diff --git a/reference/_dragdrop/addDrag.md b/reference/_dragdrop/addDrag.md
index 5903a3b..d473bf1 100644
--- a/reference/_dragdrop/addDrag.md
+++ b/reference/_dragdrop/addDrag.md
@@ -11,14 +11,10 @@ notes: true
@newDragDrop("dd", "bungee")
@ .log()
-@ // listOfWords is a dropzone as well as the gaps are
@ .addDrop( getCanvas("listOfWords") , getCanvas("gap-0") , getCanvas("gap-1") )
$ .addDrag( getText("sentence") , getText("illustrate") , getText("dummy") )
-@ // dropping a word on gap-0 or gap-1 will swap any word already present
@ .swap( getCanvas("gap-0"), getCanvas("gap-1") )
-@ // words will have a 0.5em horizonal offset from the left edge of the gap Canvas elements
@ .offset('0.5em','0em', getCanvas("gap-0"), getCanvas("gap-1"))
-@ // Wait until both gap-0 and gap-1 have been droppped a word onto them
@ .wait(
@ self.test.dropped(getCanvas("gap-0"),getCanvas("gap-1"))
@ )
diff --git a/reference/_dragdrop/addDrop.md b/reference/_dragdrop/addDrop.md
index 5a161bd..7092db5 100644
--- a/reference/_dragdrop/addDrop.md
+++ b/reference/_dragdrop/addDrop.md
@@ -11,14 +11,10 @@ notes: true
@newDragDrop("dd", "bungee")
@ .log()
-@ // listOfWords is a dropzone as well as the gaps are
$ .addDrop( getCanvas("listOfWords") , getCanvas("gap-0") , getCanvas("gap-1") )
@ .addDrag( getText("sentence") , getText("illustrate") , getText("dummy") )
-@ // dropping a word on gap-0 or gap-1 will swap any word already present
@ .swap( getCanvas("gap-0"), getCanvas("gap-1") )
-@ // words will have a 0.5em horizonal offset from the left edge of the gap Canvas elements
@ .offset('0.5em','0em', getCanvas("gap-0"), getCanvas("gap-1"))
-@ // Wait until both gap-0 and gap-1 have been droppped a word onto them
@ .wait(
@ self.test.dropped(getCanvas("gap-0"),getCanvas("gap-1"))
@ )
diff --git a/reference/_dragdrop/bungee.md b/reference/_dragdrop/bungee.md
index eda603a..6f28e02 100644
--- a/reference/_dragdrop/bungee.md
+++ b/reference/_dragdrop/bungee.md
@@ -11,14 +11,10 @@ notes: true
$newDragDrop("dd", "bungee")
@ .log()
-@ // listOfWords is a dropzone as well as the gaps are
@ .addDrop( getCanvas("listOfWords") , getCanvas("gap-0") , getCanvas("gap-1") )
@ .addDrag( getText("sentence") , getText("illustrate") , getText("dummy") )
-@ // dropping a word on gap-0 or gap-1 will swap any word already present
@ .swap( getCanvas("gap-0"), getCanvas("gap-1") )
-@ // words will have a 0.5em horizonal offset from the left edge of the gap Canvas elements
@ .offset('0.5em','0em', getCanvas("gap-0"), getCanvas("gap-1"))
-@ // Wait until both gap-0 and gap-1 have been droppped a word onto them
@ .wait(
@ self.test.dropped(getCanvas("gap-0"),getCanvas("gap-1"))
@ )
diff --git a/reference/_dragdrop/log.md b/reference/_dragdrop/log.md
index b0487b1..e2c431b 100644
--- a/reference/_dragdrop/log.md
+++ b/reference/_dragdrop/log.md
@@ -24,7 +24,7 @@ description: "Will log the time/results of the action to your results file."
@ ,
@ getText("feedback").remove()
@ )
-$ .log("all") // Log every drag event and every drop event
+$ .log("all")
@ .wait()
diff --git a/reference/_dragdrop/offset.md b/reference/_dragdrop/offset.md
index c66e463..c5ac52f 100644
--- a/reference/_dragdrop/offset.md
+++ b/reference/_dragdrop/offset.md
@@ -10,13 +10,10 @@ notes: true
@newDragDrop("dd", "bungee")
@ .log()
-@ // listOfWords is a dropzone as well as the gaps are
@ .addDrop( getCanvas("listOfWords") , getCanvas("gap-0") , getCanvas("gap-1") )
@ .addDrag( getText("sentence") , getText("illustrate") , getText("dummy") )
-@ // dropping a word on gap-0 or gap-1 will swap any word already present
@ .swap( getCanvas("gap-0"), getCanvas("gap-1") )
$ .offset('0.5em','0em', getCanvas("gap-0"), getCanvas("gap-1"))
-@ // Wait until both gap-0 and gap-1 have been droppped a word onto them
@ .wait(
@ self.test.dropped(getCanvas("gap-0"),getCanvas("gap-1"))
@ )
diff --git a/reference/_dragdrop/removeDrag.md b/reference/_dragdrop/removeDrag.md
index 61a5108..59593a1 100644
--- a/reference/_dragdrop/removeDrag.md
+++ b/reference/_dragdrop/removeDrag.md
@@ -15,7 +15,7 @@ notes: true
$ .removeDrag(getCanvas("dot"),getCanvas("otherdot"))
@ .offset(0, getCanvas("start"))
@ .offset(50, getCanvas("end"))
-@ .drop(getCanvas('dot'),getCanvas('start')) // start dropped by default
+@ .drop(getCanvas('dot'),getCanvas('start'))
@ .callback(
@ newText("feedback","Good job! Now make sure that Red is on Start and Blue is on End")
@ .css("background-color","lightgray")
diff --git a/reference/_dragdrop/removeDrop.md b/reference/_dragdrop/removeDrop.md
index b5476a1..810f1e2 100644
--- a/reference/_dragdrop/removeDrop.md
+++ b/reference/_dragdrop/removeDrop.md
@@ -15,7 +15,7 @@ notes: true
$ .removeDrop(getCanvas("start"),getCanvas("end"))
@ .offset(0, getCanvas("start"))
@ .offset(50, getCanvas("end"))
-@ .drop(getCanvas('dot'),getCanvas('start')) // start dropped by default
+@ .drop(getCanvas('dot'),getCanvas('start'))
@ .callback(
@ newText("feedback","Good job! Now make sure that Red is on Start and Blue is on End")
@ .css("background-color","lightgray")
diff --git a/reference/_dragdrop/swap.md b/reference/_dragdrop/swap.md
index 32c5a81..23b8709 100644
--- a/reference/_dragdrop/swap.md
+++ b/reference/_dragdrop/swap.md
@@ -15,7 +15,7 @@ notes: true
$ .swap(getCanvas("word1"),getCanvas("word2"),getCanvas("word3"),getCanvas("word4"))
@ .offset('0.5em')
@ .offset('unset', getCanvas("reservoir"))
-@ .wait( // make sure all 'word*' dropzones have an element on them
+@ .wait(
@ self.test.dropped(getCanvas("word1"),getCanvas("word2"),getText("hello"),getCanvas("word4"))
@ )
diff --git a/reference/_dragdrop/wait.md b/reference/_dragdrop/wait.md
index af3e227..35af258 100644
--- a/reference/_dragdrop/wait.md
+++ b/reference/_dragdrop/wait.md
@@ -12,7 +12,7 @@ notes: true
@ newDragDrop("dd")
@ .addDrag(getCanvas("dot"))
@ .addDrop(getCanvas("start"),getCanvas("end"))
-@ .offset(25) // will pin the elements to (25,25) from the top-left edge of the dropzone
+@ .offset(25)
@ .single()
@ .log()
$ .wait()
diff --git a/reference/_elements/dragdrop.md b/reference/_elements/dragdrop.md
index cfb0d2b..4c6c32b 100644
--- a/reference/_elements/dragdrop.md
+++ b/reference/_elements/dragdrop.md
@@ -11,14 +11,10 @@ description: Allows dragging elements into the specific space.
@newDragDrop("dd", "bungee")
@ .log()
-@ // listOfWords is a dropzone as well as the gaps are
@ .addDrop( getCanvas("listOfWords") , getCanvas("gap-0") , getCanvas("gap-1") )
@ .addDrag( getText("sentence") , getText("illustrate") , getText("dummy") )
-@ // dropping a word on gap-0 or gap-1 will swap any word already present
@ .swap( getCanvas("gap-0"), getCanvas("gap-1") )
-@ // words will have a 0.5em horizonal offset from the left edge of the gap Canvas elements
@ .offset('0.5em','0em', getCanvas("gap-0"), getCanvas("gap-1"))
-@ // Wait until both gap-0 and gap-1 have been droppped a word onto them
@ .wait(
@ self.test.dropped(getCanvas("gap-0"),getCanvas("gap-1"))
@ )
diff --git a/reference/_global-commands/SendResults.md b/reference/_global-commands/SendResults.md
index 8ffe053..cecf950 100644
--- a/reference/_global-commands/SendResults.md
+++ b/reference/_global-commands/SendResults.md
@@ -7,6 +7,8 @@ alternates:
notes: true
---
++ Update : It is now possible to send the results to a custom URL by using SendResults as an in-trial command.
+
1. On its own, it creates a trial whose sole function will be to send the results to the server when it is run. You can give a label to the trial by passing a string as an argument to SendResults and then refer to it in Sequence in order to send the results early.
2. Alternatively, you can use it directly inside Sequence in place of a reference to a label, with the same effect as above (but lifting the need to come up with a dedicated label)
diff --git a/reference/_global-commands/newTrial().noTrialLog.md b/reference/_global-commands/newTrial().noTrialLog.md
new file mode 100644
index 0000000..80693da
--- /dev/null
+++ b/reference/_global-commands/newTrial().noTrialLog.md
@@ -0,0 +1,21 @@
+---
+title: newTrial().noTrialLog
+syntax: newTrial().noTrialLog()
+description: "Skip the trial's Start and/or End lines in the results file"
+
+---
+
+
+
+
+@
+@newTrial(
+@ newButton("helloworld", "Hello world!")
+@ .log()
+@ .print()
+@ .wait()
+@)
+$.noTrialLog("Start","End")
+
+
++ Will skip the trial's Start and End lines in the result file.
diff --git a/reference/_how-to-guides/collecting-eyetracking-data.md b/reference/_how-to-guides/collecting-eyetracking-data.md
index 1cb3529..cb0d613 100644
--- a/reference/_how-to-guides/collecting-eyetracking-data.md
+++ b/reference/_how-to-guides/collecting-eyetracking-data.md
@@ -11,6 +11,8 @@ In this guide, we will design a simple eye-tracking experiment splitting the pag
Note that in order to collect eye-tracking data, you need to have access to a server where you can upload and execute PHP scripts. **Platforms like DreamHost offer this service with minimal setup, and server providers like Linode require more advanced setup. Resource-sharing services like Dropbox or Google Drive do NOT support PHP scripts.**
+Note: **PHP extension mbstring must be enabled on the server for the PHP script to run successfully.**
+
# The Experiment
diff --git a/reference/_how-to-guides/using-prolific.md b/reference/_how-to-guides/using-prolific.md
index d690756..67d35c3 100644
--- a/reference/_how-to-guides/using-prolific.md
+++ b/reference/_how-to-guides/using-prolific.md
@@ -10,28 +10,68 @@ To credit participants automatically via PCIbex for doing the experiments, f
3. Now you need to edit the study link after filling out the previous information as seen in the following picture.
- 
+ 
You should change each of the three possible IDs based on your need. Note that the PROLIFIC_ID in our example is the unique ID for each
participant.
+
+4. In PCIbex, include the following at the top of your experiment, below PennController.ResetPrefix(null) (search for [Header]({{site.baseurl}}/global-commands/header/){:target="_blank"} , [log]({{site.baseurl}}/standard-element-commands/standard-log/){:target="_blank"} , or [GetURLParameter]({{site.baseurl}}/global-commands/geturlparameter/){:target="_blank"} for more details) to add the participant’s Prolific ID to your results file (this can also be used to double check participation manually when needed):
+
+ ```javascript
+ Header(
+ // void
+ )
+ .log( "PROLIFIC_ID" , GetURLParameter("id") )
+ ```
-4. Choose the method to confirm participants have to completed your study
+5. Choose the method to confirm participants have to completed your study
+
+ We recommend directing participants using an URL.
+
+ 
- We recommend directing participants using an URL. Remember that URL because we will need it in our PCIbex code.
+ Add a final page to your experiment after sending results that redirects to the Completion URL (client-side) provided. Copy and paste the entire URL from there to get the correct redirection. You can copy & paste the following code and change the redirection URL to match the redirection URL on your Prolific page:
+
+ ```javascript
+ newTrial( "final" ,
+ newText("Thank you for your participation!
")
+ .center()
+ .print()
+ ,
+ newText("Click here to confirm your participation on Prolific.
This is a necessary step in order for you to receive participation credit!
")
+ .center()
+ .print()
+ ,
+ newButton("void")
+ .wait()
+ )
+ ```
+
+ However, your redirection URL may differ. It can include your own written code instead of CODE portion in https://app.prolific.co/submissions/complete?cc=CODE. The most important part is to include your redirection link (however it looks like on Prolific page) at the end of the experiment under the final trial.
+
+ (Note: the use of final ‘newButton’ command here ensures that participants cannot navigate past this page to avoid them accidentally missing the link to receive credit on Prolific)
+
+ Following this process will automatically credit participants who take web study.
-5. Configure other options as well and then press save.
+6. Configure other options as well and then press save.
-6. Now go to the PCIbex platform and enter the following code (remember to change the links to your own links obtained in the previous steps):
+7. Your final code should look like this:
```javascript
PennController.ResetPrefix(null) // Keep here
- Sequence("trials", "prolific-consent", "confirmation-prolific", SendResults())
- newTrial("prolific-consent",
- newHtml("prolific-consent.html").print()
- ,
- newButton("I consent").print().wait()
- )
+
+ Header(
+ // void
+ )
+ .log( "PROLIFIC_ID" , GetURLParameter("id") )
+
+ Sequence("prolific-consent", "trials", SendResults(), "confirmation-prolific")
+ newTrial("prolific-consent",
+ newHtml("prolific-consent.html").print()
+ ,
+ newButton("I consent").print().wait()
+ )
newTrial( "trials" ,
newButton("This is a mock trial")
@@ -45,7 +85,7 @@ To credit participants automatically via PCIbex for doing the experiments, f
.print()
,
// This is where you should put the link from the last step.
- newText("Click here to validate your submission
")
+ newText("")
.center()
.print()
,
diff --git a/reference/_mousetracker/mousetracker-log.md b/reference/_mousetracker/mousetracker-log.md
index e06ca25..94d4e9f 100644
--- a/reference/_mousetracker/mousetracker-log.md
+++ b/reference/_mousetracker/mousetracker-log.md
@@ -7,6 +7,7 @@ notes: true
---
+ See the discussion and example script on the MouseTracker element page for more information about the format of the string reporting the coordinates.
++ Additionally you can log click by writing the command: mousetracker.log("click") .
diff --git a/reference/_scale/scale-checkbox.md b/reference/_scale/scale-checkbox.md
new file mode 100644
index 0000000..ad1b272
--- /dev/null
+++ b/reference/_scale/scale-checkbox.md
@@ -0,0 +1,24 @@
+---
+title: scale.checkbox
+command_type: "action"
+syntax: .checkbox()
+description: "Turns the options into checkoxes that can all independently be on/off."
+
+---
+
+
+
+
+@newTrial(
+@ newScale("answer", "hello", "world")
+$ .checkbox()
+@ .print()
+@ ,
+@ newButton("Hello world")
+@ .print()
+@ .wait()
+)
+
+
+
++ Adds a scale with 3 checkboxes to the screen.
diff --git a/reference/_selector/selector-keys.md b/reference/_selector/selector-keys.md
index 2819f8f..5859464 100644
--- a/reference/_selector/selector-keys.md
+++ b/reference/_selector/selector-keys.md
@@ -9,6 +9,8 @@ parameters:
description: "Makes it possible to select the elements by pressing the specified keys. The keys are associated to the element in the order in which they were added, if no shuffle took place in the meantime."
---
++ Accepts special keys as arguments as well, such as (Enter, Escape, ArrowLeft, LeftShift, etc).
+
diff --git a/reference/_special-commands/jump.md b/reference/_special-commands/jump.md
new file mode 100644
index 0000000..95585ee
--- /dev/null
+++ b/reference/_special-commands/jump.md
@@ -0,0 +1,18 @@
+---
+title: jump
+syntax: jump()
+description: Navigates the sequence and jumps to the part specified.
+
+---
+
+ ```javascript
+ newButton("botao7", "Voltar")
+ .callback(jump("pratica1"),end())
+ .before( newButton("botao8", "Seguir") )
+ .css("margin-left","1em")
+ .print()
+,
+getButton("botao8").wait()
+ ```
+
++ When the button is pressed, "practica1" trial is showed.
diff --git a/reference/_standard-element-commands/standard-scaling.md b/reference/_standard-element-commands/standard-scaling.md
new file mode 100644
index 0000000..893b653
--- /dev/null
+++ b/reference/_standard-element-commands/standard-scaling.md
@@ -0,0 +1,29 @@
+---
+title: standard.scaling
+command_type: "action"
+relevant_elements: [Audio, Button, Canvas, Controller, DropDown, Html, Image, MediaRecorder, Scale, Text, TextInput, Tooltip, Video, VoiceRecorder, Youtube]
+syntax: .scaling()
+description: "Scales elements using a zoom index/to a given size/container."
+
+---
+
+
+
+
+@newTrial(
+@ newCanvas("container", 640, 360)
+@ .color("pink")
+@ .add( 20, "middle at 50%", newButton("Hello"))
+@ .add("right at 620px", "middle at 50%", newButton("world"))
+$ .scaling("page")
+@ .print("center at 50vw","middle at 50vh")
+@ ,
+@ getButton("Hello").wait()
+@)
+
+
++ In the example above, command will make sure the Canvas element and the elements it containsare stretched (preserving the ratio) so that it occupies the maximum area possible on the page.
+
+
+
+
diff --git a/reference/_textinput/textinput-callback.md b/reference/_textinput/textinput-callback.md
new file mode 100644
index 0000000..bd58197
--- /dev/null
+++ b/reference/_textinput/textinput-callback.md
@@ -0,0 +1,26 @@
+---
+title: textinput.callback
+command_type: "action"
+syntax: .callback()
+description: "Will execute the command(s) whenever the text is inputted."
+notes: true
+---
+
++ Adds a one-line input box to the screen preceded with *Violets are blue, roses are red,* on its left and waits for a press on the enter/return key, after what the text can no longer be edited.
+
+
+
+
+@newTextInput("poem", "")
+@ .before( newText("flowers", "Violets are blue, roses are red, ") )
+@ .once()
+@ .print()
+@ .wait()
+$ .callback(
+$ getVideo("skate")
+$ .stop()
+$ .play()
+$ )
+
+
++ Adds a one-line input box to the screen preceded with *Violets are blue, roses are red,* on its left and waits for a press on the enter/return key, after what the text can no longer be edited.
diff --git a/reference/_timer/timer-pause.md b/reference/_timer/timer-pause.md
new file mode 100644
index 0000000..d45cf62
--- /dev/null
+++ b/reference/_timer/timer-pause.md
@@ -0,0 +1,21 @@
+---
+title: timer.pause
+command_type: "action"
+syntax: .pause()
+description: "Pauses the timer."
+---
+
+
+
+
+@newText("pleasewait", "Please wait 1s.")
+@ .print()
+@,
+@newTimer("wait", 1000)
+@ .start()
+@,
+@getTimer("wait")
+$ .pause()
+
+
++ The code above adds the text *Please wait 1s* to the screen, starts a 1000ms timer and then pauses it.
diff --git a/reference/_timer/timer-resume.md b/reference/_timer/timer-resume.md
new file mode 100644
index 0000000..2aed43c
--- /dev/null
+++ b/reference/_timer/timer-resume.md
@@ -0,0 +1,23 @@
+---
+title: timer.resume
+command_type: "action"
+syntax: .resume()
+description: "Resumes the timer."
+---
+
+
+
+
+@newText("pleasewait", "Please wait 1s.")
+@ .print()
+@,
+@newTimer("wait", 1000)
+@ .start()
+@,
+@getTimer("wait")
+@ .pause()
+@getTimer("wait")
+$ .resume()
+
+
++ The code above adds the text *Please wait 1s* to the screen, starts a 1000ms timer and then pauses it, and then resumes it again.
diff --git a/reference/_timer/timer-set.md b/reference/_timer/timer-set.md
new file mode 100644
index 0000000..6ee5acf
--- /dev/null
+++ b/reference/_timer/timer-set.md
@@ -0,0 +1,27 @@
+---
+title: timer.set
+command_type: "action"
+syntax: .set()
+description: "Re(set) timer."
+---
+
++ The set command lets user (re)set the duration of the timer element independently of its creation.
+
+
+
+
+@newTimer("time"),
+@newScale("mode", "easy", "hard")
+@ .button().print().wait().remove()
+@ .test.selected("easy")
+$ .success( getTimer("time").set(2000) )
+$ .failure( getTimer("time").set(1000) )
+@,
+@newScale("answer", "Answer A", "Answer B")
+@ .button().print()
+@,
+@getTimer("time").start().wait()
+@ .remove()
+
+
++ The code above gives 2s to answer in the easy mode, but only 1s in the hard mode.