Chapter API
課程章節相關的API
Endpoints
# Endpoints
Get chapter list
獲取章節列表
Request
GET /app/chapter/list?lesson={lessonId}
Response (ChapterListDTO)
{
"success": true,
"message": "",
"data": [
{
"lessonId": "63238871-bfb5-4b24-8987-78ab55acbb21",
"lessonName": "課程名稱",
"lessonIntroduce": "課程介紹",
"lessonCategories": [
"復元概念",
"精神健康",
"身體健康",
"與人聯繫"
],
"pic": {
"fileKey": "mhahk/lesson/cover/L001/1",
"url": "https://jcci-test-media.aritaone.com/mhahk%2Flesson%2Fcover%2FL001%2F1",
"type": 2
},
"chapterDetailList": [
{
"chapterId": "4bf38a4b-bc7c-4569-8df4-0dc1a20400a4",
"title": "章節標題",
"subTitle": "段落標題",
"chapterType": "知識測驗",
"questionTotal": 4,
"currentProgressSort": 0,
"maxCorrectRate": "0.0%",
"isPass": false,
"button": {
"buttonEnum": 1,
"toEntrance": "CHAPTER_PAGE"
}
}
]
}
]
}
Get chapter
獲取章節
Request
GET /app/chapter/{chapter_id}?exercise={exerciseId}
Response (ChapterDetailDTO)
{
"success": true,
"message": "",
"data": [
{
"chapterId": "4bf38a4b-bc7c-4569-8df4-0dc1a20400a4",
"lessonId": "63238871-bfb5-4b24-8987-78ab55acbb21",
"fromEntrance": 1,
"type": 1,
"typeShow": "知識測驗",
"title": "章節標題",
"subTitle": "段落標題",
"content": "內容",
"currentProgress": 0,
"attachmentTypesShow": [
"圖片"
],
"attachmentTypes": [
2
],
"videoUrl": null,
"attachmentList": [
{
"fileKey": "mhahk/lesson/chapter/L001/C001/2",
"url": "https://jcci-test-media.aritaone.com/mhahk/lesson/chapter/L001/C001/2",
"type": 2
},
{
"fileKey": "mhahk/lesson/chapter/L001/C001/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/lesson/chapter/L001/C001/1",
"type": 2
}
],
"qaList": [
{
"questionId": "8d6d944a-a75b-4dc2-9ee0-f0c1fb92772d",
"type": 1,
"typeShow": "單選",
"title": "(單選題)精神病性抑鬱症和精神分裂有什麼分別? ",
"sort": 1,
"minLabel": "",
"maxLabel": "",
"rightFeedback": "回答正確。",
"wrongFeedback": "回答錯誤。",
"answerList": [
1
],
"userAnswer": [
1
],
"optionList": [
{
"optionId": "8f63bf0a-13e1-4562-abe0-8abcfcc73d0d",
"content": "心跳急促",
"sort": 1
},
{
"optionId": "b9ba08a1-5087-44e6-bc56-ad9cf4456ba5",
"content": "驚恐",
"sort": 2
}
]
}
]
}
]
}
Start testing
開始測驗/繼續測驗
Request
GET /app/chapter/{chapter_id}/testing
Response (StartTesting)
{
"success": true,
"message": "",
"data": [
{
"userExerciseId": "36fd7887-3532-4bf3-9c94-99b74023036e",
"userQuestionnaireId": "babb761d-3088-4ad5-9703-d82c4f098fe2",
"questionTotal": 4,
"currentProgressSort": 1,
"currentQuestionId": "ec4c5aae-ba55-451b-8366-e6d542cdbb1f",
"currentQuestionTitle": "(多選題)精神病性抑鬱症和精神分裂有什麼分別? ",
"currentQuestionOptions": {
"1": "心跳急促",
"2": "驚恐",
"3": "失眠",
"4": "呼吸不暢順",
"5": "頭痛",
"6": "手心冒汗",
"7": "注意力不集"
},
"correctAnswerList": [
1
],
"minLabel": "",
"maxLabel": "",
"rightFeedback": "回答正確。",
"wrongFeedback": "回答錯誤。",
"questionnaireIsFinished": false,
"correctCount": 0,
"isExpired": false
}
]
}
Claim reward
獲取章節獎勵
Request
GET /app/chapter/{id}/claim
Response (ClaimRewardRespDTO)
{
"success": true,
"message": "",
"data": {
"coin": 5,
"exp": 15,
"token": 0,
"level": 6,
"isLevelUp": false
}
}
Resources
ChapterListDTO
properties
lessonId
stringrequired課程ID
lessonName
stringrequired課程名稱
lessonIntroduce
stringrequired課程介紹
lessonCategories
array[string]required課程類別
pic
objrequired課程圖片對象
fileKey
stringrequired課程圖片fileKey
url
stringrequired課程圖片連結
課程圖片對象
chapterDetailList
array[object]required章節對象
chapterId
stringrequired章節ID
title
stringrequired章節標題
subTitle
stringrequired段落標題
chapterType
stringrequired章節類型
questionTotal
intrequired問題總數
currentProgressSort
intrequired當前進度序號
maxCorrectRate
stringrequired最高正確率
isPass
booleanrequired是否合格
button
objectrequired章節按鈕對象
按鈕Enum
按鈕跳轉頁面
ChapterDetailDTO
properties
chapterId
intrequired章節ID
lessonId
stringrequired課程ID
app入口,1:學習課程 2:個人練習
type
intrequired課程類型,對應詳見typeShow
typeShow
stringrequired課程類型
title
stringrequired章節標題
subTitle
stringrequired段落標題
content
stringrequired內容
currentProgress
intrequired當前進度,0:顯示章節,1-N:顯示對應序號的問題頁面
attachmentTypes
array[int]附件類型,對應詳見attachmentTypesShow
attachmentTypesShow
array[string]附件類型
videoUrl
string視頻連結
attachmentList
array[object]required附件對象
fileKey
stringrequired課程圖片fileKey
url
stringrequired課程圖片連結
附件對應類型enum
qaList
array[object]required問答列表
questionId
stringrequired問題ID
問題類型
typeShow
stringrequired對應type的顯示
title
stringrequired題目內容
sort
intrequired問題排序序號
minLabel
stringrequired線型刻度最小值標籤
maxLabel
stringrequired線型刻度最大值標籤
rightFeedback
stringrequired正確反饋
wrongFeedback
stringrequired錯誤反饋
answerList
array[int]required正確答案
userAnswer
array[int]required用戶回答答案
optionList
array[object]required選項列表
optionId
stringrequired選項ID
content
stringrequired選項內容
sort
intrequired選項排序序號
StartTesting
properties
userExerciseId
stringrequired練習ID
userQuestionnaireId
stringrequired問卷ID
questionTotal
intrequired問題總數
currentProgressSort
intrequired當前進度
currentQuestionId
stringrequired當前問題ID
currentQuestionContent
stringrequired問題標題
currentQuestionOptions
dictrequired問題選項, key:選項排序, value:選項內容
correctAnswerList
array[int]required正確答案列表
minLabel
stringrequired最小值標籤
maxLabel
stringrequired最大值標籤
rightFeedback
stringrequired正確回答提示
wrongFeedback
stringrequired錯誤回答提示
questionnaireIsFinished
booleanrequired該問卷是否已完成
questionnaireCorrectCount
intrequired該問卷正確數量
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.
AttachmentType
Type | Description |
---|---|
1 | 影片 |
2 | 圖片 |
3 | 音檔 |
ChapterButtonEnum
Type | Description |
---|---|
1 | 開始學習 |
2 | 繼續學習 |
3 | 重新學習 |
4 | 重溫一次 |
5 | 領取獎勵 |
ChapterEntrance
Type | Description |
---|---|
1 | 章節詳情頁 |
2 | 練習頁 |
3 | 領取獎勵頁 |
QuestionType
Type | Description |
---|---|
1 | 單選 |
2 | 多項選擇 |
3 | 線型刻度 |
4 | 核取方格 |
FromEntrance
Type | Description |
---|---|
1 | 學習課程 |
2 | 個人練習 |