# Gradescope Submission Instructions

When an assignment (such as a homework) asks you to submit a Jupyter notebook through **Gradescope**, you turn it in using a **two-step process**:

1. You **upload your completed notebook**, and an automated "autograder" converts it into a **PDF** with each question on its own page.
2. You then **tell Gradescope which PDF page(s) go with each question** so your work can be graded.

**You must complete _both_ steps for your work to be graded.** Uploading your notebook is not enough on its own -- if you skip the page-mapping step (Step 3 below), your assignment may not be graded correctly, or at all.

> **You will use two Gradescope assignments for each submission.** For each thing you turn in, there are *two* linked assignments:
>
> - **"... - Student Notebook Submission"** -- where you upload your `.ipynb` notebook.
> - **"... - PDF Export from Autograder (do not upload here!)"** -- This should automatically populate with a PDF of your notebook after you upload to the student notebook submission folder.  You should not upload anything here, but you will have to go in and tag where each question is located in the PDF.
>
> For example, for Homework 1 you will see **"Homework 01 - Student Notebook Submission"** and **"Homework 01 - PDF Export from Autograder (do not upload here!)"**.

:::{note}
**Which assignments use Gradescope, and which use D2L?** Not everything is turned in through Gradescope. Your instructor (and the assignment itself!) will tell you where each assignment should be submitted -- some assignments (for example, pre-class assignments and in-class work) are submitted directly in **D2L**, while notebook assignments that use this PDF workflow (to facilitate grading) are submitted through **Gradescope** as described on this page. If you are ever unsure where something should go, **ask your instructor before the deadline.**
:::

:::{tip}
While we hope that the steps below are sufficient for a successful Gradescope submission, we've also put together a visual overview of the Gradescope submission process. You can watch the [Gradescope Submission Workflow Video](https://mediaspace.msu.edu/media/Gradescope+Submission+Process+for+Jupyter+Notebooks+in+CMSE+Courses/1_djbkfmwt) on Mediaspace.
:::

---

## Step 1 -- Log in to Gradescope through D2L

1. Log in to **D2L** as you normally would.
2. In the D2L navigation bar, open the **drop-down menu on the right side** and click **"Gradescope."**
3. This sends you to the Gradescope website and logs you in automatically.

:::{note}
If is recommended that you always reach Gradescope this way (through D2L) so that your submission is tied to the correct account. However, if you log into Gradescope directly, you can also ensure that your account is linked to your school credentials by going to "Account" in the lower left of Gradescope and then "Edit Account" and find the "Link School Account" section. The important part is ensure that your Gradescope account is linked to your "@msu.edu" email address so that your submissions are correctly associated with your account.
:::

## Step 2 -- Upload your notebook (the autograder makes your PDF)

1. In Gradescope, on your **Dashboard** you should see your list of assignments for CMSE 202.
2. Open the submission assignment -- the one whose name ends in **"Student Notebook Submission"** (for example, **"Homework 01 - Student Notebook Submission"**).
3. **Upload your completed `.ipynb` notebook.**
4. After you upload, Gradescope runs the autograder that produces your PDF. While it is working, you will see a message such as:
   > *"The autograder hasn't finished running yet..."*
5. **Wait for the autograder to finish.** When it completes successfully, you will see a confirmation message:
   > *"Submission received. Your notebook has been converted to PDF for grading."*

If you instead see a message that says **PDF generation failed**, your notebook could not be converted -- see **"If something goes wrong"** at the bottom of this page.

## Step 3 -- Map your PDF pages to the questions

1. Return to the **Dashboard** and open the **"PDF Export from Autograder (do not upload here!)"** assignment (for example, **"Homework 01 - PDF Export from Autograder (do not upload here!)"**).
   - **Do not upload your notebook here.** This assignment already holds the PDF that was generated automatically in Step 2.
2. You should see the **auto-generated PDF** of your work, with the pages split up by question.
3. Click **"Reselect Pages."**
4. Go through the **assignment outline** and, for **each question**, select the PDF page(s) that contain your answer to that question. For example, for **Question 1.3**, make sure the page(s) showing your answer to 1.3 are selected for 1.3 in the outline. **If your solution to a question spans multiple pages, select all of those pages!**
5. When you have mapped every question, click **"Submit."** This confirms that your tagged PDF is submitted and ready for grading.

:::{note}
Once you are returned to your PDF submission, **do not** click the "Resubmit" button as this would prompt you to submit a entirely new PDF, which you _do not want to do_. If you need to make changes, you can click "Reselect Pages" again to fix your page mapping.
:::

:::{warning}
**Accurate page-mapping matters.** If pages are mapped to the wrong questions -- or not mapped at all -- the grader may not be able to find your work, and it may not be graded correctly, or at all.
:::

---

## Before you're done, confirm that you have:

- Logged in to Gradescope **through D2L**
- Uploaded your notebook to the **"Student Notebook Submission"** assignment
- Seen the message **"Submission received. Your notebook has been converted to PDF for grading."**
- Opened the **"PDF Export from Autograder"** assignment and found your generated PDF
- Used **"Reselect Pages"** to map **every** question to the correct page(s)
- Clicked **"Submit"** on the PDF Export assignment

## If something goes wrong

If any step does not work as described -- the autograder fails, no PDF appears, the PDF looks wrong or is missing pages, or you cannot map pages -- **notify your instructor immediately.** In your message, explain in as much detail as you can:

- which assignment and which step you were on,
- exactly what you did,
- what you expected to happen, and
- what actually happened (include the exact error message, or a screenshot, if possible).

The sooner you reach out, the sooner your instructor can help make sure your work gets graded.
