make first iteration to be displayed as 1 #1704
Answered
by
becky-gilbert
joseluisulloafulgeri
asked this question in
Q&A
-
Hi all, I have a very basic question. I'm new in javascript and I haven't find a solution for this. if(i < (nblocks-1)){
test_break = {
type: "html-keyboard-response",
stimulus: "<p>This is block number " + i + " out of 5.</p></br>" + "<p>Please take a break.</p></br>",
post_trial_gap: 1000,
data: {test_part: 'break'}
}; Any hint will be appreciated! |
Beta Was this translation helpful? Give feedback.
Answered by
becky-gilbert
Apr 2, 2021
Replies: 1 comment 1 reply
-
Hi Jose, try adding 1 to i and then converting the result to a string, like this: stimulus: "<p>This is block number " + (i+1).toString() + " out of 5.</p></br>" + "<p>Please take a break.</p></br>" |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
becky-gilbert
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Jose, try adding 1 to i and then converting the result to a string, like this: