fix: conjugation quiz grading, zh-TW localization, and docker tag export mismatch #67
Open
ganesh-rajput-07 wants to merge 1 commit into
Open
fix: conjugation quiz grading, zh-TW localization, and docker tag export mismatch #67ganesh-rajput-07 wants to merge 1 commit into
ganesh-rajput-07 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. Fix Conjugation & Writing Mode Grading
Issue
Correct answers in verb conjugation quizzes (e.g.
ich trinke) and writing/spelling exercises were being incorrectly marked as Wrong, causing user progress to decrease despite submitting the correct answer.Root Cause
The grading logic in
/api/quiz/answer(implemented in both:src/routes/api.jspublic/js/offline-db.js) only compared submitted answers against the word's:
translationdisplayfields.
The existing
expectedAnswervalue sent by the client—which contains the actual conjugated or written answer expected for the exercise—was not considered during validation.Fix
Updated both the online API route and the offline IndexedDB interceptor to validate answers against
expectedAnswerin addition to the existing accepted values.2. Fix Traditional Chinese (
zh-TW) Localization LoadingIssue
Selecting Traditional Chinese (
zh-TW) caused the application to either:zh) instead, orRoot Cause
A. Locale Subtags Were Stripped
The client-side locale loader used:
which transformed:
before attempting to fetch translation resources.
B. Case-Sensitive Filename Mismatch
Locale requests were normalized to lowercase by the server:
while the translation file was stored as:
This caused lookup failures on case-sensitive filesystems such as Linux and Docker environments.
Fix
Renamed:
to:
Updated
public/js/i18n.jsto preserve locale subtags rather than stripping them.Simplified
setUiLang()to delegate locale loading directly throughloadLocale().Standardized locale references from
zh-TWtozh-twin:public/js/offline.jspublic/js/world-languages.jsThis ensures consistent locale matching, caching, and filesystem resolution across all environments.
3. Fix Docker Archive Export Tag Mismatch
Issue
The deployment instructions generated by
build-and-export.shinstructed users to run:However, only the versioned image tag was created and exported:
For example:
As a result, first-time deployments using the provided instructions failed.
Fix
Updated
build-and-export.shto:Build both image tags:
Export both tags when creating the archive.
This ensures that deployment instructions reference an image tag that actually exists in the exported package.
Verification
Quiz Grading
expectedAnsweris evaluated correctly during answer validation.Localization
zh-tw.jsonresolves correctly through lowercase locale routes.Docker Export
latesttags are created during build.Summary
This PR:
zh-tw) translations.latestimage tags.