cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dishen
Advocate III
Advocate III

Create quiz in canvas PowerApps

Hello Everyone, Am going to create Quiz, In once screen only one question is allowed with list of options as answers.

I must use collection or Data verse. 

I need how to create questions and answers and how we map the questions to the answers

Any idea? Please help me with the code.

 

I have checked the previous threads but it is not matching my requirement

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Dishen ,

You can use If to judge answer and set score using a variable to different value. Something like this, set OnChange property of the dropdown to:

 

If(Dropdown1.Selected.Value=QuestionA.AnswerA,Set(score,1),Set(score,0))

 

v-albai-msft_0-1623143285220.png

Then you can directly patch this score into your datasource.

(remember to clear this score variable when patch the changes, or you can also clear this variable on OnStart property of your app)

This article is more useful for achieving this purpose:

PowerApps Simple Quiz Application (c-sharpcorner.com)

Best regards,

Allen

 

 

View solution in original post

5 REPLIES 5
v-albai-msft
Community Support
Community Support

Hi @Dishen,

We can use Patch function to match answer to a question in datasource.

I did a simple test on my side for your reference.

1. First I create a Choice column called “QuestionA” in my Dataverse with below choices:

v-albai-msft_0-1623140692282.png

 

2. In my app, add a label and set its Text property to “QuestionA”.

v-albai-msft_3-1623140790958.png

 

3. Under this label, add a dropdown control and set its Items property to below(“TC_InspectionImgs” is the name of my DataVerse table):

Choices(TC_InspectionImgs.QuestionA)

Note, here we can also add a Radio control instead of a dropdown control:

v-albai-msft_6-1623141311932.png

 

4. Add a Submit button and set its to:

Patch(TC_InspectionImgs,Defaults(TC_InspectionImgs),{QuestionA:LookUp(Choices(TC_InspectionImgs.QuestionA),Value=Dropdown1.Selected.Value).Value})

v-albai-msft_1-1623140692288.png

This is a simple example, you need to do some changes based on above example to meet you own needs.

Besides, I would suggest you refer to below articles for more information about how to create quiz in canvas app:

https://www.spguides.com/powerapps-quiz-app/ 

https://www.c-sharpcorner.com/article/powerapps-simple-quiz-application/ 

https://www.youtube.com/watch?v=RisTtTc9aOY 

https://www.youtube.com/watch?v=JXCySVtaEKg

Best regards,

Allen

timl
Super User III
Super User III

In addition to the links that @v-albai-msft  has given, I would also look at Mr Dangs's sample app here, which contains code that you can reuse.

https://powerusers.microsoft.com/t5/Community-App-Samples/Design-Patterns-from-Mr-Dang-Part-2/m-p/19...

 

Wow Thank you so much . I understood this clearly. One more additional concern is, how we map the given answers to the correct answer in order to give score? 

Hi @Dishen ,

You can use If to judge answer and set score using a variable to different value. Something like this, set OnChange property of the dropdown to:

 

If(Dropdown1.Selected.Value=QuestionA.AnswerA,Set(score,1),Set(score,0))

 

v-albai-msft_0-1623143285220.png

Then you can directly patch this score into your datasource.

(remember to clear this score variable when patch the changes, or you can also clear this variable on OnStart property of your app)

This article is more useful for achieving this purpose:

PowerApps Simple Quiz Application (c-sharpcorner.com)

Best regards,

Allen

 

 

View solution in original post

Thanks for your time 🙂🙂

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,205)