Forum Discussion
Buttons to insert value in numerical input field cause console error... Uncaught TypeError: r.value is not a function
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.
- SteveGannonCommunity Member
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?
- SteveGannonCommunity Member
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
- DeveloperIgnitiCommunity Member
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.
- SteveGannonCommunity Member
Your other thread suggests this graded question slide will ultimately be reported to the LMS via a Results slide. If that's not the case, then I suggest just using a regular numeric entry question and not a graded question slide.
- DeveloperIgnitiCommunity Member
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.
- SteveGannonCommunity Member
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.
- WaltHamiltonSuper Hero
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.
- DeveloperIgnitiCommunity Member
@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.
- WaltHamiltonSuper Hero
Actually, the first link to the User Manual deals with when to submit, while the second deals with where, how, and what to submit.
Lauren has answered the other discussion.