mitodl / edx-sga

Staff Graded Assignment XBlock for the edX platform
GNU Affero General Public License v3.0
34 stars 108 forks source link

Support for showanswer settings #185

Closed pdpinch closed 6 years ago

pdpinch commented 7 years ago

As a course author, I would like to be able to use showanswer settings with SGA. In particular, I would like to use the Attempted setting so that the learner is presented with a solution to the problem after choosing to submit it.

Acceptance criteria

Out of scope

pdpinch commented 6 years ago

One approach to doing this would be to:

  1. Fork xblock-utils. This xblock library is helpful because it can provide the studio interface for our changes.
  2. Copy & paste the relevant code from edx-platform into xblock-utils
  3. import our forked xblock-utils into edx-sga

edX asked that we submit our changes to xblock-utils upstream and also update capa_base to use them. However, this is out of scope for this issue.

pdpinch commented 6 years ago

Here is the relevant code from capa_base.py:

  1. constants: https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/capa_base.py#L29
  2. UI https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/capa_base.py#L133-L148
  3. answer_available() https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/capa_base.py#L892-L925
  4. get_answer() https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/capa_base.py#L996-L1037
  5. get_problem_html() -- template rendering https://github.com/edx/edx-platform/blob/master/common/lib/xmodule/xmodule/capa_base.py#L733