openedx / openedx/openedx-platform
Create XBlock permissions for `can_view_answer`, `can_view_correctness`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.2k
- Forks
- 4.4k
- Avg merge
- 6d 18h
- Merged PRs (30d)
- 42
Description
The ProblemBlock has some sophisticated logic for determining whether the user should be allowed to see the answer (and also whether they were correct or not):
This has been partially re-implemented in other XBlocks over time. We should refactor this into a runtime service that will return a simple True/False for this question, so that we can get consistent behavior without other XBlock authors having to think about it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the permission logic in xmodule/capa_block.py, lines 1400-1457, and compare how other XBlocks have partially reimplemented it. Design the runtime service that answers whether users can view answers and correctness, then verify that the behavior is consistent across the affected XBlocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100