Exercise API
練習相關API
Endpoints
# Endpoints
My practice
個人練習
Request (MyPracticePageFilterReq)
POST /app/practice/mine
{
"statuses": [
1,
2,
4
],
"pagination": {
"page": 1,
"size": 10
},
"sortings": []
}
Response (MyPracticePageResp)
{
"success": true,
"message": "",
"data": [
{
"pagination": {
"page": 1,
"size": 10,
"totalItems": 0,
"totalPages": 0
},
"sortings": [],
"items": [
{
"userExerciseId": "b84d022d-3280-4f61-aa85-2161ac417d29",
"chapterId": null,
"expiryReminder": "今天到期了",
"category": 1,
"categoryShow": "個人練習",
"status": 1,
"title": "Title1",
"deadline": "2024-11-25T08:44:40.383824Z",
"questionTotal": 1,
"currentProgress": 0,
"coin": 1,
"experience": 10,
"submitAt": null,
"finishedAt": null,
"isReceived": null
}
]
}
]
}
get practice detail
獲取練習情況
Request
GET /app/practice/detail?exercise={user_exercise_id}
Response (MyPracticeDetailResp)
{
"success": true,
"message": "",
"data": [
{
"userExerciseId": "b84d022d-3280-4f61-aa85-2161ac417d29",
"category": 1,
"isReceived": false,
"userPracticeDetailDTO": {
"id": "b84d022d-3280-4f61-aa85-2161ac417d29",
"type": 1,
"typeShow": "單選",
"title": "個人練習測試",
"subTitle": "subTitle",
"content": "content",
"isShowPic": false,
"updatePicTotal": 0,
"picRequired": false,
"optionTotal": 2,
"answerRequired": false,
"answerTitle1": null,
"answerTitle2": null,
"answerTitle3": null,
"answerTitle4": null,
"answerTitle5": null,
"option1": "kakaka",
"option2": "hahaha",
"option3": null,
"option4": null,
"option5": null,
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"option11": null,
"minLabel": null,
"maxLabel": null,
"status": 1,
"submitTotal": 0,
"picList": [
{
"fileKey": "mhahk/lesson/chapter/L001/C001/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/lesson/chapter/L001/C001/1"
}
]
},
"userPracticeAnswerDTO": {
"id": "b84d022d-3280-4f61-aa85-2161ac417d29",
"questionType": 1,
"hasPic": null,
"updatePicTotal": null,
"hasShortAnswer": null,
"emotionAnswer": null,
"shortAnswer1": null,
"shortAnswer2": null,
"shortAnswer3": null,
"shortAnswer4": null,
"shortAnswer5": null,
"option1": null,
"option2": true,
"option3": null,
"option4": null,
"option5": null,
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"option11": null,
"picList": [
{
"fileKey": "mhahk/lesson/chapter/L001/C001/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/lesson/chapter/L001/C001/1"
}
]
}
}
]
}
Category total
練習分類總數
Request
GET /app/practice/category-total
Response (MyPracticeCategoryCountDTO)
{
"success": true,
"message": "",
"data": [
{
"toBeFinish": 2,
"awaitingReview": 2,
"finished": 5,
"expired": 0
}
]
}
Practice submit
個人練習提交
Request (SubmitMyPracticeAnswerReq)
POST /app/practice/submit
{
"userExerciseId": "b84d022d-3280-4f61-aa85-2161ac417d29",
"hasPic": null,
"updatePicTotal": null,
"hasShortAnswer": null,
"emotionAnswer": null,
"shortAnswer1": null,
"shortAnswer2": null,
"shortAnswer3": null,
"shortAnswer4": null,
"shortAnswer5": null,
"option1": null,
"option2": true,
"option3": null,
"option4": null,
"option5": null,
"option6": null,
"option7": null,
"option8": null,
"option9": null,
"option10": null,
"option11": null,
"fileKeys": [
"mhahk/lesson/chapter/L001/C001/1"
]
}
Response (SubmitMyPracticeAnswerResultResp)
{
"success": true,
"message": "",
"data": {
"isExpired": false
}
}
Claim reward
獲取練習獎勵
Request
GET /app/practice/{userExerciseId}/claim
Response (ClaimRewardRespDTO)
{
"success": true,
"message": "",
"data": [
{
"coin": 5,
"exp": 15,
"token": 0,
"level": 6,
"isLevelUp": false
}
]
}
Resources
MyPracticePageFilterReq
properties
練習狀態過濾
分頁參數
排序字段
MyPracticePageResp
properties
userExerciseId
stringrequired練習ID
chapterId
string章節ID,個人練習時為空
expiryReminder
string到期提醒
練習類別
categoryShow
stringrequired練習類別顯示
練習狀態
title
string練習標題
deadline
datetime到期日
questionTotal
intrequired問題總數
currentProgress
intrequired當前進度
coin
int金幣
experience
int經驗
submitAt
datetime提交時間
finishedAt
datetime完成時間
isReceived
booleanrequired是否領取了獎勵
MyPracticeDetailResp
properties
userExerciseId
stringrequired練習ID
練習分類 1:個人練習 2:學習建議
isReceived
booleanrequired是否已領取獎勵, true:已領取 false:未領取
userPracticeDetailDTO
objectrequired個人練習詳情
id
stringrequired個人練習ID
題目類型
typeShow
stringrequired題目類型顯示
title
string練習標題
subTitle
string練習副標題
content
string內容
isShowPic
boolean是否顯示圖片
updatePicTotal
int上傳圖片總數
picRequired
boolean是否必須上傳圖片
optionTotal
int選項總數
answerRequired
boolean是否必須回答
answerTitle1
string簡答標題1
answerTitle2
string簡答標題2
answerTitle3
string簡答標題3
answerTitle4
string簡答標題4
answerTitle5
string簡答標題5
option1
string選項1
option2
string選項2
option3
string選項3
option4
string選項4
option5
string選項5
option6
string選項6
option7
string選項7
option8
string選項8
option9
string選項9
option10
string選項1
option11
string選項11
minLabel
string最小值標籤
maxLabel
string最大值標籤
個人練習狀態
submitTotal
datetimerequired提交次數
picList
object圖片列表
fileKey
string圖片fileKey
url
string圖片url
userPracticeAnswerDTO
object用戶回答對象
id
string用戶回答對象ID
questionType
int問題類型
hasPic
boolean回答是否有圖片
updatePicTotal
int上傳圖片數量
hasShortAnswer
boolean是否有簡答
emotionAnswer
int情緒溫度計回答
shortAnswer1
string簡答1
shortAnswer2
string簡答2
shortAnswer3
string簡答3
shortAnswer4
string簡答4
shortAnswer5
string簡答5
option1
boolean選項1是否有回答
option2
boolean選項2是否有回答
option3
boolean選項3是否有回答
option4
boolean選項4是否有回答
option5
boolean選項5是否有回答
option6
boolean選項6是否有回答
option7
boolean選項7是否有回答
option8
boolean選項8是否有回答
option9
boolean選項9是否有回答
option10
boolean選項10是否有回答
option11
boolean選項11是否有回答
picList
object用戶上傳的圖片對象列表
fileKey
string圖片fileKey
url
string圖片url
MyPracticeCategoryCountDTO
properties
toBeFinish
intrequired待完成
awaitingReview
intrequired待批改
finished
intrequired已完成
expired
intrequired已逾期
SubmitMyPracticeAnswerReq
properties
userExerciseId
stringrequired練習ID
hasPic
boolean回答是否有圖片
updatePicTotal
int上傳圖片數量
hasShortAnswer
boolean是否有簡答
emotionAnswer
int情緒溫度計回答
shortAnswer1
string簡答1
shortAnswer2
string簡答2
shortAnswer3
string簡答3
shortAnswer4
string簡答4
shortAnswer5
string簡答5
option1
boolean選項1是否有回答
option2
boolean選項2是否有回答
option3
boolean選項3是否有回答
option4
boolean選項4是否有回答
option5
boolean選項5是否有回答
option6
boolean選項6是否有回答
option7
boolean選項7是否有回答
option8
boolean選項8是否有回答
option9
boolean選項9是否有回答
option10
boolean選項10是否有回答
option11
boolean選項11是否有回答
fileKeys
array[string]圖片fileKey
SubmitMyPracticeAnswerResultResp
properties
isExpired
booleanrequired是否到期
ClaimRewardRespDTO
properties
coin
numberThe coin earned by the mission.
exp
numberThe experience earned by the mission.
token
numberThe token earned by the mission.
level
numberThe level.
isLevelUp
booleanIt indicates if the user is leveled up or not.
ExerciseStatus
Enum | Description |
---|---|
1 | 已分配 |
2 | 測驗中 |
3 | 待批改 |
4 | 再试一次 |
5 | 已完成 |
6 | 已逾期 |
QuestionType
Type | Description |
---|---|
1 | 單選 |
2 | 多項選擇 |
3 | 線型刻度 |
4 | 核取方格 |
5 | 簡答&圖片 |
6 | 情緒溫度計 |
ExerciseCategory
Type | Description |
---|---|
1 | 個人練習 |
2 | 學習建議 |
3 | 學習課程 |