@schoolio/player 1.2.1 → 1.3.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/dist/index.d.mts CHANGED
@@ -59,6 +59,10 @@ interface ExternalQuizAttempt {
59
59
  completedAt?: string;
60
60
  timeSpentSeconds?: number;
61
61
  }
62
+ interface GenerateMoreQuestionsResult {
63
+ extraQuestions: QuizQuestion[];
64
+ questionsGenerated: number;
65
+ }
62
66
  interface QuizPlayerProps {
63
67
  quizId: string;
64
68
  lessonId: string;
@@ -71,6 +75,7 @@ interface QuizPlayerProps {
71
75
  onComplete?: (result: QuizResult) => void;
72
76
  onError?: (error: Error) => void;
73
77
  onProgress?: (progress: QuizProgress) => void;
78
+ onGenerateMoreQuestions?: (attemptId: string, currentTotal: number) => Promise<GenerateMoreQuestionsResult>;
74
79
  className?: string;
75
80
  styles?: QuizPlayerStyles;
76
81
  }
@@ -104,7 +109,7 @@ interface AttemptViewerProps {
104
109
  title?: string;
105
110
  }
106
111
 
107
- declare function QuizPlayer({ quizId, lessonId, assignLessonId, courseId, childId, parentId, apiBaseUrl, authToken, onComplete, onError, onProgress, className, }: QuizPlayerProps): react_jsx_runtime.JSX.Element;
112
+ declare function QuizPlayer({ quizId, lessonId, assignLessonId, courseId, childId, parentId, apiBaseUrl, authToken, onComplete, onError, onProgress, onGenerateMoreQuestions, className, }: QuizPlayerProps): react_jsx_runtime.JSX.Element;
108
113
 
109
114
  declare function AttemptViewer({ attemptId, apiBaseUrl, authToken, onError, className, showExplanations, title, }: AttemptViewerProps): react_jsx_runtime.JSX.Element;
110
115
 
@@ -154,4 +159,4 @@ declare function calculateScore(answers: QuizAnswerDetail[]): {
154
159
  };
155
160
  declare function formatTime(seconds: number): string;
156
161
 
157
- export { type ApiClientConfig, type AttemptStatus, AttemptViewer, type AttemptViewerProps, type ExternalQuizAttempt, type QuestionType, type Quiz, type QuizAnswerDetail, QuizApiClient, QuizPlayer, type QuizPlayerProps, type QuizPlayerStyles, type QuizProgress, type QuizQuestion, type QuizResult, calculateScore, checkAnswer, createAnswerDetail, formatTime };
162
+ export { type ApiClientConfig, type AttemptStatus, AttemptViewer, type AttemptViewerProps, type ExternalQuizAttempt, type GenerateMoreQuestionsResult, type QuestionType, type Quiz, type QuizAnswerDetail, QuizApiClient, QuizPlayer, type QuizPlayerProps, type QuizPlayerStyles, type QuizProgress, type QuizQuestion, type QuizResult, calculateScore, checkAnswer, createAnswerDetail, formatTime };
package/dist/index.d.ts CHANGED
@@ -59,6 +59,10 @@ interface ExternalQuizAttempt {
59
59
  completedAt?: string;
60
60
  timeSpentSeconds?: number;
61
61
  }
62
+ interface GenerateMoreQuestionsResult {
63
+ extraQuestions: QuizQuestion[];
64
+ questionsGenerated: number;
65
+ }
62
66
  interface QuizPlayerProps {
63
67
  quizId: string;
64
68
  lessonId: string;
@@ -71,6 +75,7 @@ interface QuizPlayerProps {
71
75
  onComplete?: (result: QuizResult) => void;
72
76
  onError?: (error: Error) => void;
73
77
  onProgress?: (progress: QuizProgress) => void;
78
+ onGenerateMoreQuestions?: (attemptId: string, currentTotal: number) => Promise<GenerateMoreQuestionsResult>;
74
79
  className?: string;
75
80
  styles?: QuizPlayerStyles;
76
81
  }
@@ -104,7 +109,7 @@ interface AttemptViewerProps {
104
109
  title?: string;
105
110
  }
106
111
 
107
- declare function QuizPlayer({ quizId, lessonId, assignLessonId, courseId, childId, parentId, apiBaseUrl, authToken, onComplete, onError, onProgress, className, }: QuizPlayerProps): react_jsx_runtime.JSX.Element;
112
+ declare function QuizPlayer({ quizId, lessonId, assignLessonId, courseId, childId, parentId, apiBaseUrl, authToken, onComplete, onError, onProgress, onGenerateMoreQuestions, className, }: QuizPlayerProps): react_jsx_runtime.JSX.Element;
108
113
 
109
114
  declare function AttemptViewer({ attemptId, apiBaseUrl, authToken, onError, className, showExplanations, title, }: AttemptViewerProps): react_jsx_runtime.JSX.Element;
110
115
 
@@ -154,4 +159,4 @@ declare function calculateScore(answers: QuizAnswerDetail[]): {
154
159
  };
155
160
  declare function formatTime(seconds: number): string;
156
161
 
157
- export { type ApiClientConfig, type AttemptStatus, AttemptViewer, type AttemptViewerProps, type ExternalQuizAttempt, type QuestionType, type Quiz, type QuizAnswerDetail, QuizApiClient, QuizPlayer, type QuizPlayerProps, type QuizPlayerStyles, type QuizProgress, type QuizQuestion, type QuizResult, calculateScore, checkAnswer, createAnswerDetail, formatTime };
162
+ export { type ApiClientConfig, type AttemptStatus, AttemptViewer, type AttemptViewerProps, type ExternalQuizAttempt, type GenerateMoreQuestionsResult, type QuestionType, type Quiz, type QuizAnswerDetail, QuizApiClient, QuizPlayer, type QuizPlayerProps, type QuizPlayerStyles, type QuizProgress, type QuizQuestion, type QuizResult, calculateScore, checkAnswer, createAnswerDetail, formatTime };