Add CLI flags to output well-formatted optional question attributes. #123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: This change is backward compatible with the current learn interface.
What was done
This commit adds three new flags to the
learn md
command:--with-explanation/-e
(bool) which creates explanation attributes for correct and incorrect responses--with-rubric/-r
(bool) which creates rubric attributes--with-hints/-n
(int) which creates the indicated number of hint attributesWithout the minimal flag, the comments are preserved in the question as it previously worked. If a user specifies one of the above flags, then the corresponding comment is removed from the final output.
How was it tested
64 new unit tests for the new functionality exist in the
app/cmd/challenge_attributes_test.go
file. All tests pass.Built and tested with
go1.20.14
go1.21.7
go1.22.0
Example output
Here is running it in maximal mode with all of the new options.
Here is running it in maximal mode with just one option. Note the preserved comments from the normal maximal output.
Finally, here's what it looks like in minimal mode.