Reply To: Logging of wording of Comprehension Question

PennController for IBEX Forums Support Logging of wording of Comprehension Question Reply To: Logging of wording of Comprehension Question

#7691
Jeremy
Keymaster

Hello Silke,

Including the Question controller as you do in the code you shared but validating the trial by waiting for a Key element will only use the controller to show the question, but unless the participant makes the effort of clicking on one of the two answers (which won’t have any visible effect on their part) then the Question controller won’t detect any answer as far as it is concerned: only the Key element will detect that something happened. This is why you won’t see a line in the results file for the Question controller (unless you click on an answer)

If you’d like to stick to the original Ibex controller, you could do that instead, using the options described in the Ibex manual:

Template("items.csv", row =>
    newTrial("experiment",
        newTimer("break", 1000)
            .start()
            .wait()
        ,
        newController("DashedSentence", {s:row.sentence})
            .print()
            .log()
            .wait()
            .remove()
        ,
        newController("Question", {
            q: row.question,
            as: ["Ja", "Nein"],
            autoFirstChar:true,
            hasCorrect:row.answer,
            randomOrder:false
        })
            .print()
            .log()
            .wait()
    )
    .log("group", row.group) 
    .log("item", row.item)
    .log("condition", row.condition)
    .log("accurate_answer", row.answer)
)

You’d need to use “Ja” and “Nein” in your answer column so that that cell matches one of the two possible answers, and you’ll get a 0 or 1 in the tenth column (IIRC) indicating whether the answer was correct

Another option would be to get rid of the Question controller altogether, in which case it would be easier to implement a timeout feature:

Template("items.csv", row =>
    newTrial("experiment",
        newTimer("break", 1000)
            .start()
            .wait()
        ,
        newController("DashedSentence", {s:row.sentence})
            .print()
            .log()
            .wait()
            .remove()
        ,
        newText("Question", row.question).center().print()
        ,
        newText("<p>1. Ja<br>2. Nein</>>").center().print()
        ,
        newKey("Answer", "JN")
            .once()
            .callback( getTimer("delay").stop() )
            .log("last")
        ,
        newTimer("delay", 5000).start().wait()
        ,
        newVar("isCorrect").global()
        ,
        getKey("Answer")
            .test.pressed( row.answer )
            .success( getVar("isCorrect").set(1) )
            .failure( getVar("isCorrect").set(0) )
    )
    .log("group", row.group) 
    .log("item", row.item)
    .log("condition", row.condition)
    .log("question",row.question)
    .log("accurate_answer", row.answer)
    .log("correct", getVar("isCorrect"))
)

Note that because this tests the key that was pressed, and not which answer was chosen, row.answer should either be J or N, just like it currently is in your csv file

I’m sorry you experienced issues when exporting the xls file to a csv file. I wasn’t aware that Excel used semi-colons as a default separator in that operation: csv stands from comma-separated values, and semi-colons are not a standard when it comes to those types of files–tabs are another common separator, which have a dedicated tsv extension but are sometimes also found in place of csv files (PennController will accept tsv files too)

Jeremy