Quiz

Quiz

Represents a quiz assignment on SMHW.


Constructor

new Quiz(client, response)

Instantiate a Quiz object.

Parameters:
Name Type Description
client Client

The client that is instantiating the object.

response Object

The data for the object.

Extends

Members

(private) _client :Client

The client that instantiated this object.

Type:
  • Client
Overrides:

answered_by_students :Boolean

Whether or not the quiz is to be answered by students.

Type:
  • Boolean

attachment_ids :Array.<Number>

An array of IDs for attachments attached to the assignment.

Type:
  • Array.<Number>

class_group_id :Number

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

Type:
  • Number

class_group_name :String

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

Type:
  • String

class_year :String

The class year that the assignment was set for.

Type:
  • String

community_resource_item_id :Number

The ID of the assignment community resource.

Type:
  • Number

completed :Boolean

Whether or not the quiz is completed.

Type:
  • Boolean

created_at :Number

The timestamp of when the assignment was created.

Type:
  • Number

description :String

The description of the assignment.

Type:
  • String

due_on :Number

The timestamp of when the assignment is due.

Type:
  • Number
Overrides:

duration :String

The duration of the assignment.

Type:
  • String
Overrides:

duration_units :String

The duration units of the assignment.

Type:
  • String

has_unread_comments :Boolean

Whether or not the assignment has unread comments.

Type:
  • Boolean

id :Number

The ID of the assignment.

Type:
  • Number
Overrides:

issued_on :Number

The timestamp of when the assignment was issued.

Type:
  • Number

published_at :Number

The timestamp of when the assignment was published.

Type:
  • Number

purpose :String

The purpose of the assignment.

Type:
  • String
Overrides:

question_ids :Array.<Number>

An array of IDs to the questions in the quiz.

Type:
  • Array.<Number>

questions_time_limit :Number

The time limit for each question in seconds.

Type:
  • Number

random_order :Boolean

Whether or not the quiz is in a random order.

Type:
  • Boolean

school_id :Number

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

Type:
  • Number

school_logo_url :String

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

Type:
  • String

school_name :String

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

Type:
  • String

subject :String

The subject of the assignment.

Type:
  • String
Overrides:

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 submission status of the quiz for the client user.

Type:
  • String

teacher_id :Number

The ID of the teacher who set the assignment.

Type:
  • Number

teacher_name :String

The name of the teacher who set the assignment.

Type:
  • String

title :String

The title of the assignment.

Type:
  • String
Overrides:

type :String

The assignment type.

Type:
  • String
Overrides:

updated_at :Number

The timestamp of when the assignment was last updated.

Type:
  • Number

An array of links to web resources for the assigment.

Type:

Methods

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

Get attachments attached to the assignment.

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

The IDs of the attachments to retrieve.

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

getQuestions(idsopt) → {Promise.<Array.<QuizQuestion>>}

Get an array of questions on the Quiz.

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

The IDs of the quiz questions to retrieve.

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

getSubmission() → {Promise.<QuizSubmission>}

Get the client user's submission to the quiz.

Returns:
Type
Promise.<QuizSubmission>

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

Get comments made on the quiz's submissions.

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

The IDs of the submission comments to retrieve.

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

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

Get submissions to the quiz.

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

The IDs of the quiz submissions to retrieve.

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

getTeacher() → {Promise.<Employee>}

Get the teacher who set the assignment.

Returns:
Type
Promise.<Employee>