-
Notifications
You must be signed in to change notification settings - Fork 15
Small fixes for questions #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughControllers now propagate explicit question open/close timestamps from the semester's periodic event into question creation; the UI toggles voting-related inputs based on the selected question type. Changes
Sequence Diagram(s)(omitted — changes are focused and do not introduce a new multi-component control flow requiring visualization) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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. Comment |
There was a problem hiding this 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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/Http/Controllers/StudentsCouncil/AnonymousQuestionController.phpapp/Http/Controllers/StudentsCouncil/QuestionController.phpresources/views/utils/question_card.blade.php
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: horcsinbalint
Repo: EotvosCollegium/mars PR: 743
File: app/Http/Controllers/Auth/AdmissionController.php:237-237
Timestamp: 2025-07-08T22:59:53.901Z
Learning: When horcsinbalint defers issues for "human reviewers to check later," he's making a conscious decision to prioritize the current PR over fixing secondary issues, and this should be acknowledged rather than being insistent about immediate fixes.
📚 Learning: 2024-06-13T19:25:19.821Z
Learnt from: viktorcsimma
Repo: EotvosCollegium/mars PR: 542
File: app/Http/Controllers/Secretariat/SemesterEvaluationController.php:161-161
Timestamp: 2024-06-13T19:25:19.821Z
Learning: 'anonymous_questions' is a section name in the 'secretariat.evaluation-form.app' view and does not require handling in the `store` method of `SemesterEvaluationController.php`.
Applied to files:
app/Http/Controllers/StudentsCouncil/AnonymousQuestionController.php
🧬 Code graph analysis (1)
app/Http/Controllers/StudentsCouncil/AnonymousQuestionController.php (2)
app/Utils/HasPeriodicEvent.php (2)
periodicEventForSemester(54-62)semester(180-183)app/Http/Controllers/StudentsCouncil/QuestionController.php (1)
createQuestion(28-72)
🔇 Additional comments (7)
resources/views/utils/question_card.blade.php (3)
12-12: Excellent addition of the onchange handler.The dynamic behaviour will provide immediate feedback to the user when they select different question types.
38-38: Proper initialisation on page load.Invoking the function on DOMContentLoaded ensures the form displays in the correct state when loaded with pre-existing values.
27-36: No action required—the string literals precisely match the backend constants.The function correctly uses
"selection"and"ranking", which correspond exactly toQuestion::SELECTION = 'selection'andQuestion::RANKING = 'ranking'in the Question model. The front-end and back-end validation logic are consistent.app/Http/Controllers/StudentsCouncil/QuestionController.php (3)
28-28: Well-structured method signature enhancement.The addition of the optional timing parameters provides the flexibility to set explicit time windows for questions whilst maintaining backwards compatibility with existing callers.
38-40: Appropriate conditional validation logic.The use of
Rule::requiredIfandRule::excludeIfproperly enforces that voting options are only required and validated for selection or ranking question types, aligning nicely with the front-end behaviour.
60-61: The schema properly supports these timing columns.The
questionstable includes bothopened_atandclosed_atcolumns defined as nullable datetime fields (migration 2023_01_18_201909_create_voting_tables.php, lines 27–28). The code assignment is sound and will function correctly without runtime errors.app/Http/Controllers/StudentsCouncil/AnonymousQuestionController.php (1)
73-75: Excellent integration of the periodic event timing.The implementation properly retrieves the evaluation period's timing window and gracefully handles the case where no periodic event exists using the null-safe operator. The question will inherit the correct opened and closed dates from the semester's evaluation schedule.
cd379f8 to
957b147
Compare
2febc73 to
732ae48
Compare
732ae48 to
8a01514
Compare
No description provided.