Buttons to insert value in numerical input field cause console error... Uncaught TypeError: r.value is not a function

Feb 23, 2024

Hi,

I am experiencing a problem with the below attached course.

The course contains a numerical input question.

The value in the input field can be entered either manually, or by clicking one of the three option buttons.

The page has both a Submit button, and a “Next” button, which does not perform a submit and instead jumps to the next slide.

I have found that if I use one of the option buttons to set the input value, then click Next, I get a permanent “three dots” loading animation on screen, and this error in the Browser console: “Uncaught TypeError: r.value is not a function”.

If I set the value manually (keyboard input) and click Next, the error does not occur.

If I click an option button and use the Submit button, the error does not occur.

So, there seems to be a problem with the specific combination of setting the input value through an action (click an option button), then navigating to the next page (without submitting).

I would appreciate confirmation if this can be replicated.

Many thanks in advance.

9 Replies
Steve Gannon

You're using a numeric graded question format but allowing the user to bypass submitting the entry via the custom Next button on the slide. The solution is to submit the question response when the user clicks Next and then jump to the next slide. The Submit trigger needs to go above the Jump trigger. See attached.

EDIT

Re-reading your message, I see you don't want to submit the response. In that case, why not just use a regular numeric entry field instead of a graded question slide?

Steve Gannon

It appears you need to interact with the graded question field in order for Storyline to handle this. if you click one of the buttons without clicking into the numeric entry field and then click Next, the three dots appear. But if you click one of the buttons and simply click in the numeric entry field (you can leave the value in the box unchanged), then Storyline recognizes that you have engaged the graded question and clicking Next works as expected

Developer Ignition

Hi Steve,

The reason I don't want to submit the question is because of the issue I raised here (submitting the question sends a score to the LMS, which I am trying to avoid). I am trying to build a custom interaction that has the same "consequences" as a graded question. The Storyline file I've provided is just a proof of concept.

I appreciate your discovery that clicking on the field once is enough to prevent the error. However, I still feel this is unintended behaviour.

Developer Ignition

Sorry, I have not explained myself...

I still want a score to get sent to the LMS eventually, just not on submit of the question. I want the score to be submitted only when the results slide is reached.

I am told the only way to achieve that is by *not* having a submit action on the question, and just jump to the next slide.

Steve Gannon

Attached is a bit of a hack (which, I agree, shouldn't be necessary). When a button is clicked, a layer is activated. The layer runs a line of JavaScript 1/10th of a second after the layer starts and then the layer is hidden. The JavaScript gives focus to the numeric entry field. So, even though the user didn't manually click in the entry box, Storyline thinks the box has been interacted with.

This is just a quick test but it appears to work on my end.

Walt Hamilton

I am told the only way to achieve that is by *not* having a submit action on the question, and just jump to the next slide.

I’m very suspicious of this advice. I think it is confusing submitting the interaction for evaluation with submitting Results to the LMS. I may be wrong, but as I read your post, I think you want to have the response submitted (so it can be graded), but then later submit the Results.

https://community.articulate.com/series/articulate-storyline-360/articles/articulate-storyline-360-user-guide-how-to-submit-quiz-answers-all-at-once 

https://community.articulate.com/series/articulate-storyline-360/articles/storyline-360-publishing-a-course-for-lms-distribution#step5 

 

 

 

Developer Ignition

@Walt Hamilton: I am following the method described in your first link. That link only concerns my previous discussion: how to avoid seeing a score on the LMS *before* the test is complete. Are you saying the method described in your first link is wrong? If so, I would be grateful if you could post a response in my previous discussion so it helps other people, too.

My current discussion is regarding an error in the browser console which I currently believe is a bug.