Skip to content

bugfix remove course pre requisite only if is not entrance exam Fixes RED-512 - #494

Merged
melvinsoft merged 1 commit into
appsembler/tahoe/developfrom
maxi/bugfix-entrance-exam
Dec 12, 2019
Merged

bugfix remove course pre requisite only if is not entrance exam Fixes RED-512#494
melvinsoft merged 1 commit into
appsembler/tahoe/developfrom
maxi/bugfix-entrance-exam

Conversation

@melvinsoft

@melvinsoft melvinsoft commented Nov 28, 2019

Copy link
Copy Markdown

This error is easy to reproduce in staging.

Go to or create a new course, then go to "Schedule and Details" , enable an entrance exam for the course, you can leave the default score or change it.
Go to Content -> Outline and fill the entrance exam with a couple of courses, then create a normal unit in the course.

Go to the LMS and Enroll in the course with a new learner (without any staff privilege). You will only be able to see the entrance exam.

Go to Studio again, same course and then "Schedule and Details" change the enrollment date or any other data and save. When you go back to the LMS, you will find out that the entrance exam is disabled now, and you can see all the course content, but in the "Schedule and Details" is still active.

All this is related to the Milestones app, which is pretty messy. This bug is produce by a bugfix that @AhmedAljazzar contributed upstream while ago. Is a race condition between normal course pre requisites and entrance exams, who are technically a pre requisite too. Basically if there isn't any pre requisite course set, the backend logically deletes all the pre requisites, and the entrance exam too.

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @melvinsoft for your work on this intricate bug. You know what I'm going to say next.

Tests please 😺

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I've added few questions so I learn about the issue more.

Comment thread cms/djangoapps/contentstore/views/course.py Outdated

@iamjazzar iamjazzar left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks @melvinsoft for the detailed explanation! I still remember this module, it's messy and unstable! The issue was raised on one of the tests we ran on our mobile app back then and that was a surprise how everything's linked together.
Since we're fixing a fix here. I'd second @OmarIthawi by writing some unit tests to control the behavior here.

@melvinsoft

Copy link
Copy Markdown
Author

@OmarIthawi @AhmedAljazzar Thank you both for the review, I replied your comments and added 1 test. I'm pretty rusty on testing, specially edX testing. I agree Ahmed, this app is really buggy and unstable.

I'm not sure is only test is enough, but let me know if I'm in the right track, thanks!

@OmarIthawi OmarIthawi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@melvinsoft this is awesome! I've checked the code and it looks good and the tests fails without your fix. That's awesome!

I've added few changes after that it should be good to go.

Comment thread cms/djangoapps/contentstore/tests/test_course_settings.py Outdated
Comment thread cms/djangoapps/contentstore/tests/test_course_settings.py Outdated
@melvinsoft

Copy link
Copy Markdown
Author

@OmarIthawi Thanks for the suggestions, I'm gonna wait for the test to pass again and merge it.

add test

Update cms/djangoapps/contentstore/tests/test_course_settings.py

Co-Authored-By: Omar Al-Ithawi <i@omardo.com>

Update cms/djangoapps/contentstore/tests/test_course_settings.py

Co-Authored-By: Omar Al-Ithawi <i@omardo.com>
@melvinsoft
melvinsoft force-pushed the maxi/bugfix-entrance-exam branch from caaf482 to ed6e462 Compare December 12, 2019 15:46
@melvinsoft
melvinsoft merged commit e96c7cd into appsembler/tahoe/develop Dec 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants