-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Refactoring to community polls & fixes for quizzes #3865
Refactoring to community polls & fixes for quizzes #3865
Conversation
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.
Haven't tested it yet but have reviewed the code and left a bunch of comments.
As for the quiz implementation, I would prefer to have a "reveal correct answer" button instead of making the quiz interactive, as the interactivity of the quiz gives the user the impression that their answer is being transmitted to YouTube.
src/renderer/components/ft-community-post/ft-community-post.vue
Outdated
Show resolved
Hide resolved
src/renderer/components/ft-community-poll/ft-community-poll.vue
Outdated
Show resolved
Hide resolved
src/renderer/components/ft-community-poll/ft-community-poll.vue
Outdated
Show resolved
Hide resolved
src/renderer/components/ft-community-poll/ft-community-poll.vue
Outdated
Show resolved
Hide resolved
These comments are super helpful! I'll patch them up soon and have it ready for you. I'm definitely a fan of the reveal button, that makes a lot more sense and will probably simplify the code quite a bit. |
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
@absidue Thanks for bearing with me here! This was super educational on FreeTube's flow and practices. Let me know if you have any other suggestions. |
My only concern at the moment, is that the reveal/hide answer button isn't accessible, however that shouldn't be too hard to fix. Here is how it is done for the FreeTube/src/renderer/views/Search/Search.vue Lines 17 to 26 in 079417d
|
Apart from that accessibility issue the code looks good :). I haven't tested it yet, but I'll get onto that soon. |
Head branch was pushed to by a user without write access
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.
Local API doesnt seem to work when i try to reveal the answers
IV-API.mp4
Local-API.mp4
Interesting - I couldn't recreate this. My development happened using the local API so I'll poke around and see if anything is different in my env |
It could be that my env is buggy. If others aren't experiencing it then I'm happy to approve |
I can reproduce the reveal answer issue for local API (IV is fine) |
Head branch was pushed to by a user without write access
Great catch! I can't figure out why it wouldn't break locally, but it should be fixed now. Been on travel this week so I apologize for the delay. |
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.
Inconsistent indent
Ensure your editor supports .editorconfig
- https://editorconfig.org
src/renderer/components/ft-community-poll/ft-community-poll.css
Outdated
Show resolved
Hide resolved
src/renderer/components/ft-community-poll/ft-community-poll.css
Outdated
Show resolved
Hide resolved
src/renderer/components/ft-community-poll/ft-community-poll.css
Outdated
Show resolved
Hide resolved
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.
LGTM now just waiting on the requested changes to be implemented
Head branch was pushed to by a user without write access
Refactoring to community polls & fixes for quizzes
Pull Request Type
Related issue
Closes #3746.
Description
This PR implements community quizzes for both the local and invidious API, giving users an interactive option to take the quiz that requires no callbacks to YouTube. This also fixes the vote count format changing between local/indivious APIs
Screenshots
Before:
Broken quiz prompt:

Poll vote count on local API:

Poll vote count on Invidious API:

After:
Quiz prompt with options:

Selecting the correct answer:

Selecting the incorrect answer:

New vote count that is API independent:

Testing
Channel communities this was tested on:
These worked good for testing the vote count side of things, but Lofi Girl was the only one that really allowed me to test quizzes. If anyone else knows where to find more YT community quizzes, please feel free to comment them.
Desktop
aa1d422
Additional context
A new component was created that is intended to be used for both polls and quizzes due to their similarity, so this avoids duplicate code.