Reply To: Randomize DashedSentence

PennController for IBEX Forums Support Randomize DashedSentence Reply To: Randomize DashedSentence

#6667
adamliter
Participant

Hmm, that’s interesting. I do have "trials" in the Sequence command. I’ve pasted the full code below. I do still have this on expt.pcibex.net, not farm.pcibex.net, and I noticed the version of PennController I have is 1.8-dev, whereas it looks like the PennController version on farm.pcibex.net is 1.9. Could that be the issue?

const ParticipantID = b64_md5((Date.now() + Math.random()).toString());

//PennController.DebugOff();

PennController.Sequence("setcounter", "consent", "demographics", "description", "trials", "send", "exit");

PennController.ResetPrefix(null);

PennController("consent",
    newHtml("consent form", "consent.html")
        .print()
    ,
    newText("my_consent_clear", "<br/><br/>")
        .print()
    ,
    newButton("consent button", "By clicking this button, I consent to participate in this study.")
        .settings.center()
        .print()
        .wait()
)
.log("ParticipantID", ParticipantID);

PennController("demographics",
    defaultText
        .print()
    ,
    newText("age_text", "What is your age?")
    ,
    newTextInput("age_response")
        .settings.log()
        .settings.length(3)
        .print()
    ,
    newText("my_age_clear", "<br/><br/>")
    ,
    newText("live_in_text", "Did you live in the United States from birth until (at least) age 13?")
    ,
    newScale("live_in_response", "Yes", "No")
        .settings.log()
        .settings.labelsPosition("left")
        .settings.size("auto")
        .print()
    ,
    newText("my_live_in_clear", "<br/><br/>")
    ,
    newText("native_lang_text", "Did your parents/guardians speak English to you at home?")
    ,
    newScale("native_lang_response", "Yes", "No")
        .settings.log()
        .settings.labelsPosition("left")
        .settings.size("auto")
        .print()
    ,
    newText("my_native_lang_clear", "<br/><br/>")
    ,
    newText("town_text", "Which state did you grow up in (two letter abbreviation)?")
    ,
    newTextInput("town_response")
        .settings.log()
        .settings.length(100)
        .print()
    ,
    newText("my_town_clear", "<br/><br/>")
    ,
    newButton("submit", "Submit")
        .print()
        .wait(getTextInput("age_response").testNot.text("") &&
              getScale("live_in_response").test.selected() &&
              getScale("native_lang_response").test.selected() &&
              getTextInput("town_response").testNot.text(""))
)
.log("ParticipantID", ParticipantID);

PennController("description",
    newHtml("description", "description.html")
        .print()
    ,
    newButton("start", "Begin experiment")
        .settings.center()
        .print()
        .wait()
)
.log("ParticipantID", ParticipantID);

PennController.Template("final_pilot_03_cnp_subj_items_all_lists.csv",
    row => PennController("trials",
        defaultText
            .settings.center()
            .print()
        ,
        newController("AcceptabilityJudgment", {s: row.Sentence, as: ["1", "2", "3", "4", "5", "6", "7"], presentAsScale: true, leftComment: "very bad", rightComment: "very good"})
            .print()
            .log()
            .wait()
            .remove()
        ,
        (row.Question != "NA" ?
            newController("Question", {q: row.Question, as: ["Yes", "No"], hasCorrect: row.Answer})
                .print()
                .log()
                .wait()
                .remove()
        :
        {})
    )
    .log("ParticipantID", ParticipantID)
    .log("Group", row.Group)
    .log("UniqID", row.UniqID)
    .log("Sentence", '"' + row.Sentence + '"')
    .log("Question", '"' + row.Question + '"')
    .log("Answer", row.Answer)
);

PennController.SendResults("send");

PennController.SetCounter("setcounter");

PennController("exit",
    defaultText
        .print()
    ,
    newText("thankyou", "<h1>Thank you!</h1><p>Thank you for participating in our study.</p>")
    ,
    newText("code", "<p>To receive payment through Amazon Mechanical Turk, enter your unique identifying code in the other tab/window.</p><p>Your unique identifying code is: ".concat(ParticipantID, "</p>"))
    ,
    newText("close", "<p>After copying your unique identifying code above, you can close this tab/window. Your results have been saved.</p>")
    ,
    // A faux timer that is never started
    // in order to stay on page forever
    newTimer("faux", 10)
        .wait()
)
.log("ParticipantID", ParticipantID)
.setOption("countsForProgressBar", false);