"Flashcard" Coding? [Is this possible in Ren'Py?]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
CSV
Regular
Posts: 145
Joined: Sun Aug 31, 2014 6:58 pm
Tumblr: csvidaldraws
Deviantart: csvidal
itch: csvidal
Location: Portugal
Contact:

"Flashcard" Coding? [Is this possible in Ren'Py?]

#1 Post by CSV »

I was wondering if it would be possible to create some sort of "flashcard" system on Ren'Py using player input. What I mean is something like this:

"How many flashcards do you need?" - *player selects number of flashcards*
"Write a concept." - *player writer down a concept* / "Write the concept definition." - *player writes the definition* (And so on for every flashcard).
Then you get a quiz where you are given a random concept and have to choose the right definition from a few options.

Would this be possible in Ren'Py? I mean to make a game to help with studying (probably half study-helper and half dating sim), but I cannot seem to find a code similar to this. I already have the codes for player inputs and randomizers, though, so maybe I am overlooking something?
☆☆☆
(portfolio)
☆☆☆☆☆☆☆☆☆

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: "Flashcard" Coding? [Is this possible in Ren'Py?]

#2 Post by trooper6 »

What you ask sounds very doable. You'll want to understand some basic Python to take care of the data elements of your idea. So, if you haven't already, I recommend taking the CodeAcademy.com beginners Python course. It is free and takes 13 hours tops. It will teach you, for example, what a dictionary object is...which sounds exactly like what you'd need for your idea.
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

Onishion
Veteran
Posts: 295
Joined: Mon Apr 20, 2015 10:36 am
Contact:

Re: "Flashcard" Coding? [Is this possible in Ren'Py?]

#3 Post by Onishion »

The tricky bit, conceptually, would be the multiple choice. A good multiple choice test would include the right answer, but then three other options that are plausible that seem close to the right answer. If the player enters the word, AND enters the definition, then there's no good ways to add wrong definitions that are in any way related to the right one. You could draw from a massive stockpile of stock answers to populate the "wrong" list, but they would be very off, like:

"What is an apple?"
A. A large vehicle used by fire fighting crews.
B. A red fruit.
C. Precipitation falling from clouds.
D. The judicial branch of the US government.

You'd also run the risk of the "wrong answer pool" actually including the right answer and randomly picking it, so if the player entered the "A red fruit" answer, it would be remotely possible that the wrong answer pool could draw "D. A hard red fruit," giving two potential right answers, the latter of which would give you a "wrong" outcome. Now, if the player does add all the possible answers as well, then that's certainly something you can do easily enough. I put together a multiple-choice quiz element for a project I was working on.

shary
Newbie
Posts: 5
Joined: Sun Jun 28, 2015 8:12 pm
Contact:

Re: "Flashcard" Coding? [Is this possible in Ren'Py?]

#4 Post by shary »

It can be a nice project to learn python. However, if you want to actually make a flashcard software for people to use, you should know that there is already a lot of softwares to do that. The problem of flashcards has been thought for a long time and some people had a good comprehension of the problem and came up with complex algorithms (like the The SM2 algorithm) that involve quite a lot of math about determining the next time a card should show up again according to how well you memorized it.

What I mean is that there are some software like https://en.wikipedia.org/wiki/Anki_%28software%29 that are very well thought and very well made and you won't be able to beat them.

So… Keep in mind that if you do such a project it won't be very useful for anything else than learning how to code with a concrete project.

Also like trooper said. It will probably involve a lot of python and not so much of renpy code. You can learn about python at CodeAcademy or with this website: http://learnpythonthehardway.org/book/

User avatar
CSV
Regular
Posts: 145
Joined: Sun Aug 31, 2014 6:58 pm
Tumblr: csvidaldraws
Deviantart: csvidal
itch: csvidal
Location: Portugal
Contact:

Re: "Flashcard" Coding? [Is this possible in Ren'Py?]

#5 Post by CSV »

Thank you all for your answers. =)
☆☆☆
(portfolio)
☆☆☆☆☆☆☆☆☆

synedraacus
Regular
Posts: 58
Joined: Tue Jun 09, 2015 8:10 am
Github: synedraacus
Contact:

Re: "Flashcard" Coding? [Is this possible in Ren'Py?]

#6 Post by synedraacus »

Speaking of the wrong answer generation. Instead of a pregenerated pool of wrong answers, you can define a series of simple syntaxes, like this:

a) Adj Noun
b) Noun that Verb Noun
c) Noun of Noun

Then you take a right answer, pick one word from it at random, stuck it into one of the models and generate other ones at random. "Apple - the red fruit" might generate "The red car", "The black fruit", "The fruit of lemmatisation". You may also use some simple co-occurence statistics (first-order Markov models come to mind, but this is probably just because I use them in my work now) to make answers less nonsensical, ie make "black fruit" more probable than "rebellious fruit" or "red significance".
The advantage here is that you practically never start repeating wrong answers and your wrong answers are somewhat more like correct one (thus plausible). Of course, there is still no guarantee that you won't accidentally generate "green fruit", "fruit of apple tree" and "red sphere with a stick on top" as "wrong" definitions for an apple.

There is a pretty great Natural language processing toolkit that has way more corpora and linguistics-related Python than you may possibly stuck into your flashcard software.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Google [Bot]