Submit assessment course lesson
curl --request POST \
--url https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"answers": [
{
"question_id": "<string>",
"answer_text": "<string>",
"selected_option_ids": [
"<string>"
]
}
]
}
'import requests
url = "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment"
payload = { "answers": [
{
"question_id": "<string>",
"answer_text": "<string>",
"selected_option_ids": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
answers: [
{
question_id: '<string>',
answer_text: '<string>',
selected_option_ids: ['<string>']
}
]
})
};
fetch('https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'answers' => [
[
'question_id' => '<string>',
'answer_text' => '<string>',
'selected_option_ids' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment"
payload := strings.NewReader("{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-12-01T05:00:00.401Z",
"id": "crsar_xxxxxxxxxxxx",
"lesson": {
"id": "lesn_xxxxxxxxxxxxx",
"title": "Understanding Candlestick Patterns"
},
"result_correct": 42,
"result_grade": 6.9,
"result_graded_questions": {},
"result_passing_grade": true,
"result_question_count": 42,
"score_percent": 6.9,
"updated_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
}
}{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}{
"error": null
}{
"error": null
}{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}강좌 레슨
Submit assessment course lesson
Submit answers for a quiz or knowledge check lesson and receive a graded result.
POST
/
course_lessons
/
{lesson_id}
/
submit_assessment
Submit assessment course lesson
curl --request POST \
--url https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"answers": [
{
"question_id": "<string>",
"answer_text": "<string>",
"selected_option_ids": [
"<string>"
]
}
]
}
'import requests
url = "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment"
payload = { "answers": [
{
"question_id": "<string>",
"answer_text": "<string>",
"selected_option_ids": ["<string>"]
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
answers: [
{
question_id: '<string>',
answer_text: '<string>',
selected_option_ids: ['<string>']
}
]
})
};
fetch('https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'answers' => [
[
'question_id' => '<string>',
'answer_text' => '<string>',
'selected_option_ids' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment"
payload := strings.NewReader("{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.whop.com/api/v1/course_lessons/{lesson_id}/submit_assessment")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"answers\": [\n {\n \"question_id\": \"<string>\",\n \"answer_text\": \"<string>\",\n \"selected_option_ids\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-12-01T05:00:00.401Z",
"id": "crsar_xxxxxxxxxxxx",
"lesson": {
"id": "lesn_xxxxxxxxxxxxx",
"title": "Understanding Candlestick Patterns"
},
"result_correct": 42,
"result_grade": 6.9,
"result_graded_questions": {},
"result_passing_grade": true,
"result_question_count": 42,
"score_percent": 6.9,
"updated_at": "2023-12-01T05:00:00.401Z",
"user": {
"id": "user_xxxxxxxxxxxxx",
"name": "John Doe",
"username": "johndoe42"
}
}{
"error": {
"code": "parameter_missing",
"message": "Missing required parameter: amount.",
"param": "amount",
"type": "invalid_request_error"
}
}{
"error": {
"message": "Invalid or missing API key",
"type": "unauthorized"
}
}{
"error": {
"message": "You do not have permission to access this resource",
"type": "forbidden"
}
}{
"error": {
"message": "Resource not found",
"type": "not_found"
}
}{
"error": null
}{
"error": null
}{
"error": {
"message": "An unexpected error occurred",
"type": "internal_server_error"
}
}인증
경로 매개변수
본문
application/json
응답
A successful response
The result of a user's assessment attempt

