User Attempts Stats API - masai-oss/Masai_Refresh Wiki

Original URL: https://github.com/masai-oss/Masai_Refresh/wiki/User-Attempts-Stats-API

Get the stats of all attempts topic-wise

GET /api/stats/topic_attempts_stats/:topic_id

PARAMS

RESPONSE

Success

{
    "error": false,
    "started_attempts": false,
    "topic_attempt_stats": null
}
{
    "error": false,
    "started_attempts": true,
    "topic_attempt_stats": [
        {
            "attempt_id": "60b489ac83436699ea3655cd",
            "correct": 0,
            "skipped": 5,
            "incorrect": 0,
            "total_questions": 5,
            "date": "31/05/2021, 12:30:41"              // "N/A" for previous submission, as the data wasn't collected
        },
        {
            "attempt_id": "60b489ac83436699ea3655ce",
            "correct": 3,
            "skipped": 2,
            "incorrect": 0,
            "total_questions": 5,
            "date": "31/05/2021, 11:20:21"              // "N/A" for previous submission, as the data wasn't collected        
        }
    ]
}

RESPONSE Failure

{
    "error" : true,
    "message" : "Send topic id"
}
{
    "error": true,
    "message": "Invalid topic id"
}
{
    "error": true,
    "message": "No such topic id"
}
{
    "error": true,
    "message": "Something went wrong",
    "reason": err
}