feat: implement core e-learning classroom functionality including login, lesson viewing, and quiz pages.
This commit is contained in:
parent
0641b2547a
commit
8e57cb124a
3 changed files with 21 additions and 23 deletions
|
|
@ -15,7 +15,7 @@ const { t } = useI18n()
|
|||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const $q = useQuasar()
|
||||
const { fetchCourseLearningInfo, fetchLessonContent, submitQuiz: apiSubmitQuiz } = useCourse()
|
||||
const { fetchCourseLearningInfo, fetchLessonContent, submitQuiz: apiSubmitQuiz, markLessonComplete } = useCourse()
|
||||
|
||||
// State Management
|
||||
const currentScreen = ref<'start' | 'taking' | 'result' | 'review'>('start')
|
||||
|
|
@ -185,6 +185,13 @@ const submitQuiz = async (auto = false) => {
|
|||
|
||||
if (res.success) {
|
||||
quizResult.value = res.data
|
||||
|
||||
// Force mark lesson complete if passed (Fix for checkmark issue)
|
||||
if (res.data.is_passed) {
|
||||
markLessonComplete(courseId, lessonId).then(() => {
|
||||
console.log('Explicitly marked lesson complete')
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// Fallback error handling
|
||||
alert(res.error || 'Failed to submit quiz')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue