PATCH - Update Model Answer
This API allows authenticated users to update an existing model answer by either attaching rubric-based evaluation criteria or uploading supporting documents.
Key Parameters:
- assignmentId (
path param, required): Unique ID of the assignment. - rubricId (
form-data, optional): The unique ID of the rubric used for evaluation or you can refer this doc to get therubricId. - isFinal (
form-data, optional): Passtrueif this is the final model answer being submitted for evaluation. - documents[] (
form-data, optional): Uploads related documents such as reference material or answer sheets.
Behavior:
- You must only pass one of these at a time:
documents,rubricId, orisFinal. - If
isFinal=true, the model answer sheet will be sent for evaluation.You can either uploaddocumentsor provide arubricIdin a single request — not both. This is to ensure clarity in what part of the model answer you’re updating.
curl --request PATCH \
--url https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form rubricId=2b973c83-2830-4712-87b7-64a8c0a99035 \
--form isFinal=true \
--form 'documents=<string>' \
--form documents.items='@example-file'import requests
url = "https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/"
files = { "documents.items": ("example-file", open("example-file", "rb")) }
payload = {
"rubricId": "2b973c83-2830-4712-87b7-64a8c0a99035",
"isFinal": "true",
"documents": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('rubricId', '2b973c83-2830-4712-87b7-64a8c0a99035');
form.append('isFinal', 'true');
form.append('documents', '<string>');
form.append('documents.items', '{
"fileName": "example-file"
}');
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/', 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-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "3b27e0be-f9e8-4c4d-977b-b315bfb292ab",
"documents": [],
"rubric": {
"id": "2b973c83-2830-4712-87b7-64a8c0a99035",
"name": "English Rubrics",
"description": null,
"rubricCriteria": [
{
"id": "d102b0ff-1111-4235-b8e9-764ef03c57cb",
"name": "Confidence & fluency in speaking",
"description": "",
"maxScore": "5 Star",
"minScore": "1 Star",
"scoringLogic": [
{
"score": "5 Star",
"scoringLogic": "Speaking: Reflects poise & confidence. Great body language, eye contact."
}
],
"createdAt": "2023-10-01T12:00:00Z",
"modifiedAt": "2023-10-01T12:00:00Z"
}
],
"createdAt": "2023-10-01T12:00:00Z",
"modifiedAt": "2023-10-01T12:00:00Z"
},
"status": 1
}{
"detail": "Token has expired"
}{
"error": {
"code": 404,
"message": {
"non_field_errors": [
"Only one of documents, rubricId, or isFinal can be provided"
]
}
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Unique identifier of the assignment
Unique identifier of the model answer
Body
Flag to trigger evaluation if set to 'true'. Only one of documents, rubricId, or isFinal is allowed.
true, false "true"
List of model answer sheet documents to upload (if any).
Response
Model answer sheet updated successfully.
Unique identifier for the model answer sheet.
"3b27e0be-f9e8-4c4d-977b-b315bfb292ab"
List of documents associated with the model answer sheet.
[]
Show child attributes
Show child attributes
Status of the model answer sheet (refer this doc to get the constants)
1
Was this page helpful?
curl --request PATCH \
--url https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form rubricId=2b973c83-2830-4712-87b7-64a8c0a99035 \
--form isFinal=true \
--form 'documents=<string>' \
--form documents.items='@example-file'import requests
url = "https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/"
files = { "documents.items": ("example-file", open("example-file", "rb")) }
payload = {
"rubricId": "2b973c83-2830-4712-87b7-64a8c0a99035",
"isFinal": "true",
"documents": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('rubricId', '2b973c83-2830-4712-87b7-64a8c0a99035');
form.append('isFinal', 'true');
form.append('documents', '<string>');
form.append('documents.items', '{
"fileName": "example-file"
}');
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/', 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-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: multipart/form-data"
],
]);
$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-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/"
payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/")
.header("Authorization", "Bearer <token>")
.body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-staging.crazygoldfish.com/assignment-evaluation/v1/assignment/{id}/model-answer/{modelAnswerId}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"rubricId\"\r\n\r\n2b973c83-2830-4712-87b7-64a8c0a99035\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isFinal\"\r\n\r\ntrue\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents\"\r\n\r\n<string>\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"documents.items\"; filename=\"example-file\"\r\nContent-Type: application/octet-stream\r\n\r\n{\r\n \"fileName\": \"example-file\"\r\n}\r\n-----011000010111000001101001--"
response = http.request(request)
puts response.read_body{
"id": "3b27e0be-f9e8-4c4d-977b-b315bfb292ab",
"documents": [],
"rubric": {
"id": "2b973c83-2830-4712-87b7-64a8c0a99035",
"name": "English Rubrics",
"description": null,
"rubricCriteria": [
{
"id": "d102b0ff-1111-4235-b8e9-764ef03c57cb",
"name": "Confidence & fluency in speaking",
"description": "",
"maxScore": "5 Star",
"minScore": "1 Star",
"scoringLogic": [
{
"score": "5 Star",
"scoringLogic": "Speaking: Reflects poise & confidence. Great body language, eye contact."
}
],
"createdAt": "2023-10-01T12:00:00Z",
"modifiedAt": "2023-10-01T12:00:00Z"
}
],
"createdAt": "2023-10-01T12:00:00Z",
"modifiedAt": "2023-10-01T12:00:00Z"
},
"status": 1
}{
"detail": "Token has expired"
}{
"error": {
"code": 404,
"message": {
"non_field_errors": [
"Only one of documents, rubricId, or isFinal can be provided"
]
}
}
}