Skip to main content
Inspiring
March 3, 2017
Answered

Using Javascript to capture the incorrect state of a quiz question response.

  • March 3, 2017
  • 2 replies
  • 407 views

A client wants to add feedback messages to the incorrect questions after the trainee has completed a scored quiz and is reviewing. The feedback message is only to appear on incorrectly answered questions. I do not see a cpQuizInfo variable that will do this during the review.

Is there a way to retrieve the value of the variable that controls the selection of the correct checkmark or the incorrect X that can be then used to trigger a conditional to show/hide the feedback message?

This topic has been closed for replies.
Correct answer RodWard

There probably IS an array of some kind buried in the output that keeps track of these things, but it's not exposed in such a way that you can easily tap into it with Captivate's interactivity.

2 replies

Lilybiri
Legend
March 3, 2017

Does it have to be with JavaScript? I didn't want to answer because would have proposed advanced/shared actions.

The variable you are referring to may exist but it is not in the exposed variables. The system variable cpQuizInfoAnswerChoice can be used but since its value changes after each question you'd have to store it in a user variable per question slide.

As for skipping correct answers, have a look at: Limit Review to Incorrect Answers (Captivate 6) - Captivate blog

KB in FLAuthor
Inspiring
March 3, 2017

Hello Lilybiri and Rod:

Well, I was trying to avoid creating a bunch of UDVs here. It would seem that there is a variable bring set in the coding behind the reviewing functionality that controls the display of the check(correct) or x (incorrect) image. I was kinda hoping that if js could be used to return that value, an advanced action on the ON ENTER could then be used to show/hide the feedback message.

Wishful thinking, I guess

RodWard
Community Expert
RodWardCommunity ExpertCorrect answer
Community Expert
March 3, 2017

There probably IS an array of some kind buried in the output that keeps track of these things, but it's not exposed in such a way that you can easily tap into it with Captivate's interactivity.

RodWard
Community Expert
Community Expert
March 3, 2017

You would need to set up a tracking variable for each quiz question and then set these variables to a value via the On Success or ON Last Attempt events of each quiz question.  Then you can add a Conditional Action to each quiz slide triggered by the On Slide Enter event that looks at this variable as well the cpInReviewMode system variable to determine whether or not hidden captions on the slide should be shown.