@sage-rsc/talking-head-react 1.0.68 → 1.0.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-rsc/talking-head-react",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "A reusable React component for 3D talking avatars with lip-sync and text-to-speech",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -689,6 +689,10 @@ const CurriculumLearning = forwardRef(({
689
689
  const currentLesson = getCurrentLesson();
690
690
  const totalQuestionsInLesson = currentLesson?.questions?.length || 0;
691
691
  const isLastQuestion = stateRef.current.currentQuestionIndex >= totalQuestionsInLesson - 1;
692
+ const hasNextQuestion = stateRef.current.currentQuestionIndex < totalQuestionsInLesson - 1;
693
+
694
+ // Debug logging
695
+ console.log('[CurriculumLearning] Answer feedback - questionIndex:', stateRef.current.currentQuestionIndex, 'totalQuestions:', totalQuestionsInLesson, 'hasNextQuestion:', hasNextQuestion);
692
696
 
693
697
  const successMessage = currentQuestion.type === "code_test"
694
698
  ? `Great job! Your code passed all the tests! ${currentQuestion.explanation || ''}`
@@ -707,7 +711,7 @@ const CurriculumLearning = forwardRef(({
707
711
  lessonIndex: stateRef.current.currentLessonIndex,
708
712
  questionIndex: stateRef.current.currentQuestionIndex,
709
713
  isCorrect: true,
710
- hasNextQuestion: stateRef.current.currentQuestionIndex < totalQuestionsInLesson - 1,
714
+ hasNextQuestion: hasNextQuestion,
711
715
  score: stateRef.current.score,
712
716
  totalQuestions: stateRef.current.totalQuestions
713
717
  });
@@ -728,6 +732,10 @@ const CurriculumLearning = forwardRef(({
728
732
  const currentLesson = getCurrentLesson();
729
733
  const totalQuestionsInLesson = currentLesson?.questions?.length || 0;
730
734
  const isLastQuestion = stateRef.current.currentQuestionIndex >= totalQuestionsInLesson - 1;
735
+ const hasNextQuestion = stateRef.current.currentQuestionIndex < totalQuestionsInLesson - 1;
736
+
737
+ // Debug logging
738
+ console.log('[CurriculumLearning] Answer feedback (incorrect) - questionIndex:', stateRef.current.currentQuestionIndex, 'totalQuestions:', totalQuestionsInLesson, 'hasNextQuestion:', hasNextQuestion);
731
739
 
732
740
  const failureMessage = currentQuestion.type === "code_test"
733
741
  ? `Your code didn't pass all the tests. ${currentQuestion.explanation || 'Try again!'}`
@@ -746,7 +754,7 @@ const CurriculumLearning = forwardRef(({
746
754
  lessonIndex: stateRef.current.currentLessonIndex,
747
755
  questionIndex: stateRef.current.currentQuestionIndex,
748
756
  isCorrect: false,
749
- hasNextQuestion: stateRef.current.currentQuestionIndex < totalQuestionsInLesson - 1,
757
+ hasNextQuestion: hasNextQuestion,
750
758
  score: stateRef.current.score,
751
759
  totalQuestions: stateRef.current.totalQuestions
752
760
  });