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

feat(academy): install a quiz for part "rules" #395

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Jan 23, 2024

Add a quiz section into the "rules" part of the academy, providing an opportunity for readers to assess of their understanding of the content.

image

PS: I have refined the CSS to improve the visual appeal of the quiz; however, this is merely a preliminary version. Further aesthetic improvements to be planned.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Integrated a quiz component into the academy section.
    • Enhanced user interface with new styles for the quiz feature.
  • Documentation

    • Updated documentation to include the new quiz component.
  • Style

    • Added custom styling for the quiz, including layout and interactive elements.

@ccamel ccamel self-assigned this Jan 23, 2024
Copy link
Contributor

coderabbitai bot commented Jan 23, 2024

Walkthrough

The recent update introduces a quiz feature to the academy's rules section, complete with a new JSON quiz data file and a React Quiz component. Additionally, the styling for the quiz has been integrated into the existing SCSS framework, ensuring a seamless visual experience for users engaging with the quiz.

Changes

File Path Change Summary
docs/academy/rules.mdx
src/scss/custom.scss
src/scss/quiz.scss
Added Quiz component import and rules-quiz.json. Integrated "quiz" styles. Introduced styles for the React quiz component.

🐇✨
In the docs, there's a brand new quest,
For learning the rules, it's simply the best.
A quiz to engage, a style that's chic,
Hop through the questions, seek answers you seek! 🎓🐰

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Member

@bot-anik bot-anik left a comment

Choose a reason for hiding this comment

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

Device URL
desktop http://localhost:3000/

Device URL
mobile http://localhost:3000/

Not what you expected? Are your scores flaky? GitHub runners could be the cause.
Try running on Foo instead

@ccamel ccamel marked this pull request as ready for review January 23, 2024 09:07
@ccamel ccamel requested review from amimart and MdechampG January 23, 2024 09:07
@ccamel
Copy link
Member Author

ccamel commented Jan 23, 2024

@MdechampG can you check it on your environment? Btw, we can add new questions to the quizz in this PR to finalise it. I'll leave it to you.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0cabf77 and 160384e.
Files ignored due to path filters (1)
  • docs/academy/rules-quiz.json is excluded by: !**/*.json
Files selected for processing (3)
  • docs/academy/rules.mdx (2 hunks)
  • src/scss/custom.scss (1 hunks)
  • src/scss/quiz.scss (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/scss/custom.scss
Additional comments: 2
docs/academy/rules.mdx (2)
  • 5-6: The import statements for the Quiz component and the rules-quiz.json are correctly placed at the top of the file. Ensure that the Quiz component and the JSON file are properly tested and that the JSON structure matches the expected format of the Quiz component.
Verification successful

---

The structure of the `rules-quiz.json` file has been successfully verified with the `jq` command, and it appears to be in a correct JSON format suitable for a quiz component, with fields for quiz title, number of questions, questions, answer options, correct answer, messages for correct and incorrect answers, and points.

Since the `rg` command did not produce any output, it is likely that there are no other instances of 'import Quiz from' in text files, which means the import statement for the `Quiz` component is unique to the `docs/academy/rules.mdx` file. This is consistent with the PR's objective of adding a quiz to the "rules" section of the academy.

Based on the information provided, the review comment has been verified, and the import statements for the `Quiz` component and the `rules-quiz.json` file are correctly placed and the JSON structure is appropriate for the `Quiz` component.



</details>

<details>
<summary>Scripts Executed</summary>

The following scripts were executed for the analysis:



---

Script:
```shell
#!/bin/bash
# Verify that the Quiz component is properly tested.
rg --type mdx --files-with-matches 'import Quiz from'
# Verify that the rules-quiz.json structure matches the expected format.
jq . src/academy/rules-quiz.json

Length of output: 204



Script:

#!/bin/bash
# Since 'mdx' is not recognized by ripgrep, we'll use a general text search without specifying the file type.
rg 'import Quiz from' -t all

# The path to the JSON file might be incorrect. Let's find the correct path using 'fd'.
fd 'rules-quiz.json'

Length of output: 80



Script:

#!/bin/bash
# Now that we have the correct path to the JSON file, let's check its structure with jq.
jq . docs/academy/rules-quiz.json

Length of output: 1121

* 249-249: The `` component is added at the end of the document, which is appropriate for the context described in the PR objectives. Ensure that the `quiz` prop is correctly passed to the `Quiz` component and that it renders without errors.
Verification successful

The <Quiz> component with the quiz prop is indeed present in the docs/academy/rules.mdx file, as indicated by the output of the rg command. This confirms that the review comment is consistent with the codebase.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Verify that the quiz prop is correctly passed and renders without errors.
rg --type mdx --files-with-matches '<Quiz quiz={quiz}/>'

Length of output: 172



Script:

#!/bin/bash
# Verify that the quiz prop is correctly passed and renders without errors.
# Escaping curly braces to be taken literally in the regex pattern
rg --type mdx --files-with-matches '<Quiz quiz=\{quiz\}/>'

Length of output: 88



Script:

#!/bin/bash
# Verify that the quiz prop is correctly passed and renders without errors.
# Removing the --type flag to search all files
rg --files-with-matches '<Quiz quiz=\{quiz\}/>'

Length of output: 72

src/scss/quiz.scss Outdated Show resolved Hide resolved
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0cabf77 and bc85df0.
Files ignored due to path filters (1)
  • docs/academy/rules-quiz.json is excluded by: !**/*.json
Files selected for processing (3)
  • docs/academy/rules.mdx (2 hunks)
  • src/scss/custom.scss (1 hunks)
  • src/scss/quiz.scss (1 hunks)
Files skipped from review as they are similar to previous changes (3)
  • docs/academy/rules.mdx
  • src/scss/custom.scss
  • src/scss/quiz.scss

Copy link
Member

@MdechampG MdechampG left a comment

Choose a reason for hiding this comment

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

Thank you @ccamel it works well 👍🏻
I added few questions 💯

@ccamel
Copy link
Member Author

ccamel commented Jan 23, 2024

Perfect. Let's make it real.

@ccamel ccamel merged commit 70e2e88 into main Jan 23, 2024
12 checks passed
@ccamel ccamel deleted the feat/rules-quiz branch January 23, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants