Skip to content

Commit 0fe7c6e

Browse files
authored
Merge branch 'main' into gradeable-config-editor
2 parents b052ccc + 0f86976 commit 0fe7c6e

File tree

6 files changed

+147
-1
lines changed

6 files changed

+147
-1
lines changed

_docs/developer/rensselaer_center_for_open_source/2025_Giancarlo_Martinelli.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,26 @@ title: Giancarlo Martinelli
33
category: Developer > Rensselaer Center for Open Source (RCOS) > Summer 2025
44
---
55

6-
coming soon
6+
This summer I primarily worked on two new Submitty features, live chat and image annotation.
7+
8+
## Live Chat
9+
10+
Going into the summer, [Live Chat](https://github.com/Submitty/Submitty/pull/10214) was functional but needed security updates and some style fixes, so the first thing I did when starting work on Submitty was move the websocket from the client to the server, updated the style of the Live Chat, and added websocket chatroom enables and disables:
11+
12+
![Live Chat Demo](../../../images/RCOS_report/2025_Giancarlo_Martinelli/chatroomdemo.gif)
13+
14+
Additionally, I wrote [end to end tests](https://github.com/Submitty/Submitty/pull/11818) for the new feature, including a proof of concept for end to end websocket testing using Cypress, which we previously thought might require a different testing library. This was done with the immense help of [Jeffrey Cordero](/developer/rensselaer_center_for_open_source/2025_Jeffrey_Cordero) who implemented this new testing pattern for many other features this summer.
15+
16+
## Image Annotation
17+
18+
During the summer one of our group's main goals was to get the number of open pull requests down to 0 by the end of the summer. One large thing preventing that were our open dependency PRs, one of which was a [double dependency of PDF annotator and PDF rendering](https://github.com/Submitty/Submitty/pull/11013). While I was able to update the PDF rendering dependency with some help from the other members we were unable to update our PDF annotator dependency because the package was maintained solely by Submitty, and wasn't even working in its most recent release. That realization led to the decision to remove the PDF annotation feature in favor of an image annotation feature. This coincided well with the addition of bulk upload, which turns large PDFs into a series of images. The idea is that in the future we'll stitch these images back together into a PDF-like format. As part of that I wrote a new [image annotation](https://github.com/Submitty/Submitty/pull/11921) implementation using a library [markerJS](https://markerjs.com/) which works really well as a plug-and-play solution to the problem. The relative age of our tech stack made this a little more difficult but I was eventually able to implement image annotation:
19+
20+
![Live Chat Demo](../../../images/RCOS_report/2025_Giancarlo_Martinelli/imageannotationdemo.gif)
21+
22+
## Urgent Bugfixes
23+
24+
I made two urgent fixes to our i[nstall site script](https://github.com/Submitty/Submitty/pull/11854) and [course materials](https://github.com/Submitty/Submitty/pull/11909). The install site script had been broken inadvertently by changes to our overall install script, and I was able to fix the script with the help of my peers. The course materials bug was a bug that was discovered this summer but had existed previously, we investigated the cause of the bug and I was able to identify and fix it, along with fixing a lot of other related bugs in course materials, meaning that the feature will be more stable and predictable than it was previously. Not only is bugged input prevented, but it also should fail more gracefully if bugged input is somehow accepted.
25+
26+
## Other to Mention
27+
28+
Finally, I helped draft out [first PR autoreply](https://github.com/Submitty/Submitty/pull/11597) script/text, which allows us to more efficiently interact with new developers.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
---
2+
title: Jupyter Notebooks
3+
category: Instructor > Autograding
4+
---
5+
6+
### Example Configuration
7+
8+
Example Jupyter Notebook autograding configurations can be found on the [Submitty GitHub](https://github.com/Submitty/Submitty/tree/main/more_autograding_examples).
9+
10+
### Required Fields
11+
12+
For autograding Jupyter Notebooks, the following fields must be included in your autograding configuration.
13+
14+
```json
15+
{
16+
"autograding" : {
17+
"submission_to_runner" : [ ... ],
18+
"work_to_details" : [ ... ]
19+
},
20+
"autograding_method": "docker",
21+
"container_options": {
22+
"container_image": "..."
23+
},
24+
"allow_system_calls": [
25+
...
26+
]
27+
}
28+
```
29+
30+
The method for allowing certain system calls can be found in [System Call Filtering](/instructor/autograding/system_call_filtering).
31+
You may also need to pass in resource limit values or a max submission size.
32+
33+
```json
34+
"resource_limits" : {
35+
"RLIMIT_NPROC" : 32,
36+
"RLIMIT_FSIZE": 20971520 // 20 MB
37+
},
38+
"max_submission_size": 10485760, // 10 MB
39+
```
40+
41+
`RLIMIT_NPROC` will allow the necessary resources for the script to execute a submitted Jupyter Notebook.
42+
43+
`RLIMIT_FSIZE` allows the script to save the notebook in Submitty. In this case, it allows at most a 20 MB file to be executed and saved.
44+
45+
### Precommands
46+
47+
Because of the saved outputs, you will need to apply precommands to each testcase that requires files generated from the validation
48+
method.
49+
50+
```json
51+
{
52+
"pre_commands" : [
53+
{
54+
"command" : "cp",
55+
// Assuming the first testcase is the case where the validation method was run
56+
"testcase" : "test01",
57+
"source" : "{filename}*.*",
58+
"destination" : "./"
59+
}
60+
],
61+
...
62+
},
63+
```
64+
65+
### Validation Method
66+
67+
We offer a validation method that parses the cells in Jupyter Notebooks for autograding. The script requires a single specified
68+
input notebook (the student's submission) and outputs an executed version of the notebook. If the student has no restrictions on
69+
the naming convention for their submitted notebook, you can use a wildcard to expect any input.
70+
71+
```
72+
"command": "jupyter_notebook_grader -i *.ipynb -o executed.ipynb"
73+
```
74+
75+
The possible saved files based on parsed output are highlighted below.
76+
77+
| Cell Type | File Pattern | Description |
78+
| --------- | ----------------------- | --------------------------------------------------- |
79+
| Markdown | {filename}.txt | Contains raw markdown source from cell |
80+
| Code | {filename}_source.txt | Contains Python source code from cell |
81+
| | {filename}_err.txt | Contains traceback if error occurs, otherwise empty |
82+
| | {filename}_stdout.txt | Captures standard output (e.g., print() statements) |
83+
| | {filename}_stderr.txt | Captures standard error streams |
84+
| | {filename}_result.txt | Text representation of cell's result |
85+
| | {filename}.png | Generated image outputs |
86+
87+
By default, the filenames are generated based on the index of the cell in the notebook, starting from 1.
88+
89+
### Submitty IDs
90+
91+
Instructors can add Submitty IDs to mark specific cells in Jupyter Notebooks to grade. These specified IDs will replace the
92+
default filename of the saved output (e.g. cell1.txt --> {submitty_id}.txt). If students modify their provided Jupyter Notebook
93+
to be out of order, this method will correctly find the cell to grade. Note that your autograding configuration will also need
94+
to match the name of the saved file.
95+
96+
```json
97+
{
98+
"pre_commands" : [
99+
{
100+
"command" : "cp",
101+
"testcase" : "test01",
102+
"source" : "{submitty_id}*.*",
103+
"destination" : "./"
104+
}
105+
],
106+
"title": "STDOUT",
107+
"points": 1,
108+
"validation": [
109+
{
110+
"method": "diff",
111+
"actual_file": "{submitty_id}_stdout.txt",
112+
"expected_string" : "hello world!"
113+
}
114+
]
115+
}
116+
```
117+
118+
Jupyter Notebook provides an option to easily edit cell metadata, introduced in [7.1.0](https://jupyter-notebook.readthedocs.io/en/stable/changelog.html#id116). In the `Edit` dropdown, you can find
119+
`Edit Notebook Metadata`. An editor panel will open on the right side of your screen to easily type in the metadata.
120+
121+
![](/images/jupyter_metadata.png)
122+
123+
An alternative option would be to manually edit the Jupyter Notebook JSON itself to include the `submitty_id` property in a cell's metadata.
1.27 MB
Loading
984 KB
Loading

images/jupyter_metadata.png

86.4 KB
Loading

navtreedata.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ var NAVTREE =
136136
[ "Hidden Testcase Examples", "/instructor/autograding/hidden_testcase_examples", null ],
137137
[ "Docker Images", "/instructor/autograding/docker_images", null ],
138138
[ "Docker UI", "/instructor/autograding/docker_ui", null ],
139+
[ "Jupyter Notebook", "/instructor/autograding/jupyter_notebook", null ],
139140
[ "Static Analysis", "/instructor/autograding/static_analysis/index", [
140141
[ "Overview", "/instructor/autograding/static_analysis/index", null ],
141142
[ "Count", "/instructor/autograding/static_analysis/count", null ],

0 commit comments

Comments
 (0)