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

Source:
  - structures/Quiz.js, line 17

### Extends

- Assignment

### Members

#### (private) _client :Client

The client that instantiated this object.

Type:

- Client

Overrides:
  - Assignment#_client
Source:
  - structures/Assignment.js, line 18

#### answered_by_students :Boolean

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

Type:

- Boolean

Source:
  - structures/Quiz.js, line 24

#### attachment_ids :Array.<Number>

An array of IDs for attachments attached to the assignment.

Type:

- Array.<Number>

Overrides:
  - Assignment#attachment_ids
Source:
  - structures/Assignment.js, line 24

#### class_group_id :Number

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

Type:

- Number

Overrides:
  - Assignment#class_group_id
Source:
  - structures/Assignment.js, line 30

#### class_group_name :String

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

Type:

- String

Overrides:
  - Assignment#class_group_name
Source:
  - structures/Assignment.js, line 36

#### class_year :String

The class year that the assignment was set for.

Type:

- String

Overrides:
  - Assignment#class_year
Source:
  - structures/Assignment.js, line 42

#### community_resource_item_id :Number

The ID of the assignment community resource.

Type:

- Number

Overrides:
  - Assignment#community_resource_item_id
Source:
  - structures/Assignment.js, line 48

#### completed :Boolean

Whether or not the quiz is completed.

Type:

- Boolean

Source:
  - structures/Quiz.js, line 30

#### created_at :Number

The timestamp of when the assignment was created.

Type:

- Number

Overrides:
  - Assignment#created_at
Source:
  - structures/Assignment.js, line 54

#### description :String

The description of the assignment.

Type:

- String

Overrides:
  - Assignment#description
Source:
  - structures/Assignment.js, line 60

#### due_on :Number

The timestamp of when the assignment is due.

Type:

- Number

Overrides:
  - Assignment#due_on
Source:
  - structures/Assignment.js, line 66

#### duration :String

The duration of the assignment.

Type:

- String

Overrides:
  - Assignment#duration
Source:
  - structures/Assignment.js, line 72

#### duration_units :String

The duration units of the assignment.

Type:

- String

Overrides:
  - Assignment#duration_units
Source:
  - structures/Assignment.js, line 78

#### has_unread_comments :Boolean

Whether or not the assignment has unread comments.

Type:

- Boolean

Overrides:
  - Assignment#has_unread_comments
Source:
  - structures/Assignment.js, line 84

#### id :Number

The ID of the assignment.

Type:

- Number

Overrides:
  - Assignment#id
Source:
  - structures/Assignment.js, line 90

#### issued_on :Number

The timestamp of when the assignment was issued.

Type:

- Number

Overrides:
  - Assignment#issued_on
Source:
  - structures/Assignment.js, line 96

#### published_at :Number

The timestamp of when the assignment was published.

Type:

- Number

Overrides:
  - Assignment#published_at
Source:
  - structures/Assignment.js, line 102

#### purpose :String

The purpose of the assignment.

Type:

- String

Overrides:
  - Assignment#purpose
Source:
  - structures/Assignment.js, line 108

#### question_ids :Array.<Number>

An array of IDs to the questions in the quiz.

Type:

- Array.<Number>

Source:
  - structures/Quiz.js, line 36

#### questions_time_limit :Number

The time limit for each question in seconds.

Type:

- Number

Source:
  - structures/Quiz.js, line 42

#### random_order :Boolean

Whether or not the quiz is in a random order.

Type:

- Boolean

Source:
  - structures/Quiz.js, line 48

#### school_id :Number

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

Type:

- Number

Overrides:
  - Assignment#school_id
Source:
  - structures/Assignment.js, line 114

#### school_logo_url :String

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

Type:

- String

Overrides:
  - Assignment#school_logo_url
Source:
  - structures/Assignment.js, line 120

#### school_name :String

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

Type:

- String

Overrides:
  - Assignment#school_name
Source:
  - structures/Assignment.js, line 126

#### subject :String

The subject of the assignment.

Type:

- String

Overrides:
  - Assignment#subject
Source:
  - structures/Assignment.js, line 132

#### submission_ids :Array.<Number>

An array of IDs for submissions

Type:

- Array.<Number>

Overrides:
  - Assignment#submission_ids
Source:
  - structures/Assignment.js, line 138

#### submission_method_id :Number

The ID of the submission method to use.

Type:

- Number

Overrides:
  - Assignment#submission_method_id
Source:
  - structures/Assignment.js, line 144

#### submission_status :String

The submission status of the quiz for the client user.

Type:

- String

Overrides:
  - Assignment#submission_status
Source:
  - structures/Quiz.js, line 54

#### teacher_id :Number

The ID of the teacher who set the assignment.

Type:

- Number

Overrides:
  - Assignment#teacher_id
Source:
  - structures/Assignment.js, line 156

#### teacher_name :String

The name of the teacher who set the assignment.

Type:

- String

Overrides:
  - Assignment#teacher_name
Source:
  - structures/Assignment.js, line 162

#### title :String

The title of the assignment.

Type:

- String

Overrides:
  - Assignment#title
Source:
  - structures/Assignment.js, line 168

#### type :String

The assignment type.

Type:

- String

Overrides:
  - Assignment#type
Source:
  - structures/Quiz.js, line 60

#### updated_at :Number

The timestamp of when the assignment was last updated.

Type:

- Number

Overrides:
  - Assignment#updated_at
Source:
  - structures/Assignment.js, line 174

#### web_links :Array.<WebLink>

An array of links to web resources for the assigment.

Type:

- Array.<WebLink>

Overrides:
  - Assignment#web_links
Source:
  - structures/Assignment.js, line 180

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

Overrides:
  - Assignment#getAttachments
Source:
  - structures/Assignment.js, line 194

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.

Source:
  - structures/Quiz.js, line 85

Returns:

Type
  Promise.<Array.<QuizQuestion>>

#### getSubmission() → {Promise.<QuizSubmission>}

Get the client user's submission to the quiz.

Source:
  - structures/Quiz.js, line 67

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.

Source:
  - structures/Quiz.js, line 94

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.

Source:
  - structures/Quiz.js, line 76

Returns:

Type
  Promise.<Array.<QuizSubmission>>

#### getTeacher() → {Promise.<Employee>}

Get the teacher who set the assignment.

Overrides:
  - Assignment#getTeacher
Source:
  - structures/Assignment.js, line 202

Returns:

Type
  Promise.<Employee>