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

💻 hide all quizes/parsons and show tabs in levels #5156

Merged
merged 21 commits into from
Mar 7, 2024
Merged

Conversation

hasan-sh
Copy link
Collaborator

@hasan-sh hasan-sh commented Feb 15, 2024

Fixes #5141

Key points

  • a quize/parson is added as a tab in the customize-class page. This makes it closer to how it'd look like for students.
  • the current "hide quize/puzzle" switches will behave as "toggle all quizes/puzzles". Why? Consider the following:
    • the teacher decides to hide all quizes.
    • they are removed from all levels,
    • they can of course still choose to show a quize in certain levels, while keeping the rest hidden.
    • however, what if they (for whatever reason) want to show all quizes but hide one or two?
    • this scenario is likely because until now the "hide quize" behaves as toggling all quizes, so it should still behave similarly.
    • thus it could be considered as resetting all quizes/puzzles.
  • the order of puzzle and quiz tabs are always fixed to be always the last two tabs, respectively.

Something went missing when i added the key translations for #5026 (check 6ee2c4f#diff-852046eb47f474139974edf5e69ed9758f9fde82e1432c49d772b89aef354b37), so I'm adding them here.

How to test?

  • go the customize-class page
  • add/remove a quiz/puzzle
  • reset all puzzles/quizes to test that functionality.
    • note that if you disable all quizes and you add one quiz in level 2, for instance, the disable checkbox will be updated since not all quizes are disabled now. (it needs a refresh for now for that to be reflected in the DOM, but this should be dealt with in [UX] Use autosave everywhere  #4888)
  • log in as a student or preview as teacher to see your changes from the perspective of students.
  • verify that everything works as expected.

@ghost
Copy link

ghost commented Feb 15, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@hasan-sh hasan-sh self-assigned this Feb 27, 2024
@hasan-sh hasan-sh marked this pull request as ready for review February 29, 2024 12:52
@Felienne Felienne assigned jpelay and unassigned hasan-sh Mar 3, 2024
@Felienne Felienne requested a review from jpelay March 3, 2024 15:18
@hasan-sh hasan-sh assigned hasan-sh and unassigned jpelay Mar 5, 2024
@Felienne Felienne assigned jpelay and unassigned hasan-sh Mar 5, 2024
Copy link
Member

@jpelay jpelay left a comment

Choose a reason for hiding this comment

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

Hi @hasan-sh! Sorry for not reviewing it earlier! Everything works great, and I think this is a great idea, however there's something we must change: if a class already has a customization object and I enter the customization page again, then my class won't have any quizes. Can we find a way to automatically add parsons and quizzes to the customization objects that hasn't been touched previous to this PR? Like a migration.

@hasan-sh
Copy link
Collaborator Author

hasan-sh commented Mar 7, 2024

Hi @hasan-sh! Sorry for not reviewing it earlier! Everything works great, and I think this is a great idea, however there's something we must change: if a class already has a customization object and I enter the customization page again, then my class won't have any quizes. Can we find a way to automatically add parsons and quizzes to the customization objects that hasn't been touched previous to this PR? Like a migration.

@jpelay thanks for the reminder, i had a TODO in the code, but apparently i missed it! Does your IDE notify you about todos!?

Now it should be ready to roll!

Copy link
Contributor

mergify bot commented Mar 7, 2024

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 0297631 into main Mar 7, 2024
11 checks passed
@jpelay
Copy link
Member

jpelay commented Mar 7, 2024

@jpelay thanks for the reminder, i had a TODO in the code, but apparently i missed it! Does your IDE notify you about todos!?

Now it should be ready to roll!

Actually no haha! I often write those down in my notebook or in the calender. If I do it in the code I tend to forget.

@mergify mergify bot deleted the hide-quiz-parsons branch March 7, 2024 13:37
mergify bot pushed a commit that referenced this pull request Mar 9, 2024
Fixes #4655 
Depends-On: #5156

<img width="1440" alt="Screenshot 2024-03-01 at 11 31 37" src="https://github.com/hedyorg/hedy/assets/48122190/8f04d20b-5095-4a93-a9a3-89628158a15c">

Start teaching goes to:
- if not logged in: `signup?teacher=true`
- if logged in as teacher: `for-teachers`
- if logged in as student: `my-profile`

In the future, we want it to be linked to #5183
mergify bot pushed a commit that referenced this pull request Mar 12, 2024
Fixes #5155 
Depends-On: #5156

Added a general "Go back" button to: `/customize-class` `/live-stats` `/customize-adventure` `/grid-overview` and `/for-teachers/class`

<img width="1440" alt="Screenshot 2024-02-29 at 14 34 15" src="https://github.com/hedyorg/hedy/assets/48122190/1e397636-61eb-4257-843e-e8cae421627e">
boryanagoncharenko pushed a commit that referenced this pull request Mar 13, 2024
Fixes #5155 
Depends-On: #5156

Added a general "Go back" button to: `/customize-class` `/live-stats` `/customize-adventure` `/grid-overview` and `/for-teachers/class`

<img width="1440" alt="Screenshot 2024-02-29 at 14 34 15" src="https://github.com/hedyorg/hedy/assets/48122190/1e397636-61eb-4257-843e-e8cae421627e">
mergify bot pushed a commit that referenced this pull request Mar 19, 2024
**Problem**
Related to #5156

![image](https://github.com/hedyorg/hedy/assets/20051470/ff41ff88-14e7-456f-838e-553b00cc12a2)

The feature actually works. However, it only works if the teacher has logged in and at least visited the customize-class page. This is because there's a migration step that I added which basically adds the quizzes/puzzles to the list of adventures if they were not hidden before. The problem that this PR solves is related to the scenario in which a student is logged in and interacts with a class while their teacher has not refreshed the customize-class page: Thus the migration was not done yet at this point, hence the students then would not see the quizzes/puzzles.

_Why didn't we figure it out earlier not during testing nor reviewing?_ This is mainly because **we tested it while relying on** the _previewing class_ feature. This feature, supposidely, would allow a teacher to exactly simulate what students see and how they interact with the related class. But apparently that's not the case, since the preview feature is simply coplying the customization class and "allowing the user to merely see that class". 

**How to test?** 
- in your `dev_database.json` file, remove the quiz/puzzle manually from at least the first level of the `sorted_adventures` of your class (e.g., CLASS1)
- then log in as a student and the quiz/puzzle should be readded and shown to you, iff. the quiz/puzzle was not disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

💻 level quiz or all quizes
3 participants