Task

Task

Represents a Task on SMHW.


Constructor

new Task(client, response)

Instantiate a Task object.

Parameters:
Name Type Description
client Client

The client that is instantiating the object.

response Object

The data for the object.

Members

(private) _client :Client

The client that instantiated this object.

Type:
  • Client

class_group_name :String

The name of the class group that the task is set for.

Type:
  • String

class_task_description :String

The description of the task.

Type:
  • String

class_task_id :Number

The ID of the task.

Type:
  • Number

class_task_title :String

The title of the task.

Type:
  • String

class_task_type :String

The type of task.

Type:
  • String

completed :Boolean

Whether or not the task has been completed.

Type:
  • Boolean

description :String

The description of the task.

Type:
  • String

due_on :Number

The timestamp of when the task is due.

Type:
  • Number

has_assignments :Boolean

Whether or not the task has assignments.

Type:
  • Boolean

id :Number

The ID of the task.

Type:
  • Number

issued_on :Number

The timestamp of when the task was issued.

Type:
  • Number

subject :String

The subject that the task was set for.

Type:
  • String

submission_status :String

The submission status of the task for client.

Type:
  • String

submission_status :string

The submission type of the task.

Type:
  • string

teacher_name :String

The name of the teacher who set the task.

Type:
  • String

user_id :String

The ID of the user who the task is for.

Type:
  • String

Methods

getAssignment() → {Promise.<(Homework|FlexibleTask)>}

Get the task assignment.

Returns:
Type
Promise.<(Homework|FlexibleTask)>

setCompleted(completed) → {Promise.<Task>}

Mark the task as completed or incomplete.

Parameters:
Name Type Description
completed Boolean

Whether or not the task should be marked completed or incomplete.

Returns:
Type
Promise.<Task>

setViewed() → {Promise.<Boolean>}

Fire an event to set the homework as viewed.

Returns:
Type
Promise.<Boolean>

toggleCompleted() → {Promise.<Task>}

Toggle the task as completed or incomplete.

Returns:
Type
Promise.<Task>