-
-
Notifications
You must be signed in to change notification settings - Fork 113
Fix duplicate key quiz when duplicate #182
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
|
The tests are not passing: |
Contributor
Author
|
Wii be updated.
Dimitrije Dimitrijevic
+381646158060
…On Fri, 24 Oct 2025 at 08:02, Alexandre Lion ***@***.***> wrote:
*alxlion* left a comment (ClaperCo/Claper#182)
<#182 (comment)>
The tests are not passing:
1) test quizzes calculate_user_score/2 correctly calculates score (Claper.QuizzesTest)
test/claper/quizzes_test.exs:147
** (FunctionClauseError) no function clause matching in Claper.Quizzes.submit_quiz/3
The following arguments were given to Claper.Quizzes.submit_quiz/3:
# 1
2153
# 2
[%Claper.Quizzes.QuizQuestionOpt{__meta__: #Ecto.Schema.Metadata<:loaded, "quiz_question_opts">, id: 273, content: "option 1", is_correct: true, response_count: 0, percentage: nil, quiz_question_id: 137, quiz_question: #Ecto.Association.NotLoaded<association :quiz_question is not loaded>, inserted_at: ~N[2025-10-24 06:00:47], updated_at: ~N[2025-10-24 06:00:47]}]
# 3
137
Attempted function clauses (showing 2 out of 2):
def submit_quiz(%Claper.Accounts.User{} = user, quiz_opts, quiz_id)
def submit_quiz(attendee_identifier, quiz_opts, quiz_id) when is_binary(attendee_identifier) and is_list(quiz_opts)
code: {:ok, _} = Quizzes.submit_quiz(user.id, [correct_option], quiz.id)
stacktrace:
(claper 2.4.0) lib/claper/quizzes.ex:302: Claper.Quizzes.submit_quiz/3
test/claper/quizzes_test.exs:154: (test)
..
2) test quizzes submit_quiz/3 with user_id records responses and updates counts (Claper.QuizzesTest)
test/claper/quizzes_test.exs:116
** (FunctionClauseError) no function clause matching in Claper.Quizzes.submit_quiz/3
The following arguments were given to Claper.Quizzes.submit_quiz/3:
# 1
2157
# 2
[%Claper.Quizzes.QuizQuestionOpt{__meta__: #Ecto.Schema.Metadata<:loaded, "quiz_question_opts">, id: 279, content: "option 1", is_correct: true, response_count: 0, percentage: nil, quiz_question_id: 140, quiz_question: #Ecto.Association.NotLoaded<association :quiz_question is not loaded>, inserted_at: ~N[2025-10-24 06:00:48], updated_at: ~N[2025-10-24 06:00:48]}]
# 3
140
Attempted function clauses (showing 2 out of 2):
def submit_quiz(%Claper.Accounts.User{} = user, quiz_opts, quiz_id)
def submit_quiz(attendee_identifier, quiz_opts, quiz_id) when is_binary(attendee_identifier) and is_list(quiz_opts)
code: Quizzes.submit_quiz(user.id, [option], quiz.id)
stacktrace:
(claper 2.4.0) lib/claper/quizzes.ex:302: Claper.Quizzes.submit_quiz/3
test/claper/quizzes_test.exs:123: (test)
—
Reply to this email directly, view it on GitHub
<#182 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEMYVWEZ2YFFCEWD3IIXOS33ZG6HJAVCNFSM6AAAAACJWBHR5GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINBRGIYDINBSGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
Updated tests, so they match how things work now. |
alxlion
added a commit
that referenced
this pull request
Dec 26, 2025
##⚠️ Breaking changes - S3 variables are now named: S3_ACCESS_KEY_ID, S3_SECRET_ACCESS_KEY, S3_REGION and S3_BUCKET - Users now have roles. Refer to the `roles` table and assign a role to a user with the `role_id` column in the `users` table. ## Features - Add Admin Panel to manage users and presentations - Add user roles: user, admin - Add `LANGUAGES` setting to configure available languages in the app - Add hideable presenter attendee count (#183 #155) - Add Hungarian translation (#161) - Add Latvian translation (#163) - Add custom S3 endpoint with `S3_SCHEME`, `S3_HOST`, `S3_PORT` and `S3_PUBLIC_URL` ## Fixes and improvements - Upgrade JS dependencies - Upgrade Elixir dependencies, including Phoenix Live View to 1.0.17 - Upgrade to Tailwind 4+ - Refactor view templates to use {} instead of <%= %> - Fix event name validation to be required - Docker image is now using Ubuntu instead of Alpine for better dependencies support - Fix scrollbar not showing in event manager when no presentation file (#164) (@aryel780) - Fix settings scroll for small screen (#168) - Fix duplicate key quiz when duplicate (#182) - Fix email change confirmation (#172) - Fix italian translation (#179) - Fix random poll choices (#184)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes sporadic issue when duplicate key is in multi.