Currently, the query being used in the Quizzes page +page.svelte is getting the incorrect answers and the correct answers. The user can see this query in the Network tab in inspect mode. It should instead get the answers and then after the user submits, we will check for those questionid's in the net_correct_answers table and see if they are right.
Here is an example of what the query should look like after this change:
And then you will need a function that receives a questionid and answer and checks the net_correct_answers table.
The query itself might look something like this:
(Note: You could perhaps use a _in as well for this if you prefer to work with a list. Many different ways to tackle this, use what works for you)
Then perhaps have a counter that tracks correct answers and keeps data for each question. This is the rough idea, feel free to do whatever works in your mind. We'll somehow want to get the correct answer as well to show them what was right.
Currently, the query being used in the Quizzes page
+page.svelte
is getting the incorrect answers and the correct answers. The user can see this query in the Network tab in inspect mode. It should instead get the answers and then after the user submits, we will check for thosequestionid
's in thenet_correct_answers
table and see if they are right.Here is an example of what the query should look like after this change:
And then you will need a function that receives a
questionid
andanswer
and checks thenet_correct_answers
table. The query itself might look something like this: (Note: You could perhaps use a _in as well for this if you prefer to work with a list. Many different ways to tackle this, use what works for you)Then perhaps have a counter that tracks correct answers and keeps data for each question. This is the rough idea, feel free to do whatever works in your mind. We'll somehow want to get the correct answer as well to show them what was right.