# 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.

Source:
  - structures/Task.js, line 10

### Members

#### (private) _client :Client

The client that instantiated this object.

Type:

- Client

Source:
  - structures/Task.js, line 16

#### class_group_name :String

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

Type:

- String

Source:
  - structures/Task.js, line 22

#### class_task_description :String

The description of the task.

Type:

- String

Source:
  - structures/Task.js, line 28

#### class_task_id :Number

The ID of the task.

Type:

- Number

Source:
  - structures/Task.js, line 34

#### class_task_title :String

The title of the task.

Type:

- String

Source:
  - structures/Task.js, line 40

#### class_task_type :String

The type of task.

Type:

- String

Source:
  - structures/Task.js, line 46

#### completed :Boolean

Whether or not the task has been completed.

Type:

- Boolean

Source:
  - structures/Task.js, line 52

#### description :String

The description of the task.

Type:

- String

Source:
  - structures/Task.js, line 58

#### due_on :Number

The timestamp of when the task is due.

Type:

- Number

Source:
  - structures/Task.js, line 64

#### has_assignments :Boolean

Whether or not the task has assignments.

Type:

- Boolean

Source:
  - structures/Task.js, line 70

#### id :Number

The ID of the task.

Type:

- Number

Source:
  - structures/Task.js, line 76

#### issued_on :Number

The timestamp of when the task was issued.

Type:

- Number

Source:
  - structures/Task.js, line 82

#### subject :String

The subject that the task was set for.

Type:

- String

Source:
  - structures/Task.js, line 88

#### submission_status :String

The submission status of the task for client.

Type:

- String

Source:
  - structures/Task.js, line 94

#### submission_status :string

The submission type of the task.

Type:

- string

Source:
  - structures/Task.js, line 100

#### teacher_name :String

The name of the teacher who set the task.

Type:

- String

Source:
  - structures/Task.js, line 106

#### user_id :String

The ID of the user who the task is for.

Type:

- String

Source:
  - structures/Task.js, line 112

### Methods

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

Get the task assignment.

Source:
  - structures/Task.js, line 158

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.

Source:
  - structures/Task.js, line 120

Returns:

Type
  Promise.<Task>

#### setViewed() → {Promise.<Boolean>}

Fire an event to set the homework as viewed.

Source:
  - structures/Task.js, line 170

Returns:

Type
  Promise.<Boolean>

#### toggleCompleted() → {Promise.<Task>}

Toggle the task as completed or incomplete.

Source:
  - structures/Task.js, line 150

Returns:

Type
  Promise.<Task>