Technology used:
- React
- Material UI
- OpenAI API

During the winter break of my sophomore year, I created a React app designed to streamline studying for quizbowl by parsing questions from a database of past questions and generating flashcards using the OpenAI API.
Quizbowl is a game in which two teams compete head-to-head to answer questions from all areas of knowledge, including history, literature, science, fine arts, and more. One of the most effective study methods for quizbowl is to study questions that have appeared in past tournaments. QB Reader has a massive database of past questions. To enhance knowledge retention, many quizbowl players, myself included, create flashcards containing information from past questions, most commonly using the program Anki. Having created thousands of Anki cards manually, I wanted to leverage OpenAI to streamline the creation of Anki cards from QB Reader.
Some boring details
Retrieving information from QB Reader
QB Reader has an API for retrieving questions containing a desired query string. Additionally, one can optionally provide additional parameters including the difficulties and categories of the returned questions. For example, if I provide the query string “Frida Kahlo,” and specify high school level difficulties as well as the categories “Visual Fine Arts” and “American Literature,” the API will return all of the questions of the specified categories and difficulties that contain the string “Frida Kahlo.” In my React app, I provide a query string input box and dropdowns where the user can optionally specify question difficulties and categories. After submission, the QB Reader database is queried and corresponding questions are retrieved, which can now be fed into ChatGPT.
Asking OpenAI to make Anki cards
The OpenAI API is given a system prompt specifying the generation of Anki flashcards from the database questions.
You are going to receive a series of quizbowl tossups and bonuses related to a given query. If you see the same clue related to that query repeatedly mentioned in the list of questions, format it into an Anki cloze flashcard (a sentence with the important keywords in clozes). Place an emphasis on information related to question answerlines, and keep the flashcards separated by newline. If you see “this” followed by some noun in a question, look at the corresponding answerline to figure out what it’s referring to and replace it. Clozes should not have the same number unless they are very closely related or refer to the same thing. Each flashcard should have 2 to 5 clozes, and consist of a single sentence. Make sure that you don’t repeat clues in the flashcards.
For example, for the query “Barbara Hepworth,” if you see the “This wife of Ben Nicholson dedicated Single Form, which is at the UN Headquarters, to Dag Hammarskjöld.” and “Name this 20th-century sculptor who also created a 21-foot tall memorial to Dag Hammarskjöld entitled Single Form.” in separate questions, you might create “{{c1::Barbara Hepworth}} dedicated {{c2::Single Form}} to {{c3::Dag Hammarskjöld}}” as a flashcard.
ChatGPT has converted the database questions into a set of cloze deletion flashcards separated by line break. The React app then parses the output string into individual strings for each flashcard which are displayed in text fields. The user is now able to edit the flashcards. Each flashcard element has a set of buttons on the side that let the user add additional clozes and delete the card if desired. The user is able to enter another query and generate additional cards. This will add to the running list of cards, though the user can choose to clear all existing cards. At the end, the user can export the cards as a file that can be imported into Anki for future studying.