curl --request POST \
--url https://api.example.com/api/quiz/submit \
--header 'Content-Type: application/json' \
--data '
{
"courseId": "<string>",
"chapterId": "<string>",
"answers": [
{}
]
}
'{
"success": false,
"message": "Invalid request data"
}
Submit quiz answers and receive score with AI-powered recommendations
curl --request POST \
--url https://api.example.com/api/quiz/submit \
--header 'Content-Type: application/json' \
--data '
{
"courseId": "<string>",
"chapterId": "<string>",
"answers": [
{}
]
}
'{
"success": false,
"message": "Invalid request data"
}
Authorization: Bearer <user_token>
[0, 2, 1, 3, 0, 1, 2, 0, 3, 1]Show result object
"needs_review" (≤40%), "on_track" (41-75%), or "mastered" (>75%)const response = await fetch('https://api.skillrise.com/api/quiz/submit', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
courseId: '507f1f77bcf86cd799439011',
chapterId: 'chapter-001',
answers: [0, 2, 1, 3, 0, 1, 2, 0, 3, 1]
})
});
const data = await response.json();
console.log(data.result);
{
"success": true,
"result": {
"score": 9,
"total": 10,
"percentage": 90,
"group": "mastered",
"recommendations": "• Excellent work! You've demonstrated strong mastery of variables and data types\n• Challenge yourself by exploring advanced topics like type coercion and symbol data types\n• Practice building small projects that utilize different data types effectively\n• Consider helping peers who are struggling with these concepts to reinforce your knowledge\n• Keep up the great momentum as you progress through the course"
}
}
{
"success": true,
"result": {
"score": 6,
"total": 10,
"percentage": 60,
"group": "on_track",
"recommendations": "• Review the differences between let, const, and var declarations\n• Practice writing code examples for each primitive data type\n• Revisit the lectures on type conversion and comparison operators\n• Try creating a small project that uses different variable types\n• Don't get discouraged - you're making solid progress!"
}
}
{
"success": true,
"result": {
"score": 3,
"total": 10,
"percentage": 30,
"group": "needs_review",
"recommendations": "• Revisit all lectures in this chapter, taking detailed notes\n• Focus on understanding what variables are and how they store data\n• Practice declaring variables using let and const with simple examples\n• Watch supplementary videos on JavaScript data types\n• Consider scheduling time with a tutor or joining a study group\n• Remember that learning takes time - stay persistent!"
}
}
{
"success": false,
"message": "Invalid request data"
}
{
"success": false,
"message": "Quiz not found"
}
{
"success": false,
"message": "Answer count does not match question count"
}
| Group | Percentage Range | Description |
|---|---|---|
needs_review | 0-40% | Significant gaps in understanding. Comprehensive review recommended. |
on_track | 41-75% | Good progress with room for improvement. Additional practice suggested. |
mastered | 76-100% | Strong comprehension. Ready to advance to next topics. |
answers array must contain exactly the same number of elements as there are questions in the quiz