mschrumpf

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • in reply to: Customize slider #7782
    mschrumpf
    Participant

    Hello Jeremy,
    I have solved this problem in the meantime. The solution was to simply include “max width”: “none” in the css settings of the element in the main script:

    newScale("Originell", 100)
                .slider()
                .settings.css({
                    "max-width" : "none",
                    "width": "450px",
                    "margin": "auto",  
                    "align": "center",
                    "text-align": "center"
                    })
                .before(newText("label3", "gar nicht   "))
                .after(newText("label4", "   perfekt"))
                .center()
                .print()
                .log()
    • This reply was modified 2 years, 2 months ago by mschrumpf.
    in reply to: Customize slider #7777
    mschrumpf
    Participant

    Hello,
    I have a similar problem. I want to increase the width of a few slider elements. I have tried several methods including the ones discussed here, but nothing so far has increased the width of the slider beyond ~160 pixels.
    I tried setting the width of the elements themselves with different units (%, px, in, cm), I tried editing the global_main.css and slider.css, and even the Scale.js module, but none of these had an effect.

    What’s the most reliable way of increasing the width of a slider scale element?

    Thanks

    Matthias

    in reply to: Cannot select radio scale buttons #7727
    mschrumpf
    Participant

    Hello Jeremy
    thank you very much. Looks like that solved the problem.

    Matthias

    in reply to: Neutral answer on test.selected #7697
    mschrumpf
    Participant

    Thank you very much, Jeremy.
    This solution works for one scale, but I would like to check both scales that are used in my experiment for input.
    Is there a way to do that?
    Best

    Matthias

    in reply to: Bug? Some trials will not show up #7189
    mschrumpf
    Participant

    I discovered and resolved the problem myself. It was caused by bad syntax in the following segment on the trial “Rueckmeldung”:

    newTextInput("Strategie")
            .center()
            .print()
            .log(<ul>final</ul>)

    There need to be quotation marks around the word “final”.

    As I described above, this error caused the trial to not be displayed at all; it also seems to have caused the following trial (“Dank”) to not be displayed, both of which without an error message in the debugger. I could not find any additional mistakes in the code of trial “Dank”.

    in reply to: DashedSentence in a PennController trial #6993
    mschrumpf
    Participant

    Hello Jeremy,
    thank you very much for your elaborate answer.
    I implemented the functions into my experiment and it works like a charm.
    The only change I made was changing the hidden text into gray underlines, just like they would in the native controller. My bosses are going back and forth on that one 😉

    Matthias

    in reply to: DashedSentence in a PennController trial #6967
    mschrumpf
    Participant

    Hi Jeremy,
    thanks a lot for your help.
    Is it possible to integrate the function into the DashedSentence.js file? As is, it works, but previous words in the sentence remain visible until the end. Plus, the elements in our material consist of two or three words each. I previously used the “hideUnderscores: true” option for this, but I would have to find another way to work around that now. So I would really appreciate it if you could point me in the right direction as to how to include a portion of code that hides everything except punctuation in the DashedSentence controller.
    Best regards

    Matthias

    in reply to: DashedSentence in a PennController trial #6956
    mschrumpf
    Participant

    I have to reiterate my question from earlier on in this thread for the current version of PennController. How do I edit the DashedSentence controller so that it keeps punctuation and line breaks intact? We want the overall structure of the sentence to remain visible for the participants. So if there is a comma or a stop somewhere in the item, we want them to be able to see it.
    I tried the solution suggested by Jeremy here with the current version of PennController, but I keep getting errors. Scanning through the DashedSentence controller, it also didn’t become clear to me where it is specified which characters are hidden and transformed into dashes and which ones remain visible (blank spaces or asterisks, depending on the settings).

    mschrumpf
    Participant

    Hi Jeremy,
    thank you very much for your help. It’s those little details that slip through when I’m checking my own code. I have added the missing .wait() command and a canvas for the selection task. The template looks like this now:

    Template( "subco_english_acc2.csv" , 
        row => newTrial( "experiment",
            newController("DashedSentence", {hideUnderscores: true, display: "dashed",  s : row.Sentence})
                .print()
                .log()
                .wait()
                .remove()
            ,
            newText("Question", row.Question)
            .center()
            .print()
            ,
            getText("Question")
            .test.text( /\?$/ ) //Previously, this field contained " " and the instructions for failure and success were reversed
               .failure( newTimer(500).start().wait()) 
               .success(
                    newText("AnswerL", row.AnswerL).print()
                    .after(newText("AnswerR", row.AnswerR).print())
                    ,
                    newText("F", "<b>F</b>")
                    ,
                    newText ("J", "<b>J</b>")
                    ,
                    newCanvas("Canvas", 600, 200)
                    .add(0, 0, getText("AnswerL"))
                    .add(400, 0, getText("AnswerR"))
                    .add(0, 50, getText("F"))
                    .add(400, 50, getText("J"))
                    .print()
                    ,
                    newSelector("Answer")
                    .add( getText("AnswerL")   , getText("AnswerR") )
                    .keys(     "F"           ,        "J"           )
                    .print()
                    .log()
                    .wait()
                    )
        )
    )

    It doesn’t look great, but it works – just in case anyone is faced with a similar problem.
    Best regards
    Matthias

    in reply to: Several questions about the TextInput element #6330
    mschrumpf
    Participant

    Hello Jeremy,
    thank you very much for your answer.
    Regarding the first three questions: As you correctly guessed, this is about the demographic data trial which we already discussed in another thread. I also have an HTML version of that trial, but I chose to re-make it in pcIBEX so that I could log the data that is entered here to each line of the results file.
    Is it possible to achieve the same thing with inputs made to an HTML element? I imagine one would have to get those inputs, split them up and save them as global variables. If that can be accomplished, points one, two and three would already be solved in my HTML file.

    Regarding question 4, that’s pretty much what I expected and I’ll talk this one through with my team. I am now wondering if I could simply create a new key press element for all letters on the keyboard and log the time for the first time one of them is pressed.

    Thank you very much for your help.
    Matthias

    in reply to: log global vs. local variable #6329
    mschrumpf
    Participant

    Hello Jeremy,
    thank you very much. I had checked those parentheses but never double-checked them because I expected the whole script to throw an error if there was something off there. I put the parentheses in the right spot and it works as expected now.
    Matthias

    in reply to: log global vs. local variable #6316
    mschrumpf
    Participant

    Hello everyone.
    If you don’t mind me barging in, I have the same problem. Either the fix is not working for me, or I am doing something wrong. Either way, I would appreciate some feedback on this.
    I want to record some demographic data at the start of the experiment:

    newTrial( "Angaben" , 
        newText("Ueberschrift", "<h2>Stichproben-relevante Angaben</h2>").center().print()
        ,
        newTextInput("inputAlter")
        .size("100px")
        ,
        newScale("inputGeschlecht", "m&auml;nnlich", "weiblich", "divers")
        ,
        newScale("inputHaendigkeit", "linksh&auml;ndig", "rechtsh&auml;ndig")
        ,
        newTextInput("inputGeboren")
        ,
        newTextInput("inputWohnsitz")
        ,
        newScale("inputDeutsch", "ja", "nein")
        ,
        newTextInput("inputMuttersprache")
        ,
        newTextInput("inputProlific-ID")
        ,
        newCanvas("Canvas", 600, 320)
            .add( 0,    0,  newText("Alter:"))
            .add( 400,  0,  getTextInput("inputAlter").log())
            .add( 0,    40,  newText("Geschlecht:"))
            .add( 400,  40,  getScale("inputGeschlecht").log())
            .add( 0,    80,  newText("H&auml;ndigkeit"))
            .add( 400,  80,  getScale("inputHaendigkeit").log())
            .add( 0,    120,  newText("Geboren in (Bundesland/Staat):"))
            .add( 400,  120,  getTextInput("inputGeboren").log())
            .add( 0,    160,  newText("Derzeitiger Wohnsitz (Bundesland/Staat):"))
            .add( 400,  160,  getTextInput("inputWohnsitz").log())
            .add( 0,    200, newText("Deutsch als Muttersprache?"))
            .add( 400,  200, getScale("inputDeutsch").log())
            .add( 0,    240, newText("Muttersprachen (au&szlig;er Deutsch):"))
            .add( 400,  240, getTextInput("inputMuttersprache").log())
            .add( 0,    280, newText("Prolific-ID:"))
            .add( 400,  280, getTextInput("inputProlific-ID").log())
            .print()
        ,
        newText("Warnung1", "Bitte f&uuml;llen Sie die Pflichtangaben aus.")
            .color("red")
            .italic()
            .center()
            .hidden()
            .print()
        ,
        newButton("Weiter") 
            .center()
            .print()
            .wait(
                getTextInput("inputAlter").test.text(/.+/)
                .and(getTextInput("inputGeboren").test.text(/.+/))
                .and(getTextInput("inputWohnsitz").test.text(/.+/))
                .and(getTextInput("inputProlific-ID").test.text(/.+/))
                .and(getScale("inputGeschlecht").test.selected())
                .and(getScale("inputHaendigkeit").test.selected())
                .and(getScale("inputDeutsch").test.selected())
                    .failure( 
                        getText("Warnung1")
                        .hidden()
                        ,
                        newTimer(100)
                        .start()
                        .wait()
                        ,
                        getText("Warnung1").visible() )
        ,
        newVar("Alter")
            .global()
            .set( getTextInput("inputAlter") )
        ,
        newVar("Geboren")
            .global()
            .set( getTextInput("inputGeboren") )
        ,
        newVar("Wohnsitz")
            .global()
            .set( getTextInput("inputWohnsitz") )
        ,
        newVar("Muttersprache")
            .global()
            .set( getTextInput("inputMuttersprache") )
        ,
        newVar("Prolific-ID")
            .global()
            .set( getTextInput("inputProlific-ID") )
            ,
        newVar("Geschlecht")
            .global()
            .set( getScale("inputGeschlecht") )
        ,
        newVar("Haendigkeit")
            .global()
            .set( getScale("inputHaendigkeit") )
        ,
        newVar("Deutsch")
            .global()
            .set( getScale("inputDeutsch") )
        
                )
        .log("Alter", getVar("Alter"))
        .log("Geschlecht", getVar("Geschlecht"))
        .log("Haendigkeit", getVar("Haendigkeit"))
        .log("Geboren", getVar("Geboren"))
        .log("Wohnsitz", getVar("Wohnsitz"))
        .log("Deutsch", getVar("Deutsch"))
        .log("Muttersprache", getVar("Muttersprache"))
        .log("Prolific-ID", getVar("Prolific-ID"))
    )
    .setOption("countsForProgressBar", false)
    .setOption("hideProgressBar", true);

    Then in a later trial, I want to call back to the variables entered here to write them into each line of the results file:

    Template( "itemlist_1_1.csv" , //Aufbau parallel zu "exercise.csv"
        row => newTrial( "Experiment" ,
            newKey("Enter", "Enter")
                .callback(
                    getButton("Weiter").click()
                    )
            ,
            newText("")
            .settings.css({
            "padding-top": "100px"
            })
            .print()
            ,
            newText("prompt", row.prompt)
            .settings.cssContainer({
            "background-color": "lightgrey",
            "width": "800px",
            "border-radius": "5px",
            "margin": "auto",
            "align": "center",
            "text-align": "center",
            "padding": "5px",
            "font-size": "large"})
            .print()
            .log()
            ,
            newText("Line", "<hr>")
            .settings.css({
            "width": "100%",
            "margin": "auto",  
            })
            .print()
            ,
            newTextInput("Continuation", "")
            .lines(1)
            .center()
            .settings.css({
                "border": "solid 2px royalblue",
                "border-radius": "5px",
                "width": "75%",
                "align": "center",
                "text-align": "left",
                //"padding": "10px 5px 0px 5px",
                "font-size": "large",
                "margin": "auto"
            })
            .print()
            .log()
            ,
            newText("Line", "<hr>")
            .settings.css({
            "width": "100%",
            "margin": "auto",  
            })
            .print()
            ,
            newText("Warnung3", "Bitte geben Sie eine Fortsetzung ein.")
            .color("red")
            .italic()
            .center()
            .hidden()
            .print()
            ,
            newButton("Weiter")
            .center()
            .print()
            .wait( getTextInput("Continuation").testNot.text("")
                .failure( 
                    getText("Warnung3")
                    .hidden()
                    ,
                    newTimer(100)
                    .start()
                    .wait()
                    ,
                    getText("Warnung3").visible() ) 
            )
        )
        .log("Alter", getVar("Alter"))
        .log("Geschlecht", getVar("Geschlecht"))
        .log("Haendigkeit", getVar("Haendigkeit"))
        .log("Geboren", getVar("Geboren"))
        .log("Wohnsitz", getVar("Wohnsitz"))
        .log("Deutsch", getVar("Deutsch"))
        .log("Muttersprache", getVar("Muttersprache"))
        .log("Prolific-ID", getVar("Prolific-ID"))
        //Zeichnet demografische Angaben aus Folie 2 in jeder Ergebniszeile auf
        .log("id", row.id)
        .log("cond", row.cond)
        .log("np1", row.np1)
        .log("np2", row.np2)
        .log("coref", row.coref)
        .log("vclass", row.vclass)
        .log("verb", row.verb)
        .log("list", row.list)
        .log("prompt", row.prompt)
        //Zeichnet Werte aus den angegebenen Tabellenspalten fuer die aktuelle Tabellenzeile auf 
        .log("Continuation", getVar("Continuation"))
    )

    But just like in Peiyao’s case, the lines .log("Alter", getVar("Alter")) and so on only insert “undefined” into the results file each time. The logging works fine on the demographic information trial. But later in the actual experiment, all variables are “undefined”. What can I do to fix this?

    in reply to: Format of table is invalid (PennController: 4) #6078
    mschrumpf
    Participant

    Thank you, Jeremy.
    I checked my .csv file again and realized it contained fields that were only partially marked as strings and which contained commas.
    The format looked like this:
    ...,xyz:"xyz,xyz",...
    I made sure that those fields begin and end with quotation marks:
    ...,"xyz,xyz",...
    It seems to be working now.
    Best regards
    Matthias

    in reply to: Using if statements during a trial #5716
    mschrumpf
    Participant

    Hello everybody,
    I am currently working on a very similar experiment: a self-paced reading task where some but not all of the items have a comprehension question.
    I tried to apply your code from earlier in this thread, Jeremy, as stated below. My implementation has completely taken out the skript however, as I now only get the “There must be some items in the running order” error message when I try to run it.
    This is my code:

    Template( "MyTable.csv" ,
        row => newTrial( "experiment" ,
            dashed("sentence", row.Satz)
            ,
            newButton("Fertig")
                .print()
                .wait()
            ,
            newTimer(200)
                .start()
                .wait()
            ,
            newText("Frage", row.Frage)
            ,
            newText("Links", row.Links)
            ,
            newText("Rechts", row.Rechts)
            ,
            newCanvas("Canvas", 450,200)
            ,
            newSelector("Selector")            
            ,
            newTimer("200", 200)
                .start()
                .wait()
            ,
            ( row.Antwort=="1" ? [
                getText("Frage")
                    .print(),
                getText("Links")
                    .print(),
                getText("Rechts", row.Rechts)
                    .print(),
                getCanvas("Canvas")
                    .add(   0 , 0 , getText("Links") )
                    .add( 250 , 0 , getText("Rechts") )
                    .print(),
                getSelector("Selector")
                    .add ( getText("Links"), getText("Rechts"))
                    .keys(          "F"     ,           "J")
                    .log()
                    .once()
                    .wait()
                ] : [
                getText("Frage")
                .print() //Placeholder code. The final skript should just "do nothing" here
                    ] )
        )
        .log("Item" , row.Item )
        .log( "Konsistent" , row.Konsistent )
        .log( "Geschlecht" , row.Geschlecht )
        .log( "Krit" , row.Krit )
        .log( "Anzahl" , row.Anzahl )
        .log( "Antwort" , row.Antwort )
        .log( "Satz" , row.Satz )
        .log( "Frage" , row.Frage )
        .log( "Links" , row.Links )
        .log( "Rechts" , row.Rechts )
    )

    Since the error message is giving me nothing to work with, I would be very grateful for any hints as where I have gone wrong.
    Thanks in advance and best regards

    in reply to: DashedSentence in a PennController trial #5247
    mschrumpf
    Participant

    Hello Jeremy,
    thank you very much for your help. Your solution worked great. I just need to work out two more things.
    Firstly, how to replace each character of each word with a hyphen “-” instead of a blank space with a border on the bottom. I’m sorry this didn’t become clearer in my other post. It looked much clearer in the editor than in the finished post.
    Secondly, and perhaps more important, how to call the function in a template and supply the argument “sentence” from a row in a .csv file.
    Best regards,
    Matthias

Viewing 15 posts - 1 through 15 (of 17 total)