-
Notifications
You must be signed in to change notification settings - Fork 733
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
Update exam.question_count calculation #12196
Changes from all commits
e335845
4580d82
7b89f69
094e1fa
967becc
4ecc912
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,15 +277,6 @@ export default function useQuizCreation() { | |
* @throws {Error} if quiz is not valid | ||
*/ | ||
function saveQuiz() { | ||
const totalQuestions = get(allSections).reduce((acc, section) => { | ||
acc += parseInt(section.question_count); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nucleogenesis - this value again feels like something we maybe shouldn't even store in the backend, as all it seems to represent is a user intention of how many questions there should be in the section? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah that's a good point - it can always be derived from the length of questions anyway. @AlexVelezLl I'll include the removal of saving this in my PR #12200 |
||
return acc; | ||
}, 0); | ||
|
||
set(_quiz, { | ||
...get(_quiz), | ||
question_count: totalQuestions, | ||
}); | ||
if (!validateQuiz(get(_quiz))) { | ||
throw new Error(`Quiz is not valid: ${JSON.stringify(get(_quiz))}`); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -574,6 +574,7 @@ | |
|
||
.answered { | ||
display: inline-block; | ||
margin-right: 8px; | ||
margin-left: 8px; | ||
white-space: nowrap; | ||
} | ||
|
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.
Might be good to update this: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/exams/test/test_exam_api.py#L45 to remove this from the data we send to the backend in tests, and then add a test to assert that the value is properly set on create?
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 can do this in #12200 to keep the clean-up separate from the fix here.