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

Fix student progress reset not working in some cases #7181

Merged
merged 2 commits into from
Sep 21, 2023
Merged

Conversation

m1r0
Copy link
Member

@m1r0 m1r0 commented Sep 21, 2023

Resolves #7175

Proposed Changes

Fix the progress reset by preventing a redirect from happening during the REST API call.

Testing Instructions

  1. Create a course with a lesson and a quiz.
  2. Submit the quiz and complete the course.
  3. Go to the admin panel -> Sensei LMS -> Students
  4. Reset the course progress.
  5. These should be no error and the progress should be reset.

Pre-Merge Checklist

  • PR title and description contain sufficient detail and accurately describe the changes
  • Acceptance criteria is met
  • Decisions are publicly documented
  • Adheres to coding standards (PHP, JavaScript, CSS, HTML)
  • All strings are translatable (without concatenation, handles plurals)
  • Follows our naming conventions (P6rkRX-4oA-p2)
  • Hooks (p6rkRX-1uS-p2) and functions are documented
  • New UIs are responsive and use a mobile-first approach
  • New UIs match the designs
  • Different user privileges (admin, teacher, subscriber) are tested as appropriate
  • Code is tested on the minimum supported PHP and WordPress versions
  • User interface changes have been tested on the latest versions of Chrome, Firefox and Safari
  • "Needs Documentation" label is added if this change requires updates to documentation
  • Known issues are created as new GitHub issues

@m1r0 m1r0 added this to the 4.17.1 milestone Sep 21, 2023
@m1r0 m1r0 requested a review from a team September 21, 2023 13:01
@m1r0 m1r0 self-assigned this Sep 21, 2023
@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #7181 (f8a80d0) into trunk (d4e94b4) will decrease coverage by 0.01%.
Report is 37 commits behind head on trunk.
The diff coverage is 77.77%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7181      +/-   ##
============================================
- Coverage     49.84%   49.83%   -0.01%     
- Complexity    10678    10684       +6     
============================================
  Files           595      601       +6     
  Lines         45138    45160      +22     
  Branches        402      402              
============================================
+ Hits          22497    22504       +7     
- Misses        22314    22329      +15     
  Partials        327      327              
Files Changed Coverage Δ
includes/internal/emails/class-email-generator.php 82.60% <0.00%> (ø)
...ails/generators/class-student-completes-lesson.php 100.00% <ø> (ø)
...submission/answer/models/class-answer-abstract.php 66.66% <ø> (ø)
...z-submission/grade/models/class-grade-abstract.php 92.30% <ø> (ø)
...-submission/grade/models/class-grade-interface.php 0.00% <0.00%> (ø)
...bmission/grade/models/class-tables-based-grade.php 0.00% <0.00%> (ø)
...ils/generators/class-email-generators-abstract.php 41.66% <33.33%> (ø)
...ubmission/answer/models/class-answer-interface.php 50.00% <50.00%> (ø)
...ission/answer/models/class-tables-based-answer.php 50.00% <50.00%> (ø)
...ission/grade/models/class-comments-based-grade.php 75.00% <75.00%> (ø)
... and 21 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3a74164...f8a80d0. Read the comment docs.

Copy link
Member

@merkushin merkushin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Miro! Works well!

@m1r0 m1r0 merged commit f158260 into trunk Sep 21, 2023
24 of 25 checks passed
@m1r0 m1r0 deleted the fix/reset-progress branch September 21, 2023 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to reset progress
2 participants