This is a small web app built with blazor that generates a quiz game from existing Wikipedia articles. Similar to programs like Kahoot, it offers the players several options to choose from and allows them to guess which answer might be correct. The questions are generated by retrieving a wikipedia article and pulling a sentence from that article that contains a hyperlink to another article. Then this link is replaced with a blank and the players recieve 8 words, all of which are the names of links to other pages from nearby sentences. That means in a given page, there are only so many valid questions and a shorter article is more likely to generate similar or identical questions as it has much fewer options to select from.
To play, open the WikipediaUrls.txt file and paste in any number of links to Wikipedia articles. Each article should be on a new line, and once you've finished save the article. Once this is completed, run the game from a host computer. The opening page will prompt you to select whether you are a host or a player. Select host and open the 'Options' tab. From there, paste your IPv4 address and port (likely :5064) into the 'Generate QR Code' text box and click the button. For further simplicity you can add /player to the end so no one joining will accidentally attempt to host. After clicking 'Generate QR Code', the QR Code on the main page will automatically be updated. Other Options will let you customize the game. The questions will automatically cycle through all available Wikipedia pages by randomly selecting one every X number of questions. This number can be modified as well as the win condition desired (points or # of questions).
Once the options have been set, players can join by scanning the QR code as long as they are on the same Wifi network as the host. If prompted, players must select player and not host. Currently if they select host the entire program should be restart to work properly. I am aware this is not ideal, but I haven't worked around it yet. Players can join even after the match has started, though they'll need to enter the IP address manually as the code won't be on screen. After they have joined, each question should appear on the host screen while the options appear on the player's screen. The question will not advance until the host presses the button to do so. Points are awarded based on the player's entry order. The first player to answer recieves 100 points and each subsequent player recieves 10 less with the minimum being 50. The third player to answer recieves 80 points. The fifth player to answer recieves 60. The sixth and any player after that recieves 50 points.
Once the game is over a scoreboard will show every player's final standings. Currently the game must be closed and rehosted to start again, though that will hopefully change.
There are still several bugs and features that I hope to fix, though the game is still playable with them in the code.
- Implement a timer on the questions so they progress automatically without the user needed to progress each one
- Allow players to reconnect if a disconnection occurs
- automatically retrieve the host IP to allow players to connect without manual input
- Allow Wikipedia articles to be inputed at game set-up rather than in a text document prior to starting the game
- Only allow one host
- Allow the host to restart the game upon its conclusion
- Update ReadMe to include how to set up the project on a separate machine.
References https://developer.mozilla.org/en-US/docs/Web/CSS https://www.youtube.com/watch?v=ikfygSrR8H0 https://chatgpt.com/ https://developer.mozilla.org/en-US/docs/Web/