Steps to reproduce:
In the current 5.x-dev...
1. Uncheck the quiz setting "Allow quiz creators to set a pass/fail option when creating a questionnaire" and save.
2. Go to admin/quiz/settings/quiz-form.
3. Try to save. Receive error in subject.
Cause:
In the event that checkbox is unchecked and saved, the pass/fail options are prevented from showing on the form, and so the submission errors out.
This appears to be another refactoring-related one, because we're sharing that form with the same form on the quiz creation form, and in THAT event, the pass/fail options are actually SUPPOSED to not be on the form.
Patch approach:
Unconditionally show the pass/fail options when in the settings form.
Comment | File | Size | Author |
---|---|---|---|
#7 | general_error_1364-2509232-7.patch | 1.91 KB | djdevin |
#4 | general_error_1364-2509232-4.patch | 2.4 KB | djdevin |
Comments
Comment #1
captainack CreditAttribution: captainack commentedI added the pass/fail options to the form, since the form description implies that users can't OVERRIDE default pass/fail options, not that there are no pass/fail options.
Comment #2
captainack CreditAttribution: captainack commentedComment #3
captainack CreditAttribution: captainack commentedSorry for the bump. Updated issue summary to make it easier to read.
FYI, the most recent dev still spits this error out, which renders disabling the "Allow quiz creators to set a pass/fail option when creating a questionnaire" checkbox broken.
Comment #4
djdevinThe pass_rate field should really be nullable in the database, since it does not have to have a value - 0 is not the same as "does not have a passing rate".
Updated the schema definition and added an update hook.
I don't get the fatal now, on the configuration form or on the node itself.
Also fixed a few notices resulting from the pass result text not existing.
Comment #6
captainack CreditAttribution: captainack commentedGood point. That's a cleaner and better approach.
Comment #7
djdevinComment #8
djdevinFixed.