HomeworkSubmission

HomeworkSubmission

Represents a homework submission on SMHW.


Constructor

new HomeworkSubmission(client, response)

Instantiate a HomeworkSubmission object.

Parameters:
Name Type Description
client Client

The client that is instantiating this object.

response Object

The data for the object.

Extends

Members

(private) _client :Client

The client that instantiated this object.

Type:
  • Client
Overrides:

assignment_type :String

The type of assignment that the submission is for.

Type:
  • String

comment_ids :Array.<Number>

An array of IDs of comments posted to the submission.

Type:
  • Array.<Number>

completed :Boolean

Whether or not the homework submission is marked as complete.

Type:
  • Boolean

created_at :Number

The timestamp of when the submission was created.

Type:
  • Number

current_submission_version_id :Number

The ID of the current homework submission version.

Type:
  • Number

event_ids :Array.<Number>

An array of IDs to events refering to the submission.

Type:
  • Array.<Number>

grade :String

The grade recieved for the event.

Type:
  • String
Overrides:

grade_sent :Boolean

Whether or not a grade has been given for the homework submission.

Type:
  • Boolean

grading_comment :String

The comment made for the grade for the homework submission.

Type:
  • String

handed_in_on :Number

The timestamp of when the homework submission was handed in.

Type:
  • Number

has_unread_comments :Boolean

Whether or not the homework submission has unread comments.

Type:
  • Boolean

homework_id :Number

The ID of the homework that the homework submission is for.

Type:
  • Number

id :String

The ID of the submission.

Type:
  • String
Overrides:

marked :Boolean

Whether or not the homework submission has been marked.

Type:
  • Boolean

overdue :Boolean

Whether or not the homework submission is overdue.

Type:
  • Boolean

status :String

The status of the submission.

Type:
  • String
Overrides:

student_avatar :String

The avatar URL of the student.

Type:
  • String

student_id :Number

The ID of the student.

Type:
  • Number

student_name :String

The name of the student.

Type:
  • String

submission_type :String

The type of submission.

Type:
  • String

updated_at :Number

The timestamp of when the submission was last updated.

Type:
  • Number

version_ids :Array.<Number>

An array of IDs to each homework submission version.

Type:
  • Array.<Number>

Methods

getComments(idsopt) → {Promise.<Array.<HomeworkSubmissionComment>>}

Get an array comments made to the submission.

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

An array of IDs of the submission comments to retrieve.

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

getEvents(idsopt) → {Promise.<Array.<SubmissionEvent>>}

Get submission events that refer to this submission.

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

An array of IDs of submission events to retrieve.

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

getHomework() → {Promise.<Homework>}

Get the homework that the homework submission is for.

Returns:
Type
Promise.<Homework>

getStudent() → {Promise.<Student>}

Get the student who submitted the flexible task submission.

Returns:
Type
Promise.<Student>

getVersions(idsopt) → {Promise.<Array.<HomeworkSubmissionVersion>>}

Get homework submission versions for the homework submission.

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

An array of IDs of homework versions to retrieve.

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

postComment(text) → {Promise.<HomeworkSubmissionComment>}

Post a comment on the submission from the client user.

Parameters:
Name Type Description
text String

The text of the comment.

Returns:
Type
Promise.<HomeworkSubmissionComment>