June 23, 2018
Creating a free-text question and using quiz variables
Comments
(7)
June 23, 2018
Creating a free-text question and using quiz variables
Newbie 5 posts
Followers: 0 people
(7)

I am working on a quiz question in Captivate and I’m not sure if I am going about it the right way. My plan was to keep poking through previously answered questions, but couldn’t find exactly what I’m looking to find.

I want to create a quiz question that requires a user to input a value, but the question needs to be dynamic and change each time the user accesses the course. I have already successfully created my variables, but I’m not familiar with the different system quiz variables that exist. I’ve learned that many of the quiz variables need to be adjusted using JavaScript, but I don’t know what I should manipulate in my JavaScript.

I tried using the generic “fill in the blank” quiz question, but this will not work as far as I can tell because I can’t add a variable as a “blank” to keep the question dynamic as I mentioned before.

Here is a simplified version of my variables and the associated question:

X = random number between 2 & 5

Y = random number between 0 & 5

Z = X + Y

Given the values of variables X & Y, provide the value of Z

I have been able to create my variables and they function great. My thought was to have users input their response in a free-text box and then use advanced actions to add points to the learner’s score if the free-text box variable matches the “Z” variable in the problem presented. However, I found most of the system quiz variables cannot be manipulated using the advanced actions. So now I am left to do this through JavaScript. This would be fine, except that I am worried I won’t be getting the results I want if I just increment variable cpQuizInfoTotalCorrectAnswers by 1.

My next step is to just play around with the variables and hope I don’t mess up my project too much.

Has anyone tried to do this before and can help me out? If there is another way to do this right within the UI without JavaScript, that would be great! Just let me know

Thanks!

NOTE: Attached below is my project. It is still in the beginning phases, but gives a concept of the variables. In the final result, the user will only see limited variables (the values listed in the black box) and will have to input the value of the other variables by performing their own calculation. Ignore the formatting, as this will eventually change.

Play
7 Comments
2018-06-24 18:19:25
2018-06-24 18:19:25

Added a comment but is not approved yet because it had some links to blog posts that could help you. Sorry about that.

It is possible without JS, but that is of course my approach. Most JS experts will convince you to do it with JS. Quizzing system variables are read only, cannot be changed by Captivate’s advanced or shared actions. My approach – explained in extenso in a blog post – is to add two (shape) buttons to the slide wich are hidden in output?. One button has the score you want to give for a correct answer, the other has no score. Those buttons can be Next buttons, but they need to be clicked by the user. Based on your advanced action you’ll show either the scored or the non-scored button.

Like
(2)
(5)
>
Lieve Weymeis
's comment
2018-06-24 20:59:52
2018-06-24 20:59:52
>
Lieve Weymeis
's comment

Hi Lieve,

I’m a long-term trainer/ID, short-term Captivate user, but I’ve seen what an asset you have been to the Captivate community! Thanks for responding so quick 🙂

That could work, but wouldn’t it only work if I had a single score/user response for each set of variables. In my simplified example above, I suggested there would only be one response from the user. In reality, I may choose to require the user to fill in several of the variables from my equation and score them separately.

If I were to do this with JS, can you tell me which quiz variables I would need to include? I saw your blog post about the different quiz variables:

http://blog.lilybiri.com/using-quizzing-system-variables

This is helpful, but what I really want to know is which variables I would need to include in my JS in order to add points based on every entry made by the user. Could you help me out?

Like
(1)
>
kylec53358588
's comment
2018-06-24 22:13:26
2018-06-24 22:13:26
>
kylec53358588
's comment

The variable that should be getting the score added is cpQuizInfoPointsscored.

Like
(1)
>
Lieve Weymeis
's comment
2018-06-25 04:11:28
2018-06-25 04:11:28
>
Lieve Weymeis
's comment

If I increase that variable without adding to one of the “total” variables, will it cause a calculation error?

Like
(1)
>
kylec53358588
's comment
2018-06-25 07:25:00
2018-06-25 07:25:00
>
kylec53358588
's comment

Sorry, but I tried to explain that those variables are read only. JS should be used to first increase a user variable until it has its defnite score and then transfer it to a system variable. It can also be cpQuizInfoLastSlidePointScored. I don’t use JS for the purpose but CpExtra widget. I am bit lazy, hate syntax rules probably due to having programmed too much in my career.

Like
(1)
>
Lieve Weymeis
's comment
2018-06-25 12:31:04
2018-06-25 12:31:04
>
Lieve Weymeis
's comment

Alright, thanks!

Like
(1)
2018-06-24 18:15:35
2018-06-24 18:15:35

Did you see my blog posts:
http://blog.lilybiri.com/playing-with-numbers-part-1
http://blog.lilybiri.com/playing-with-numbers-part-2

Each scored object can be included in the quizzing system variables. This means you could use a button to transfer the score in case of a correct answer I described a possible workflow in a very old post, but it is still valid:
http://blog.lilybiri.com/report-custom-questions-part-2
Quizzing system variables are all read only, which means you cannot control them by advanced actions. It is possible to do so with JS or by using the CpExtra widget developed by InfoSemantics (Australia). Here you’ll find a descriptive list of all quizzing system variables:
https://elearning.adobe.com/2017/03/creative-with-quizzing-system-variables/

Like
(1)
Add Comment