Delaying response until clicking the submit button

I was in Jay’s webinar last night and he was talking about a script to delay the response for the numeric value entered…which was exactly what I needed. Only, it’s not working for me. Below is the link to the activity, which I modified from someone else’s activity I found on this site. Slide 2 is the original script. Slide 1 is all of my modifications. I want the students to make an educated guess and not see a response until they click a button. Thanks for any suggestions.

Screen 1 looks pretty good! There are a few small changes that would make it work brilliantly but I need some clarification first. Looking at the script here’s my guess for what you want it to say:

  • <40: “higher”
  • 40-41 “youre so close, just a little higher”
  • 42-43 “Wow! you got it!”
  • 44-45 “youre so close, just a little lower”
  • >45 “Lower”

Is that correct? Do you want it to give a prompt in any other case?

Also, are you only accepting integers? What would happen if a student enters 42.5?

You are exactly right. I’m extremely new to this, so I just copy and try not to deviate too much from the script. I would like to accept integers and would also like to include a prompt.

Got it. Remember how we talked about reading from the top down until we find where we want to stop? We’re gonna apply that here by starting off looking at a very small window and then broadening:

  1. when number1.numericValue>=42 and number1.numericValue<43 and number1.submitted "Wow! You got it!"

This looks at the smallest window possible. it must be between 42 and 43 inclusive and the button must be pressed. If the submission doesn’t fall into this we go on to the next window:

  1. when number1.numericValue>43 and number1.numericValue<=45 and number1.submitted "You're so close, just a little lower!"
  2. when number1.numericValue>=40 and number1.numericValue<42 and number1.submitted "You're so close, just a little higher!"

Here, if you weren’t giving the second message “just a little _____” we could combine 2 and 3 into one line an just say number1.numericValue>=40 and number1.numericValue<=45 because we have already ruled out a correct answer. But extra feedback doesn’t hurt so (2) and (3) will work… moving on!

  1. when number1.numericValue<40 and number1.submitted "Higher"
  2. when number1.numericValue>45 and number1.submitted "Lower"

Same thing here. If you aren’t giving specific “higher” or “lower” messages you could just say number1.submitted but again, this is fine.
Side note: there is a way to combine 2 and 3 and combine 4 and 5 but it requires some tricky moves that might not actually save us time!

Last bit:

  1. otherwise "Whatever prompt you want here"

When nothing is submitted, show the prompt.

There is a trick to only allowing integer values, I’ll just share it with you and you can copy/paste it in to the input component (not the note)

submitDisabled: numericValue("\\operatorname{mod}\\left(${this.numericValue},1\\right)")>0

That worked perfectly!!! Thank you so much!!!

I need to delay the equation I enter in the input box from displaying in the graph until I click submit, but I can’t get it to work. Any ideas?