Skip to main content

Chapter API

學習課程相關的API

Endpoints

# Endpoints


Get chapter

獲取章節

Request

GET /web/chapter/{id}

Response (ChapterDTO)

{
"success": true,
"message": "",
"data": [
{
"chapterId": "615c21c2-146e-44bd-8bf1-0e00c8259a1f",
"lessonId": "7212f962-3c12-4dbf-923f-385973926181",
"type": "知識測驗",
"title": "章節標題",
"subTitle": "段落標題",
"content": "Content XXXXXXXXxxxxxxxxXXXXXXXXXXxxxxxxxx",
"attachmentTypes": [
"圖片"
],
"videoUrl": null,
"attachmentList": [
{
"fileKey": "mhahk/lesson/chapter/L001/C001/1",
"url": "https://jcci-test-media.aritaone.com/mhahk/lesson/chapter/L001/C001/1"
}
],
"qaList": [
{
"questionId": "2b8cb7b2-f924-46c8-837f-fec440a68e9a",
"type": "單選",
"title": "Question1 Single Selection",
"sort": 1,
"minLabel": null,
"maxLabel": null,
"answerList": [
2
],
"rightFeedback": "GOOD!!!",
"wrongFeedback": "No No No!!!",
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 2,
"title": "Question2 Multiple Selection",
"sort": 2,
"answerList": [
1,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 3,
"title": "Question3 linear scale",
"sort": 3,
"minLabel": "不爱",
"maxLabel": "最爱",
"answerList": [
6
],
"optionList": [
{
"content": "0",
"sort": 1
},
{
"content": "5",
"sort": 2
}
]
},
{
"type": 4,
"title": "Question4 check box",
"sort": 4,
"answerList": [
1,
2,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
}
]
}
]
}

Add chapter

增加章節

Request (AddChapterDTO)

POST /web/chapter
{
"id": "7212f962-3c12-4dbf-923f-385973926181",
"lessonId": "7212f962-3c12-4dbf-923f-385973926181",
"type": 1,
"title": "章節標題",
"subTitle": "段落標題",
"content": "Content XXXXXXXXxxxxxxxxXXXXXXXXXXxxxxxxxx",
"attachmentTypes": [
2
],
"videoUrl": "https://www.youtube.com",
"fileKeys": [
"temp/9948f8b8-7f5c-4990-9319-f5cc5331c38e"
],
"qaList": [
{
"type": 1,
"title": "Question1 Single Selection",
"sort": 1,
"answerList": [
2
],
"rightFeedback": "GOOD!!!",
"wrongFeedback": "No No No!!!",
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 2,
"title": "Question2 Multiple Selection",
"sort": 2,
"answerList": [
1,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 3,
"title": "Question3 linear scale",
"sort": 3,
"minLabel": "不爱",
"maxLabel": "最爱",
"answerList": [
6
],
"optionList": [
{
"content": "0",
"sort": 1
},
{
"content": "5",
"sort": 2
}
]
},
{
"type": 4,
"title": "Question4 check box",
"sort": 4,
"answerList": [
1,
2,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
}
]
}

Response

{
"success": true,
"message": "",
"data": null
}

Put chapter

修改章節

Request (AddChapterDTO)

PUT /web/chapter
{
"id": "7212f962-3c12-4dbf-923f-385973926181",
"lessonId": "7212f962-3c12-4dbf-923f-385973926181",
"type": 1,
"title": "章節標題",
"subTitle": "段落標題",
"content": "Content XXXXXXXXxxxxxxxxXXXXXXXXXXxxxxxxxx",
"attachmentTypes": [
2
],
"videoUrl": "https://www.youtube.com",
"fileKeys": [
"temp/9948f8b8-7f5c-4990-9319-f5cc5331c38e"
],
"qaList": [
{
"type": 1,
"title": "Question1 Single Selection",
"sort": 1,
"answerList": [
2
],
"rightFeedback": "GOOD!!!",
"wrongFeedback": "No No No!!!",
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 2,
"title": "Question2 Multiple Selection",
"sort": 2,
"answerList": [
1,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
},
{
"type": 3,
"title": "Question3 linear scale",
"sort": 3,
"minLabel": "不爱",
"maxLabel": "最爱",
"answerList": [
6
],
"optionList": [
{
"content": "0",
"sort": 1
},
{
"content": "5",
"sort": 2
}
]
},
{
"type": 4,
"title": "Question4 check box",
"sort": 4,
"answerList": [
1,
2,
3,
4
],
"optionList": [
{
"content": "optionA",
"sort": 1
},
{
"content": "optionB",
"sort": 2
},
{
"content": "optionC",
"sort": 3
},
{
"content": "optionD",
"sort": 4
}
]
}
]
}

Response

{
"success": true,
"message": "",
"data": null
}

chapter page

章節列表

Request (ChapterFilterReqDTO)

POST /web/chapter/page
{
"lessonId": "7212f962-3c12-4dbf-923f-385973926181",
"pagination": {
"page": 1,
"size": 10
},
"sortings": []
}

Response (ChapterPageRespDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"id": "615c21c2-146e-44bd-8bf1-0e00c8259a1f",
"title": "章節標題",
"type": 1,
"typeShow": "知識測驗",
"questionTotal": 4,
"correctCount": 0,
"peopleTotal": 0,
"studyingTotal": 0,
"finishedTotal": 0,
"updatedAt": "2024-10-31T02:28:28.033316Z",
"accuracy": "0%"
}
]
}
}

chapter all simply

章節列表

Request

GET /web/chapter/list?lesson={lesson_id}

Response (ChapterSimplyList)

{
"success": true,
"message": "",
"data": {
"id": "615c21c2-146e-44bd-8bf1-0e00c8259a1f",
"title": "章節標題"
}
}


Resources

AddChapterDTO

properties
  • id
    String
    章節id, 修改時必填,新增時不填
  • lessonId
    String
    required
    課程id, 新增時必填,修改時不填
  • type
    int
    required
    章節類型,1:知識測驗 2:感受評估 3:經驗反思
  • title
    string
    required
    章節標題
  • subTitle
    string
    required
    段落標題
  • content
    required
    引言文字
  • attachmentTypes
    required
    附加類型(多選) 1:影片 2:圖片 3:音檔
  • videoUrl
    String
    required
    影片連接,attachmentTypes为1,3时必填
  • fileKeys
    array[String]
    required
    圖片或音檔fileKey,attachmentTypes为2时必填
  • qaList
    array[Object]
    required
    題目列表
  • type
    array[String]
    required
    問題類型,1:單選 2:多項選擇 3:線型刻度 4:核取方格
  • title
    String
    required
    題目標題
  • sort
    int
    required
    題目排序
  • answerList
    array[int]
    required
    正確答案
  • rightFeedback
    string
    required
    正確答案反饋
  • wrongFeedback
    string
    required
    錯誤答案反饋
  • optionList
    array[object]
    required
    選項列表
  • answerList
    array[int]
    required
    正確答案
  • content
    string
    required
    選項文字
  • sort
    int
    required
    選項排序

ChapterDTO

properties
  • id
    String
    章節id, 修改時必填,新增時不填
  • lessonId
    String
    required
    課程id, 新增時必填,修改時不填
  • type
    string
    required
    章節類型
  • title
    string
    required
    章節標題
  • subTitle
    string
    required
    段落標題
  • content
    required
    引言文字
  • attachmentTypes
    string
    required
    附加類型
  • videoUrl
    String
    required
    影片連接,attachmentTypes为1,3时必填
  • fileKeys
    String
    required
    圖片或音檔fileKey
  • url
    String
    required
    圖片或音檔的連結
  • qaList
    array[Object]
    required
    題目列表
  • questionId
    String
    required
    問題id
  • type
    String
    required
    問題類型
  • title
    String
    required
    題目標題
  • sort
    int
    required
    題目排序
  • minLabel
    int
    required
    最小值,題目類型為線型刻度時才有
  • maxLabel
    int
    required
    最大值,題目類型為線型刻度時才有
  • answerList
    array[int]
    required
    正確答案
  • rightFeedback
    string
    required
    正確答案反饋
  • wrongFeedback
    string
    required
    錯誤答案反饋
  • optionList
    array[object]
    required
    選項列表
  • answerList
    array[int]
    required
    正確答案
  • optionId
    String
    required
    選項id
  • content
    string
    required
    選項文字
  • sort
    int
    required
    選項排序

ChapterFilterReqDTO

properties
  • lessonId
    string
    required
    課程ID

ChapterPageRespDTO

properties
  • id
    string
    required
    章節ID
  • title
    string
    required
    章節名稱
  • type
    int
    required
    章節類型
  • typeShow
    string
    required
    章節類型
  • questionTotal
    int
    required
    總題目數量
  • correctCount
    int
    required
    正確數
  • peopleTotal
    int
    required
    學習總人數
  • studyingTotal
    int
    required
    用戶學習數量(學習中)
  • finishedTotal
    int
    required
    用戶學習數量(已完成)
  • accuracy
    string
    required
    整體正確率
  • updatedAt
    datetime
    required
    最後更新時間

ChapterSimplyList

properties
  • id
    String
    章節id
  • title
    string
    required
    章節標題

ChapterType

TypeDescription
1知識測驗
2感受評估
3經驗反思

AttachmentType

TypeDescription
1影片
2圖片
3音檔

QuestionType

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