openedx / openedx/openedx-platform

Create XBlock permissions for `can_view_answer`, `can_view_correctness`

Open
#33,325 2 comments 0 reactions 0 assignees View on GitHub

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):

https://github.com/openedx/edx-platform/blob/f9148f032fc93bd339fb0ab50afb5cb3b1cdca21/xmodule/capa_block.py#L1400-L1457

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.