Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart Quiz redirects to the course completed page if the course was completed #7212

Closed
renatho opened this issue Oct 11, 2023 · 3 comments · Fixed by #7377
Closed

Restart Quiz redirects to the course completed page if the course was completed #7212

renatho opened this issue Oct 11, 2023 · 3 comments · Fixed by #7377
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Pri] Normal Can wait for the next release Quizzes [Status] Triaged Issue has been triaged [Type] Bug
Milestone

Comments

@renatho
Copy link
Contributor

renatho commented Oct 11, 2023

Steps to Reproduce

  1. Create a course with lessons.
  2. Create a quiz with the "Allow Retakes" setting enabled.
  3. Complete the course as a student.
  4. Return to the quiz and click on "Restart Quiz"

What I Expected

Continue on the quiz page to answer the questions again.

What Happened Instead

I was redirected to the course completed page.

PHP / WordPress / Sensei LMS version

PHP 7.4 / WP 6.3 / Sensei 4.17.0

Browser / OS version

Chrome / Mac OS

Screenshot / Video

Screen.Recording.2023-10-11.at.16.42.31.mov
@renatho renatho added [Pri] Normal Can wait for the next release Quizzes [Status] Triaged Issue has been triaged labels Nov 7, 2023
@StefMattana
Copy link

A user in 7375078-zen reported the same bug, and tried to fix it with this hook:

add_action('sensei_user_lesson_reset', function($user_id, $lesson_id) {
$current_page = get_permalink();
wp_redirect($current_page);
exit;
}, 9, 2);

However, they stumbled upon with more issues:

  • passing the course allows students to retake the quiz anyway
  • quiz taken twice leads to a course completion despite not reaching the % needed to pass the quiz.

Their solution would be to extend the Sensei_Course_Theme_Quiz class and add a provision to only show the retake quiz button on failed grades, but they're looking for a better hook to manage that. Would that be possible?

Copy link

Support References

This comment is automatically generated. Please do not edit it.

  • 7375078-zen

@github-actions github-actions bot added the Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". label Nov 30, 2023
@StefMattana StefMattana added [Pri] High Ship ASAP [Pri] Normal Can wait for the next release and removed [Pri] Normal Can wait for the next release [Pri] High Ship ASAP labels Nov 30, 2023
@donnapep donnapep added this to the 4.19.3 milestone Dec 12, 2023
@m1r0
Copy link
Member

m1r0 commented Dec 12, 2023

passing the course allows students to retake the quiz anyway

I've created a separate issue for this: #7379

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Customer Report Issues or PRs that were reported via Happiness. Previously known as "Happiness Request". [Pri] Normal Can wait for the next release Quizzes [Status] Triaged Issue has been triaged [Type] Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants