Skip to content

feat: limit discrete questions to 50 options max#4336

Draft
SylvainChevalier wants to merge 3 commits intomainfrom
claude/issue-3780-update-guidelines-for-generating-discrete
Draft

feat: limit discrete questions to 50 options max#4336
SylvainChevalier wants to merge 3 commits intomainfrom
claude/issue-3780-update-guidelines-for-generating-discrete

Conversation

@SylvainChevalier
Copy link
Contributor

Closes #3780

  • Add guideline to question-writing page about discrete question limits
  • Add frontend validation in question creator to cap at 50 options
  • Add backend validation in QuestionWriteSerializer to enforce the limit
  • Update error messages in all translation files

Generated with Claude Code

- Add guideline to question-writing page about discrete question limits
- Add frontend validation in numeric_question_input to cap at 50 options
- Add backend validation in QuestionWriteSerializer to enforce the limit
- Update error messages in all translation files (en, es, cs, pt, zh, zh-TW)
- Add MaxDiscreteOptionCount constant (frontend) and MAX_DISCRETE_OPTION_COUNT (backend)

Closes #3780

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@SylvainChevalier
Copy link
Contributor Author

@claude the error message and guidelines should say "increase the step size or tighten the bounds"

@claude
Copy link

claude bot commented Feb 12, 2026

Claude finished @SylvainChevalier's task in 3m 25s —— View job


Updated error messages and guidelines

  • Read current error messages and guidelines text
  • Update guideline text on question-writing page
  • Update error message in backend serializer
  • Update error messages in all translation files (en, cs, es, pt, zh, zh-TW)
  • Commit and push changes

Changed "use a continuous question instead" to "tighten the bounds" across all locations:

  • front_end/src/app/(main)/question-writing/page.tsx — guidelines page text
  • questions/serializers/common.py — backend validation error message
  • front_end/messages/en.json — English translation
  • front_end/messages/cs.json — Czech translation
  • front_end/messages/es.json — Spanish translation
  • front_end/messages/pt.json — Portuguese translation
  • front_end/messages/zh.json — Chinese (Simplified) translation
  • front_end/messages/zh-TW.json — Chinese (Traditional) translation
    |

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/issue-3780-update-guidelines-for-generating-discrete

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.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

🚀 Preview Environment

Your preview environment is ready!

Resource Details
🌐 Preview URL https://metaculus-pr-4336-claude-issue-3780-update-guide-preview.mtcl.cc
📦 Docker Image ghcr.io/metaculus/metaculus:claude-issue-3780-update-guidelines-for-generating-discrete-2b77820
🗄️ PostgreSQL NeonDB branch preview/pr-4336-claude-issue-3780-update-guide
Redis Fly Redis mtc-redis-pr-4336-claude-issue-3780-update-guide

Details

  • Commit: b2dfd4460ed647607767c9f66f4fc513df61a5a0
  • Branch: claude/issue-3780-update-guidelines-for-generating-discrete
  • Fly App: metaculus-pr-4336-claude-issue-3780-update-guide

ℹ️ Preview Environment Info

Isolation:

  • PostgreSQL and Redis are fully isolated from production
  • Each PR gets its own database branch and Redis instance
  • Changes pushed to this PR will trigger a new deployment

Limitations:

  • Background workers and cron jobs are not deployed in preview environments
  • If you need to test background jobs, use Heroku staging environments

Cleanup:

  • This preview will be automatically destroyed when the PR is closed

@SylvainChevalier
Copy link
Contributor Author

@claude functionality looks good, now fix the issues from the unit tests.

@claude
Copy link

claude bot commented Feb 13, 2026

Claude finished @SylvainChevalier's task in 5m 25s —— View job


Fixed Prettier formatting issues

  • Check CI status and identify failing tests
  • Fix Prettier formatting in question-writing/page.tsx
  • Fix Prettier formatting in numeric_question_input.tsx
  • Commit and push changes

The Frontend Checks CI job was failing due to Prettier formatting issues in two files:

  1. page.tsx — Collapsed multi-line <strong> tag to a single line
  2. numeric_question_input.tsx — Broke a long Math.max(3, Math.min(...)) expression across multiple lines to stay within print width

Both files now pass prettier --check.
|

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.

Update guidelines for generating Discrete Questions

1 participant