Skip to content
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

Reveal correct trivia answer in the end #2911

Open
wants to merge 1 commit into
base: v5
Choose a base branch
from

Conversation

ProditorMagnus
Copy link

Currently there is no feedback which answer was correct, so it is not possible to learn from mistakes.

Description of the Change

After user loses in trivia, response message includes index of correct answer.

Applicable Issues

Testing

None, low risk change.

Screenshots

@dennisrijsdijk
Copy link
Collaborator

It looks like this'll only post the number/index of the correct answer, is that intentional or was the intention to include the answer as text?

@ProditorMagnus
Copy link
Author

My intention was just index. I was mostly thinking about message sentence flow, thought that index would fit the message better.

In case of multiple choice questions answer text would also work, but I think 1/2 look better than true/false in sentence.

@ProditorMagnus
Copy link
Author

Actually there is no reason to include the fragment if there were only two options. In that case answer text looks better. I will see if I can figure out question data model for answer text.

Currently there is no feedback which answer was correct, so it is not possible to learn from mistakes.
@ProditorMagnus
Copy link
Author

ProditorMagnus commented Nov 28, 2024

Maybe

await twitchChat.sendChatMessage(`Sorry ${chatMessage.userDisplayName ?? username}, that is incorrect. ${question.answers.length > 2 ? 'The answer was' + question.answers[question.correctIndex - 1] + '. ' : ''}Better luck next time!`, null, chatter);

Not sure I should still keep it as inline condition. And not sure if question.answers[question.correctIndex - 1] is correct syntax, that change I am not confident to do without testing.

@ProditorMagnus
Copy link
Author

Force push was just rebasing commit from master to v5.

@dennisrijsdijk
Copy link
Collaborator

Couple things:

We prefer string interpolation over string concat

`this is a ${variable}`

rather than "this is a " + variable

I think the condition, or the answer finding logic should definitely be broken out into a different line.

${question.answers.length > 2 ? 'The answer was' + question.answers[question.correctIndex - 1] + '. ' : ''

is it intentional there's nothing here for the false condition?

Regardless, let's see what the team thinks (whether or not number, string, or a combination of the 2 should be used) and then you can go based off their feedback

@CKY-
Copy link
Collaborator

CKY- commented Nov 29, 2024

adding an option to this would be better then forcing everyone to show the correct answers.. you have viewers that will abuse it.

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.

3 participants