frontend-app-learning icon indicating copy to clipboard operation
frontend-app-learning copied to clipboard

[Bug] Students have access to course content even if the Entrance Exam wasn't finished

Open GlugovGrGlib opened this issue 1 year ago • 4 comments

STR:

  1. Enable feature ENTRANCE_EXAMS
  2. Set Entrance exam for course in schedule and details image
  3. As a student, enroll to the course

Actual Result

Students have access to the full course even before the Entrance Exam is finished image

Expected Result

Students don't have access to course content before passing with necessary score for entrance exam image

Notes:

Result of investigation:

The problem is Learning MFE used sections from course_outline. This data was fetched from /edx-platform/openedx/core/djangoapps/content/learning_sequences/api/outlines.py, get_user_course_outline_details. This function doesn`t check if is there an entrance exam and if the user passes the exam.

An example of how to check if the chapter is an entrance exam and did user passed it can be found at edx-platform/lms/djangoapps/courseware/views/index.py, _add_entrance_exam_to_context function

GlugovGrGlib avatar Jul 03 '24 14:07 GlugovGrGlib

@GlugovGrGlib I am interested to work on this. I would like to know where should the user be navigated to on click of the next buttons(end of course) if the entrance exam is not passed?

imasdekar avatar Jul 31 '24 15:07 imasdekar

@GlugovGrGlib I did check that the backend was correctly sending the entrance exam data to the mfe but the exam status was nowhere checked in the mfe. I have an open PR #1429 , just waiting to make changes to the navigation link on the next(end of course) button if the entrance exam is not passed. Currently have not added any next link for the button.

imasdekar avatar Aug 02 '24 07:08 imasdekar

Hey @imasdekar, in case user hasn't passed the entrance exam they should see a disabled Next button, similar to what is currently displayed for users in the very last section of the course. image

GlugovGrGlib avatar Aug 05 '24 17:08 GlugovGrGlib

@GlugovGrGlib I have updated my PR #1429 and now the next buttons will be disabled(as in the screenshot below) if the user dose not pass the entrance exam

image

Can you review or ask some appropriate person to review the PR #1429 ?

imasdekar avatar Aug 07 '24 07:08 imasdekar

https://github.com/openedx/frontend-app-learning/pull/1429 will fix this on the frontend, but a backend bug remains - the backend should never serve the user content from an exam-gated course before the user has passed the exam, regardless of the logic we have on the frontend.

bradenmacdonald avatar Sep 13 '24 19:09 bradenmacdonald

@bradenmacdonald I am a fullstack python developer and would love to work on a backend fix for this issue as well. What is the expected response in such a case where the entrance exam status is failed and the user requests for further course data?

imasdekar avatar Sep 16 '24 06:09 imasdekar

@imasdekar I'm not sure, as I'm not super familiar with exams, but I would assume it should be just as if the exam section is the only section in the course - requesting any other section should return a 404, and requesting the outline should only list the entrance exam section. However, it would be good to do a little investigation first and see if there's any reason why it wasn't implemented that way in the first place. I may be missing something.

bradenmacdonald avatar Sep 16 '24 16:09 bradenmacdonald

@bradenmacdonald for the investigation of the above mentioned backend related change can I help in any way? Is there someone with sufficient know how about this with whom I can connect?

imasdekar avatar Sep 26 '24 07:09 imasdekar

@imasdekar That would be great! I'm not really sure; I would recommend searching through the edx-platform PRs related to that feature and/or using "blame", to see who worked on it and then ping them on GitHub or Slack to get their input on why the backend isn't blocking access via API and how best to fix it.

bradenmacdonald avatar Sep 26 '24 15:09 bradenmacdonald

@bradenmacdonald ok, I will try to investigate alongside working on some other edx task

imasdekar avatar Sep 27 '24 07:09 imasdekar