I’m working on a digital Qbank app and now building a statistics page. I want to show a pie chart of correct and incorrect answers.
I have a table called User Answers where I keep record of every questions answered by users. Here is the table:
- choice_id (linked to choices table)
- question_id (linked to questions table)
- user_id (linked to user table)
- is_correct (yes/no)
I’m using the Chart Element plugin to build my pie chart. I need to do a search in user answers and group them by “is_correct”. However, it doesn’t show up in the group settings. This is my first problem.
Then I created an option set (only includes correct and incorrect) and manually edit some rows. I can do a search and group by with this field. However, It only counts unique elements and shows 1 for each option.
How can I get the total count for correct and incorrect answers?
