Closed alex1897 closed 2 years ago
Yeah, it's possible. Something like the following?
{
"result": [
{
"question_id": 1,
"is_correct": false,
"score": -1,
"given_answer": 20,
"correct_answer": 10.5
},
{
"question_id": 2,
"is_correct": true,
"score": 5,
"given_answer": "123456",
"correct_answer": "123456"
}
]
}
Yes, even better with more information. I just thought about true/false. However, the given/correct will be difficult for the multiple choice.
correct_answer
may also contain other types of data. The above JSON snippet is just for ref.
@harishdurga: Sorry for checking so late, I was busy on other projects.
I think this works in general, but noticed two things:
Hey @alex1897 , If you have some spare time can you please raise a PR fixing the mentioned problem?
Hi @harishdurga, I already looked at the code and to be honest I can't solve the problem.
Understood. No problem, I will try to solve this in sometime.
Is it currently not possible to check after a question is answered if it's correct, right?
The leering effect is a lot better if the user knows on which question they made a mistake, instead of just telling them the points they made at the end.
I built myself a validation which seems to work (for single/multiple choice) but I guess there would a better way. Since the model already has the validation, could it provide a function to validate it?
Something like: $quizAttempt->validate($quiz_question->id)