Skip to main content

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
  • statuses
    array[ExerciseStatus]
    required
    練習狀態過濾
  • pagination
    required
    分頁參數
  • sortings
    排序字段

MyPracticePageResp

properties
  • userExerciseId
    string
    required
    練習ID
  • chapterId
    string
    章節ID,個人練習時為空
  • expiryReminder
    string
    到期提醒
  • category
    ExerciseCategory
    required
    練習類別
  • categoryShow
    string
    required
    練習類別顯示
  • status
    required
    練習狀態
  • title
    string
    練習標題
  • deadline
    datetime
    到期日
  • questionTotal
    int
    required
    問題總數
  • currentProgress
    int
    required
    當前進度
  • coin
    int
    金幣
  • experience
    int
    經驗
  • submitAt
    datetime
    提交時間
  • finishedAt
    datetime
    完成時間
  • isReceived
    boolean
    required
    是否領取了獎勵

MyPracticeDetailResp

properties
  • userExerciseId
    string
    required
    練習ID
  • category
    ExerciseCategory
    required
    練習分類 1:個人練習 2:學習建議
  • isReceived
    boolean
    required
    是否已領取獎勵, true:已領取 false:未領取
  • userPracticeDetailDTO
    object
    required
    個人練習詳情
  • id
    string
    required
    個人練習ID
  • type
    required
    題目類型
  • typeShow
    string
    required
    題目類型顯示
  • 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
    最大值標籤
  • status
    required
    個人練習狀態
  • submitTotal
    datetime
    required
    提交次數
  • 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
    int
    required
    待完成
  • awaitingReview
    int
    required
    待批改
  • finished
    int
    required
    已完成
  • expired
    int
    required
    已逾期

SubmitMyPracticeAnswerReq

properties
  • userExerciseId
    string
    required
    練習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
    boolean
    required
    是否到期

ClaimRewardRespDTO

properties
  • coin
    number
    The coin earned by the mission.
  • exp
    number
    The experience earned by the mission.
  • token
    number
    The token earned by the mission.
  • level
    number
    The level.
  • isLevelUp
    boolean
    It indicates if the user is leveled up or not.

ExerciseStatus

EnumDescription
1已分配
2測驗中
3待批改
4再试一次
5已完成
6已逾期

QuestionType

TypeDescription
1單選
2多項選擇
3線型刻度
4核取方格
5簡答&圖片
6情緒溫度計

ExerciseCategory

TypeDescription
1個人練習
2學習建議
3學習課程