Git Product home page Git Product logo

nightbotquiz's People

Contributors

ljacqu avatar

Watchers

 avatar  avatar

nightbotquiz's Issues

Configurable data URL

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

Show quiz acitvity setting in header

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.

Index page leaks correct custom question answer

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.

Get language definitions from GitHub

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.

Timer: Provide answers via Twitch (send chat to Twitch)

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.

Timer: Button to turn quiz activity setting on

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.

Use refresh token to get new OAuth token

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.

Generate questions dynamically

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.

Play online

Have a page (configurable per owner) that allows to play through some random questions—stateless and independent of the current running quiz.

Parameter sets

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?

Timer: Stop after current question

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"?

Take over language data from old project

  • Create a new branch in this project with the language files
  • Change the updater to use the files in this project
  • Add note of archiving to readme of old project
  • Archive the other project

Answers not visible for mobile users

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?)

Admin: statistics about orphaned draws

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

Timer: Buttons to answer

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.

Timer: Startup wait

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.

Demo owner

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.

Creation date of draws

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.

Page to send API calls

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_?

Country A or B questions can be answered with any country

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?

Update script

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.

  • download zip from GitHub
  • extract to quiz-new/
  • copy over local config files from quiz/ to quiz-new/
    • Configuration.php
    • anything in /gen/
  • delete quiz/
  • rename quiz-new/ to quiz/
  • delete files like .gitattributes

Show high scores

For each quiz, show the top answerers. Maybe also ratio of correct vs false?

Admin option to disable commands

Have a checkbox somewhere that disables the commands so that the quiz can be easily enabled and disabled without needing to fiddle with Nightbot

Command to view past text

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 question scores are always zero

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)

Handle question deletions

When questions are updated, questions can be deleted:

  • ensure that the history parameter is still below the total number of question categories
  • solve the current draw if it refers to a deleted question

Consistent favicon behavior

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.

Yoruba text has no diacritics

Probably not correct as diacritics are missing?

Awon ogede un wa lorisirisi itobi ati awo nigba ti won ba ti pon.

Delete old texts

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

poll.php variant not trimmed

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

Change logout / exit impersonation to use POST

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.

Resolve/delete current question

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.

Update questions: Roll back files if transaction fails

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.