-
Notifications
You must be signed in to change notification settings - Fork 10
feat: ChoiceAnswer and Quiz
#270
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
Open
lebalz
wants to merge
93
commits into
main
Choose a base branch
from
feature/choice-answer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
93 commits
Select commit
Hold shift + click to select a range
1a193aa
Start documenting initial idea.
SilasBerger d983bcc
Remove unnecessary import.
SilasBerger 4855a91
Rework syntax.
SilasBerger 3a8868a
Implement basic radio buttons.
SilasBerger e122ed6
Add support for MC.
SilasBerger f8e5c67
Draft new syntax.
SilasBerger 79272e8
Tweak syntax examples.
SilasBerger 8680d05
Work on plugin.
SilasBerger 6a63d4c
Cleanup.
SilasBerger ae459ac
Make MDX plugin not suck.
SilasBerger c180085
Enumerate options.
SilasBerger ba2d47c
Implement saving.
SilasBerger 6924fff
Show save icon.
SilasBerger fe9a647
Run formatter.
SilasBerger 459e625
Start integrating Quiz.
SilasBerger 367bc13
Start adding Quiz.
SilasBerger 0b9b522
Fix prop passing.
SilasBerger 91e5df4
Inject doc from quiz.
SilasBerger 27a78bd
Prevent redundant visit of questions in quiz.
SilasBerger d4c791d
Format.
SilasBerger e45daed
Improve save icon handling.
SilasBerger 53da651
Cleanup.
SilasBerger 587a307
Implement deleting answer.
SilasBerger ebd1a38
Add support for true/false answer.
SilasBerger 30392aa
Cleanup.
SilasBerger 950cba5
Add styling and support for question title.
SilasBerger 0930e44
Improve visuals.
SilasBerger c7ff69c
Add option randomization.
SilasBerger e732a4b
Implement quiz randomization.
SilasBerger 64cfacc
Cleanup and fixes.
SilasBerger ab16f82
Clean up.
SilasBerger 2d94413
Start working on component cleanup.
SilasBerger 9913b00
Slim context further.
SilasBerger 67ee1d9
Reduce choice answer props to minimum.
SilasBerger ebab0da
Fix non-randomization of true/false options.
SilasBerger 04b897f
Hide delete btn behind hover.
SilasBerger f34f4b5
Make fade a little snappier.
SilasBerger 06073bb
Use canEdit, fix some bugs, clean up.
SilasBerger 2f98410
Use card style.
SilasBerger 0f0f97a
Start working on auto-grading.
SilasBerger a8fa353
Refactor, work on auto-grading.
SilasBerger 4007fb6
Implement basic SC grading logic.
SilasBerger 7807798
Implement MC grading.
SilasBerger e9bf2d6
Cleanup.
SilasBerger 887a426
Fix reset.
SilasBerger 5a79c29
Map true/false answer correct state.
SilasBerger 33f1ec3
Move controls for quiz.
SilasBerger cd93b0e
Use grading color in header.
SilasBerger 0adc3f8
Restyle feedback.
SilasBerger a11b28c
Work on grading.
SilasBerger c9bea09
Implement basic grading.
SilasBerger 6ace3d1
Update readme.
SilasBerger 8bd2681
Show max points when not graded.
SilasBerger dfc4a31
Add noPoints grading function.
SilasBerger 91a3dab
Implement grading hints.
SilasBerger 8e6bec4
Add some documentation.
SilasBerger f00152c
Implement MC grading.
SilasBerger d6e6353
Implement lower points limit for quiz.
SilasBerger b183eec
Prevent answer changes when not allowed.
SilasBerger e414aaa
Cleanup.
SilasBerger d9da2b7
Fix some grading/verification edge cases.
SilasBerger 7c0a362
Restructure.
SilasBerger d37db6d
Integrate grading hint into points badge.
SilasBerger 5b73f7d
Remove standalone scoring hint if no questions have scoring.
SilasBerger b07fd05
Work on renaming.
SilasBerger 4b08937
Split grading into scoring and assessment.
SilasBerger 4a4fb72
Rename grading prop to scoring.
SilasBerger 6228226
Finish nomenclature change.
SilasBerger af7c8a6
Clean up README.
SilasBerger 6c00d40
Fix z-index issue.
SilasBerger 4807a05
Cover scoring-but-no-scoring-hint edge case.
SilasBerger 9b1b104
Clean up feedback.
SilasBerger 007982d
Enforce header if there is scoring.
SilasBerger 94644bd
Cleanup.
SilasBerger f0fc07b
Work on documentation.
SilasBerger 047c8f3
Update docs.
SilasBerger d8468a7
Get rid of header-less questions.
SilasBerger 3a60831
Add imports to documentation examples.
SilasBerger d06b914
Make question controls more mobile friendly.
SilasBerger ac61ad7
Make points badge more mobile friendly.
SilasBerger 490c718
Make quiz controls and feedback more mobile friendly.
SilasBerger 3bfc2d1
Fix visual glitches in multiline options.
SilasBerger 4642c1a
Improve option alignment.
SilasBerger 511e385
Revert unnecessary change to ProgressState.
SilasBerger 3e58075
Cleanup.
SilasBerger 9732668
Cleanup.
SilasBerger 857a332
Remove obsolete feedback admonition.
SilasBerger 648ad33
Simplify feedback style computation.
SilasBerger 7bce9bf
Remove playground.
SilasBerger c58e04a
Merge branch 'main' into feature/choice-answer
SilasBerger a998cf0
Add installation docs.
SilasBerger 787992b
Fix hook usage.
SilasBerger 8681761
Merge branch 'main' into feature/choice-answer
lebalz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
110 changes: 110 additions & 0 deletions
110
tdev-website/docs/gallery/persistable-documents/answer/choice-answer/index.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| page_id: 08ac6803-b890-4608-9d4e-28f334addfb0 | ||
| tags: | ||
| - persistable | ||
| --- | ||
|
|
||
| import PermissionsPanel from "@tdev-components/PermissionsPanel" | ||
| import BrowserWindow from '@tdev-components/BrowserWindow'; | ||
|
|
||
| # Choice Answer | ||
| Choice-Antwort für Multiple-Choice, Single-Choice und Wahr/Falsch-Fragen. Geeignet für Aufgaben, Quizzes und Prüfungen. | ||
|
|
||
| ## Standalone-Fragen | ||
| Einfache Single- und Multiple-Choice-Fragen: | ||
|
|
||
| ```html | ||
| <ChoiceAnswer id="9c86f782-39bc-4a2d-bdb5-53a6dad884aa"> | ||
| Wir gilt als Erfinder des World Wide Web (WWW)? | ||
|
|
||
| <ChoiceAnswer.Option id="1">Steve Jobs</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="2" correct>Tim Berners-Lee</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="3">Ada Lovelace</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="4">Alain Berset</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="5">Charles Bartowski</ChoiceAnswer.Option> | ||
| </ChoiceAnswer> | ||
| ``` | ||
|
|
||
| Mithilfe der IDs können die Antwortmöglichkeiten eindeutig identifiziert werden. Dies erlaubt es, die Reihenfolge der Optionen zu ändern und z.B. Tippfehler zu korrigieren, ohne dass die Korrektheit der Antworten verloren geht. Die IDs sind **frei wählbar**: Es können z.B. UUIDs, laufende Nummern oder semantische Schlüssel verwendet werden. | ||
|
|
||
| ```html | ||
| <ChoiceAnswer id="7b97dd5d-d304-46db-823f-68237814fee5" multiple> | ||
| Welche der folgenden Aussagen zu Primzahlen sind korrekt? Es sind **mehrere** Antworten möglich. | ||
|
|
||
| <ChoiceAnswer.Option id="1" correct>2 ist die einzige gerade Primzahl.</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="2">Jede Primzahl ist ungerade.</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="3">1 ist eine Primzahl.</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="4" correct>5 ist eine Primzahl.</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="5" correct>Primzahlen sind nur durch 1 und sich selbst teilbar.</ChoiceAnswer.Option> | ||
| </ChoiceAnswer> | ||
| ``` | ||
|
|
||
| Für Wahr/Falsch-Fragen steht eine spezielle Komponente zur Verfügung: | ||
|
|
||
| ```html | ||
| <TrueFalseAnswer id="89c97b84-0d7a-4d58-8dc7-c8a72569a7e4"> | ||
| Die Erde ist flach. | ||
| </TrueFalseAnswer> | ||
| ``` | ||
|
|
||
| Mit der `randomize`-Property werden die Antwortmöglichkeiten in zufälliger Reihenfolge dargestellt. Zudem dürfen bei SC-Aufgaben auch mehrere Optionen korrekt sein. Wird eine davon ausgewählt, gilt die Antwort als richtig: | ||
|
|
||
| ```html | ||
| <ChoiceAnswer id="5f3a2c5a-0d39-4572-8245-5232a9066b9d" randomize> | ||
| Welche der folgenden Programmiersprachen sind statisch typisiert? **Hinweis:** Es kann mehr als eine Antwort korrekt sein. | ||
|
|
||
| <ChoiceAnswer.Option id="ts" correct>TypeScript</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="python">Python</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="js">JavaScript</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="java" correct>Java</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="ruby">Ruby</ChoiceAnswer.Option> | ||
| </ChoiceAnswer> | ||
| ``` | ||
|
|
||
| ## Fragegruppen | ||
| Bei Abschluss-Quizzes und Prüfungen werden in der Regel mehrere MC- und SC-Fragen zusammengefasst. Dies kann mit der `ChoiceAnswer.Group`-Komponente erreicht werden: | ||
|
|
||
| ```html | ||
| <ChoiceAnswer.Group> | ||
| <ChoiceAnswer id="c655526e-6cf4-46e6-990e-b4c63a4e96b7"> | ||
| In welchem Jahr war 2024? | ||
|
|
||
| <ChoiceAnswer.Option id="1965">1965</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="1983">1983</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="1991">1991</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="2000">2000</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="2024" correct>2024</ChoiceAnswer.Option> | ||
| </ChoiceAnswer> | ||
|
|
||
| <TrueFalseAnswer id="c4b45b05-c883-4fcb-97ff-f0b4b9e942b7"> | ||
| HTML ist eine Programmiersprache. | ||
| </TrueFalseAnswer> | ||
|
|
||
| <ChoiceAnswer id="ed234dee-60e6-457a-a3b2-7d7f8a642e6b" multiple> | ||
| Welche der folgenden Protokolle werden für die Übertragung von E-Mails verwendet? | ||
|
|
||
| <ChoiceAnswer.Option id="smtp" correct>SMTP</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="ftp">FTP</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="imap" correct>IMAP</ChoiceAnswer.Option> | ||
| <ChoiceAnswer.Option id="http">HTTP</ChoiceAnswer.Option> | ||
| </ChoiceAnswer> | ||
| </ChoiceAnswer.Group> | ||
| ``` | ||
|
|
||
| ## TODO | ||
| - Bei MC-Aufgaben sind Teilpunktzahlen möglich. | ||
| - TODO TODO: Standalone MC-Fragen müssten demnach auch nicht nur mit richtig und falsch, sondern mit "teilweise richtig" bewertet werden? | ||
| - Mehrere ChoiceAnswers können in einer ChoiceAnswerGroup zusammengefasst werden. | ||
| - Eine ChoiceAnswerGroup kann auf ein Karussell reduziert werden, um Platz zu sparen. | ||
| - Bei einer ChoiceAnswerGroup kann eine Gesamtpunktzahl definiert werden, die auf die einzelnen ChoiceAnswers aufgeteilt wird. | ||
| - Die Wertung der Antworten kann angepasst werden – es sind z.B. auch Negativpunkte möglich. Es kann zudem eingestellt werden, ob die Gruppe insgesamt weniger als 0 Punkte ergeben darf. | ||
| - Der Korrekturknopf einer ChoiceAnswerGroup kann versteckt oder mit einer Permission geschützt werden. | ||
| - Bei einer ChoiceAnswerGroup kann eingestellt werden, ob die Fragen in der vorgegebenen Reihenfolge oder zufällig angezeigt werden sollen. | ||
| - TODO TODO: | ||
| - Korrektur: Einzeln oder nur Punkte? | ||
| - Konzept eines "Durchgangs" (Versuch)? Versuch verwerfen und neu starten nach Korrektur? | ||
| - Soll eine CA / CA.Group automatische eine Aufgabe sein? Soll sie automatisch eine Checkbox erhalten? Soll diese automatisch aktiviert sein, wenn das Quiz fertig gelöst ist? Soll sie nur aktiviert sein, wenn alles korrekt gelöst wurde? Soll das alles eine Option sein? | ||
|
|
||
| ## Future Work | ||
| - Statt die korrekten Antworten direkt in der Komponente zu markieren, soll bei einer ChoiceAnswerGroup auch angegeben werden können, dass die Lösung extern abgespeichert ist. In diesem Fall verfügt die Gruppe über ein Upload-Feld, über welches das entsprechende Lösungs-File hochgeladen werden kann. Die Lösungen werden nach erfolgreichem Upload im LocalStore gespeichert, damit z.B. bei Prüfungen mehrere Schüler:innen korrigiert werden können. Für Admins steht zudem ein Download-Button bereit, mit dem sie ein Template für die Lösungen einer spezifischen Gruppe herunterladen können. | ||
| - Allgemeine Überlegung: Im Sinne einer Autokorrektur für Prüfungen soll die `ChoiceAnswer.Group` eine Funktion anbieten, die ein Lösungsdokument (z.B. als Teil eines Lösungsdokuments für die gesamte Prüfung) entgegennimmt und als Antwort eine Punktzahl und z.B. einen Report in Form `4 richtig | 1 falsch | 0 nicht beantwortet` zurückgibt. Dies könnte dann als Korrektur für diese Aufgabe in Korrektur-Document des entsprechenden Schülers eingetragen werden (während z.B. bei Textaufgaben eine manuelle Feedback- und Punkteeingabe durch die Lehrperson erfolgt). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coole Idee 👍 Würde ich gerne brauchen :)
Zum Verfassen und zur Darstellung als "normales" Markdown: wie wäre eine Syntax vergleichbar zum Step bzw. ProgressState? Die
idwürde obsolet, da die Reihenfolge dann bereits gegeben ist, randomisieren wäre immernoch möglich. Einzig die korrekten Antworten müssten noch speziell markiert werden, bspw. soUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it! One thing I would change though: The question should IMO be inside the
ChoiceAnswerblock (I know, it's not part of the answer…). This makes it easier to e.g. automatically add anaufgabeadmonition and a checkbox to aChoiceAnswer, select the individualChoiceAnswersin a group to arrange them into a carroussel, etc.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this would be really cool - but it's not that easy to create a robust behavior...
The approach of
ProgressStateis to expect a<ul>as a child and process it (https://github.com/GBSL-Informatik/teaching-dev/blob/main/src/components/documents/ProgressState/index.tsx) - with additional content that could be pre- or post<ul>, it could be hard to do it robust.Maybe you'd need to add a remark plugin could help? not sure what's the best approach...