@olenbetong/synergi-course 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/document/cues.d.ts +1 -1
- package/es/document/cues.js +3 -1
- package/es/document/effects.d.ts +3 -3
- package/es/document/effects.js +3 -1
- package/es/document/schema.d.ts +1778 -190
- package/es/document/schema.js +35 -2
- package/es/document/validate.js +14 -18
- package/es/index.d.ts +3 -2
- package/es/index.js +1 -1
- package/es/player/CoursePlayer.css +18 -0
- package/es/player/CoursePlayer.js +3 -2
- package/es/player/PlayerBars.d.ts +32 -0
- package/es/player/PlayerBars.js +14 -0
- package/es/steps/Blocks.d.ts +24 -3
- package/es/steps/Blocks.js +14 -7
- package/es/steps/Markdown.js +1 -1
- package/es/steps/QuizStepView.d.ts +2 -1
- package/es/steps/QuizStepView.js +20 -10
- package/es/steps/SlideStepView.d.ts +1 -1
- package/es/steps/SlideStepView.js +14 -4
- package/es/steps/StepBodyProps.d.ts +9 -0
- package/es/steps/StepView.css +65 -7
- package/es/steps/StepView.d.ts +29 -3
- package/es/steps/StepView.js +21 -5
- package/es/types.d.ts +13 -2
- package/package.json +1 -1
- package/src/document/box.test.ts +234 -0
- package/src/document/cues.ts +2 -1
- package/src/document/effects.ts +4 -3
- package/src/document/schema.ts +44 -2
- package/src/document/validate.ts +15 -19
- package/src/index.ts +11 -1
- package/src/player/CoursePlayer.css +18 -0
- package/src/player/CoursePlayer.tsx +38 -58
- package/src/player/PlayerBars.tsx +106 -0
- package/src/steps/Blocks.tsx +55 -8
- package/src/steps/Box.test.tsx +95 -0
- package/src/steps/Markdown.test.tsx +3 -0
- package/src/steps/Markdown.tsx +1 -1
- package/src/steps/QuizStepView.test.tsx +79 -0
- package/src/steps/QuizStepView.tsx +34 -12
- package/src/steps/SlideStepView.tsx +15 -3
- package/src/steps/StepBodyProps.ts +9 -0
- package/src/steps/StepView.css +65 -7
- package/src/steps/StepView.test.tsx +116 -0
- package/src/steps/StepView.tsx +100 -19
- package/src/types.ts +13 -2
package/src/types.ts
CHANGED
|
@@ -70,7 +70,10 @@ export interface QuizQuestion {
|
|
|
70
70
|
text: string;
|
|
71
71
|
/** Several options may be right: shown as checkboxes instead of radio buttons. */
|
|
72
72
|
multiple: boolean;
|
|
73
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* Already answered in this attempt. Set when an open attempt is resumed; the quiz continues at the first question
|
|
75
|
+
* without it. With `retryUntilCorrect`, only a correct answer counts, so a question last answered wrong is asked again.
|
|
76
|
+
*/
|
|
74
77
|
answered?: boolean;
|
|
75
78
|
options: QuizOption[];
|
|
76
79
|
}
|
|
@@ -79,6 +82,11 @@ export interface QuizAttempt {
|
|
|
79
82
|
attemptId: string;
|
|
80
83
|
/** Percent of correct answers needed to pass. `null` means every answer must be correct. */
|
|
81
84
|
passPercent: number | null;
|
|
85
|
+
/**
|
|
86
|
+
* Each question must be answered correctly before the next one: a wrong answer only says so, and the learner
|
|
87
|
+
* answers the same question again. The attempt passes once every question is right; `passPercent` is not used.
|
|
88
|
+
*/
|
|
89
|
+
retryUntilCorrect?: boolean;
|
|
82
90
|
questions: QuizQuestion[];
|
|
83
91
|
/** The learner has passed this quiz before; the player shows it as passed without asking again. */
|
|
84
92
|
alreadyPassed?: boolean;
|
|
@@ -86,7 +94,8 @@ export interface QuizAttempt {
|
|
|
86
94
|
|
|
87
95
|
export interface QuizAnswerResult {
|
|
88
96
|
correct: boolean;
|
|
89
|
-
|
|
97
|
+
/** Left out after a wrong answer when the quiz has `retryUntilCorrect`; the player then never shows one. */
|
|
98
|
+
explanation?: string | null;
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
export interface QuizResult {
|
|
@@ -95,6 +104,8 @@ export interface QuizResult {
|
|
|
95
104
|
correctCount: number;
|
|
96
105
|
questionCount: number;
|
|
97
106
|
passPercent: number | null;
|
|
107
|
+
/** The quiz had to be answered correctly question by question, so a passed attempt is every question right. */
|
|
108
|
+
retryUntilCorrect?: boolean;
|
|
98
109
|
/** The ids of the must-be-correct questions that were answered wrong. */
|
|
99
110
|
missedRequired: string[];
|
|
100
111
|
}
|