Skip to content

Returns the current user stored result for one quiz lesson, or null if they have not attempted it.

When the quiz has hide_result set, the correct answers are stripped from the stored result before it is returned.

Endpoint

  • Method: GET

  • Path: /courses/{course_id}/lessons/{lesson_id}/quiz/result

  • Edition: PRO

  • Controller: FluentCommunityPro\App\Modules\Quiz\Http\Controllers\QuizController@getQuizResult

  • Route source: fluent-community-pro/app/Modules/Quiz/Http/quiz_api.php:9

  • Requires the caller to be enrolled in the course.

  • Requires FluentCommunity Pro with the Quiz module.

Live sample

The request and response below were recorded against a running FluentCommunity install and then anonymised — member names, emails, avatars and post content are fictional, and long collections are trimmed to a few entries.

GET Get Lesson Quiz Result

GET
/courses/{course_id}/lessons/{lesson_id}/quiz/result

Returns the current user stored result for one quiz lesson, or null if they have not attempted it.

Controller: FluentCommunityPro\App\Modules\Quiz\Http\Controllers\QuizController@getQuizResult
Route source: fluent-community-pro/app/Modules/Quiz/Http/quiz_api.php:9

Authorizations

ApplicationPasswords

WordPress Application Passwords — use Basic auth with username:application_password.

Type
API Key (header: Authorization)

Responses

Successful response

application/json
JSON
{
  
"result": {
  
  
"content_type": "string",
  
  
"id": 0,
  
  
"message": {
  
  
  
"q1": {
  
  
  
  
"is_correct": true,
  
  
  
  
"user_answer": "string"
  
  
  
},
  
  
  
"q2": {
  
  
  
  
"is_correct": true,
  
  
  
  
"user_answer": [
  
  
  
  
  
"string"
  
  
  
  
]
  
  
  
}
  
  
},
  
  
"meta": {
  
  
  
"attempts": 0,
  
  
  
"correct_answers": 0,
  
  
  
"total_questions": 0
  
  
},
  
  
"parent_id": "string",
  
  
"post_id": "string",
  
  
"score": "string",
  
  
"status": "string",
  
  
"type": "string",
  
  
"updated_at": "string",
  
  
"user_id": "string"
  
}
}

Playground

Authorization

Samples

Powered by VitePress OpenAPI

FluentCommunity developer documentation