- SCUPIOJ
25 修改作业中题目内容
测试中
PUT
http://127.0.0.1:8000/home/<str:coursename>/<str:assignmentname>/
OJ
只有老师和管理员可以调用
修改在str:coursename班级中,str:assignmentname作业中的题目的内容,允许批量修改,只需要将修改之后的题目信息放在list中
注意需含有修改题目的id,id可用get获得,返回修改后题目的信息
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Body 参数application/json
array of:
id
integer
必需
title
string
必需
content_problem
string
必需
score
integer
必需
type
string
必需
response_limit
integer | null
必需
non_programming_answer
string | null
必需
示例
[
{
"id": 14,
"title": "NEWProblem 1",
"content_problem": "Describe the process of normalization in databases.",
"score": 10,
"type": "text",
"response_limit": 500,
"non_programming_answer": "Normalization is the process of organizing data in a database..."
},
{
"id": 15,
"title": "NEWProblem 2",
"content_problem": "What is the time complexity of a binary search algorithm?",
"score": 5,
"type": "choice",
"response_limit": null,
"non_programming_answer": "O(log n)"
},
{
"id": 16,
"title": "NEWProblem 3",
"content_problem": "Write a function to reverse a string.ASDFASDFASDFADS",
"score": 15,
"type": "programming",
"response_limit": null,
"non_programming_answer": null
}
]
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'http://127.0.0.1:8000/home/<str:coursename>/<str:assignmentname>/' \
--header 'Content-Type: application/json' \
--data-raw '[
{
"id": 14,
"title": "NEWProblem 1",
"content_problem": "Describe the process of normalization in databases.",
"score": 10,
"type": "text",
"response_limit": 500,
"non_programming_answer": "Normalization is the process of organizing data in a database..."
},
{
"id": 15,
"title": "NEWProblem 2",
"content_problem": "What is the time complexity of a binary search algorithm?",
"score": 5,
"type": "choice",
"response_limit": null,
"non_programming_answer": "O(log n)"
},
{
"id": 16,
"title": "NEWProblem 3",
"content_problem": "Write a function to reverse a string.ASDFASDFASDFADS",
"score": 15,
"type": "programming",
"response_limit": null,
"non_programming_answer": null
}
]'
返回响应
🟢200成功
application/json
Body
array of:
id
integer
必需
title
string
必需
content_problem
string
必需
score
integer
必需
type
string
必需
response_limit
integer | null
必需
non_programming_answer
string | null
必需
示例
[
{
"id": 14,
"title": "NEWProblem 1",
"content_problem": "Describe the process of normalization in databases.",
"score": 10,
"type": "text",
"response_limit": 500,
"non_programming_answer": "Normalization is the process of organizing data in a database..."
},
{
"id": 15,
"title": "NEWProblem 2",
"content_problem": "What is the time complexity of a binary search algorithm?",
"score": 5,
"type": "choice",
"response_limit": null,
"non_programming_answer": "O(log n)"
},
{
"id": 16,
"title": "NEWProblem 3",
"content_problem": "Write a function to reverse a string.ASDFASDFASDFADS",
"score": 15,
"type": "programming",
"response_limit": null,
"non_programming_answer": null
}
]
修改于 2024-03-21 02:34:49