Skip to content

Conversation

@itsjeyd
Copy link
Member

@itsjeyd itsjeyd commented Feb 25, 2016

This PR introduces an instance-wide option to hide previous answers (and feedback) for MCQs in Problem Builder. When this option is enabled, students will still receive per-question feedback after providing answers to MCQs and submitting the containing block, but that feedback will not be visible when they return to the block, and all choices for a given MCQ will be unchecked.

cf. MCKIN-3861

Screenshots: LMS

Default settings:

lms-pb-option-disabled

Previous answers hidden:

lms-pb-option-enabled


Screenshots: Apros

Default settings:

apros-pb-option-disabled

Previous answers hidden:

apros-pb-option-enabled

Test instructions

  1. Create a subsection with two units and add a Problem Builder block to each one.

  2. Add a long answer, MCQ, Rating, MRQ, and Slider to one of the Problem Builder blocks.

  3. Publish the units.

  4. In LMS/Apros, provide answers to all questions and click "Submit".

  5. Navigate to the other unit, then come back to the first unit. Observe that Problem Builder shows previous answers and feedback for all questions.

  6. In lms.env.json, enable the new option by modifying the XBLOCK_SETTINGS for mentoring:

        "mentoring": {
            "theme": {
                // ...
            },
            "options": {
                "pb_mcq_hide_previous_answer": true
            }
        },
  7. Restart LMS/Apros and reload the page showing the first unit. Observe that Problem Builder does not show previous answers and feedback for MCQs.

var steps = runtime.children(element).filter(function(c) { return c.element.className.indexOf('assessment_step_view') > -1; });
var steps = runtime.children(element).filter(function(c) {
return $(c.element).attr("class").indexOf('assessment_step_view') > -1;
});
Copy link
Member

Choose a reason for hiding this comment

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

In case you're wondering why you had to make this change: https://openedx.atlassian.net/browse/TNL-4161

I believe the earlier version is "better" but it doesn't work with the latest edx-platform master. The new version you have here should always work, so we may as well keep this change.

@Kelketek
Copy link
Member

@itsjeyd Just a couple of comments.

@itsjeyd itsjeyd force-pushed the hide-previous-answer branch from 1b1728e to d2397fb Compare February 29, 2016 14:14
@Kelketek
Copy link
Member

👍 Though please squash at least some of the commits first.

itsjeyd and others added 3 commits February 29, 2016 17:08
- Fix existing tests.
- Add unit tests for code that deals with instance-wide options.
- Add integration test for scenario where previous answers for MCQs are configured to be hidden.
- Refactor: Take advantage of mixins from xblock-utils accessing xblock settings.
@itsjeyd itsjeyd force-pushed the hide-previous-answer branch from d2397fb to b17c0ee Compare February 29, 2016 16:11
@itsjeyd
Copy link
Member Author

itsjeyd commented Feb 29, 2016

@Kelketek Thanks, done.

itsjeyd added a commit that referenced this pull request Feb 29, 2016
Problem Builder: Add instance-wide option to hide previous answers for MCQs
@itsjeyd itsjeyd merged commit d754b29 into master Feb 29, 2016
@@ -63,6 +64,10 @@
'locations': ['public/themes/lms.css']
Copy link
Member

Choose a reason for hiding this comment

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

@itsjeyd Is this _default_theme_config being used? Looks to me like with ThemableXBlockMixin you need to define default_theme_config as an attribute on the class instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants