cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jblackburnHWGA
New Member

Quiz question - scoring multiple checkboxes

I work in a school and I'm trying to make a quiz. Its a science one and one of the questions is

Which two organs are where digestion of food occurs?

I have 6 answers as checkboxes. How do i score multiple checkboxes?

So far i have 

If(Checkbox1.Value = true, Set(Score,1),Set(score,0)) 

I also want to add 1 to the score if checkbox1_5 is true.

 

The score,0 is to automatically set the score to 0 on a retake of the quiz.

 

I am mainly doing quizzes at the moment. If there is any help you can point me in the direction off it would be great. Even though i'm stuck the quiz part seems simple but i wanted a good finish page. Something that shows the overall mark and maybe which answers they gave incorrectly and what the correct answer was

 

I was hoping for a finish page that showed the score and 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@jblackburnHWGA 

There are a variety of ways to go about this.  The key will be how to make it manageable in some way.

I have done similar and found that having two labels in the app (doesn't make a difference where), one for correct answers and one for incorrect answers.

Now, let's say you have 6 checkboxes for your digestion question, two are correct and 4 are wrong.  I will call these Checkbox1 through Checkbox6.  Checkbox3 and Checkbox 5 are correct and the rest are wrong.

 

In the Correct Label you would have the following formula:

Sum(
    [Checkbox3.Value, Checkbox5.Value], 
    If(Value, 1, 0)
)

In the  incorrect label you would have:

Sum(
    [Checkbox1.Value, Checkbox2.Value, Checkbox4.Value, Checkbox6.Value], 
    If(Value, 1, 0)
)

 

Now that you have these labels, they will have the sum of all of the correct and incorrect answers.  You can refer to those labels anywhere you need to get the value - ex.  Value(labelCorrect.Text) would be the number of correct answers.

 

Anyway, this is just one of many ways.  This one I particularly like because it is relatively simple.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@jblackburnHWGA 

There are a variety of ways to go about this.  The key will be how to make it manageable in some way.

I have done similar and found that having two labels in the app (doesn't make a difference where), one for correct answers and one for incorrect answers.

Now, let's say you have 6 checkboxes for your digestion question, two are correct and 4 are wrong.  I will call these Checkbox1 through Checkbox6.  Checkbox3 and Checkbox 5 are correct and the rest are wrong.

 

In the Correct Label you would have the following formula:

Sum(
    [Checkbox3.Value, Checkbox5.Value], 
    If(Value, 1, 0)
)

In the  incorrect label you would have:

Sum(
    [Checkbox1.Value, Checkbox2.Value, Checkbox4.Value, Checkbox6.Value], 
    If(Value, 1, 0)
)

 

Now that you have these labels, they will have the sum of all of the correct and incorrect answers.  You can refer to those labels anywhere you need to get the value - ex.  Value(labelCorrect.Text) would be the number of correct answers.

 

Anyway, this is just one of many ways.  This one I particularly like because it is relatively simple.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (752)