Code help! (I have 2 problems)

Hey guys, I need help. I’m making a quiz but I don’t know what to put in the last scene (the one we’re it tells you what u are)

I put this in every choice (it’s a multiple option quiz):


I’m not sure if this is correct.

And my 2nd problem is I don’t know what cod to put in the end (the scene where the quiz shows what you are)

Here’s an example:


Credit to @Jedi4Jesus on the hs app and forum

But yeah, my 2nd problem is a bit hard because I need the code to make the text pop up according to what you press and not just to be random answers!

(I’m making a Harry Potter quiz!)

  • Candy
8 Likes

hey there! so the variables you have in each ‘when self is tapped’ are going to set the variables to that number, not increase them.

for example, say I was making a quiz and it was like

what is your favorite color?
  • red
  • green
  • blue

0 voters

and i had one object per option. when the green option is tapped, i would put an increase (+1 green) by 1 block, to show that the green option was tapped once. and every time the question changes, i’d just have the object that determines the green result always increases the +1 green variable by the same amount, and same for all other objects

as for the end, what i’d do is determine which of the variables are holding the greatest number. you’d do this with check if else blocks, to check if one variable was the greatest. for example, you’d write

check if else (((+1 green) > (+1 blue)) and ((+1 green) > (+1 red)))
set text to (you got green!!)

i know this is a little unclear haha, feel free to check this out and look around in the code for more help

8 Likes

Is this for my comp lol
If it is then i’ll mute this topic so i dont get spoilers hah

9 Likes

I just put this in a more appropriate category: Debug my Code

Open Source Code & How Tos is more for showing others how to make something cool.

8 Likes

Haha it is! I was bored yesterday so I decided to start working on it but since I’m still a beginner i still need a little help when it comes to code!
And to answer your question, you can mute this topic

7 Likes

This helped a lot thanks! I can add you to the credits :slight_smile:

7 Likes

Hey! For the 2nd problem I still don’t understand. (I tried ur project as well)
If possible please could you make a separate project/tutorial on how to do this?

5 Likes

ofc! here you go!!

open up everything in the code, there are comments to explain what everything does - if you still have trouble understanding reach out again! :))

5 Likes

Ohhh I just realised you know how you have the questions on 1 scene? My 3 questions are on different scenes.

4 Likes

thats fine as long as you keep the same variables

3 Likes

Alright thanks!

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.