Reply To: html layout/event times/selector vs. scale/ compatibility

PennController for IBEX Forums Support html layout/event times/selector vs. scale/ compatibility Reply To: html layout/event times/selector vs. scale/ compatibility



I have noticed that the calculation of RT within the script is reported in the results, but it’s not correctly reported if I pass the table in R with the tidyverse function.
Do you know what might be the reason?

By “the tidyverse” function, do you mean this?

tidied_results <- tidied_results %>%
  mutate(reaction_time = selection_time - canvas_time,
        correct = if_else(condition == selection, 1, 0))

This piece of code calculates reaction times post-data-collection, based on the timestamps of each event reported in the results file. In our messages, we had discussed using a Var element to calculate reaction times during runtime and report them as an extra column in every row of the corresponding trial. That solution doesn’t require the table transformation illustrated in the piece of code above

I guess I have to make a column for the expected key each trial of the practice, then after each answer it should check whether the key match or not, if the pressed key is different it should provide the feedback like a text message, and a counter must go up of 1. If the counter at the end of the practice is higher than, let’s say 5, it should reload the trial practice, if it’s below 5, it should load the experimental trial.

This is what I would do indeed. You don’t need to write (non-PennController) javascript code for that, PennController will provide you with what you need

I’ll illustrate with an example here, as I lack information to give a solution adapted to your case, and I actually think doing that would obscure the reasoning anyway. In this example, I want the participant to give more than 2 correct responses before they can proceed:


// (Re)set the Var element to 0 before running the practice session
newTrial("prepractice", newVar("practice_score").global().set(0) )

// Very simple trial structure for illustration
Template( "table.csv" , row =>
  newTrial( "practice",
    newText( row.question ).print()
    newScale("answer", "Yes", "No")
        .test.selected( row.correct )  // Increment if correct answer
        .success( getVar("practice_score").set(v=>v+1) )

    // Check the value after the practice session
            newText("Sorry, you do not meet the threshold").print()
            newButton("Take the practice again").print().wait()
            // jump will make the experiment go back to "prepractice" after this trial

This is the table I used:

say yes,Yes
say no,No
don't say yes,No
don't say no,Yes

Let me know if you have questions