electricbookworks / betterquiz

The Bettercare quiz engine
GNU Affero General Public License v3.0
0 stars 1 forks source link

If no redirect site for done.php, go to starting URL of quiz #2

Open arthurattwell opened 9 years ago

arthurattwell commented 9 years ago

Right now, when a user is finished a test, the starting URL must provide a redirect for when they are finished, for done.php. However, in the event that no redirect URL was supplied, done.php says: "We don't have a redirect site: nowhere to go home to."

Instead, can we set a default/fallback redirect back to the starting URL of the quiz? E.g. http://quiz.bettercare.co.za/quiz.php?qz=1.

This is mainly in case we provide a URL to a user without a redirect for some reason (e.g. human error when creating the link).

craigmj commented 9 years ago

No problem doing that, but it does leave the user in an infinite loop. Should I not rather give an error right at the beginning if you go to betterquiz without a redirect, OR have a default redirect back to bettercare? (so if you forget the URL, the user will be returned to the home page of bettercare, from whence they can at least find their way back to wherever they were...)?

C

On 2015/07/15 10:22 AM, Arthur Attwell wrote:

Right now, when a user is finished a test, the starting URL must provide a redirect for when they are finished, for |done.php|. However, in the event that no redirect URL was supplied, |done.php| says: "We don't have a redirect site: nowhere to go home to."

Instead, can we set a default/fallback redirect back to the starting URL of the quiz? E.g. |http://quiz.bettercare.co.za/quiz.php?qz=1|.

This is mainly in case we provide a URL to a user without a redirect for some reason (e.g. human error when creating the link).

— Reply to this email directly or view it on GitHub https://github.com/electricbookworks/betterquiz/issues/2.

arthurattwell commented 9 years ago

The quiz will mostly be running in an iframe (at least that's the plan), so redirecting to the main Bettercare site may look odd to users.

If I'm not overcomplicating this, could we detect whether we're in an iframe and:

  1. If we're in an iframe, the user isn't in a loop because they can navigate away in the parent frame. We can log the user out and redirect to the starting URL (e.g. http://quiz.bettercare.co.za/login_form.php?qz=1).
  2. If we're not in an iframe, we can send them to the Learning Station home page: http://ls.bettercare.co.za.

Unless I'm missing something, which is often the case :)

arthurattwell commented 9 years ago

I've now got a default redirect in our setup, which at least on our Bettercare Learning Station will always ensure a redirect URL (to http://quiz.bettercare.co.za/login_form.php?qz={ID}).

So this is not a critical issue.