# /get-grades

**Input Parameters**

| Parameter  | Type   | Description                                                                                                                                                 |
| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| quizId     | String | The unique identifier for the quiz.                                                                                                                         |
| primaryKey | String | <p>The primary key for the student.<br><br><strong>Optional:</strong> if no PK is passed, we will <strong>fetch ALL submissions for this quiz</strong>.</p> |

**Example Request**

```javascript
// Example to get grades
fetch("https://api.arlinear.com/functions/v1/get-grades", {
  method: "POST",
  headers: {
    Authorization: "<Your API Key>",
  },
  body: JSON.stringify({
    quizId: "ba777045-7033-4701-b17b-da9e90dcd41e",
    primaryKey: "emily@school.com", // optional: if no PK is passed, we will fetch ALL submissions for this quiz
  }),
});
```

**Example Return Value**

Returns a list of quiz submissions.

* `primaryKey`: The primary key for the student.
* `score`: Total points scored.
* `scoreOutOf`: Maximum possible points.
* `createdAt` : Date when the student submitted the quiz.
* `corrections`: An array of corrections for each question.

**Note:** if no `primaryKey` is passed, we will fetch ALL submissions for this quiz.

```json
[
  {
    "primaryKey": "emily@school.com",
    "score": 8,
    "scoreOutOf": 10,
    "createdAt": "2023-11-17T20:20:29.644882+00:00",
    "corrections": [
      {
    	  "studentInput": "y=6",
    	  "score":  1,
    	  "scoreOutOf":  1,
    	  "feedback":  "Correct answer. Great job!"
      },
      ...
     ]
  }
]
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arlinear.gitbook.io/documentation/api/get-grades.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
