Browse Source

fix issue with empty submission to radio-style multiplechoice question

tags/current_release
adam j hartz 3 months ago
parent
commit
2441b4f4f4
2 changed files with 8 additions and 1 deletions
  1. +4
    -0
      CHANGELOG.md
  2. +4
    -1
      catsoop/__QTYPES__/multiplechoice/multiplechoice.py

+ 4
- 0
CHANGELOG.md View File

@@ -30,6 +30,10 @@ _Work toward next release. Currently under development._
* Fixed issue with `csq_rerender` ignoring prompts (courtesy of Valerie
Richmond).

* Fixed an issue whereby submitting a multiplechoice question using the
`'radio'` renderer would cause an error if no option was selected (courtesy
of Kade Phillips)

**SECURITY:**

**DOCUMENTATION:**


+ 4
- 1
catsoop/__QTYPES__/multiplechoice/multiplechoice.py View File

@@ -64,7 +64,10 @@ def handle_submission(submissions, **info):
if check is defaults["csq_check_function"]:
check = defaults["csq_checkbox_check_function"]
else:
sub = int(sub)
if len(sub) == 0:
sub = -1
else:
sub = int(sub)
if info["csq_soln_mode"] == "value":
sub = info["csq_options"][sub] if sub >= 0 else "--"
check_result = check(sub, soln)


Loading…
Cancel
Save