Homework

Homework

Represents a homework assignment on SMHW.


Constructor

new Homework(client, response)

Instantiate a Homework 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

attachment_ids :Array.<Number>

An array of IDs for attachments attached to the homework.

Type:
  • Array.<Number>

bookstore_content_ids :Array.<Number>

Type:
  • Array.<Number>

class_group_id :Number

The ID of the class group that the homework was set for.

Type:
  • Number

class_group_name :String

The name of the class group that the homework was set for.

Type:
  • String

class_year :String

The class year that the homework was set for.

Type:
  • String

community_resource_item_id :Number

The ID of the homework community resource.

Type:
  • Number

created_at :Number

The timestamp of when the homework was created.

Type:
  • Number

description :String

The description of the homework.

Type:
  • String

due_on :Number

The timestamp of when the homework is due.

Type:
  • Number

duration :String

The duration of the homework.

Type:
  • String

duration_units :String

The duration units of the homework.

Type:
  • String

has_unread_comments :Boolean

Whether or not the homework has unread comments.

Type:
  • Boolean

id :Number

The ID of the homework.

Type:
  • Number

issued_on :Number

The timestamp of when the homework was issued.

Type:
  • Number

marking_scheme_id :Number

The ID of the marking scheme used for the homework.

Type:
  • Number

published_at :Number

The timestamp of when the homework was published.

Type:
  • Number

purpose :String

The purpose of the homework.

Type:
  • String

school_id :Number

The ID of the school that the homework is set for.

Type:
  • Number

school_logo_url :String

The logo URL of of the school that the homework is set for.

Type:
  • String

school_name :String

The name of the school that the homework is set for.

Type:
  • String

subject :String

The subject of the homework.

Type:
  • String

submission_ids :Array.<Number>

An array of IDs for submissions

Type:
  • Array.<Number>

submission_method_id :Number

The ID of the submission method to use.

Type:
  • Number

submission_status :String

The status of the submission for the client user.

Type:
  • String

submission_type :String

The name of the submission method to use.

Type:
  • String

teacher_id :Number

The ID of the teacher who set the homework.

Type:
  • Number

teacher_name :String

The name of the teacher who set the homework.

Type:
  • String

title :String

The title of the homework.

Type:
  • String

updated_at :Number

The timestamp of when the homework was last updated.

Type:
  • Number

An array of links to web resources for the homework.

Type:
  • Array.<String>

Methods

getAttachments(idsopt) → {Promise.<Array.<Attachment>>}

Get attachments on the homework.

Parameters:
Name Type Attributes Description
ids Array.<Number> <optional>

The IDs of the attachments to retrieve.

Returns:
Type
Promise.<Array.<Attachment>>

getSubmission() → {Promise.<HomeworkSubmission>}

Get the client user's submission to the homework.

Returns:
Type
Promise.<HomeworkSubmission>

getSubmissionComments(idsopt) → {Promise.<Array.<SubmissionComment>>}

Get comments made on homework submissions.

Parameters:
Name Type Attributes Description
ids Array.<Number> <optional>

The IDs of the homework comments to retrieve.

Returns:
Type
Promise.<Array.<SubmissionComment>>

getSubmissions(idsopt) → {Promise.<Array.<HomeworkSubmissions>>}

Get submissions to the homework.

Parameters:
Name Type Attributes Description
ids Array.<Number> <optional>

The IDs of the homework submissions to retrieve.

Returns:
Type
Promise.<Array.<HomeworkSubmissions>>

getTeacher() → {Promise.<Employee>}

Get the teacher who set the homework.

Returns:
Type
Promise.<Employee>