Skip to content

add full quiz histrory with show more/show less functionality#649

Open
Vrushti07 wants to merge 2 commits into
AOSSIE-Org:mainfrom
Vrushti07:feature/show-all-quizzes
Open

add full quiz histrory with show more/show less functionality#649
Vrushti07 wants to merge 2 commits into
AOSSIE-Org:mainfrom
Vrushti07:feature/show-all-quizzes

Conversation

@Vrushti07
Copy link
Copy Markdown

@Vrushti07 Vrushti07 commented Mar 30, 2026

Addressed Issues:

Fixes #641

Improves the quiz dashboard history to display all generated quizzes instead of only last 5 and adds a show more/show less option to view full history.

How It Solves the Issue:

  • Replaced the limited storage approach with allQuizzes to persist all generated quizzes in localStorage.
  • Added a "Show More / Show Less" toggle in the Quiz Dashboard:
  • Displays only the latest 5 quizzes initially for a clean UI
  • Allows users to expand and view the complete quiz history when needed

This ensures no quiz data is lost while maintaining a user-friendly interface.

Screenshots/Recordings:

Before :

5.questions.only.mp4

After :

Show.More.quiz.mp4

Summary by CodeRabbit

  • New Features
    • Quiz history now stores and displays all previous quizzes instead of limiting to the last 5.
    • Added "Show More" and "Show Less" buttons to toggle between the first 5 items and the complete history (Show More appears only when >5).
    • Quiz history persists across sessions for better tracking of past work.
    • Clear action removes the entire quiz history and resets the view.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b9677f89-0d70-470c-b6d6-c823ec800087

📥 Commits

Reviewing files that changed from the base of the PR and between 0004647 and 6bce553.

📒 Files selected for processing (1)
  • eduaid_web/src/pages/Previous.jsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • eduaid_web/src/pages/Previous.jsx

📝 Walkthrough

Walkthrough

Persisted all generated quizzes to localStorage key allQuizzes and updated the history UI to default to the latest 5 quizzes with a toggleable "Show More / Show Less" to reveal the full stored list; clearing removes allQuizzes.

Changes

Cohort / File(s) Summary
Quiz Persistence
eduaid_web/src/pages/Text_Input.jsx
Save new quiz by prepending to allQuizzes in localStorage (store full history), then navigate to /output. Removed prior bounded last5Quizzes push/shift logic.
History UI & Controls
eduaid_web/src/pages/Previous.jsx
Read from allQuizzes; added showAll state and displayedQuizzes derived array (first 5 by default). Render list from displayedQuizzes. Added conditional "Show More" (if >5 and not shown) and "Show Less" (when shown). Clear action removes allQuizzes and resets showAll.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Text_Input
    participant LocalStorage as Storage
    participant Router
    participant Previous

    User->>Text_Input: submit quiz details
    Text_Input->>Storage: read `allQuizzes`
    Text_Input->>Storage: write updated `allQuizzes` (prepend new)
    Text_Input->>Router: navigate to /output
    User->>Previous: open history page
    Previous->>Storage: read `allQuizzes`
    Previous->>Previous: derive `displayedQuizzes` (first 5 or all if showAll)
    alt more than 5 and showAll=false
        Previous->>User: render "Show More" button
    else showAll=true
        Previous->>User: render full list and "Show Less" button
    end
    User->>Previous: click Clear
    Previous->>Storage: remove `allQuizzes`
    Previous->>Previous: set showAll = false
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through storage, a trail of quizzes bright,

Prepending each memory by soft moonlight,
Five at a time or the whole meadow's view,
Show More to wander, Show Less to renew,
A rabbit's small cheer for history made true.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'add full quiz histrory with show more/show less functionality' directly describes the main changes: storing all quiz history and adding toggle UI controls.
Linked Issues check ✅ Passed The PR successfully implements all coding objectives from issue #641: stores all quizzes in localStorage, adds Show More/Show Less toggle, and displays first 5 quizzes by default with full history on demand.
Out of Scope Changes check ✅ Passed All changes are directly aligned with issue #641 requirements: modifications to Previous.jsx and Text_Input.jsx focus solely on quiz history storage and UI toggle functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@eduaid_web/src/pages/Previous.jsx`:
- Around line 27-30: The handleClearQuizzes function currently removes
"allQuizzes" and clears setQuizzes but doesn't reset the showAll toggle; update
handleClearQuizzes to also call setShowAll(false) so the Show More/Show Less UI
is reset when quizzes are cleared (refer to handleClearQuizzes and the
showAll/setShowAll state variables).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e4ceb149-c2d6-4712-9c7b-5a8189439a54

📥 Commits

Reviewing files that changed from the base of the PR and between 2038116 and 0004647.

📒 Files selected for processing (2)
  • eduaid_web/src/pages/Previous.jsx
  • eduaid_web/src/pages/Text_Input.jsx

Comment thread eduaid_web/src/pages/Previous.jsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Ability to view all the past quizess instead of just recent 5

1 participant