- assessment.indices = assessment.fixed
- ? _.range(assessment.questions.length)
- : _.shuffle( _.range(assessment.questions.length) );
+ if (!paper)
+ {
+ assessment.indices = assessment.fixed
+ ? _.range(assessment.questions.length)
+ : _.shuffle( _.range(assessment.questions.length) );
+ }
+ else
+ {
+ // Resuming
+ let indices = paper.inputs.map( input => { return input.index; });
+ let remainingIndices = _.difference( _.range(assessment.questions.length).map(String), indices );
+ assessment.indices = indices.concat( _.shuffle(remainingIndices) );
+ }
+ assessment.index = !!paper ? paper.inputs.length : 0;
+ Vue.nextTick(libsRefresh);