Picture of Matt Leathes
Re: Assessment Random Question Bank How to get question number
by Matt Leathes - Monday, 15 January 2018, 6:53 PM
 

You could do something like this:

function getQuestionNumber(){
    var questionComponents = Adapt.assessment.get()[0]._currentQuestionComponents;
    return questionComponents.indexOf(Adapt.findById(this._id)) + 1;
}
Handlebars.registerHelper("questionNumber", getQuestionNumber);

That would allow you to display the question number by setting the displayTitle of the question to "Question {{questionNumber}}" in the JSON

Picture of K Edison
Re: Assessment Random Question Bank How to get question number
by K Edison - Tuesday, 26 February 2019, 6:36 PM
 

In which file do I add this function to? I am using the Framework versionĀ 3.2.0.

Picture of Matt Leathes
Re: Assessment Random Question Bank How to get question number
by Matt Leathes - Wednesday, 27 February 2019, 10:10 AM
 

https://github.com/adaptlearning/adapt-contrib-assessment#componentsjson