Current Behavior
Currently, if a quiz/test/exam question is assigned a negative value for the assigned weight (worth) of a question using the marks property (e.g., marks: -1), this value is accepted. This shouldn't be the case. The marks property needs validation.
There is no mechanism to notify instructors that negative marks are not supported or may be unintended.
Expected Behavior
- Validation logic to ensure the scoring logic never processes negative marks silently, notifies of this error in value.
- An error message (e.g., using
errorf) in the template engine when .marks less than or equal to 0.
- Display a validation phase in UI if negative marks are found in the YAML.
Implementation
Try suggestion 1. first, then move to 2. if that doesn't work.
- use Hugo's templating language to check for the presence of parameters and their basic types within your layouts and partials.
or
- Use Hugo's templating language to check for the presence of parameters and their basic types within your layouts and partials.Create a partial or a custom hook that runs during the Hugo build process to perform validation checks across all content files that use the
test archetype. or
Contributor Guide and Resources
Current Behavior
Currently, if a quiz/test/exam question is assigned a negative value for the assigned weight (worth) of a question using the
marksproperty (e.g.,marks: -1), this value is accepted. This shouldn't be the case. The marks property needs validation.There is no mechanism to notify instructors that negative marks are not supported or may be unintended.
Expected Behavior
errorf) in the template engine when.marksless than or equal to 0.Implementation
Try suggestion 1. first, then move to 2. if that doesn't work.
or
testarchetype. orContributor Guide and Resources