-
Notifications
You must be signed in to change notification settings - Fork 699
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
Quiz creation DEBUG data improvements #11662
Quiz creation DEBUG data improvements #11662
Conversation
Build Artifacts
|
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.
Thanks @nucleogenesis! I added one non-blocking question. I think overall there might be some additional improvements to the comments that can be made in the spec as the feature gets closer and closer to being done, but let's go ahead and merge this so it's available for next week, and we can continue to tweak the comments and names of things if needed as development continues.
@@ -70,7 +70,7 @@ export default function useQuizCreation(DEBUG = false) { | |||
console.error("You're trying to generate test data in production. Please set DEBUG = false."); | |||
} | |||
// First let's make some QuizQuestion objects so we have them to initialize resources with | |||
// Typically this data would be fetched and usable from the useQuizResources module | |||
// Typically this data would be fetched and usable from the useExerciseResources module |
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.
what is the difference between a quiz exercise (i.e. useExerciseResources
and a QuizExercise
). Is it because the useExerciseResources
module will be shared and repurposed beyond "quizzes"?
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.
maybe this is actually now a commit that got overwritten, but there is still a reference to useExerciseResources
in the new diff.
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.
Yeah the useExerciseResources
module is what I'm calling the "navigating the tree, checkbox logic, assessmentmetadata annotations, etc" module.
I think that it will be used in future updates to Lesson as well (or at least want it to be an option for that).
Summary
DEBUG data
Improves the DEBUG data generation when the
DEBUG
flag is set totrue
in theuseQuizCreation
module.This relies heavily on the
quizCreationSpecs.js
module which defines a set of "types" which are referenced throughout the greater quiz creation module.We generate a bunch of questions (
QuizQuestion
) and then we create a bunch of resources (QuizResource
- representing aContentNode
object suitable for our uses (aka, it hasassessmentids
which map to theQuizQuestion.question_id
).Those resources are then used to generate the
resource_pool
properties for some sections (QuizSection
) and then sets that sectionsquestions
(QuizQuestion[]
) array to the items in our dummy questions that match the section'sresource_pool
resources.IRL a separate module will be handling the business of fetching and storing the
QuizQuestion
data which we can read from based on the data in a quiz section. For example -- when a user "selects resources" the section'sresource_pool
will list the resources selected. This gives us a list ofassessment_ids
which we can use to fetch and display actual questions from within each resource.Removing
ExerciseResource
I previously envisioned that the module would work in a way where the
resource_pool
could house either a Topic OR an Exercise and then we'd be able to answer the question "should the checkbox for this Topic here be checked, indeterminate (ie, we have some but not all children of the topic), or unchecked?" by reducing theresource_pool
to list of all of the exercises within selected topics and so forth.However, after chatting w/ @rtibbles we're going to lean on the
fetchTree
API method which will allow us to basically get 2 generations of a tree at any time so we will only give the topic a checkbox if we can get all of its children using this. We'll calculate this by comparing the "total resources in this topic" with the "total resources among this topics children and grandchildren" -- if they're different, then we cannot access all of the Exercises in the Topic and won't show the checkbox at all.The point is -- we only now are concerned with one "type", the
QuizResource
which will be an Exercise and have the assessment_ids we need to get the actual questions.Bonus fixes
Reviewer guidance
Code Review