teaching machines

Generalized IQ Test

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

I decided to design my program to ask five questions that any person would be expected to know the answer to, and allow them to enter their answers to be used to make a judgement about their intelligence.

   

My program has the five standard questions to be used to judge someones intelligence. Questions are displayed one at a time, with a text field to input an answer into. Users can enter their answers and submit to proceed. They also have the option of going back to previous questions. Once the user goes through all the questions, they are given a page displaying the questions with their correct answers along with the user’s answers. The strings entered by the user, as I imagined there would be situations where the user could be close and partially correct, so passing judgement is left to the discretion of the user.

The most important thing I learned (and I’m sure other people did this in their programs as well) is the intent.putExtra() method for transferring data between activities. A variable can simply be put into the new activity like so:

Intent intent = new Intent(v.getContext(), Results.class);
intent.putExtra(“questions”, questions);
startActivity(intent);

On the activity “Results” the following code is added:

Bundle bundle = getIntent().getExtras();
@SuppressWarnings(“unchecked”)
ArrayList<String> questions = (ArrayList<String>) bundle.getSerializable(“questions”);

This can be done with regular variables and any complex variables that are serializable.

In the future, I would like to add mp3 clips of these questions and answers being spoken in their original context, and play the clips whenever the question is clicked on by the user.