Skip to content

%100% correct answer feedback is not shown if checkbox_feedback is set #119

@markkuriekkinen

Description

@markkuriekkinen

In questionnaires (mooc-grader v1.10), if a checkbox question has enabled the checkbox_feedback setting, then feedback for correct answers set with the %100% value is not rendered at all in the feedback HTML. (Checkbox_feedback causes the feedback for the choice to be rendered directly under each checkbox when it is selected.)

This is not important to fix if nobody really needs this small feature. Checkbox_feedback is usually not enabled.

This is probably very easy to fix in the templatetag find_common_hints. It should just read the key %100% from the hints and add it to the returned list.

common_hints = list_of_hints.get('not')

if comparison == "%100%":
add = ok
else:
# Freetext questions with 'string', 'subdiff' or 'regexp'
# compare method can have reqular expression based hints.
if methods[0] in ('string', 'regexp', 'subdiff'):
if fb.get('compare_regexp', False):
methods_used = 'regexp'
else:
methods_used = 'string'
methods_used = '-'.join([methods_used] + mods)
else:
methods_used = method
r = self.compare_values(methods_used, value, comparison)
add = not r if fb.get('not', False) else r
# Checkbox-hints should be linkable with their options:
if t == "checkbox" and checkbox_feedback and add:
if fb.get('not'):
hints['not'] = hints.get('not') or OrderedDict()
hints['not'][fb.get('value', '')] = new_hint
else:
hints[fb.get('value', '')] = new_hint

Related to apluslms/a-plus-rst-tools#112

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions