I’m in a few online communities. Shocker, I know.
Some of the communities are tight-knit, some are looser-knit, some are very casual.
In one of the communities I’m in, one of the folks there decided to throw a trivia event. Now, I love trivia (obviously) and I love the subject matter of that community, so I was like HELL YES.
And it was done quite well, except that the host’s wife ended up manually tabulating the results of like 30+ people across five rounds.
So, I said to myself, that if the host wanted to do this again, I would offer my LEET SKILLZORZ.
And a new trivia date (later next month) is happening, so I’m helping out!
How? Basically, I’m taking Challenge 1 – The Rapids from River of Kurn and I’m repurposing a lot of code.
Something I wrote is actually going to be useful for something other than its original intended purpose??? What?!
Since it’s so low-stakes, I’m playing fast and loose with a few things. First, there’s only a login if you’re an admin (so me and the host) and everyone else just picks their username and it populates the table with that username and a whole bunch of null values across the table. I probably don’t need to run a unique check (although the value should be, you know, unique in the database) because most people use their regular handles. See, fast and loose. hahaha.
So how it works is that you “log in” by entering your name. Your name gets put into the database. All the columns are populated with null. Each column represents a specific question in a specific round of the game. Five rounds, ten questions each. Now, the host does not want people to know their score, but if we’re going to prevent the host’s wife from manually tabulating All The Things, then the game needs to know the score and store that (as well as the answers) to present the host’s wife with a list of “okay, this is what everyone wrote for round 1”. Then the host’s wife can go through and manually grant “correct” if the game was like “nope” but it’s close enough. There shouldn’t be too many corrections, but it’ll be nice that a human will look it over.
So logging in as the host or me will get to the admin page where you can pull up round 1, 2, 3, 4 or 5’s full answers and make modifications and then also have a scores page which will list scores in descending order from highest to lowest, linked to the username.
Meanwhile, users will only move into each round (which is timed!) when the host tells them to. The form won’t show any questions, only fields for answers. The post data gets carried to a calculate page where the answers are stored and the score is calculated and stored. Then the users get brought to an “in between rounds” page before they are instructed by the host to move forward by clicking a link. Each answer page will be timed and the form will autosubmit when the time runs out, much like The Rapids. Only the host is much nicer than I am and will grant several minutes instead of one minute to answer these trivia questions. It makes me feel like a somewhat evil, maniacal game designer. And I gotta say, I don’t hate that feeling. ;)
So I’m playing around with all kinds of stuff right now and it’s fascinating how much I’ve forgotten about, say, a login process. My login process for River of Kurn is awesome! It’s smart, clever, logical, commented and, honestly, I’m impressed with myself from two years ago.
I’m also remembering that being able to process form data makes me feel like a god.
You can do anything when someone submits a form. Like seriously, damn near anything you want. Want people to go to THAT page when you’re done? Sure. Want them to see THIS message? Okay! It’s a lot of fun to play around with things that are slightly (okay, quite) different from my game and still manage to modify my own code to make it work for this purpose.
In terms of River of Kurn, things are progressing. My current goal is to stop using a MySQL docker container to hold my database when, you know, I can use an Amazon RDS server. So that’s the project for this weekend and next. It should theoretically be okay, but I’m having to look into CICD stuff (continuous integration/continuous deployment) because if I’m going to use an RDS stage server, I’m going to have to change things when pushing to master and deploying to production or my code will just point to the stage server. So that’s a whole other headache to deal with.
This is why I’m cool with tinkering with this trivia game project before getting back to River of Kurn. At least I have the foggiest notion of what I’m doing with the game project as opposed to the devops side of things with River of Kurn.
Anyway. Quarantine/self-isolation continues to ensure I don’t get this nasty virus out there. I hope you and yours are all safe and healthy.