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

Create tables-based versions of student progress and quiz data when saving of their comment based versions #7140

Merged
merged 13 commits into from
Sep 4, 2023

Conversation

merkushin
Copy link
Member

@merkushin merkushin commented Aug 29, 2023

Resolves #7078

Proposed Changes

  • Create course/lesson/quiz tables based progress if not exist while saving their comments based versions.
  • Create quiz submissions/answers/grades if not exist while saving their comments based versions.

Testing Instructions

  1. Disable the feature flag, take a course and pass a quiz.
  2. Enable the feature flag (tables_based_progress).
  3. Check you don't have submission, answers and grades for the submission from the first step in DB.
  4. Go to Sensei LMS -> Grades, grade and save the submission.
  5. Make sure you have all needed tables based versions.

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

@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Merging #7140 (eb0bfa3) into trunk (d8ec1c6) will increase coverage by 0.07%.
Report is 111 commits behind head on trunk.
The diff coverage is 90.04%.

Impacted file tree graph

@@             Coverage Diff              @@
##              trunk    #7140      +/-   ##
============================================
+ Coverage     49.60%   49.68%   +0.07%     
- Complexity    10609    10623      +14     
============================================
  Files           580      580              
  Lines         44791    44876      +85     
  Branches        402      402              
============================================
+ Hits          22220    22297      +77     
- Misses        22244    22252       +8     
  Partials        327      327              
Files Changed Coverage Δ
.../admin/editor-wizard/steps/lesson-patterns-step.js 33.33% <ø> (ø)
includes/class-sensei-db-query-learners.php 86.51% <ø> (ø)
includes/class-sensei-posttypes.php 8.35% <ø> (ø)
includes/class-sensei-question.php 11.35% <ø> (ø)
includes/class-sensei-settings-api.php 15.47% <ø> (ø)
includes/class-sensei-utils.php 52.44% <ø> (ø)
includes/class-sensei.php 22.98% <0.00%> (ø)
...ncludes/course-theme/class-sensei-course-theme.php 18.78% <0.00%> (ø)
...port/models/class-sensei-import-question-model.php 80.87% <ø> (ø)
...codes/class-sensei-shortcode-course-categories.php 0.00% <ø> (ø)
... and 14 more

... and 1 file with indirect coverage changes


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 164ea6e...eb0bfa3. Read the comment docs.

@merkushin merkushin added this to the 4.16.2 milestone Aug 30, 2023
@merkushin merkushin self-assigned this Aug 30, 2023
@merkushin merkushin changed the title WIP: Create table version on save Create tables-based versions of student progress and quiz data when saving of their comment based versions Aug 31, 2023
@merkushin merkushin added the HPPS label Aug 31, 2023
@merkushin merkushin marked this pull request as ready for review August 31, 2023 00:12
@merkushin merkushin requested a review from m1r0 August 31, 2023 07:57
@m1r0
Copy link
Member

m1r0 commented Sep 1, 2023

Looks solid overall but I found a few bugs:

  • When you grade a quiz, the lesson progress is not created.
  • When you grade a quiz, the quiz feedback is not saved.
mewF8k.mov

@merkushin
Copy link
Member Author

When you grade a quiz, the lesson progress is not created.

It looks like we don't try to save it there, so I think it is out of scope. Or I miss something?

I'm looking at the issue now and the task has a vague description. I think we discussed to create counterparts only on save. Or do you think, we should do it on get/has as well? That's possible, but might impair performance on the other hand.

When you grade a quiz, the quiz feedback is not saved.

Good catch, thank you. Fixed here: 5f6bb07

m1r0
m1r0 previously approved these changes Sep 4, 2023
Copy link
Member

@m1r0 m1r0 left a comment

Choose a reason for hiding this comment

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

It looks like we don't try to save it there, so I think it is out of scope.

After seeing that the course progress was created after grading the quiz, I've just assumed that the lesson progress should be created as well. But I agree, this is out of scope and also it might be unnecessary to do.

👍

@merkushin merkushin merged commit 7f1925d into trunk Sep 4, 2023
24 checks passed
@merkushin merkushin deleted the add/create-table-version-on-save branch September 4, 2023 20:25
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.

If data sync is enabled and the entry is missing in custom table, create it
2 participants