Repeat trials until correct

PennController for IBEX Forums Support Repeat trials until correct

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8094
    li_dx
    Participant

    Hi! I’m wondering if we could repeat trials until the responses are 100% correct? Here’s the link to our study: https://farm.pcibex.net/r/lPvVfI/ and the relevant code is below. We are testing whether participants have learned the meanings of the two non-sense words, and we hope to make sure that they have learned the meanings before proceeding to the next part of the study, so we wonder if it’s possible to repeat the two test trials and provide feedback until the participants answer both questions correctly without the help of the feedback message? Thank you very much in advance!

    //Learning the verbs
    newTrial("verb",
        newText("question1", "<p>What does 'dax' mean?</p>")
            .center()
            .print()
        ,
        newText("lift1", "Lift")
            .print()
        ,
        newText("turn1", "Turn")
            .print()
        ,
        newSelector("choice1")
            .add(getText("lift1") , getText("turn1"))
            .shuffle()
            .frame("solid 2px purple")
            .wait()
            .log()
        ,
        newText("feedback1")
        ,
        newButton("check_response1", "Continue")
            .center()
            .callback(
                getSelector("choice1")
                    .test.selected("lift1")
                    .failure(getText("feedback1").text("Sorry, this is not the correct answer. Please select again.").print() ))
            .print()
            .wait(getSelector("choice1").test.selected("lift1"))
        ,
        clear()
        ,
        newText("question2", "<p>What does 'zep' mean?</p>")
            .center()
            .print()
        ,
        newText("lift2", "Lift")
            .print()
        ,
        newText("turn2", "Turn")
            .print()
        ,
        newSelector("choice2")
            .add(getText("lift2") , getText("turn2"))
            .shuffle()
            .frame("solid 2px purple")
            .wait()
            .log()
        ,
        newText("feedback2")
        ,
        newButton("check_response2", "Continue")
            .center()
            .callback(
                getSelector("choice2")
                    .test.selected("turn2")
                    .failure(getText("feedback2").text("Sorry, this is not the correct answer. Please select again.").print() ))
            .print()
            .wait(getSelector("choice2").test.selected("turn2"))
    )
    #8096
    Jeremy
    Keymaster

    Hi,

    You have different ways of doing it, but what I would do would be to test the different words in separate trials, which I would generate using Template (I would list the words in a CSV table). Then I would use a global Var element to keep track of performance and, at the end of the series of trials, I would go back to the beginning of the series if they did not get everything right. Here is what it would look like:

    Sequence("pre-verb", "verb", "post-verb")
    
    newTrial("pre-verb",
        newVar("verb-performance").global().set(true)
    )
    //Learning the verbs
    Template("verbs.csv", row=>
      newTrial("verb",
        newText("question", "<p>What does '"+row.word+"' mean?</p>")
            .center()
            .print()
        ,
        newText("guess1", row.guess1)
            .print()
        ,
        newText("guess2", row.guess2)
            .print()
        ,
        newSelector("choice")
            .add(getText("guess1") , getText("guess2"))
            .shuffle()
            .frame("solid 2px purple")
            .wait()
            .log()
        ,
        newButton("check_response", "Continue")
            .center()
            .print()
            .wait(
                getSelector("choice")
                    .test.selected( getText(row.correct) )
                    .failure( 
                        getVar("verb-performance").set(false)
                        ,
                        newText("Sorry, this is not the correct answer. Please select again.").print() 
                    )
            )
      )
    )
    newTrial("post-verb",
        getVar("verb-performance").global().test.is(true).failure( jump("pre-verb") )
    )

    With verbs.csv:

    word,guess1,guess2,correct
    dax,Lift,Turn,guess1
    zep,Lift,Turn,guess2

    Jeremy

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.