Tạo phân nhóm học tập cho khóa học

Mục lục

API dùng để tạo phân nhóm học tập cho Khóa học, thiết lập số thành viên trong nhóm và thay đổi thành viên giữa các nhóm. 

To create a group plan for the course, you can set the group numbers and switch members to each group. The group plan will be applied to the classroom grouping tool inside the virtual classroom.

URL

https://root_url/partner/api/course.api.php?action=addCourseGroup

HTTP Request Methods #

  • POST

Coding Format #

  • UTF-8

Request Data #

KeyBắt buộcYêu cầu thêmMô tảHướng dẫn
SIDBắt buộcID của trườngXem dữ liệu này tại Trang quản lý classin.com trong mục API
safeKeyBắt buộcFixed 32-bit all lowercase charactersKhóa bảo mật xác thực trường họcsafeKey=MD5(SECRET+timeStamp)
timeStampBắt buộcTheo Unix Epoch timestamp & có hiệu lực trong vòng 20 phútThời gian UNIX Epoch là số giây đã trôi qua kể từ 00:00:00 (giờ chuẩn quốc tế) vào ngày 1 tháng 1 năm 1970
courseIdBắt buộc —course ID
groupListBắt buộcjson string[ [{ “studentUid”: 1000152,”isLeader”: 1}, {“studentUid”: 1000109,”isLeader”: 0}],[{“studentUid”: 1000101,”isLeader”: 1}, {“studentUid”: 1000100,”isLeader”: 0}]]
groupNameBắt buộcCho phép hiển thị tối đa 20 ký tựTên của phân nhóm

Response Data #

KeyTypeSample ValueMeaning
error_infoobject Return message object
└ errnonumber1Error code
└ errorstring“Program normal execution”Error list
datanumber147667group ID

Sample #

  • HTTP Request
POST /partner/api/course.api.php?action=addCourseGroup HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache


SID=1234567&safeKey=5458edceccc78c6698de624e94364285&timeStamp=1493026245&courseId=176465&groupName=课程分组&groupList= [[{"studentUid": 1000152, "isLeader": 1 }, { "studentUid": 1000109, "isLeader": 0}],[{"studentUid": 1000101,"isLeader": 1}, {"studentUid": 1000100,"isLeader": 0}]]
  • Shell cURL analog request instruction
curl -H "Content-Type: application/x-www-form-urlencoded" -X "POST" \
       -d "SID=123456" \
       -d "safeKey=b8fa5232411a0870ccd1f51c2146fdc9" \
       -d "timeStamp=1637133326" \
       -d "courseId=176465" \
       -d "groupName=课程分组" \
       -d 'groupList= [[{"studentUid": 1000152, "isLeader": 1 }, { "studentUid": 1000109, "isLeader": 0}],[{"studentUid": 1000101,"isLeader": 1}, {"studentUid": 1000100,"isLeader": 0}]]'\
       "https://root_url/partner/api/course.api.php?action=addCourseGroup"

Response Sample(The normal return json packet example) #

{
"error_info": {
    "errno": 1,
    "error": "程序正常执行"
},
"data": 147667 //groupId
}

Notes #

Description of groupList parameter
[
[{
"studentUid": 1000152,
"isLeader": 1

},
{"studentUid": 1000109,
"isLeader": 0

}],
[{
"studentUid": 1000101,
"isLeader": 1

},
{"studentUid": 1000100,
"isLeader": 0

}]
]    
1. Paramter of studentUid and isLeader are required, there should be a leader for each team.   (isLeader indicates the team leader.  1=Yes 0=No)    
2. Team members can not be duplicated

Error Code description #

Error CodeMô tả
1Thành công
100Parameters sai định dạng hoặc không hoàn chỉnh
102Không có quyền thao tác (Xác thực bảo mật thất bại)
104Thao tác không thành công (lỗi không xác định)
890Thiết lập phân nhóm thất bại
892Thao tác không thành công vì đã tồn tại phân nhóm
895Thao tác không thành công, UID trưởng nhóm sai
896Thao tác thất bại, học sinh không tồn tại trong trường
897Thao tác thất bại. Tất cả học sinh đều chưa được thêm vào khóa học
898Thao tác thành công. Một số studentUID chưa chính xác