Quiz Demo

In the thread for my Wordle clone, I mentioned that I have been thinking about data files. I figured I’d share a proof of concept and a teaser of my next project.

I don’t have an editor for the data file yet. I basically exported the contents of a database that I created for a different project and then massaged the CSV file into a JSON file. The “important” data is encoded so that you don’t accidentally view the questions and answers. I also hacked together an “extension of an extension,” allowing the excellent Text Sprite extension to handle long strings by wrapping lines.

This one is going to take a bit of time yet, but I thought the basis of the project might inspire some of you to take the core of it and use the ideas in your own JavaScript projects.

Have fun!

4 Likes

Just in case any of you want to dig deeper into this idea, I cleaned this up a bit last night and fixed the hilarious typo in the question that randomly appeared in the original screenshot. :laughing:

The data1.ts file is closer to what I’m envisioning for the output of some sort of data file generator. Here’s my leading candidate for a design:

  1. Use a generic tool to create a SQLite database with the data. There are many really good, cross-platform tools out there, like DBeaver and SQLite Studio. Why reinvent the wheel!
  2. Create a translation app.
    1. Read the tables from the database.
    2. Present a simple UI to the user to select tables, columns, and which columns to encrypt.
    3. Generate TypeScript files that can be copied and pasted into a MakeCode project.

I’m thinking C# to build a web app that can be tossed into Azure Static Pages. Easy enough to build native apps, too, with .NET.

I can think of at least two use cases.

  • The obvious use case is to store questions and answers for a quiz game.
  • Another really cool use case would be for interactive fiction.

Happy to entertain any thoughts or ideas that y’all have. Just felt like doing a brain dump to sort and clarify some of my thoughts.

Happy Wednesday! Hope you’ve all had a great start to the week!