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

refactor: migrate live quiz to unified data structure (i.e., from question instances/blocks to element block and element instances) #4338

Merged
merged 38 commits into from
Nov 30, 2024

Conversation

sjschlapbach
Copy link
Member

@sjschlapbach sjschlapbach commented Oct 28, 2024

DO NOT SQUASH THIS BRANCH ON MERGE - development branch for live quiz migration

Before / after merging and applying this branch, execute the following steps:

  • Test that all functionalities of live quiz (including sessions with time limit, element instance updates, etc.) work correctly
  • Verify that variable point logic (timeToZeroBonus and maxBonusPoints) still works as it should
  • Migration script should: copy group activity status to new status, copy element stack type to new type, migrate QuestionInstance to ElementInstance, migrate SessionBlock to ElementBlock, migrate LiveSession to LiveQuiz
  • After migration: Remove QuestionInstance, SessionBlock, LiveSession, rename new group activity status to old one and drop old enum, rename new element stack type to old one and drop old column, (drop originalId columns?!)
  • Create database dump to avoid any potential data loss
  • Apply all database migrations

…ting (#4337)

Co-authored-by: Roland Schläfli <rolandschlaefli@gmail.com>
Copy link

aviator-app bot commented Oct 28, 2024

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Copy link

coderabbitai bot commented Oct 28, 2024

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

178 files out of 300 files are above the max files limit of 75. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cypress bot commented Oct 28, 2024

klicker-uzh    Run #3726

Run Properties:  status check passed Passed #3726  •  git commit 801d9f047f: refactor: migrate live quiz to unified data structure (i.e., from question insta...
Project klicker-uzh
Branch Review v3
Run status status check passed Passed #3726
Run duration 11m 51s
Commit git commit 801d9f047f: refactor: migrate live quiz to unified data structure (i.e., from question insta...
Committer Roland Schläfli
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 146
View all changes introduced in this branch ↗︎

Copy link

cypress bot commented Oct 28, 2024

klicker-uzh    Run #3725

Run Properties:  status check passed Passed #3725  •  git commit b9c73782b1 ℹ️: Merge c4e050f4549b64c9806222a4b1db1d601098d09e into b014faa40c46f4371e663c05a134...
Project klicker-uzh
Branch Review v3-new-live-quiz
Run status status check passed Passed #3725
Run duration 11m 47s
Commit git commit b9c73782b1 ℹ️: Merge c4e050f4549b64c9806222a4b1db1d601098d09e into b014faa40c46f4371e663c05a134...
Committer Julius Schlapbach
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 146
View all changes introduced in this branch ↗︎

Copy link

gitguardian bot commented Nov 6, 2024

⚠️ GitGuardian has uncovered 8 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
1509424 Triggered Generic Password 761360a docker-compose.yml View secret
1509424 Triggered Generic Password 761360a deploy/compose/docker-compose.yml View secret
1623504 Triggered Username Password 761360a deploy/compose-traefik-proxy/klicker/services.env View secret
1509424 Triggered Generic Password 761360a deploy/compose/docker-compose.yml View secret
1509424 Triggered Generic Password c06d004 util/_restore-db.sh View secret
1509424 Triggered Generic Password c06d004 util/_restore-db.sh View secret
1509424 Triggered Generic Password c06d004 docker-compose.yml View secret
1509424 Triggered Generic Password c06d004 util/_restore-db.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secrets safely. Learn here the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@sjschlapbach sjschlapbach marked this pull request as ready for review November 10, 2024 11:03
@rschlaefli rschlaefli changed the title refactor: migrate live quiz to element stack and element instances refactor: migrate live quiz to element block and element instances Nov 10, 2024
rschlaefli and others added 4 commits November 10, 2024 23:38
…w-live-quiz

# Conflicts:
#	apps/frontend-manage/src/components/activities/creation/practiceQuiz/PracticeQuizSettingsStep.tsx
#	apps/frontend-manage/src/components/activities/creation/practiceQuiz/PracticeQuizWizard.tsx
#	cypress/cypress/e2e/H-practice-quiz-workflow.cy.ts
#	packages/graphql/src/ops.ts
#	packages/graphql/src/public/client.json
#	packages/graphql/src/public/schema.graphql
#	packages/graphql/src/public/server.json
#	pnpm-lock.yaml
@rschlaefli rschlaefli requested a review from Copilot November 25, 2024 15:10
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 331 out of 346 changed files in this pull request and generated 1 suggestion.

Files not reviewed (15)
  • _down_macos.sh: Language not supported
  • apps/auth/package.json: Language not supported
  • apps/docs/docs/gamification/experience.mdx: Language not supported
  • apps/docs/docs/gamification/grading_logic.mdx: Language not supported
  • apps/docs/docs/tutorials/course_management.mdx: Language not supported
  • apps/docs/docs/tutorials/element_management.mdx: Language not supported
  • apps/docs/docs/tutorials/group_activity.mdx: Language not supported
  • apps/docs/docs/tutorials/live_qa.mdx: Language not supported
  • apps/docs/docs/tutorials/live_quiz.mdx: Language not supported
  • apps/docs/docs/tutorials/lti_integration.mdx: Language not supported
  • apps/docs/docs/tutorials/microlearning.mdx: Language not supported
  • apps/docs/docs/tutorials/practice_quiz.mdx: Language not supported
  • apps/backend-docker/scripts/fixQuestionData.ts: Evaluated as low risk
  • .github/workflows/cypress-testing.yml: Evaluated as low risk
  • .github/workflows/test-graphql.yml: Evaluated as low risk
Comments skipped due to low confidence (1)

CHANGELOG.md:380

  • The word 'quesiton' is misspelled. It should be corrected to 'question'.
* ensure that validation in quesiton edit modal works properly ([#4251](https://github.com/uzh-bf/klicker-uzh/issues/4251)) ([5e26453](https://github.com/uzh-bf/klicker-uzh/commit/5e2645381465ccfbf26dac17d2f36b380ef9e4bf))

README.md Outdated Show resolved Hide resolved
rschlaefli and others added 10 commits November 25, 2024 16:33
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…w-live-quiz

# Conflicts:
#	apps/frontend-manage/src/components/activities/creation/CompletionStep.tsx
#	packages/graphql/src/ops.ts
#	packages/graphql/src/public/client.json
#	packages/graphql/src/public/server.json
#	packages/graphql/src/services/practiceQuizzes.ts
…is sequentially to prevent instance mismatches due to ordering
"react": "18.3.1",
"react-dom": "18.3.1",
"sharp": "0.33.5",
Copy link
Member

Choose a reason for hiding this comment

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

I believe this is a prod dependency especially in standalone deployments but this might have changed with Next.js 15. I'll add it back and we can check it later :)

@@ -83,6 +71,7 @@
"eslint-config-next": "~15.0.0",
"postcss": "~8.4.47",
"postcss-import": "~16.1.0",
"react-tagcloud": "~2.3.3",
Copy link
Member

Choose a reason for hiding this comment

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

! Why did we move this production dependency to dev deps? Would fail once deployed, as in Docker, we only get "dependencies" installed.

"is-hotkey": "0.2.0",
"js-cookie": "3.0.5",
Copy link
Member

Choose a reason for hiding this comment

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

! I think this is necessary as we are using it in shared-components (useStickyState) and the component is imported in frontend-manage.

"js-search": "2.0.1",
"localforage": "1.10.0",
Copy link
Member

Choose a reason for hiding this comment

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

! Same, used in useStickyState and therefore used in frontend-manage

"react": "18.3.1",
"react-csv-downloader": "3.1.1",
Copy link
Member

@rschlaefli rschlaefli Nov 25, 2024

Choose a reason for hiding this comment

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

! this is also used in shared-components (DataTable).

Copy link
Member

@rschlaefli rschlaefli left a comment

Choose a reason for hiding this comment

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

Will merge this now as functionality has been verified and/or fixed. Will be tested further on staging including the other PRs before deployment tomorrow.

Small TODOs for before/after deployment that I saw during testing:

  • Fix realtime feedback charts on quiz cockpit not displayed nicely
  • Fix countdown block closing but not updating lecturer UI (still showing with 0 sec)
  • Fix grid display layout of choice questions

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
5.8% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@rschlaefli rschlaefli changed the title refactor: migrate live quiz to element block and element instances refactor: migrate live quiz from question instances and sessions to element block and element instances Nov 30, 2024
@rschlaefli rschlaefli changed the title refactor: migrate live quiz from question instances and sessions to element block and element instances refactor: migrate live quiz from question instances/blocks to element block and element instances Nov 30, 2024
@rschlaefli rschlaefli changed the title refactor: migrate live quiz from question instances/blocks to element block and element instances refactor: migrate live quiz from question instances/blocks to element block and element instances (unified data structures) Nov 30, 2024
@rschlaefli rschlaefli changed the title refactor: migrate live quiz from question instances/blocks to element block and element instances (unified data structures) refactor: migrate live quiz to unified data structures (i.e., from question instances/blocks to element block and element instances) Nov 30, 2024
@rschlaefli rschlaefli changed the title refactor: migrate live quiz to unified data structures (i.e., from question instances/blocks to element block and element instances) refactor: migrate live quiz to unified data structure (i.e., from question instances/blocks to element block and element instances) Nov 30, 2024
@rschlaefli rschlaefli merged commit 801d9f0 into v3 Nov 30, 2024
31 of 33 checks passed
@rschlaefli rschlaefli deleted the v3-new-live-quiz branch November 30, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants