Skip to content
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

Conversation

nucleogenesis
Copy link
Member

@nucleogenesis nucleogenesis commented Dec 20, 2023

Summary

DEBUG data

Improves the DEBUG data generation when the DEBUG flag is set to true in the useQuizCreation 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 a ContentNode object suitable for our uses (aka, it has assessmentids which map to the QuizQuestion.question_id).

Those resources are then used to generate the resource_pool properties for some sections (QuizSection) and then sets that sections questions (QuizQuestion[]) array to the items in our dummy questions that match the section's resource_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's resource_pool will list the resources selected. This gives us a list of assessment_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 the resource_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

  • Provide/Inject the handlers for the accordion actions
  • Visual bug where having a lot of questions would give us a second scrollbar on the questions list

Reviewer guidance

Code Review

  • Does the code make sense?
  • Do the comments help explain what is going on and why?

@nucleogenesis nucleogenesis added the TODO: needs review Waiting for review label Dec 20, 2023
@github-actions github-actions bot added APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: medium labels Dec 20, 2023
Copy link
Member

@marcellamaki marcellamaki left a 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
Copy link
Member

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"?

Copy link
Member

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.

Copy link
Member Author

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).

@nucleogenesis nucleogenesis merged commit 439e564 into learningequality:develop Dec 21, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APP: Coach Re: Coach App (lessons, quizzes, groups, reports, etc.) DEV: frontend SIZE: medium TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants