Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/SaadAhmed1122/Kids_learnig_App/llms.txt

Use this file to discover all available pages before exploring further.

The Food Quiz (FoodActivity) introduces children to common fruits and foods through vibrant picture questions. Each session delivers ten food images in randomised order, with three photograph options to choose from. A correct tap advances the green progress dot row and immediately loads the next question, creating a smooth and rewarding learning loop for young players.

Launching the Food Quiz

FinalmainScreen starts FoodActivity via its fruitsAct() method. The value extra is set to 32, which is outside the sequence range of 1–7 and therefore triggers standalone mode, ending with a ScoringPage.
// FinalmainScreen.java — fruitsAct()
Intent ii = new Intent(FinalmainScreen.this, FoodActivity.class);
ii.putExtra("value", 32);
startActivity(ii);
The Sequence game identifies this category by the name “Food” in its spinner selection logic.

Quiz Data

FoodActivity stores all question and answer resources as int arrays of drawable resource IDs. The layout file is activity_food.

Question Images

Question #Drawable
1c0
2c1
3c2
4c3
5c4
6c5
7c6
8c7
9c8
10c9

Correct Answers

Option positions: 0 = left, 1 = middle, 2 = right.
int[] correct_answer = {0, 2, 0, 1, 0, 2, 1, 2, 0, 1};
Question #DrawableCorrect Option
1c0Left (0)
2c1Right (2)
3c2Left (0)
4c3Middle (1)
5c4Left (0)
6c5Right (2)
7c6Middle (1)
8c7Right (2)
9c8Left (0)
10c9Middle (1)

Question Flow

1

Randomise Queue

random_number_generator() shuffles indices 0–9 into queue[] so every game session presents questions in a different order.
2

Show Question

displayquestion() sets the question ImageView to questions[queue[counter]] and loads three option images from answers[queue[counter]].
3

Tap to Answer

All three option cards share the onClickCard(View) click listener. Any tap triggers condition().
4

Check Answer

condition() evaluates which LinearLayout was tapped against correct_answer[queue[counter]]:
  • Correctcorrect_ans_count++, next green dot lights, displayquestion() called.
  • Wrongwrong_ans_count++, tapped option’s LinearLayout is set to GONE.
5

Finish

After ten correct answers:
// Standalone mode
Intent in = new Intent(FoodActivity.this, ScoringPage.class);
in.putExtra("Wrong", wrong_ans_count);
startActivity(in);

Scoring & Feedback

Correct Tap

correct_ans_count increments and the corresponding green dot (grenc1grenc10) illuminates. The next question loads instantly.

Wrong Tap

wrong_ans_count increments and the tapped option disappears. The remaining one or two options stay visible so the child can keep trying.

Sequence Mode

When the Sequence game starts FoodActivity with a value of 1–7, the activity calls finish() on completion instead of launching ScoringPage. The show_mark(int count) method is called on launch to overlay checkmark images on the progress dots for steps already finished earlier in the current sequence run.

Build docs developers (and LLMs) love