Hello!
I have a lot of questions and I am still quite new to PowerApps so please bear with me!
I’m trying to create a quiz on PowerApps that links to an existing SharePoint list – the quiz needs to mark questions as correct and incorrect on select. I have managed to set up the rules for marking my radio answers and triggering a next button using the following formulas:
Radio buttons:
Items:
["NHSI", "YICP", "YICE", "YCUI", "YIMM"]
OnSelect:
If(Radio_Answers_2.SelectedText.Value ="YICP",Set(Score,Score+1); UpdateContext({visibleCorrect:true}); UpdateContext({visibleIncorrect:false}),Set(Score,Score);UpdateContext({visibleCorrect:false}); UpdateContext({visibleIncorrect:true}));UpdateContext({RadioDisplay:DisplayMode.Disabled}); UpdateContext({visibleButton:true})
Incorrect Label:
Visible: visibleIncorrect
Correct Label:
Visible: visibleIncorrect
Score:
Text: "Score: " & Score & " / " & NumberQuestions.Text
However I am having issues doing a similar thing with my multiple choice questions. I currently have 4 checkboxes and a correct text label with the following formula:
Correct Label:
Visible:
Sum(
[Choice4_Q11.Value And Choice2_Q11.Value],
If(Value, 1, 0)
)
The correct label appears when the two answers are selected but it also shows the answer as correct when all checkboxes are selected or Choice2 and Choice4 are both selected in conjunction with any of the incorrect answers. Is there any way I can control this to only have Correct appear when ONLY those two correct answers are both selected and set up a label for Incorrect to appear if any of the incorrect checkboxes are selected including combinations e.g. (Choice1 only, Choice3 only, both Choice1 and Choice3 including any combinations of that with the correct answers and also if all boxes are selected or blank).
I also need to know if I can create a button that can be selected to check the answers before the correct or incorrect labels appear so trainees completing the quiz do not see if the answer is correct or incorrect by selecting and de-selecting checkboxes to gain a point on their score. Essentially I want the trainee to select their checkboxes, then when they’re happy with their answer they can click Check Answers, then find out if it’s correct or incorrect and are unable to change these answers after this.
In addition, I’d like to be able to add these answers to an existing SharePoint list, I currently have a button to add to SharePoint for my radio answers but I’m unsure if this would need to be modified for multiple choice. Current formula in place for this button is:
OnSelect:
Patch('Skills Assessment', Defaults('Skills Assessment'), {Title: "Skills Assessment", Q1: Radio_Answers_1.SelectedText, Q2: Radio_Answers_2.SelectedText, Q3: Radio_Answers_3.SelectedText, Q4: Radio_Answers_4.SelectedText}); Navigate(FinalScore,ScreenTransition.None)
Will I also need to use a different formula to calculate the score?
Thanks so much in advance! I know there’s a lot of questions and I really hope I can get some clear answers. If I need to use something other than checkboxes for multiple choice that’s fine but I would just need to know the formula to be able to do so.