Applied Branches
Claude Sonnet 4.5
๐ Skibidi Revision
Skibidi Revision is a mobile-friendly, themeable, browser-based revision quiz platform.
> skibidi-revision-readme.md (177 lines - 12 Nov 25)
# ๐ Skibidi Revision App (Post-Refactor โ ) A fun, AI-powered PHP quiz app designed to help students (like Bob!) revise throughout the day โ topic by topic, subject by subject โ in short bursts. ๐โจ **AUTHOR:** Abstract Warlock **CO-DEVELOPMENT:** Claude Sonnet 4.5 **DATE:** 12 November 2025 **LICENSE:** None --- ## ๐ Overview Skibidi Revision is a mobile-friendly, themeable, browser-based revision quiz platform. Built for daily learning motivation, powered by OpenAI for smart feedback, and backed by a clean MySQL structure. Now with **year-level filtering** and **secure password-based login**! You can: - Jump into any subject for a specific school year - Answer as many questions as you want - Get instant AI-marked feedback - Track progress live with beautifully styled UI --- ## โ Refactored Architecture (2025) - ๐ฅ Session-less quiz state (only player name stored) - ๐ **Password-based login** for existing users - ๐๏ธ **Year-level filtering** for questions and progress - ๐ All questions & answers from MySQL - ๐ก AI-scored answers with detailed feedback - ๐ DB-powered daily summary with progress bar - ๐จ Fully themed with Bootstrap 5 and emoji icons - ๐ Controllers handle logic โ Views handle UI --- ## ๐งฑ Core Features ### ๐ Daily Quiz Flow - Select a school year to filter subjects - Subjects shown as beautiful cards - Each click = new random question (never repeated today for the selected year/subject) - Submit answer โ see score + correct answer + AI explanation ### ๐ง Scoring - Answers scored by AI out of 5 - Score โฅ 3 = correct - Daily stats: correct %, points %, per-subject totals **(now year-specific)** ### ๐ฏ Clean Views - `menu`, `question`, `feedback`, `results` all share consistent layout and styling ### ๐ Themes - `Teacher`, `Dad`, and `Wife` โ can be toggled in UI - CSS loads via `styles.css?v=<?= time() ?>` for updates --- ## ๐๏ธ Data Model ### users | Field | Type | |--------------|-------------| | id | INT (PK) | | name | VARCHAR | | password_hash| VARCHAR | (for secure login) | created_at | TIMESTAMP | ### revision_questions | Field | Type | |-------------|-------------| | id | INT (PK) | | subject | VARCHAR | | topic | VARCHAR | | year | INT | (school year level) | question | TEXT | | answer | TEXT | | type | VARCHAR | | options | JSON (nullable) | | created_at | TIMESTAMP | ### daily_answers | Field | Type | |--------------|-------------| | id | INT (PK) | | user_id | INT (FK) | | date | DATE | | subject | VARCHAR | | question_id | INT (FK) | | user_answer | TEXT | | ai_score | INT | | ai_feedback | TEXT | | created_at | TIMESTAMP | --- ## ๐ง AI Answer Logic OpenAI (gpt-4.1-mini) evaluates each answer: - Uses fixed prompt logic (do not alter the scoring prompt) - Types: `factual_recall`, `multiple_choice`, `explanation`, etc. - AI returns: - `score` (0โ5) - `isCorrect` - `aiExplanation` --- ## ๐ฅ๏ธ Project Structure ``` / โโโ index.php # Front controller โโโ config.php # DB + OpenAI config โโโ functions.php # Utilities + score summary โโโ openai.php # AI scoring โโโ controllers/ โ โโโ login_controller.php โ โโโ quiz_controller.php โ โโโ answer_controller.php โ โโโ theme_controller.php โ โโโ menu_controller.php โโโ views/ โ โโโ partials/ โ โ โโโ header.php โ โ โโโ footer.php โ โ โโโ progress.php โ โโโ login_prompt.php โ โโโ menu.php โ โโโ question.php โ โโโ feedback.php โ โโโ results.php โโโ data/ # Migration input JSONs (optional) ``` --- ## ๐ Setup 1. Clone repo and upload to PHP server 2. Import the DB schema (see `/sql/` or refactor docs) and **ensure you've added the `year` column to `revision_questions` and `password_hash` to `users`**. 3. **Populate the `year` column** in your `revision_questions` table for all relevant questions. 4. Add OpenAI key to `config.php` 5. Ensure `SESSION` and `PDO` are enabled 6. Visit `index.php` and enter your name. **The first time you log in, you will be prompted to set a password.** --- ## ๐ TODO These are polish/future ideas you may want to add soon: - [ ] Refactor `results.php` into full `results_controller.php` - [ ] views/menu.php needs slight width/style tweeks - [ ] Highlight current subject icon in header - [ ] Merge daily progress bar into header across all pages - [ ] Leaderboard (daily/weekly) - [ ] Optional: Smooth transition animations (between views) - [ ] Optional: Per-topic completion tracking - [ ] Optional: Full admin question editor - [ ] Optional: Theme "Dad Mode" and "Wife Mode" CSS final polish --- ## ๐ฌ Credits Built with โค๏ธ for Bob โ by his team of nerdy, helpful, fun-grown-upsโข. If you're reading this and thinking "wow this is actually solid" โ we agree. Want a print version? ๐ซก Weโll turn it into a book called *"Refactor Wars: The Session Menace."* ---