Picture of Barry Jenkin
Page jump on assessment retry
by Barry Jenkin - Sunday, 22 October 2017, 3:37 AM
 

I have a few instances where I've used a quiz at the end of a page of content, using Assessment Results with retry activated. The problem is, on retry users are stranded at the top of the page and have to scroll down to where the quiz was. Would ideally like to page-jump to the article containing the assessment.

Is there a hack for this if I can reference the article id or place an anchor somewhere?

Picture of Matt Leathes
Re: Page jump on assessment retry
by Matt Leathes - Monday, 23 October 2017, 10:42 AM
 

Hi Barry

Something like this in the onRetry function in assessmentResults should do it

Adapt.once('pageView:ready', _.bind(function() {
	var assessmentModel = Adapt.assessment.get(this.model.get("_assessmentId"));
	Adapt.scrollTo('.' + assessmentModel.get('_id'), {duration:10});
}, this));
Picture of Matt Leathes
Re: Page jump on assessment retry
by Matt Leathes - Monday, 23 October 2017, 11:44 AM
 

If you've got trickle on the page the above won't cut it; you'll have to do more work to make sure trickle has unlocked before attempting the scroll.

Picture of Barry Jenkin
Re: Page jump on assessment retry
by Barry Jenkin - Wednesday, 25 October 2017, 11:31 PM
 

Ok cool thanks - I'll give that a try. Yes I'm trickling all over the place .. I can't help myself.