Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Quiz implementation #359

Unanswered
iliakan asked this question in Q&A
Discussion options

Sometimes, a quiz is needed, rather than a code task.
That is: a question + a list of options with "choose one" / "choose many".
When a visitor selects the correct answer, then show ✅ ; otherwise ❌ with the feedback text explaining why it's wrong.

How should I implement it?

Astro component, perhaps?

I'd like to try, please sketch out a correct way ;)

You must be logged in to vote

Replies: 3 comments

Comment options

Lessons without coding tasks can hide the file tree and editor by specifying editor: false in frontmatter: https://tutorialkit.dev/reference/configuration/#editor.

---
type: tutorial
editor: false
---

To build a list of options with logic for showing correct answer and description for incorrect answers, you could create a Vite application in the template for this.

You must be logged in to vote
0 replies
Comment options

Yes, I do need the logic for showing the answer/description.

"Vite application" - any docs or a similar example in the tutorial?

P.S. I've never built Vite apps, but surely can google up and read. So the question is mainly about how to integrate this into tutorialkit without patching.

You must be logged in to vote
0 replies
Comment options

Where would you like to show the feedback for correct and incorrect answers? If in the preview tab is enough, you could have something like https://stackblitz.com/~/edit/vitejs-vite-zwwnxg?file=src%2Ftemplates%2Fdefault%2Findex.html&terminal=dev.

It's running the quiz application in preview and hiding the code editor. The quiz application itself doesn't have to be built with Vite - any web application works.

image

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Question related to TutorialKit that doesn't require changes in codebase.
Converted from issue

This discussion was converted from issue #272 on October 02, 2024 10:34.

AltStyle によって変換されたページ (->オリジナル) /