Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
ishani07 committed Jan 18, 2024
1 parent 2ab7e90 commit 33c073a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
30 changes: 19 additions & 11 deletions autograder_gradescope/autograder_gradescope.qmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Autograder and Gradescope
title: Autograder and Gradescope
format:
html:
toc: true
Expand All @@ -10,7 +10,17 @@ format:
- cosmo
- cerulean
callout-icon: false
jupyter: python3
jupyter:
jupytext:
text_representation:
extension: .qmd
format_name: quarto
format_version: '1.0'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

::: {.callout-note collapse="true"}
Expand All @@ -24,7 +34,7 @@ jupyter: python3
If it has been a while since you’ve worked on an assignment, the kernel will shut itself down to preserve memory. When this happens, all of your variables are forgotten, including the grader. That’s OK. The easiest way to fix this is by restarting your kernel and rerunning all the cells. To do this, in the top left menu, click `Kernel` -> `Restart and Run All Cells`.

### I’m positive I have the right answer, but the test fails. Is there a mistake in the test?
While you might see the correct answer displayed as the result of the cell, chances are you solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, restart your kernel and run all the cells in-order: `Kernel` -> `Restart and Run All Cells`.
While you might see the correct answer displayed as the result of the cell, chances are your solution isn’t being stored in the answer variable. Make sure you are assigning the result to the answer variable and that there are no typos in the variable name. Finally, restart your kernel and run all the cells in order: `Kernel` -> `Restart and Run All Cells`.

### Why does `grader.check_all()` fail if all previous tests passed?
This can happen if you “overwrite” a variable that is used in a question. For instance, if Question 1 asks you to store your answer in a variable named `stat` and, later on in the notebook, you change the value of `stat`, the test after Question 1 will pass, but the test at the end of the notebook will fail. It is good programming practice to give your variables informative names and to avoid repeating the same variable name for more than one purpose.
Expand All @@ -33,29 +43,27 @@ This can happen if you “overwrite” a variable that is used in a question. Fo
You probably ran your notebook out of order. Re-run all previous cells in order, which is how your code will be graded.

### I accidentally deleted something in a cell that was provided to me – how do I get it back?
Suppose you’re working on Lab 5. One solution is go directly to DataHub and rename your lab05 folder to something else, like lab05-old. Then, click the Lab 5 link on the course website again, and it’ll bring you to a brand-new version of Lab 5. You can then copy your work from your old Lab 5 to this new one, which should have the original version of the assignment.
Suppose you’re working on Lab 5. One solution is to go directly to DataHub and rename your lab05 folder to something else, like lab05-old. Then, click the Lab 5 link on the course website again, and it’ll bring you to a brand-new version of Lab 5. You can then copy your work from your old Lab 5 to this new one, which should have the original version of the assignment.

## Gradescope

When submitting to Gradescope, there are often unexpected errors that make students loose more points than expected. Thus, it is imperative that you stay on the submission page until the autograder finishes running, and the results are displayed.
When submitting to Gradescope, there are often unexpected errors that make students lose more points than expected. Thus, it is imperative that you stay on the submission page until the autograder finishes running, and the results are displayed.

### Why did a Gradescope test fail when all the Jupyter notebook’s tests passed?
This can happen if you’re running your notebook’s cells out-of-order. The autograder runs your notebook from top-to-bottom. If you’re defining a variable at the bottom of your notebook and using it at the top, the Gradescope autograder will fail because it doesn’t recognize the variable when it encounters it.
This can happen if you’re running your notebook’s cells out of order. The autograder runs your notebook from top-to-bottom. If you’re defining a variable at the bottom of your notebook and using it at the top, the Gradescope autograder will fail because it doesn’t recognize the variable when it encounters it.

This is why we recommend going into the top left menu and clicking `Kernel`` -> `Restart` -> `Run All``. The autograder “forgets” all of the variables and runs the notebook from top-to-bottom like the Gradescope autograder does. This will highlight any issues.

Find the first cell that raises an error. Make sure that all of the variables used in that cell have been defined above that cell, and not below.

### My autograder keeps running/timed out

If your Gradescope submission page has been stuck running on this page for a while
If your Gradescope submission page has been stuck running on this page for a while:

<center><img src = "gradescope_loading.png" width = "500"></img></a></center>

or if it timed out
or if it timed out:

<center><img src = "gradescope_timeout.png" width = "500"></img></a></center>

this means that the Gradescope autograder failed to execute in the expected amount of time. This could be a problem on Gradescope's end, so we recommend resubmitting and letting the autograder rereun. If it still fails, please make a private Ed post.


this means that the Gradescope autograder failed to execute in the expected amount of time. This could be a problem on Gradescope's end, so we recommend resubmitting and letting the autograder rerun. If it still fails, please make a private Ed post.
18 changes: 13 additions & 5 deletions datahub/datahub.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,17 @@ format:
- cosmo
- cerulean
callout-icon: false
jupyter: python3
jupyter:
jupytext:
text_representation:
extension: .qmd
format_name: quarto
format_version: '1.0'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

### I can’t edit a cell
Expand All @@ -30,14 +40,12 @@ Occasionally when running the `grader.export(run_tests=True)` cell at the end of
Converting a Jupyter notebook to a PDF involves formatting some of the markdown text in [LaTeX](https://www.latex-project.org/). However, this process will fail if your free response answers have (unresolved) LaTeX characters like `\n`, `$`, or `$$`. If you're short on time, your best bet is to take screenshots of your free response answers, paste them into a Google Doc, and submit that as a PDF to Gradescope. If you have more time and would like the Datahub-generated PDF, please remove any special LaTeX characters from your free response answers.

### My text cell looks like code
If you double click on a text (markdown) cell, it'll appear in it's raw format. To fix this, simply run the cell. If this doesn't fix the problem, check out the commonly asked question below.
If you double-click on a text (markdown) cell, it'll appear in its raw format. To fix this, simply run the cell. If this doesn't fix the problem, check out the commonly asked question below.

### My text cell changed to a code cell / my code cell changed to a text cell
Sometimes, a text (markdown) cell was changed to a code cell, or a code cell can't be run because it's been changed to a text (markdown) or raw cell. To fix this, toggle the desired cell type in the top bar.

<center><img src = "toggle_cell_type.gif" width = "700"></img></a></center>

### Why does running a particular cell cause my kernel to die?
If one particular cell seems to cause your kernel to die, this is likely because the computer is trying to use more memory than it has available. For instance: your code is trying to create a gigantic array. To prevent from crashing the entire server, the kernel will “die”. This is an indication that there is a mistake in your code that you need to fix.


If one particular cell seems to cause your kernel to die, this is likely because the computer is trying to use more memory than it has available. For instance: your code is trying to create a gigantic array. To prevent the entire server from crashing, the kernel will “die”. This is an indication that there is a mistake in your code that you need to fix.
18 changes: 13 additions & 5 deletions jupyter_shortcuts/jupyter_shortcuts.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,21 @@ format:
- cosmo
- cerulean
callout-icon: false
jupyter: python3
jupyter:
jupytext:
text_representation:
extension: .qmd
format_name: quarto
format_version: '1.0'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---

::: {.callout-note collapse="false"}
**Note**: if you're using a MacBook, please replace `ctrl` with `cmd`
**Note**: if you're using a MacBook, please replace `ctrl` with `cmd`.
:::

## Shortcuts for Cells
Expand Down Expand Up @@ -45,12 +55,10 @@ To run all cells in a notebook:
<center><img src = "run_all.gif" width = "500"></img></a></center>

## Restarting Kernel
In the menu bar on the left, click `Kernel`. From here, you have several options. The ones we use most commly are:
In the menu bar on the left, click `Kernel`. From here, you have several options. The ones we use most commonly are:

- `Restart Kernel...`
- `Restart Kernel and Run up to Selected Cell`
- `Restart Kernel and Run All Cells`

<center><img src = "kernel.gif" width = "500"></img></a></center>


0 comments on commit 33c073a

Please sign in to comment.