DXStudentClient

This class is responsible for making request to the student API.

You will need to enable the "Training" scope for your app in the developer dashboard before using the student API.

Properties

public static let shared: DXStudentClient

Singleton instance of DXStudentClient. You will access all the available DXStudentClient methods through this instance.

Methods

addComment

public func addComment(
    studentId: String,
    classId: String,
    text: String,
    lessonId: String? = nil,
    _ completion: @escaping (_ error: Error?, _ comment: DXStudentComment?) -> Void)
    -> Void

Adds a comment about a student.

Parameter

Type

Description

studentId

String

ID of the student to which this comment pertains.

classId

String

Id of the class to which this comment pertains.

text

String

Text of the comment.

lessonId

String?

If the comment pertains to a specific lesson, specify it here.

completion

(_ error: Error?, _ comment: DXStudentComment?) -> Void

The closure invoked when the request finishes. Called with an Error argument if the request fails; otherwise, called with the newly created DXStudentComment.

getComments

public func getComments(
    studentId: String?,
    classId: String?,
    courseId: String?,
    lessonId: String?,
    _ completion: @escaping (_ error: Error?, _ comments: [DXStudentComment]?) -> Void)
    -> Void

Retrieves comments about students based on the query provided.

Parameter

Type

Description

studentId

String?

ID of the student whose comments you would like to retrieve.

classId

String?

ID of the class to retrieve comments for.

courseId

String?

ID of the course to retrieve comments for.

lessonId

String?

ID of the lesson to retrieve comments for.

completion

(_ error: Error?, _ comments: [DXStudentComment]?) -> Void

The closure invoked when the request finishes. Called with an Error argument if the request fails; otherwise, called with the requested comments.

Last updated