textinput.settings.log

getTextInput(id).settings.log()

or getTextInput(id).settings.log("final") (since beta 0.3)

or getTextInput(id).settings.log("validate") (since beta 0.3)

or getTextInput(id).settings.log("first") (since beta 0.3)

or getTextInput(id).settings.log("last") (since beta 0.3)

or getTextInput(id).settings.log("all") (since beta 0.3)

or getTextInput(id).settings.log("final", "first", ...) (since beta 0.3)

Will add a line to the result file containing the text in the input box at the moment of the event. By default, leaving the parenthesis blank is equivalent to .settings.log("final", "validate", "first").

  • "final" will add a line reporting the text in the input box at the end of the trial.

  • "validate" will add a line for each press on the enter/return key, reporting the text in the input box at that time and the corresponding timestamp.

  • "first" will add a line for the first key press that happens in the input box (regardless of whether the key press results in inserting or deleting a character or no change).

  • "last" will add a line for the last key press that happens in the input box (same note).

These two are helpful if you want to measure how much time was spent on editing the text, by subtracting first‘s timestamp from last‘s.

  • "all" is a special case: it will record every single key press in the input box (regardless of text modification, see note above). It will add a line reporting how many such events took place, and three more lines: one line reporting all the keys that were pressed, a line reporting the text at the moment of the key press, and a line reporting the timestamps of each key press. This can seriously increase the weight of the result file in cases where the text is long and/or edited a lot. Note that these three lines add an indefinite number of columns (i.e., as many as there were key press events). Keep that in mind when parsing the results file for analyses (e.g., you can use the fill=TRUE and col.names=paste("col", 1:N, sep="_") options in R’s command read.csv, with N corresonding to 12 + the number of key press events).

Example:

[js highlight=”2″ try=”true”]newTextInput(“feedback”, “Leave your feedback comments here.”)
.settings.log()
.settings.lines(0)
.settings.size(400, 200)
.print()
,
newButton(“send”, “Send”)
.print()
.wait()
[/js]

Adds a 400x200px multiple-line input box containg the text Leave your feedback comments here to the screen above a Send button and waits for a click on the button. At least two lines will be added to the results file: one reporting the text in the box at the end of the trial, and one reporting the first key press. Additionally, you will see one line for each time the enter/return key was pressed.