Correct Answer Count by the Score

I want figure out the number of correct questions answered by the learners AICC Score to Test.

If I have the score I should be able to figure out the number of correct questions.

(AICC_Score * VNumberofSlidesInTest)ROUND = Correct Number of Questions

Now you can't always round down. In a 30 question test if a learner gets 43%, 43% * 30 - 12.9. But the learner got 13 questions right. So we must round to nearest whole number.

This can all do done on the result page after Lectora has Processed the Test.

Any ideas is JS the best choice or built in Lectora ?

Discussion (3)

Hi Trav,

This can be done pretty easily without the need for JS with just a couple of variables and a few actions, assuming that you have 1 question per page of your test.

Create two user-defined variables. We'll call them _numberOfQuestions and _numberOfCorrectQuestions

Add an action somewhere inside of your test chapter that does this:

OnShowModVar: _numberOfQuestions Set Equal To VAR(PagesInChapter)

Then on your results page, add the following actions:

OnShowModVar: _numberOfCorrectQuestions Set Equal To _numberOfQuestions

OnShowModVar: _numberOfCorrectQuestions Multiply Variable By VAR(Test_1_Score) - [or whatever the reserved variable name is for your test. Look on the Reserved tab of the Variable Manager for this.]

OnShowModVar: _numberOfCorrectQuestions Multiply Variable By 0.01

OnShowModVar: _numberOfCorrectQuestions Round Variable

That should give you the number of correctly answered questions even for fractional values.

I hope this helps.

Edit: Alternately, and if you do not have 1 question per page, you could add an action, 1 for each question, that adds 1 to a variable where "Question_0001" Is Correct. But your way is definitely quicker!

Oh, I see! How nice that you take such care with your templates! Your other developers must really appreciate that! I know I would!

Indeed, I would love to see your JS solution when you finish it!

Lectora has two rounding types that you can use with the Modify Variable action. One rounds to the nearest whole number, up or down, and the other always rounds down.

Hey Wendy that's a great method.

My development is not really about fixing my problems but making my templates sturdy for other developers. I want to add in actions and functions they don't need to change. The developers could put any number of questions in each test section and some question layouts do contain more than one question. I guess I could put the add action on each layout. I do worry that I will end up with so many actions !

I will share the JS here I used one I have it refined !

How does the Round Variable Action work in Lectora ?

Discussions have been disabled for this post