Fixing any_unfulfilled_milestones in enrollments API - #14758
Conversation
|
Thanks for the pull request, @AhmedAljazzar! I've created OSPR-1717 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information. |
542144e to
ccd3763
Compare
|
Jenkins ok to test |
6efb4b7 to
a1ee777
Compare
|
Tests are passing now after the rebase. |
|
The branch updated with another commit. |
bf554cb to
ddcb1af
Compare
|
Hey @gsong I've updated the branch again to fix a recent merge conflict. Please let me know if I need anything else to do. |
|
Hey @gsong, just a gentle reminder about this PR. |
ddcb1af to
f8c80b6
Compare
|
@andy-armstrong @BenjiLee Do you know who might be the right person to review this PR? |
|
@gsong Probably me. @mattdrayer would be another option. |
|
@BenjiLee Would appreciate getting this into a sprint, let me know the best way to do that. Thank you. |
|
@jasperho CC |
|
jenkins run all |
|
Jenkins ok to test |
f8c80b6 to
260225e
Compare
|
Thanks @gsong, I'll fix the brokens tests/quality checks. |
260225e to
43437fb
Compare
|
@AhmedAljazzar I've rebase this PR and fixed both of the conflicts and PEP8 issue. Unfortunately, I left the subtle broken test to you. Please check |
|
@OmarIthawi looks like we lost |
|
Thanks @AhmedAljazzar, looks like the tests are good. CC: @gsong |
|
@jasperho Can you help us schedule this into a sprint review? Thanks. |
|
Just a gentle reminder @jasperho. |
|
This ticket is currently in our sprint and will be reviewed. |
|
Thanks @BenjiLee! Looking forward for your feedback. |
|
@AhmedAljazzar I think this one bug deserves a test case to ensure it survives future updates. Let's work on it today if you have time. |
f6761a1 to
45f607f
Compare
45f607f to
5ddb1dd
Compare
|
This LGTM. Waiting on testcase. |
|
Thanks @BenjiLee! Could you please mark this as |
|
I did some refactoring as well. Please review and let me know your feedback. |
|
@AhmedAljazzar could you please do a quick review? I'd like to squash the commits. |
…ones (for mobile APIs)
a19792f to
bc64e52
Compare
|
Jenkins ok to test |
|
jenkins run all |
|
@gsong how about |
|
@OmarIthawi Jenkins is a bit backed up right now, it'll get to this eventually. |
BenjiLee
left a comment
There was a problem hiding this comment.
Waiting on passing tests
|
Merged via #15623. |
Description
In User Course Enrollments List: /api/mobile/v0.5/users/username/course_enrollments, if we enabled Entrance Exam from Schedule & Details section and then re-desabling it, the
courseware_accessfield in the API will keep preventing the student from showing the course on the mobile apps.This problem is happening because the
get_course_milestones_fulfillment_pathsmethod in the milestones API is returning an empty dictionary{}if the course doesn't have any milestones, after enabling Entrance Exam it returns a complex dict-of-dicts like this:{ "course-v1:org+course+run.entrance_exams.Completed Course Entrance Exam": { "content": [ "block-v1:org+course+run+type@chapter+block@cd5f1b8bef874bcdad80b2857f5aeffd" ] } }While redoubling the entrance exam causes the method to return the previously-enabled prerequisites with an empty dictionary like this:
{"course-v1:org+course+run.entrance_exams.Completed Course Entrance Exam": {}}The method
any_unfulfilled_milestonesis not addressing this scenario, so what I did is checking that every value in the dict returned fromget_course_milestones_fulfillment_paths, if any value has a non-empty dictionary then the student is still having unfulfilled milestones and we are returningTrue, if the dictionary is empty or the student have fulfilled the milestones then we are returningFalse.Note
This solution won't affect the result if the learner completed the prerequisites since the
get_course_milestones_fulfillment_pathswill return an empty dictionary if the Entrance Exam fulfilled.TODO
Update
Another issue arised as if the instructor enabled and disabled the Prerequisite Course in Studio's Requirements section, the course became inaccessible for learner in the dashboard and the API views.
This happens because selecting None from the dropdown list in Studio has no functionality in the code.