Jump to ContentJump to Navigation/Login
` ` ` ` ` `

[Register]

Occasional ATutor release updates


No Members Logged In

(10 guests in past 15 min.)
Locations of visitors to this page

Support Forums

ATutor Bug Reports

can't click Previous to get to question 1 of test


You must be signed-in to post.

AuthorSubject
  Page: 1
mwarner
Subject: can't click Previous to get to question 1 of testQuote this post in your reply
I'm using 1.6.1, but I imagine this is in all recent versions, as there have been no patches for it.

If a test is set to list one question per page and you answer, for example, 5 out of 10 questions, you can only go back as far as question #2 to review/change your answer. Clicking the Previous button again will take you to the question immediately after the last one you answered. In this case #6.

The file that handles this is /tools/take_test_q.php

When going to question 1, $_GET["pos"] becomes zero, which is the same value ATutor is looking for when it decides to resume the test at the next question when the user returns.
Posted: 2009-12-16 13:51:20
mwarner
Subject: Re: can't click Previous to get to question 1 of testQuote this post in your reply
I added a referrer check to fix it for now since I have a tight deadline for getting this working, but I'm sure there's a more elegant solution:

lines 86 + 87 of /tools/take_test_q.php:

From
[code]
// set position to allow users to return to a test they have partially completed, and continue from where they left of.
if ($pos == 0 && $result_id > 0)
[/code]

to:

[code]
// set position to allow users to return to a test they have partially completed, and continue from where they left off.
if ($pos == 0 && $result_id > 0 && !strstr($_SERVER["HTTP_REFERER"],"take_test_q.php"))
[/code]
Posted: 2009-12-16 13:57:14
harris

Avatar for harris
Subject: Re: can't click Previous to get to question 1 of testQuote this post in your reply
Cannot reproduce this on my local, if you have some time, can you try reproducing this on our demo? I am thinking this might be fixed.
Posted: 2009-12-18 10:03:50
mwarner
Subject: Re: can't click Previous to get to question 1 of testQuote this post in your reply
you're right. I couldn't replicate this in the demo. I did notice that the url args are different in 1.6.4 than in 1.6.1. Guess I'll have to run a diff to see what the fix is.

Thanks for looking into it.

Mike
Posted: 2009-12-18 12:36:49
 Page: 1

You must be signed-in to post.