Jeremy

Forum Replies Created

Viewing 15 posts - 406 through 420 (of 1,522 total)
  • Author
    Posts
  • in reply to: Unable to randomize fillers and experimental items #8227
    Jeremy
    Keymaster

    Hi Yasmin,

    You center the Scale but not the Text element, which is why the two do not appear aligned together

    Jeremy

    Jeremy
    Keymaster

    Hi,

    The more often you update the values of the Var elements, the less likely it is that participants see a message due to an outdated, empty Var element, so that reasoning would suggest to lower the value of 10. However, it’s quite unlikely that a participant would type any text and validate their answer in less than 10ms

    It could be that execution is slowed down and the Timer is not actually run every 10ms but much less frequently. You could try using the javascript function window.requestAnimationFrame instead, which is optimized to execute loops:

    Template("ansa_template.csv", row =>
      newTrial("ansa", 
        ...[...new Array(20)].map( (v,i) => newVar("ansa_"+Number(i+1),"").global() )
        ,
        newFunction( ()=>{
          const currentPennController = document.querySelector(".PennController-PennController");
          const checkBlanks = () => {
            document.querySelectorAll("textarea[name^='blank']")
              .forEach( (v,i) => getVar("ansa_"+Number(i+1)).set(v.value)._runPromises() );
            if (currentPennController == document.querySelector(".PennController-PennController"))
              window.requestAnimationFrame( checkBlanks );
          };
          checkBlanks();
        }).call()

    Did you also double-check your tests on the Var element, and whether what the participant typed in the boxes is indeed supposed to satisfy those tests when they see the messages?

    Jeremy

    in reply to: stimuli presentation order logging #8225
    Jeremy
    Keymaster

    Hi,

    All PennController results lines include an EventTime column, and by default all PennController trials report a results line for when the trial started: you can use the value of the EventTime column from those lines to sort the trial by running order (note that the lines int the results file should already be sorted using the values from that column)

    Another option would be to do something like that:

    Header(
      newVar("runningOrder", 0).global().set(v=>v+1)
    )
    .log("runningOrder", getVar("runningOrder"))

    Jeremy

    in reply to: MediaRecorder – filenames using ID #8224
    Jeremy
    Keymaster

    Hi Shamim,

    This won’t be possible, because new* PennController commands are executed immediately, that is, before participants can interact with the page. So it’s not possible to reference a value to be set later (the participant’s ID) in the arguments of newMediaRecorder

    What you can do is generate and store a unique ID in a javascript variable and reference that variable in newMediaRecorder and in log, for example

    Jeremy

    in reply to: recording audio production #8214
    Jeremy
    Keymaster

    Hi,

    How sepWith works is explained in the Ibex manual. If UploadRecordings("sendAsync", "noblock") is commented out with //, and assuming there is no other trial labeled sendAsync defined in the code, then any reference to sendAsync in the sequence will have no effect, since there will be no trial with a matching label to include. Note, however, that you mention sepWith("Async", randomize(experiment)) (I assume the code has sepWith, which is the Ibex function to use in a sequence, rather than SepWith): the reference here is Async, not sendAsync, so you need to look for a trial labeled Async in the code, which does not correspond to UploadRecordings("sendAsync", "noblock"), so it’s not relevant whether that line is commented out or not

    Re. how to match the files, here’s a made-up sample of selected lines from a results file:

    1612992170,SUBMISSION1,PennController,28,0,experiment,NULL,MediaRecorder,filler1,Filename,filler1.webm,1612991498311,NULL
    1612992170,SUBMISSION1,PennController,30,0,experiment,NULL,PennController,UploadRecordings,Filename,12345678-abcd-efgh-ijkl-901234567890.zip,1612991504982,async
    1612992170,SUBMISSION1,PennController,29,0,experiment,NULL,MediaRecorder,filler2,Filename,filler2.webm,1612991501417,NULL
    1612992170,SUBMISSION1,PennController,31,0,experiment,NULL,PennController,UploadRecordings,Filename,90123456-mnop-qrst-uvwx-789012345678.zip,1612991505176,sync
    1612993451,SUBMISSION2,PennController,28,0,experiment,NULL,MediaRecorder,filler1,Filename,filler1.webm,1612991506231,NULL
    1612993451,SUBMISSION2,PennController,30,0,experiment,NULL,PennController,UploadRecordings,Filename,abcdefgh-1234-5678-9012-ijklmnopqrst.zip,1612991507023,async
    1612993451,SUBMISSION2,PennController,29,0,experiment,NULL,MediaRecorder,filler2,Filename,filler2.webm,1612991507189,NULL
    1612993451,SUBMISSION2,PennController,31,0,experiment,NULL,PennController,UploadRecordings,Filename,uvwxyzab-3456-7890-1234-cdefghijklmn.zip,1612991508309,sync

    Here, you can see that two zip files correspond to SUBMISSION1: 12345678-abcd-efgh-ijkl-901234567890.zip and 90123456-mnop-qrst-uvwx-789012345678.zip. The recordings filler1.webm and filler2.webm reported in the lines above for SUBMISSION1 will be included in those zip files (they might both be in just one of the two, or one in each, depending on how upload went)

    Then two zip files correspond to SUBMISSION2: abcdefgh-1234-5678-9012-ijklmnopqrst.zip and uvwxyzab-3456-7890-1234-cdefghijklmn.zip. Likewise, you will find the recordings filler1.webm and filler2.webm from SUBMISSION1 in those zip files

    Jeremy

    in reply to: Scale name logging #8212
    Jeremy
    Keymaster

    Hi Henrik,

    The name of the Scale element is reported in the results file, here’s a sample from a test run of mine:

    1653659265	EDITED	PennController	0	0	trials	NULL	Scale	scale_1	Choice	 small	1653659258865	NULL
    1653659265	EDITED	PennController	0	0	trials	NULL	Scale	scale_2	Choice	 tiny	1653659259777	NULL
    1653659265	EDITED	PennController	0	0	trials	NULL	Scale	scale_3	Choice	 tall	1653659261098	NULL
    1653659265	EDITED	PennController	0	0	trials	NULL	Scale	scale_4	Choice	 tiny	1653659261951	NULL
    1653659265	EDITED	PennController	0	0	trials	NULL	Scale	scale_5	Choice	 gigantic	1653659263569	NULL

    As you can see, the first line reports scale_1 and the last one reports scale_5

    Jeremy

    in reply to: Unable to randomize fillers and experimental items #8208
    Jeremy
    Keymaster

    Hi Yasmin,

    It depends how exactly you mean to add labels, but one option would be to do this:

    newTrial(
      newText(`<span style='width: 2em; text-align: left;'>0</span>
               <span style='width: 2em; text-align: center;'>25</span>
               <span style='width: 2em; text-align: center;'>50</span>
               <span style='width: 2em; text-align: center;'>75</span>
               <span style='width: 2em; text-align: right;'>100</span>`)
        .css({display: 'flex', 'justify-content': 'space-between', width: '20em'})
        .print()
      ,
      newScale("answer", 100)
        .slider()
        .css({'max-width':'unset', width: '20em'})
        .print()
        .log()
        .wait()
    )

    Note that using CSS rules in the code like that is not ideal, so you might want to consider adding rules to the project’s CSS files instead

    Jeremy

    in reply to: recording audio production #8206
    Jeremy
    Keymaster

    Hi,

    1) As long as (all) UploadRecordings complete(s) before SendResults (eg. because you inserted UploadRecordings("upload") before SendResults() — no second argument in UploadRecordings, because otherwise it would be non-blocking and would therefore likely complete *after* SendResults) you will have a line for each uploaded zip file in your results file, which you can use to pair zip files with submissions. The recorded audio files are named after the MediaRecorder element that produced them. More details in this post

    2) Unfortunately that is not currently supported, since all major browsers support only webm/opus when recording via the MediaRecorder API, which PennController uses in its own MediaRecorder element type. The webm files can easily be converted to wav files though, eg. using ffmpeg: ffmpeg -i "file.webm" -vn "file.wav"

    Jeremy

    in reply to: running penncontroller locally #8204
    Jeremy
    Keymaster

    Hi,

    How do you reference the image in the HTML file? It should look like <img src="http://localhost:3000/server.py?resource=logo.png">

    NB: I cannot see the screenshot at the ImgBB link from your message

    Jeremy

    in reply to: running penncontroller locally #8200
    Jeremy
    Keymaster

    Hi,

    Do you still have any non-HTML, non-CSV file in chunk_includes with an extension that you didn’t list in an endsWith command as illustrated above (note that this is case-sensitive, so make sure all your extensions are lower case)? That would produce the error you report

    Jeremy

    in reply to: Trial termination key? #8197
    Jeremy
    Keymaster

    Hi Mieke,

    Even though that probably won’t fit an actual data collection scenario, let me note that the debugger has a button “Next screen” in the “Log” tab and a button “Reach” in the “Sequence” tab

    You could add newKey("Q").callback( end() ) as the very first command in newTrial to make a press on that key immediately end the trial

    Jeremy

    in reply to: Very uneven group assignment #8196
    Jeremy
    Keymaster

    Hi Nadine,

    Page 10 in the advanced tutorial also says:

    PennController uses an internal counter to counterbalance group assignment. By default, the counter increases by one at the end of an experiment, which rotates which experimental item group is run.

    11 and 13 of your participants opened the link to your experiment when the counter had a value whose modulo 7 was 1 or 4, respectively

    You could use SetCounter to insert a trial at the very beginning of your experiment to increase the counter at the very beginning instead, but that won’t ensure that your participants start with a different counter value (eg. if multiple people click the link at the same time) or that participants with a different counter value will complete your experiment (anyone can decide to leave before finishing)

    The most certain way to collect an even number of participants is to collect your data in batches, circulating a link with ?withsquare=0, one with ?withsquare=1, one with ?withsquare=2, etc. and run more participants for each link as needed after you check your results file

    Jeremy

    Jeremy
    Keymaster

    Hi,

    Use .test.selected:

    newSelector("answer")
      .add(getImage("pic1"),getImage("pic2"))
      .shuffle()
      .keys("F","J")
      .frame("solid 5px purple")
      .log()
      .once()
      .wait()
      .test.selected( getImage("pic1") )
      .success( newImage(row.gif1).print() ) 
      .failure( newImage(row.gif2).print() )
    ,
    getCanvas("myCanvas").remove()
    

    Jeremy

    in reply to: Format of table is invalid #8187
    Jeremy
    Keymaster

    Hi,

    You’re missing quotations marks on lines 156 (opening) and 197 (closing). Add them back in and that error will go away

    Jeremy

    Jeremy
    Keymaster

    Hi Aiden,

    I don’t see trials_2.1 or trials_2.2 in your experiment because it contains no tables named SS_Trials_2.1.csv or SS_Trials_2.2.csv

    That being said, the error you report is consistent with some audio files being corrupt, or some lines in a table referencing an invalid filename

    Jeremy

Viewing 15 posts - 406 through 420 (of 1,522 total)