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

Channel based quizzes #8212

Merged
merged 23 commits into from
Jul 20, 2021
Merged

Conversation

sairina
Copy link
Contributor

@sairina sairina commented Jul 16, 2021

Summary

Created interface for coach user to assign pre-made quizzes (channel-based quizzes) to students like a regular quiz.

References

Addresses #7862

Reviewer guidance

Pre-requisite: make sure a channel-based-quiz is available in your Kolibri instance:

  1. Sign in as a superuser.
  2. Go to "Device" > "Channels" and click on the "Import" button
  3. Click on the "Kolibri Studio" radio button.
  4. Click on "Import with token" button, and type into the Channel token: kucap-supam kurap-supam

Test to see that a channel test can be selected:

  1. Sign in as a coach user, and enter a class.
  2. Click on the "Plan" tab > "Quizzes" tab > "New quiz" button.
  3. Choose "Select channel quiz"
  4. Click through each content card until you reach the preview page. The "folder" icon on the content card should become a "clipboard" icon, indicating you have reached a quiz.
  5. At this page (PlanChannelQuizPreviewPage), check to see that the title of the test matches the title in the toolbar, and that the properties such as "Total questions", "Quiz duration", etc. have populated.
  6. Click "Select quiz".
  7. You should be redirected to the "Plan your class" quizzes page (note that "Quiz created" should appear in the snackbar and disappear).

Making copies of the quiz (method 1):

  1. Click on the channel based quiz, and make sure everything is populated (button to "Start quiz", preview of the questions, etc.).
  2. Click on the "Options" button > "Copy quiz" > "Assign quiz to entire class"
  3. Click on the link that takes you back to planning ("All quizzes"), and look for "Copy of [your quiz name]" as a title in the list of quizzes.

Making copies of the quiz (method 2):

  1. Click on the "New quiz" button
  2. Choose "Select channel quiz"
  3. Create the same channel quiz (basically, doing the exact same thing you did in "Test to see that a channel test can be selected" and selecting the same pre-made quiz). Click through each content card until you reach the preview page. The "folder" icon on the content card should become a "clipboard" icon, indicating you have reached a quiz.
  4. At this page (PlanChannelQuizPreviewPage), check to see that the title of the test has an additional (#) appended to the end, and that the properties such as "Total questions", "Quiz duration", etc. have populated. Note that the number will update depending on how many copies of this test exist.
  5. Click "Select quiz".
  6. You should be redirected to the "Plan your class" quizzes page (note that "Quiz created" should appear in the snackbar and disappear).

Test to see that the channel quiz can be assigned to students

Testing checklist

  • Contributor has fully tested the PR manually
  • Critical user journeys are covered by Gherkin stories

PR process

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Reviewer checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@sairina sairina added the TODO: needs review Waiting for review label Jul 16, 2021
@sairina sairina requested review from rtibbles and khangmach July 16, 2021 21:53
@sairina sairina force-pushed the channel_based_quizzes branch from 8e88e5c to 4445211 Compare July 16, 2021 22:11
@sairina sairina marked this pull request as ready for review July 16, 2021 22:12
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick skim didn't flag anything except the unresolved merge conflict.

Will do some manual testing.

@sairina sairina mentioned this pull request Jul 17, 2021
6 tasks
Copy link
Member

@rtibbles rtibbles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working perfectly to spec.

One thing I noticed while testing is that there is a bug in Studio currently where 'randomized' is shown as defaulting to False in the UI, but on publish, it actually defaults to True.

If we were actually able to get randomize to be set to False on the channel based quiz, it would be good to transfer that to the randomize attribute when we create a quiz - so that might be the only update I'd make here!

@radinamatic
Copy link
Member

radinamatic commented Jul 19, 2021

  1. UX improvement suggestion

    This page could benefit from adding a sentence to clarify that what is displayed are channels that contain pre-made quizzes. At the moment the heading says to select a quiz, but listed below are the channels.

    LEDev2104 (start)  Running  - Oracle VM VirtualBox_010

  2. At first I thought that the PR has issues with copying quizzes in the case of more than one facility on the device, but it seems to happen for normal quizzes (and lessons!) too, so not specifically issue in this PR. At this point I'm not sure if it's a regression, me not remembering this limitation, or just something we did not account for... 🤔

    While in coach dashboard of the facility ZukVillage (which was an imported facility from Kolibri beta server), I followed the steps to test making a copy of the quiz from the Channel based quiz test imported previously. When it came to assign the quiz to the class, I was presented with a list of classes from the other facility (Home Facility dd, created during the initial setup wizard for the device), and no options to select any of the other classes in the facility ZukVillage (there are 4 other classes). It looks as if Kolibri takes it as a default facility, and ONLY allows copying quizzes and lessons to it, and not to any other facility imported afterwards. Copy operation was successful, but the workflow still leaves me uneasy...

    ZukVillage Home Facility dd
    LEDev2104 (start)  Running  - Oracle VM VirtualBox_011 LEDev2104 (start)  Running  - Oracle VM VirtualBox_012

    If this limitation (not possible to copy lessons and quizzes in facilities different from the default one) is by design, we should add a warning to the user documentation and retouch/add some Gherkin scenarios.

cc @jtamiace @khangmach (as both points above are UX related).

Attaching the db.sqlite3 file of my device, if it helps for debugging.

@rtibbles
Copy link
Member

If this limitation (not possible to copy lessons and quizzes in facilities different from the default one) is by design, we should add a warning to the user documentation and retouch/add some Gherkin scenarios.

This certainly seems like a bug - all activity within a facility should be scoped within that facility (there may be a use case for copying a quiz across facilities, but that workflow would only be applicable for a super admin).

@radinamatic
Copy link
Member

radinamatic commented Jul 19, 2021

that workflow would only be applicable for a super admin

Yes, bumping into this issue is certainly the result of me going through the coach-specific workflow as a superadmin on a device with multiple facilities. When user is signed in as a coach and goes through the steps of the feature, they do not encounter any problems.

@sairina, since this is a different (edge case) problem not related to your work on this PR, we may disregard my point 2 above, I'll file a separate issue to document and fix this independently.

@sairina
Copy link
Contributor Author

sairina commented Jul 19, 2021

@radinamatic (cc: @khangmach and @jtamiace) -

Here's what it currently looks like, and it would only appear for the channels. It's at an h2 heading. Does this work?
Screen Shot 2021-07-19 at 12 05 04 PM

@khangmach
Copy link
Contributor

perfect!

@radinamatic
Copy link
Member

Looking good, @sairina, although I don't think it's necessary for that sentence to be a heading in this context. H2 could have made sense if the channels below were grouped by some criteria (so each group would have a different H2 heading), but since that's not the case, I don't see semantic heading as warranted here.

@rtibbles
Copy link
Member

One other thing that we had discussed in the run up to design of the feature was hiding it and reverting to no drop down on the button behaviour in the case there are no channel based quizzes (as it is still a somewhat limited access feature at the moment).

We can do the actual toggling post-merge, but would be good to have the original button hidden behind an if="false" flag.

@sairina
Copy link
Contributor Author

sairina commented Jul 20, 2021

If we were actually able to get randomize to be set to False on the channel based quiz, it would be good to transfer that to the randomize attribute when we create a quiz - so that might be the only update I'd make here!

@rtibbles, Does this fix the issue?
2021-07-19 20 42 52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TODO: needs review Waiting for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants