How aarahman04/new_loyal_quiz works
Purpose and delivery model
Loyal’s MCQ is a static, browser-run learning site for KG-3 and Class 1 practice in Math, English, Science, and GK. It has no backend, database, package runtime, or build step; HTML pages, CSS, and ES6 browser JavaScript are deployed to any HTTP static host, including GitHub Pages. Primary entry point: index.html.
Learner navigation tree
Navigation is an explicit hierarchy of linked static pages: home → level/subject → subject topics → individual exercise. Key routing layers are start-page/subject_level1.html, start-page2/Level 1/Level1_math_options.html, and start-page3/Level1_english/level1_eng_identify_options.html. Exercise pages are terminal content-and-runtime units, not dynamically routed application views.
Shared page chrome and path boundary
All pages reserve header/footer placeholders; js/partials.js injects shared UI, favicon references, and footer icon dependencies. It derives the site root from its own script URL, insulating deeply nested exercise pages from relative-path depth. partials/header.html and partials/footer.html are reference markup, while runtime injection is owned by js/partials.js. HTTP serving is required for this shared-resource behavior.
Quiz engines
Four client-side interaction engines operate against page-embedded question banks:
• Standard MCQ lifecycle—random selection, answer evaluation, feedback/explanations, score, and emoji effects—is in js/script.js, used heavily by question/Level 1 Maths/ and question/level_1_GK/.
• Picture/count selection is in js/tap_select.js, used by KG-3 exercises such as question/KG-3_math/kg3_math_tap_and_count.html.
• English manipulation exercises use js/drag_and_drop.js, with examples under question/level-1/English/level1_eng_drag_&_drop/.
• Listen-and-choose uses browser Web Speech APIs through js/audio.js.
Exercise content contract
Each exercise is a standalone HTML file containing its question data and selecting its engine at page load. MCQ pages expose questions and invoke initMCQQuiz; tap-select pages invoke initTapSelectQuiz. Engines copy/shuffle the source bank and present 25 questions from a typical 100-question bank, preserving the embedded array for repeat attempts. The shared quiz DOM contract and shell styling center on css/question.css; interaction-specific layers are css/dnd.css and css/tap_select.css.
Content domains and assets
Question-bank ownership follows subject folders: question/Level 1 Maths/, question/level-1/English/, question/level-1_Science/, and question/level_1_GK/. Visual prompts and local fonts are supplied from image/, while global presentation is split between css/index.css for navigation/shared UI and quiz-format stylesheets. Google Fonts and Bootstrap Icons are external browser-loaded UI services; audio depends on the browser’s speech implementation.
Generation and hosting
gen_questions.py and gen_gk.py are optional offline Python generators for math/GK question-bank content, outside the production site runtime. Deployment infrastructure is static-host oriented, with GitHub workflow configuration at .github/workflows/static.yml; local development can use Python’s HTTP server.
Main entry points: subject_level1.html Level and subject · question.css Quiz styles · index.html Home · Level1_math_options.html Math topic menu
Components 18
Static delivery
Browser-served files with no application backend.
- Static HTTP host · Serves the site files; HTTP is required for shared-resource loading.
Navigation
Linked static-page hierarchy.
- Home
index.html - Level and subject
start-page/subject_level1.html - Math topic menu
start-page2/Level 1/Level1_math_options.html - English exercise menu
start-page3/Level1_english/level1_eng_identify_options.html
Shared chrome
Runtime-injected page shell and shared styling.
- Chrome injector · Derives the site root from its script URL and injects shared UI.
js/partials.js - Header and footer markup · Reference markup for the injected page chrome.
partials/header.html - Navigation styles
css/index.css
Quiz runtime
Page-selected browser interaction engines.
- Standard MCQ engine · Shuffles a copied bank, runs 25 questions, scores, and shows feedback.
js/script.js - Tap-select engine
js/tap_select.js - Drag-and-drop engine
js/drag_and_drop.js - Listen-and-choose · Uses browser Web Speech APIs.
js/audio.js - Quiz styles · Shared shell plus tap-select and drag-and-drop layers.
css/question.css
Exercise content
Standalone pages with embedded question banks.
- Exercise pages · Embed question arrays and select an engine at page load.
- Subject question banks · Math, English, Science, and GK exercise ownership.
- Images and fonts
Offline tooling
Optional content generation and static deployment.
- Question generators · Optional offline math and GK content generation.
gen_questions.py - GitHub Pages workflow
.github/workflows/static.yml
Connections 20
- Static HTTP host → Home: serves
- Home → Level and subject: links
- Level and subject → Math topic menu: links
- Level and subject → English exercise menu: links
- Math topic menu → Exercise pages: links to exercises
- English exercise menu → Exercise pages: links to exercises
- Exercise pages → Subject question banks: organized under
- Exercise pages → Chrome injector: loads
- Chrome injector → Header and footer markup: injects chrome from
- Exercise pages → Navigation styles: uses
- Exercise pages → Images and fonts: uses prompts and fonts
- Exercise pages → Standard MCQ engine: initializes MCQ
- Exercise pages → Tap-select engine: initializes tap-select
- Exercise pages → Drag-and-drop engine: initializes drag-and-drop
- Exercise pages → Listen-and-choose: enables listening
- Standard MCQ engine → Quiz styles: uses
- Tap-select engine → Quiz styles: uses
- Drag-and-drop engine → Quiz styles: uses
- Question generators → Subject question banks: generates optional content for
- GitHub Pages workflow → Static HTTP host: deploys to