Picture of Ludovic Bas
Assessment with a mix of random and not random mcq
by Ludovic Bas - Friday, 24 November 2017, 10:56 AM
 

Hello,

Let say I need the first 5 questions to be not randomized, and the 5 others to be randomized.

I need to display the number of each question (1, 2, 3, 4, 5, 6...).

But I also need at the end to display the assessment result.

How can I achieve that?

I'm thinking about 2 solutions:

1. rewrite theĀ _banksĀ feature of the assessment to allow selecting banks with a boolean to set the randomization in it.

2. create 2 assessments and rewrite the assessment result to combine the score of the 2 assessments

As for the display of the number of the question, I don't know where should I add the feature.

Thanks.

Picture of Matt Leathes
Re: Assessment with a mix of random and not random mcq
by Matt Leathes - Friday, 24 November 2017, 12:01 PM
 

I'd be tempted to go for 2) as that way you're using existing functionality as much as possible. Also, the assessment extension is already combining the scores for you, you just need to query it to get that data or register for the assessment:complete event as this will send the listener function an object containing data like the score.

As for displaying the question number, if you're using v2.1.1 (or better) of the framework* then you can do this using a handlebars expression in your JSON (e.g. "this is question {{questionNumber}}") and include handlebars helper that has the logic to go an look up the current question's number from the assessment's list of questions. Your theme's JS would be a good place to add a customisation like this.

Note that your theme might need updating too if it still has a copy of the all the templates. We moved them from the vanilla theme into the framework around this time so if your theme has handlebars templates in it they will be out of date.

Picture of Ludovic Bas
Re: Assessment with a mix of random and not random mcq
by Ludovic Bas - Wednesday, 29 November 2017, 8:40 AM
 

Thanks for your answer. I'll try option 2 soon.