From b19208cae3b45cc4c589b17eb8f7bb76cc087742 Mon Sep 17 00:00:00 2001 From: Mateo Date: Wed, 15 Jul 2026 05:32:34 -0500 Subject: [PATCH 1/2] No Spam Click --- app/pages/reader/forms.vue | 75 +++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/app/pages/reader/forms.vue b/app/pages/reader/forms.vue index 055f781..758872b 100644 --- a/app/pages/reader/forms.vue +++ b/app/pages/reader/forms.vue @@ -104,11 +104,20 @@ function triggerTicketClick() { // Flow state const activeForm = ref(null) +const selectedClass = ref(null) const preFormStep = ref(null) // 'ask' | 'has-book' | 'no-book' | null const hasOwnBook = ref(false) const currentComponentID = ref(0) const answers = ref>({}) const feedbackVisible = ref>({}) +const showJoinClassroomModal = ref(false) +const roomCode = ref('') + +function joinClassroom() { + // Mock function + showJoinClassroomModal.value = false + roomCode.value = '' +} const isCurrentComponentCorrect = computed(() => { const q = currentComponent.value @@ -169,16 +178,39 @@ function checkAnswer() { if (q) feedbackVisible.value[q.id] = true } +const isProcessingNext = ref(false) + function nextStep() { + if (isProcessingNext.value) return + isProcessingNext.value = true + const qs = currentFormComponents.value + const q = qs[currentComponentID.value] + + if (q && ['text', 'mcq'].includes(q.questionType)) { + const ans = answers.value[q.id] + if (ans === undefined || ans === null || String(ans).trim() === '') { + isProcessingNext.value = false + return + } + } + if (currentComponentID.value < qs.length - 1) { currentComponentID.value++ } else { submitChallenge() } + + setTimeout(() => { + isProcessingNext.value = false + }, 100) } +const isSubmitting = ref(false) + async function submitChallenge() { + if (isSubmitting.value) return + isSubmitting.value = true const formId = activeForm.value.id // Persist completion and XP @@ -197,6 +229,7 @@ async function submitChallenge() { currentComponentID.value = 0 feedbackVisible.value = {} answers.value = {} + isSubmitting.value = false }, 500) } @@ -235,6 +268,9 @@ function getBadgeClass(type: string) { ReadingHuddle Reading Buddy +
@@ -280,8 +316,19 @@ function getBadgeClass(type: string) {

Daily Forms 📝

+ +
+ + +
+ -
+
+
+ + +
+
+
+

Join a Classroom

+

Enter the room code provided by your teacher to join their class.

+ +
+ + +
+
+
+ +
From 54e47e6e914b8743afa0d1593534305dba0e8d40 Mon Sep 17 00:00:00 2001 From: Mateo Date: Wed, 22 Jul 2026 08:17:50 -0500 Subject: [PATCH 2/2] Remove prototype UI changes --- app/pages/reader/forms.vue | 52 +------------------------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/app/pages/reader/forms.vue b/app/pages/reader/forms.vue index 758872b..df0930e 100644 --- a/app/pages/reader/forms.vue +++ b/app/pages/reader/forms.vue @@ -104,21 +104,11 @@ function triggerTicketClick() { // Flow state const activeForm = ref(null) -const selectedClass = ref(null) const preFormStep = ref(null) // 'ask' | 'has-book' | 'no-book' | null const hasOwnBook = ref(false) const currentComponentID = ref(0) const answers = ref>({}) const feedbackVisible = ref>({}) -const showJoinClassroomModal = ref(false) -const roomCode = ref('') - -function joinClassroom() { - // Mock function - showJoinClassroomModal.value = false - roomCode.value = '' -} - const isCurrentComponentCorrect = computed(() => { const q = currentComponent.value if (!q || !answers.value[q.id]) return true @@ -268,9 +258,6 @@ function getBadgeClass(type: string) { ReadingHuddle Reading Buddy
-
@@ -316,19 +303,8 @@ function getBadgeClass(type: string) {

Daily Forms 📝

- -
- - -
- -
- +
- - -
-
-
-

Join a Classroom

-

Enter the room code provided by your teacher to join their class.

- -
- - -
-
-
- -