-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add validation to capa problem authoring markdown #265
add validation to capa problem authoring markdown #265
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HamzaIbnFarooq overall LGTM. few typos needs to be fixed and I have question.
@@ -402,6 +402,9 @@ | |||
line = lines[i].trim(); | |||
if (line.length > 0) { | |||
textHint = extractHint(line, true); | |||
if (!textHint.nothint) { | |||
throw new Error("One of the provided options don't have valid text value") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace don't have valid
with doesn't have a valid
. Are these error messages are marked for internationalization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have fixed the typo and the messages are already internationalized in the showErrorMeassage
method but I have added translations to individual strings as well.
3dec514
to
88d0d01
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
2975572
to
8621270
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
745c00d
to
9dc9a34
Compare
@pdpinch I have created an upstream PR related to this feature: https://github.com/edx/edx-platform/pull/27858 |
389595b
to
d85f98a
Compare
Before this commit, if a course author created a capa mcqs or similar problem without providing any answer text for an option the question would be created causing abnormal behavior for learners. This commit will validate answer text of all options and raise an error message to author to fix the issue on the go.
…fix response report generation If an author has created a capa problem like an mcqs or something similar without providing answer text to an option and some learner selected that option then the response report generation will fail due to that missing answer text. The current commit will add default text to be substituted and prevents report generation crash.
d85f98a
to
9e655a4
Compare
The upstream PR https://github.com/edx/edx-platform/pull/27858 has been merged so closing this internal PR as well |
Related Issue
#239
#240
What this PR does
It adds validation to CAPA problems and shows a notification to the course author regarding the issue, along with fixing old response report generation issues by providing a default value for the problems having no text values for answer options.
How to test this PR
To understand the purpose of this PR, follow the below steps to reproduce the issue:
Data Download
underInstructor
tabReports
section, select the Problem and pressCreate a report of problem responses
The error will be generated.
Now use the current PR and go through the same process, and you will see that the editor will not allow saving such content and mentions an error message instead.
Screenshots