teaching machines

Homework 1 -mQuiz

September 30, 2011 by . Filed under cs491 mobile, fall 2011, postmortems.

I decided to make a basic quiz application, but more of a “fill in the blank” music lyrics quiz.  In its current state it immediately lets you know that your answer is incorrect and has you try it again until you get it correct, however it also keeps track of the amount of times you got it wrong.

My addition was in the final dialog instead of only including the amount of times  the user was incorrect, I also included an “Educate me” button.  Basically if this button is pressed it creates a Uri array with youtube links, and then:

int random = (int) Math.floor(Math.random()*5);
Intent intent = new Intent(Intent.ACTION_VIEW, youtubes[random]);
startActivity(intent);

It creates a random number (floor is used to make sure every number 0-4 is equally represented), which then selects the uri from the array, and passes it off as an intent.  Voila.

If I had more time I would much rather change quite a bit, mainly make the questions/answers/correct answer all into one class, which would then allow me to let the users make their own questions instead of having only the ones hard coded in.