Skip to content

Fix: fixed math quiz giving invalid options in some questions#443

Merged
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
ash-heinz:fix/Math-Quiz-has-Invalid-Options
May 19, 2026
Merged

Fix: fixed math quiz giving invalid options in some questions#443
steam-bell-92 merged 1 commit into
steam-bell-92:mainfrom
ash-heinz:fix/Math-Quiz-has-Invalid-Options

Conversation

@ash-heinz
Copy link
Copy Markdown
Contributor

@ash-heinz ash-heinz commented May 19, 2026

I made it so that the options for the prime number question is fixed rather than generating random numbers

📝 Description

  • Added fixedOptions: when a question type has a known, constrained set of valid answers (e.g. prime uses only 1 or 2) we attach the exact options here so showQuestion() skips generateOptions() which would produce arbitrary nearby numbers that are meaningless for the question being asked.
  • the only valid answers are 1 (yes) or 2 (no). using generateOptions() in the case of prime numbers would fill the remaining 2 slots with random nearby integers (e.g. 13, 11, 3) that are irrelevant and confusing as was shown in the issue.

🔗 Linked Issue

Closes #354


📋 Contribution Checklist

  • My code strictly adheres to the project guidelines (Standard library only, procedural code, clean spacing).
  • I have tested my changes thoroughly on my local machine.
  • GSSoC 2026: I have been formally assigned to this issue and noted it above.

I made it so that the options for the prime number question is fixed rather than generating random numbers
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

@ash-heinz is attempting to deploy a commit to the Anuj's projects Team on Vercel.

A member of the Team first needs to authorize it.

@steam-bell-92 steam-bell-92 merged commit 8e8fd26 into steam-bell-92:main May 19, 2026
6 of 7 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Thank you for your contribution!

Your Pull Request has been merged successfully.

We appreciate the time and effort you put into improving this project. Contributions like yours help the repository grow and stay useful for everyone.

If you'd like to contribute again, please check the open issues and make sure you are assigned before opening another Pull Request.

Thanks again for your support! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Math Quiz has Invalid Options

2 participants