Skip to content

Fix nested forms for quizzes #791

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

Merged
merged 21 commits into from
Jun 10, 2025
Merged

Fix nested forms for quizzes #791

merged 21 commits into from
Jun 10, 2025

Conversation

Splines
Copy link
Member

@Splines Splines commented Jun 10, 2025

Important

Merge #790 beforehand.

This is a follow-up to #751 and fixes #788 by reworking the nested params for quizzes. Among others, for the solution content, we introduce a new intermediate layer called "dynamic", sued to render the fields of a matrix, of a tuple or an expression. It can look like this:

question[solution_content][column_count]: "2"
question[solution_content][dynamic][1,1][content]: "1"
question[solution_content][dynamic][1,2][content]: "2"
question[solution_content][dynamic][1,3][content]: "0"
question[solution_content][dynamic][1,4][content]: "0"
question[solution_content][dynamic][2,1][content]: "3"
question[solution_content][dynamic][2,2][content]: "4"
question[solution_content][dynamic][2,3][content]: "0"
question[solution_content][dynamic][2,4][content]: "0"
question[solution_content][dynamic][3,1][content]: "0"
question[solution_content][dynamic][3,2][content]: "0"
question[solution_content][dynamic][3,3][content]: "0"
question[solution_content][dynamic][3,4][content]: "0"
question[solution_content][dynamic][4,1][content]: "0"
question[solution_content][dynamic][4,2][content]: "0"
question[solution_content][dynamic][4,3][content]: "0"
question[solution_content][dynamic][4,4][content]: "0"
question[solution_content][explanation]: ""
question[solution_content][nerd]: ""
question[solution_content][row_count]: "2"
question[solution_content][tex]: ""
question[solution_error]: "Syntax Error"
question[solution_type]: "MampfMatrix"

Due to the inherent complexity of quizzes, I'm not sure if this fixes them entirely. Please test this thoroughly manually, e.g. play multiple quizzes (where you answer the same question incorrectly, then play it again where you answer it correctly; create new quizzes etc.).

@Splines Splines requested a review from Copilot June 10, 2025 10:03
@Splines Splines self-assigned this Jun 10, 2025
@Splines Splines added the bug label Jun 10, 2025
Copilot

This comment was marked as outdated.

Copilot

This comment was marked as off-topic.

Copy link
Collaborator

@fosterfarrell9 fosterfarrell9 left a comment

Choose a reason for hiding this comment

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

Bildschirmaufnahme.2025-06-10.133256.mp4

I tested the quiz functionality thouroughly, it ist working now. There is one minor bug that concerns the display of inputs after saving or reloading the page, see the attached screenshot and video.
Screenshot 2025-06-10 132230

@Splines Splines requested a review from Copilot June 10, 2025 14:55
Copilot

This comment was marked as outdated.

@Splines Splines requested a review from fosterfarrell9 June 10, 2025 15:05
fosterfarrell9
fosterfarrell9 previously approved these changes Jun 10, 2025
Copy link
Collaborator

@fosterfarrell9 fosterfarrell9 left a comment

Choose a reason for hiding this comment

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

Nice, it is working now.

Base automatically changed from feature/debug-vscode to next June 10, 2025 18:01
@Splines Splines dismissed fosterfarrell9’s stale review June 10, 2025 18:01

The base branch was changed.

Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 54.33%. Comparing base (6a0b02f) to head (7183db9).
Report is 3 commits behind head on next.

Files with missing lines Patch % Lines
app/models/mampf_expression.rb 0.00% 1 Missing ⚠️
app/models/mampf_matrix.rb 0.00% 1 Missing ⚠️
app/models/mampf_set.rb 0.00% 1 Missing ⚠️
app/models/mampf_tuple.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             next     #791   +/-   ##
=======================================
  Coverage   54.33%   54.33%           
=======================================
  Files         179      179           
  Lines        7502     7502           
=======================================
  Hits         4076     4076           
  Misses       3426     3426           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Splines Splines merged commit e4a1f22 into next Jun 10, 2025
5 checks passed
@Splines Splines deleted the fix/quiz-rack-nested branch June 10, 2025 18:20
@Splines Splines mentioned this pull request Jul 10, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MaMpf Quiz LaTeX rendering & flow broken
2 participants