nasimbhmn

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • in reply to: No blankText in SPR #10987
    nasimbhmn
    Participant

    Hi Jeremy,

    Is there any way to remove the blank screen completely?

    Best, Nasim

    in reply to: Aesthetics of the scale element after selection #10504
    nasimbhmn
    Participant

    I just figured it out. I added the following to the CSS and it worked:

    
    .PennController-Scale .option input:checked + label{
        background-color: steelblue;
        color: white;
        font-size: 1em;
    }
    

    Thanks again! It was greatly helpful.
    Best, Nasim

    in reply to: Aesthetics of the scale element after selection #10503
    nasimbhmn
    Participant

    That works perfectly! Thank you!
    Another question: how can I change the aesthetics of the selected option?

    in reply to: Aesthetics of the scale element after selection #10492
    nasimbhmn
    Participant

    I noticed I made a mistake in highlighting the code chunks. I tried to edit it immediately after posting, but I got an error, and when refreshed the page the editing option was not available anymore. Sorry for the mess.

    in reply to: Unable to randomize fillers and experimental items #10429
    nasimbhmn
    Participant

    Hi Jeremy,

    Thanks for the reply. Sorry, I had a typo in my example but not in my script. It seems that undefined does not work in PCIbex, but hasOwnProperty works perfectly.
    Just a minor comment on the log command (in case somebody needs to use it); it should be: .log("list", (row.hasOwnProperty("LIST")?row.LIST:"filler")).

    Best, Nasim

    in reply to: Unable to randomize fillers and experimental items #10366
    nasimbhmn
    Participant

    Oh btw, it seems that this chunk doesn’t work either: row.LIST===undefined?"filler":row.LIST). The error message says No column named ‘LIST’ found in table fillers.csv.

    in reply to: Unable to randomize fillers and experimental items #10362
    nasimbhmn
    Participant

    Hi Jeremy,
    I have a related question, so I am asking it below this thread.

    In the example template you created above, let’s assume I have a column “QUESTION” but only in the fillers table. And this column is empty for half of the filler items. I have revised your script as below, but I receive an error message saying that “No column named ‘QUESTION’ found in table experimental.csv”. Could you please help me resolve it?

    experimental.csv:

    ITEM,SENTENCE,COMPATIBILITY,SUBJECT,LIST,TYPE, 
    101,Sentence 1,1,subject1,A,item
    201,Sentence 2,1,subject1,B,item
    102,Sentence 3,2,subject2,B,item
    202,Sentence 4,2,subject2,A,item

    fillers.csv:

    ITEM,SENTENCE,COMPATIBILITY,SUBJECT,TYPE,QUESTION
    501,Filler 1,.,.,filler,QUESTION501
    502,Filler 2,.,.,filler,
    503,Filler 3,.,.,filler,QUESTION502

    Sample script:

    function_for_template = row => newTrial( row.TYPE ,
          newText( row.SENTENCE ).print()
          ,
          newScale("answer", "True", "False").button().print().log().wait()
          ,
          ...(table.Question!==undefined && table.QUESTION ? [
                newText("question", table.QUESTION).print()
                ,
                newScale("answer", "yes", "no")
                    .keys("f", "j")
                    .button()
                    .print()
                    .log()
                    .wait()
            ] : [null])
    )
    .log("item", row.ITEM)
    .log("compatibility", row.COMPATIBILITY)
    .log("subject", row.SUBJECT)
    .log("list", (row.LIST===undefined?"filler":row.LIST))
    
    Template("experimental.csv", function_for_template)
    Template("fillers.csv", function_for_template)

    Thanks in advance!

    • This reply was modified 1 year, 1 month ago by nasimbhmn.
    in reply to: Text Not Displaying Correctly #9738
    nasimbhmn
    Participant

    ahh, you’re right, it works perfectly when I use the font-face rules directly in the CSS file.
    Many thanks.

    in reply to: Text Not Displaying Correctly #9719
    nasimbhmn
    Participant

    Hi Jeremy,

    I have a problem with changing the font via CSS. I was able to use google API fonts in the original Ibexfarm, but now in PCIbex, neither @import nor @font-face really works.
    Here is the demo of a sample script. Could you please help me resolve the issue?
    https://farm.pcibex.net/r/pfEfgV/

    FYI, in this demo, I have added the font to the global_z.css, but I even tried revising the original global_main.css and nothing changed.

    Thanks and best, Nasim

    in reply to: test.selected() for multiple options #9711
    nasimbhmn
    Participant

    Hi Jeremy,

    That’s a great solution. Thanks a lot.

    Best, Nasim

    in reply to: test.selected() for multiple options #9709
    nasimbhmn
    Participant

    Hi Jeremy,

    I am asking my question here because it is relevant to this topic.
    I have two questions on a single page and I want to give a warning to participants if they left any of them unanswered before they proceed to the next page. I want the warning message to appear below the question that is unanswered. Everything seems to be working except that if people answer the second question and only forget about the second question, both warning messages appear. It works fine the other way around though.

    Here is my code. Could you please help me find the problem?

    
    newTrial("trial1", 
        newText("Question 1")
            .print()
        ,
        
        newScale("scale1",5)
                .before( newText("left", "(<em>totally natural</em>)").css("font-size", "small") )
                .after( newText("right", "(<em>totally unnatural</em>)").css("font-size", "small") )
                .labelsPosition("top")
                .size(200)
                .css("max-width", "unset")
                .left()
                .log()
                .print()
        ,
        
        newText("<br><p>Question 2</p>")
            .print()
        ,
        
        newScale("scale2",  "yes", "no", "I'm not sure")
            .radio()
            .labelsPosition("right")
            .vertical()
            .print()
            .log()
            // .wait("first")
        ,
        
        newButton("proceed","click here to continue")
            .cssContainer({"margin-bottom":"3em"})
            .cssContainer({"margin-top":"3em"})
            .print()
            .wait( 
                getScale("scale1")
                .test.selected()
                .failure(newText("required1")
                        .css("position", "relative")
                        .css("bottom", "270px")
                        .bold().color("red").print())
                .and(
                getScale("scale2")
                .test.selected()
                .failure(newText("required2")
                    .css("position", "relative")
                    .css("bottom", "100px")
                    .bold().color("red").print())
                    )
            )
    )
    

    Thanks a lot in advance!
    Best, Nasim

    in reply to: Conditional trial #8058
    nasimbhmn
    Participant

    Ahh thanks for the explanation and for your prompt answer.

    Best, Nasim

    in reply to: Several questions about the TextInput element #7506
    nasimbhmn
    Participant

    Great! It worked.
    Thanks a lot!

    Best, Nasim

    in reply to: Several questions about the TextInput element #7503
    nasimbhmn
    Participant

    Thanks for your answer, Jeremy. You’re right about the last note. I just changed names/labels after I pasted the copied chunk, but apparently, I forgot to change the last part.

    I tried your solution, and here are the two errors I got:
    1- A pop-up error: “There must be some items in the running order!”
    2- PennController Debug error: “Command ‘and’ unknown on Button element”

    As for the first error, there is nothing wrong with other parts of my script. When I comment the .add() part, it works fine.

    Thank you very much for your help.
    Best, Nasim

    in reply to: Several questions about the TextInput element #7499
    nasimbhmn
    Participant

    Hello Jeremy,

    I have a question related to this topic.
    In your example above (point number 2) it is not clear if “alter” refers to the input field name or its id, or the html file. I do not understand how you retrieve the value from html input field.

    Here is what I need to do:
    I have an html file with multiple text input fields and I want to allow participants to move on to the next page if (1) they have completed all fields and (2) if one of these fields equals exactly 100 (it’s an input field whose value is automatically computed according to the value of two other fields). Can you help me with adding condition (2) to the code below?

    This is the input field in my html document “demographics”:

    
    <input name="useTotal" type="text" id="sum" class="obligatory" readonly="TRUE">
    

    And here is the script on PCIbex with condition (1) implemented:

    
    newTrial("consent_demog",
    newHtml("demographics", "demographic.html")
            .checkboxWarning("Required") 
            .radioWarning("Required")
            .inputWarning("Required")
            .print()
            .log()
    
    newButton("Continue")
            .print()
            .wait(
                getHtml("demographics").test.complete()
                .failure(getHtml("consent").warn())
                )
    )
    
Viewing 15 posts - 1 through 15 (of 23 total)