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
Stringrequired課程id, 新增時必填,修改時不填
章節類型,1:知識測驗 2:感受評估 3:經驗反思
title
stringrequired章節標題
subTitle
stringrequired段落標題
content
required引言文字
附加類型(多選) 1:影片 2:圖片 3:音檔
videoUrl
Stringrequired影片連接,attachmentTypes为1,3时必填
fileKeys
array[String]required圖片或音檔fileKey,attachmentTypes为2时必填
qaList
array[Object]required題目列表
type
array[String]required問題類型,1:單選 2:多項選擇 3:線型刻度 4:核取方格
title
Stringrequired題目標題
sort
intrequired題目排序
answerList
array[int]required正確答案
rightFeedback
stringrequired正確答案反饋
wrongFeedback
stringrequired錯誤答案反饋
optionList
array[object]required選項列表
answerList
array[int]required正確答案
content
stringrequired選項文字
sort
intrequired選項排序
ChapterDTO
properties
id
String章節id, 修改時必填,新增時不填
lessonId
Stringrequired課程id, 新增時必填,修改時不填
章節類型
title
stringrequired章節標題
subTitle
stringrequired段落標題
content
required引言文字
attachmentTypes
stringrequired附加類型
videoUrl
Stringrequired影片連接,attachmentTypes为1,3时必填
fileKeys
Stringrequired圖片或音檔fileKey
url
Stringrequired圖片或音檔的連結
qaList
array[Object]required題目列表
questionId
Stringrequired問題id
type
Stringrequired問題類型
title
Stringrequired題目標題
sort
intrequired題目排序
minLabel
intrequired最小值,題目類型為線型刻度時才有
maxLabel
intrequired最大值,題目類型為線型刻度時才有
answerList
array[int]required正確答案
rightFeedback
stringrequired正確答案反饋
wrongFeedback
stringrequired錯誤答案反饋
optionList
array[object]required選項列表
answerList
array[int]required正確答案
optionId
Stringrequired選項id
content
stringrequired選項文字
sort
intrequired選項排序
ChapterFilterReqDTO
properties
lessonId
stringrequired課程ID
ChapterPageRespDTO
properties
id
stringrequired章節ID
title
stringrequired章節名稱
type
intrequired章節類型
typeShow
stringrequired章節類型
questionTotal
intrequired總題目數量
correctCount
intrequired正確數
peopleTotal
intrequired學習總人數
studyingTotal
intrequired用戶學習數量(學習中)
finishedTotal
intrequired用戶學習數量(已完成)
accuracy
stringrequired整體正確率
updatedAt
datetimerequired最後更新時間
ChapterSimplyList
properties
id
String章節id
title
stringrequired章節標題
ChapterType
Type | Description |
---|---|
1 | 知識測驗 |
2 | 感受評估 |
3 | 經驗反思 |
AttachmentType
Type | Description |
---|---|
1 | 影片 |
2 | 圖片 |
3 | 音檔 |
QuestionType
Type | Description |
---|---|
1 | 單選 |
2 | 多項選擇 |
3 | 線型刻度 |
4 | 核取方格 |