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: corrects the navigation issue if the student does not pass the entrance exam #1429

Merged
merged 2 commits into from
Sep 23, 2024

Conversation

imasdekar
Copy link
Contributor

  • adds checks while rendering the next button text for status of the entrance exam.

closes #1415

Signed-off by: Ishan Masdekar [email protected]

@openedx-webhooks
Copy link

openedx-webhooks commented Aug 2, 2024

Thanks for the pull request, @imasdekar!

What's next?

Please work through the following steps to get your changes ready for engineering review:

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/committers-frontend-app-learning. Tag them in a comment and let them know that your changes are ready for review.

Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@imasdekar
Copy link
Contributor Author

@mphilbrick211 Can you please get the checks run and get this reviewed?

@GlugovGrGlib
Copy link
Member

@imasdekar I believe we need to wait another week until @bradenmacdonald and @farhaanbukhsh take on maintainer responsibilities for this repo, after this it can be reviewed and scheduled for merge

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.80%. Comparing base (b9d1198) to head (c98da6d).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1429      +/-   ##
==========================================
+ Coverage   87.78%   87.80%   +0.01%     
==========================================
  Files         310      310              
  Lines        5320     5328       +8     
  Branches     1350     1355       +5     
==========================================
+ Hits         4670     4678       +8     
  Misses        633      633              
  Partials       17       17              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@itsjeyd itsjeyd added the waiting for eng review PR is ready for review. Review and merge it, or suggest changes. label Aug 8, 2024
@itsjeyd
Copy link

itsjeyd commented Aug 8, 2024

Hi @imasdekar, thank you for this contribution!

@itsjeyd
Copy link

itsjeyd commented Aug 8, 2024

OSPR management note: This PR includes user-facing changes. However, it fixes an existing bug (#1415) so there should be no need to send it through product review.

CC @jmakowski1123

@itsjeyd itsjeyd requested a review from a team September 7, 2024 08:06
);
const exitActive = exitMode !== COURSE_EXIT_MODES.disabled;
const exitActive = ((exitMode !== COURSE_EXIT_MODES.disabled) && (exitMode !== COURSE_EXIT_MODES.entranceExamFail));
Copy link
Contributor

@bradenmacdonald bradenmacdonald Sep 11, 2024

Choose a reason for hiding this comment

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

Can you help me understand this? What exactly does exitActive mean and what are the various exit modes? Just want to make sure this logic is correct, but I'm not clear on what's even going on here.

I'd love if you could add a few JSDoc comments to this file as part of this PR to explain what an "exit mode" is and what each of the COURSE_EXIT_MODES mean. And why exitActive should be false when the exit mode is entranceExamFail ??

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exitActive is used to enable/disable the exit mode i.e. the next buttons.
Available COURSE_EXIT_MODES: disabled, celebration, nonPassing, inProgress, entranceExamFail
So if the user has failed the entrance exam, access to further course sections should be disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added some comments in the code as per your suggestion. Let me know if more explanation is needed in the comments and I will add accordingly.

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Thanks for the fix. I tested it and confirmed the issue is fixed. Although there is still obviously a major bug on the backend - it should be refusing to provide the rest of the course to the user who hasn't passed the exam, regardless of what logic we have on the frontend.

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

@imasdekar Actually could you please add a test case for this too? That will fix the coverage problem. Sorry, I just noticed now there isn't a new test.

@imasdekar
Copy link
Contributor Author

@bradenmacdonald before implementing this fix on the frontend I dis check the backend and found that the entrance data is sent to the frontend and the respective data has a field which states that the user has failed the entrance exam. Hence I decided to utilise the same and implement a fix on the frontend.

@imasdekar
Copy link
Contributor Author

I will add a test case and update this PR.

@imasdekar
Copy link
Contributor Author

@bradenmacdonald If req. is also that further course data not be sent from the backend at all if the entrance exam status is failed then what exactly should be the response in such a case? I can work on this backend fix as well.

@bradenmacdonald
Copy link
Contributor

Great! Replied on #1415.

@itsjeyd itsjeyd added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed waiting for eng review PR is ready for review. Review and merge it, or suggest changes. labels Sep 20, 2024
…ntrance exam

- adds checks while rendering the next button text for status of the
entrance exam.

closes openedx#1415

Signed-off by: Ishan Masdekar <[email protected]>
@imasdekar
Copy link
Contributor Author

@bradenmacdonald I've added tests as required.

@bradenmacdonald
Copy link
Contributor

Thanks @imasdekar ! Unfortunately the test is not passing on CI - can you please take a quick look?

- Introduces a test case each for scenarios where the entrance exam
status is failed and pass

Signed-off by: Ishan Masdekar <[email protected]>
@imasdekar
Copy link
Contributor Author

imasdekar commented Sep 23, 2024

@bradenmacdonald apologies, it should work now. I missed to push a small update.

@bradenmacdonald bradenmacdonald merged commit fbe1648 into openedx:master Sep 23, 2024
8 checks passed
@itsjeyd itsjeyd removed the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

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