ljacqu / nightbotquiz Goto Github PK
View Code? Open in Web Editor NEWNightbot (Twitch) quiz command
Home Page: https://jalu.ch/ext/quiz/
Nightbot (Twitch) quiz command
Home Page: https://jalu.ch/ext/quiz/
If someone writes a wrong answer, instead of writing "Use !q to see the question", just include it if it's:
It would be good to have the quiz admin be the only link one must remember, i.e. if it could link per owner to where the data is defined with a configurable link, that would be pretty nice. For example, we could show a button at the bottom of the index page, or have a button in update.php
When the timer page is stopped, hovering over the buttons still looks like they're active somehow. A minor styling improvement would be to make disabled buttons not react to mouse hovers.
Show a green/yellow/red indication of some sort in the header of every page (maybe next to the username?) so we can see at a glance if the quiz is currently set to be active or not.
If someone answers the correct thing for a question of type CUSTOM
, it can be detected what the right answer is because a user answering with an alias will have his answer changed to the first correct answer specified in the question. There's no good way around this but we can hide current answers for CUSTOM unsolved questions.
Create chunks of 200 when saving the questions
Country questions will show all countries, but right now the country questions are all about choosing one of two countries.
I'm currently calling a URL that runs the flat-file version of the language guesser to get the language definitions; plan is to keep the definitions in the other project (https://github.com/ljacqu/TextLanguageGuesser) but not to have it run anywhere. Means adding a parseable format of the language definitions there and changing the code in that project to also be able to deal with it.
After 6 hours, the timer page stops itself, and I think the buttons are still active, which I'm not sure makes sense. This issue stands for checking the behavior more closely.
Continuation of #35: If there's a way to send messages as the streaming user to Twitch chat, it would be nicer as the guesses of the streamer would be input the same way as everyone else's. Need to hook into Twitch and get permission to send messages like this. So best would be to keep both so that the quiz owner can choose what he wants to do.
It would be more natural to have the name of the correct guesser if it's only one
If someone opens the timer page, it would be good to have a short-hand way of setting the quiz activity to enabled when it's not. At the end, we could also offer to turn the quiz activity off in case someone wants to ensure the quiz only exists during their presence.
If a user is indicated, show an additional column with their answer.
I'm saving the refresh token that Nightbot provides, but I'm not doing anything with it. Instead of forcing the user to retrieve a new token from Nightbot every month, I could try to get a token myself once I have a refresh token.
For a question type (-> countries), instead of saving static ones, define a probability that it's a question of that type and then generate it dynamically. Need a way to store past answers so that they can be displayed, and not repeated.
Have a page (configurable per owner) that allows to play through some random questions—stateless and independent of the current running quiz.
It would be nice to have different sets of parameters, like profiles, so that different timeouts can be applied, e.g. with a dropdown on the timer page. This would also allow to back up values before changing them.
Some of the parameters should not be part of the profile, e.g. the settings regarding the web page. Move them to another table?
Additionally to the "Stop quiz" button, I think it would be useful to have a button to gracefully shut down the quiz: once the current question is resolved, stop polling with !q timer
.
Probably only useful if the quiz is not configured to create a new question when the current one is solved. Should maybe anyway be configurable whether to show "Stop" and "Stop after current question"?
The index page has "hover over the column to see the answer", which is not a mobile-friendly solution: think of alternatives (spoilers on websites are typically click to see?)
Draws might refer to a question that was deleted since it was created; add a section in the statistics that lists the number of draws and draw answers that have been orphaned. Possibly with an option to clean them up as they shouldn't influence anything else -- fairly sure the high score queries already exclude them because of inner joins
Not sure I want to do this, but a lot of questions are yes/no or "A or B" questions, in which case it would be easy to add buttons so that the one running the quiz can answer without having to enter it into chat. For language guessing, it's a bit more difficult: would we want to have a button for every language?
Reason I'm not sure to do this is because it might seem a bit cheaty for the quiz owner to be able to answer with another method of input.
Regardless of when someone has last run !q
, a timer running !q timer
will display the same question again
If the timer is accidentally left on, it could run all night -> have some auto-pause mechanism after, say, 6 hours
Allow to start the timer but to have it wait x seconds before actually running; allows to unpause the page without it immediately doing something.
I'd love to have a demo owner that has three questions of every question type for demonstration. Maybe we can also have a special rule in the timer that it doesn't connect with Nightbot so that we can check the timer and everything.
All major buttons could have configurable keyboard shortcuts.
On the public page, add a hint as to creation date of the draw, and also include it in the admin area (e.g. overview). When resolving a question etc. it's interesting information to have.
Admin page to send requests to poll.php and answer.php to simulate calls by different users. Probably allow to specify different usernames for proper testing.
Later on there should also be a functionality to remove all questions produced by these tests. Preface all users with something like &demo_
?
For now, a question like "Does CH or NL have a bigger surface" can be answered by any recognized country, which is of course nonsense. It would be nice to validate with the question whether CH or NL is provided and to give a hint to the user otherwise.
Probably need to have the question type be able to define some sort of error message?
I can't pull from this repo on my web server because there's already a git repo, so creating a bash script is my next best option.
For each quiz, show the top answerers. Maybe also ratio of correct vs false?
Have a checkbox somewhere that disables the commands so that the quiz can be easily enabled and disabled without needing to fiddle with Nightbot
When the answer is revealed, I might want to see the question again, not generate a new question.
Not sure how that command would be called. New variant: !q last
Place questions always assume that the answer is false, because the right answer is determined based on the answer value, and the score is ignored everywhere. The score is currently wrong for place questions—it's always zero.
Probably should remove the score column, or fix the mechanism and migrate the existing answers (if useful for #29)
If a question is presented and no one answers, it might be nice to be able to repeat the question after a defined time, and to only resolve it after another defined time span
Create a page to change one's password
When questions are updated, questions can be deleted:
Some pages have the favicon from the host instead of the quiz one; I kept it intentionally so I could distinguish localhost from remote. Probably should introduce some mechanism to have a different (or no) favicon on localhost, but to then apply it consistently on all NightbotQuiz pages.
Probably not correct as diacritics are missing?
Awon ogede un wa lorisirisi itobi ati awo nigba ti won ba ti pon.
Just so I don't forget—delete all old question texts on the data
branch once we can confirm we decommission the old running version of the Nightbot quiz
Pro memoriam: !q timer
with a space at the end is not treated like !q timer
. This can lead to confusing errors if someone is not careful while setting it up
Solution: trim variant
It's not best practice to bind actions to GET since a user can more easily be tricked into calling that URL than performing a POST request. Neither action is "destructive" in any way so it's not a big priority.
At stream end, the problem is the timer might generate a question, or leave it unresolved. It would be good to have a button to remove an open question if it has no answers, as well as a button to resolve the current question (if it has answers).
On the timer page would be convenient, but these actions should also be available outside of the timer page.
The warning when the quiz is configured to be off doesn't make much sense; it would make sense to just turn it on. However, when turning the timer off, we should probably make it configurable whether the quiz activity setting is changed or not.
Pressing P should (un)pause the timer. Also, extract the JS to its own file
The admin function to update questions also updates files with various definitions, but if the questions fail to update, the files will be updated but the SQL transaction will be rolled back, leading to data being out of sync. Maybe copy the old files before updating them, then if the transaction is rolled back restore the copies, otherwise delete them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.