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.

ScoringPage is the results screen that every standalone quiz Activity hands off to once all ten questions are answered. It receives a single integer — the number of wrong answers — through an Intent extra, decides which tier of reward imagery to show, plays a Google AdMob rewarded ad, and then sets the final result images and message. Children see one of three star ratings: zero stars for a rough round, two stars for a decent attempt, or three stars for an excellent performance. A back press from this screen returns the player to FinalmainScreen rather than to the quiz.

Receiving Quiz Results

ScoringPage reads the Wrong integer extra that the calling quiz Activity places on its outgoing Intent:
// Inside the quiz Activity (e.g. EmoQuestionsActivity, TravelAct, Vehicals_Act)
Intent intent = new Intent(QuizActivity.this, ScoringPage.class);
intent.putExtra("Wrong", wrong_ans_count);
startActivity(intent);
Inside ScoringPage.onCreate(), the value is retrieved with:
int a = getIntent().getIntExtra("Wrong", 0);
Only activities running in standalone mode (seq == 0) launch ScoringPage. When a quiz runs as part of a Sequence Game it calls finish() instead, so ScoringPage is never shown mid-chain.

Three-Tier Result System

Performance is divided into three tiers based on how many questions the child answered incorrectly.
Wrong AnswersResult ImageStars DrawableOn-Screen Message
>= 7zeroscorereward_star1"Play Again.. !!!"
4 – 6 (< 7 and > 3)smile_rewardreward_start2"No Bad Play Again!"
0 – 3 (< 3)reward_2323917_2155564reawar_start3"Congratulations Well Played"

Result Logic (Java)

if (a >= 7) {
    rewords_img.setImageResource(R.drawable.zeroscore);
    reward_star.setImageResource(R.drawable.reward_star1);
    reward_text.setText("Play Again.. !!!");
} else if (a < 7 && a > 3) {
    rewords_img.setImageResource(R.drawable.smile_reward);
    reward_star.setImageResource(R.drawable.reward_start2);
    reward_text.setText("No Bad Play Again!");
} else if (a < 3) {
    rewords_img.setImageResource(R.drawable.reward_2323917_2155564);
    reward_star.setImageResource(R.drawable.reawar_start3);
    reward_text.setText("Congratulations Well Played");
}
Notice that the boundary condition a == 3 falls between the second and third tier — children who answer exactly 3 questions wrong will not match the third else if (a < 3) branch. Design your difficulty or messaging around this if needed.

AdMob Rewarded Ad Integration

A RewardedAd is loaded during onCreate(). When the ad is ready, it is shown before the result images are set, so the reward moment feels earned. The result drawables and text are applied inside the ad’s callback handlers, ensuring they appear only after the ad interaction completes.
1

Load ad in onCreate

RewardedAd.load() is called with the AdMob ad unit ID as soon as the activity is created, giving the ad maximum time to fetch before it is needed.
2

Ad shown on result screen

Once the quiz data is ready, the loaded rewarded ad is displayed. The child watches a short video or interacts with the ad format.
3

Callbacks set result imagery

Inside onUserEarnedReward and the ad dismiss callback, the three ImageView/TextView fields (rewords_img, reward_star, reward_text) are populated with the appropriate tier’s resources.
Displaying the rewarded ad first creates a natural pause that builds anticipation. The star rating and celebratory image are then revealed as an immediate follow-up reward, reinforcing the ad-completion action with positive visual feedback.
ActionDestination
Back button pressedFinalmainScreen (via onBackPressed)
Play again (implicit)Child re-launches the quiz from FinalmainScreen
@Override
public void onBackPressed() {
    Intent intent = new Intent(ScoringPage.this, FinalmainScreen.class);
    startActivity(intent);
    finish();
}
Calling finish() after starting FinalmainScreen ensures ScoringPage is removed from the back stack, so pressing Back on the main screen does not return to the results.
  • Emotions Quiz — standalone quiz that sends Wrong to this screen
  • Transport Quiz — standalone quiz that sends Wrong to this screen
  • Things Quiz — standalone quiz that sends Wrong to this screen
  • Sequence Game — chained mode that bypasses this screen entirely

Build docs developers (and LLMs) love