Skip to main content

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
    string
    required
    課程ID
  • lessonName
    string
    required
    課程名稱
  • lessonIntroduce
    string
    required
    課程介紹
  • lessonCategories
    array[string]
    required
    課程類別
  • pic
    obj
    required
    課程圖片對象
  • fileKey
    string
    required
    課程圖片fileKey
  • url
    string
    required
    課程圖片連結
  • type
    AttachmentType
    required
    課程圖片對象
  • chapterDetailList
    array[object]
    required
    章節對象
  • chapterId
    string
    required
    章節ID
  • title
    string
    required
    章節標題
  • subTitle
    string
    required
    段落標題
  • chapterType
    string
    required
    章節類型
  • questionTotal
    int
    required
    問題總數
  • currentProgressSort
    int
    required
    當前進度序號
  • maxCorrectRate
    string
    required
    最高正確率
  • isPass
    boolean
    required
    是否合格
  • button
    object
    required
    章節按鈕對象
  • buttonEnum
    required
    按鈕Enum
  • toEntrance
    required
    按鈕跳轉頁面

ChapterDetailDTO

properties
  • chapterId
    int
    required
    章節ID
  • lessonId
    string
    required
    課程ID
  • fromEntrance
    FromEntrance
    required
    app入口,1:學習課程 2:個人練習
  • type
    int
    required
    課程類型,對應詳見typeShow
  • typeShow
    string
    required
    課程類型
  • title
    string
    required
    章節標題
  • subTitle
    string
    required
    段落標題
  • content
    string
    required
    內容
  • currentProgress
    int
    required
    當前進度,0:顯示章節,1-N:顯示對應序號的問題頁面
  • attachmentTypes
    array[int]
    附件類型,對應詳見attachmentTypesShow
  • attachmentTypesShow
    array[string]
    附件類型
  • videoUrl
    string
    視頻連結
  • attachmentList
    array[object]
    required
    附件對象
  • fileKey
    string
    required
    課程圖片fileKey
  • url
    string
    required
    課程圖片連結
  • type
    required
    附件對應類型enum
  • qaList
    array[object]
    required
    問答列表
  • questionId
    string
    required
    問題ID
  • type
    required
    問題類型
  • typeShow
    string
    required
    對應type的顯示
  • title
    string
    required
    題目內容
  • sort
    int
    required
    問題排序序號
  • minLabel
    string
    required
    線型刻度最小值標籤
  • maxLabel
    string
    required
    線型刻度最大值標籤
  • rightFeedback
    string
    required
    正確反饋
  • wrongFeedback
    string
    required
    錯誤反饋
  • answerList
    array[int]
    required
    正確答案
  • userAnswer
    array[int]
    required
    用戶回答答案
  • optionList
    array[object]
    required
    選項列表
  • optionId
    string
    required
    選項ID
  • content
    string
    required
    選項內容
  • sort
    int
    required
    選項排序序號

StartTesting

properties
  • userExerciseId
    string
    required
    練習ID
  • userQuestionnaireId
    string
    required
    問卷ID
  • questionTotal
    int
    required
    問題總數
  • currentProgressSort
    int
    required
    當前進度
  • currentQuestionId
    string
    required
    當前問題ID
  • currentQuestionContent
    string
    required
    問題標題
  • currentQuestionOptions
    dict
    required
    問題選項, key:選項排序, value:選項內容
  • correctAnswerList
    array[int]
    required
    正確答案列表
  • minLabel
    string
    required
    最小值標籤
  • maxLabel
    string
    required
    最大值標籤
  • rightFeedback
    string
    required
    正確回答提示
  • wrongFeedback
    string
    required
    錯誤回答提示
  • questionnaireIsFinished
    boolean
    required
    該問卷是否已完成
  • questionnaireCorrectCount
    int
    required
    該問卷正確數量
  • 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.

AttachmentType

TypeDescription
1影片
2圖片
3音檔

ChapterButtonEnum

TypeDescription
1開始學習
2繼續學習
3重新學習
4重溫一次
5領取獎勵

ChapterEntrance

TypeDescription
1章節詳情頁
2練習頁
3領取獎勵頁

QuestionType

TypeDescription
1單選
2多項選擇
3線型刻度
4核取方格

FromEntrance

TypeDescription
1學習課程
2個人練習