Skip to content

Commit fc57dab

Browse files
authored
add request signature script (#674)
* add request signature script Signed-off-by: Alex Chi <[email protected]> * chmod 755 Signed-off-by: Alex Chi <[email protected]> * more info Signed-off-by: Alex Chi <[email protected]> * update template Signed-off-by: Alex Chi <[email protected]> * fix typo Signed-off-by: Alex Chi <[email protected]> * rm Your Signed-off-by: Alex Chi <[email protected]> --------- Signed-off-by: Alex Chi <[email protected]>
1 parent 84a60a5 commit fc57dab

File tree

2 files changed

+124
-78
lines changed

2 files changed

+124
-78
lines changed

GRADESCOPE.md.template

Lines changed: 13 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,18 @@
1-
# BusTub Non-CMU Gradescope
2-
3-
To create a fair learning environment for all students and avoid potential
4-
Academic Integrity Violations within CMU, we ask you to AVOID making your
5-
BusTub repository public on GitHub. If you are not a student from CMU, you will
6-
need to sign this document before submitting to Gradescope.
7-
8-
Please sign this document by filling your information in the form and include
9-
this file along with your submission. Firstly, run the following command to copy
10-
this file:
11-
12-
```
13-
cp GRADESCOPE.md.template GRADESCOPE.md
14-
```
15-
16-
Then, please read the following agreement and fill in the signature below.
17-
18-
```plain
19-
I hereby agree to the terms outlined in this agreement ("Agreement"). By
20-
signing this Agreement, I acknowledge that I have read, understood, and will
21-
comply with the following terms and conditions:
22-
23-
1. Respect for System Security: I understand and acknowledge that the Gradescope
24-
system, which is used for the submission and grading of assignments, projects,
25-
and examinations, is a secure platform. I agree to respect the security measures
26-
implemented by Gradescope and will not engage in any activities that could
27-
compromise the integrity, functionality, or security of the system.
28-
29-
TL;DR: DO NOT try to retrieve private test cases from the autograder. They are
30-
not meant to be used by students in their local development environment.
31-
32-
2. Academic Integrity: I affirm that the work I submit for assessment,
33-
including assignments, projects, and examinations, is my original work. I
34-
understand that cheating, plagiarism, or any form of academic dishonesty is
35-
strictly prohibited by the School/Organization's policies, and any violation
36-
will result in appropriate disciplinary action, which may include academic
37-
penalties and sanctions.
38-
39-
TL;DR: DO submit your own work.
40-
41-
3. Prohibition on Publishing: I agree not to publish, upload, or otherwise make
42-
available any solutions, code, assignments, projects, or related materials
43-
provided by the School/Organization that are designated as confidential or
44-
proprietary to any public repositories on GitHub or any other online
45-
platforms accessible to the public. This includes but is not limited to
46-
personal repositories, organizational repositories, public gists, and forums.
47-
48-
TL;DR: DO NOT publish your project solution anywhere. You may publish blog
49-
posts on your general approach and ideas about the project, but DO NOT
50-
publish it before the CMU deadline for that project, and DO NOT publish code.
51-
52-
4. No Official Help: I understand and acknowledge that the School/Organization
53-
does not offer official assistance or support for technical, academic, or
54-
non-academic matters. This includes, but is not limited to, help with
55-
assignments, projects, technical troubleshooting, academic advising, and
56-
administrative inquiries.
57-
58-
TL;DR: This is an unofficial Gradescope for 15-445/645 course. DO NOT submit
59-
issues to the BusTub repo regarding Gradescope issues. There is an
60-
unofficial Discord server, but neither TAs or professors will actively
61-
monitor it. See the course FAQ for the Discord link.
62-
63-
===BEGIN SIGNATURE===
64-
Student's GitHub ID:
65-
Student's Legal Name:
66-
Student's Organization/School Name:
67-
Student's Email:
1+
To create a fair learning environment for all students and avoid potential Academic Integrity Violations within Carnegie Mellon University, we ask you to sign this short agreement before submitting to Gradescope.
2+
3+
1. I agree NOT to make my solution public. i.e., DO NOT make it public on GitHub or create videos explaining the solution code.
4+
2. I agree NOT to hack Gradescope. i.e., DO NOT retrieve private test cases from Gradescope, or bypass correctness checks.
5+
3. I affirm that the work I submit for assessment is my original work. i.e., DO NOT purchase/copy solution from others.
6+
4. I understand that the course staff does not provide official help for students outside CMU. i.e., DO NOT email the course staff or create GitHub issues for course-related questions. Use the unofficial Discord server.
7+
I understand that if I violate the rules, I will be banned from using Gradescope.
8+
9+
Name:
10+
Affiliation (School/Company):
11+
Email:
12+
GitHub ID:
6813
Date:
69-
=== END SIGNATURE ===
70-
```
71-
72-
* Note: Your email should be the same as your Gradescope email. Please use the email
73-
from your academic affiliation if possible.
74-
* Note: If you do not have a GitHub account, please fill in N/A.
75-
* Note: If you are not affiliated with any organization, you can fill in
76-
the third line with N/A.
7714

78-
The `make submit-pX` command will automatically include this file (TBD) and the
79-
grader will grade your submission. Thank you for your interest in the BusTub
80-
project, and thank you for helping us create a fair learning environment.
15+
I understand that if I provide a fake signature, I will be banned from using Gradescope.
8116

8217
[id]: bustub-non-cmu-gradescope-23333
8318

gradescope_sign.py

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#!/usr/bin/env python3
2+
3+
from datetime import datetime
4+
from pathlib import Path
5+
import subprocess
6+
7+
8+
def request_yn(buffer, msg):
9+
print(msg, end="")
10+
print(" [y/N] ", end="")
11+
yn = input()
12+
assert yn == "y"
13+
buffer += msg
14+
buffer += "\n"
15+
return buffer
16+
17+
18+
def request_sign(buffer, msg):
19+
print(msg, end="")
20+
print(" ", end="")
21+
data = input()
22+
assert len(data) >= 2
23+
buffer += msg
24+
buffer += " "
25+
buffer += data
26+
buffer += "\n"
27+
return buffer
28+
29+
30+
def request_date(buffer, msg):
31+
print(msg, end="")
32+
buffer += msg
33+
date = datetime.today().strftime("%Y-%m-%d")
34+
print(" " + date)
35+
buffer += " "
36+
buffer += date
37+
buffer += "\n"
38+
return buffer
39+
40+
41+
def add_to_submission():
42+
for item in Path().iterdir():
43+
name = item.name
44+
if name.startswith("project") and name.endswith("-submission.zip"):
45+
print("adding GRADESCOPE.md to", name)
46+
subprocess.run(["zip", name, "GRADESCOPE.md"])
47+
48+
49+
def main():
50+
if Path("GRADESCOPE.md").exists():
51+
print("Found existing signature GRADESCOPE.md, adding to all submissions...")
52+
add_to_submission()
53+
print(
54+
"If you want to make modifications to signed document, run `rm GRADESCOPE.md` and then run this script again."
55+
)
56+
return
57+
buffer = ""
58+
buffer = request_yn(
59+
buffer,
60+
"To create a fair learning environment for all students and avoid potential Academic Integrity Violations within Carnegie Mellon University, we ask you to sign this short agreement before submitting to Gradescope.",
61+
)
62+
buffer += "\n"
63+
buffer = request_yn(
64+
buffer,
65+
"1. I agree NOT to make my solution public. i.e., DO NOT make it public on GitHub or create videos explaining the solution code.",
66+
)
67+
buffer = request_yn(
68+
buffer,
69+
"2. I agree NOT to hack Gradescope. i.e., DO NOT retrieve private test cases from Gradescope, or bypass correctness checks.",
70+
)
71+
buffer = request_yn(
72+
buffer,
73+
"3. I affirm that the work I submit for assessment is my original work. i.e., DO NOT purchase/copy solution from others.",
74+
)
75+
buffer = request_yn(
76+
buffer,
77+
"4. I understand that the course staff does not provide official help for students outside CMU. i.e., DO NOT email the course staff or create GitHub issues for course-related questions. Use the unofficial Discord server.",
78+
)
79+
buffer = request_yn(
80+
buffer,
81+
"I understand that if I violate the rules, I will be banned from using Gradescope.",
82+
)
83+
buffer += "\n"
84+
buffer = request_sign(buffer, "Name:")
85+
buffer = request_sign(buffer, "Affiliation (School/Company):")
86+
buffer = request_sign(buffer, "Email:")
87+
buffer = request_sign(buffer, "GitHub ID:")
88+
buffer = request_date(buffer, "Date:")
89+
buffer += "\n"
90+
buffer = request_yn(
91+
buffer,
92+
"I understand that if I provide a fake signature, I will be banned from using Gradescope.",
93+
)
94+
print()
95+
print("--- THIS IS A COPY OF THE SIGNED DOCUMENT ---")
96+
print(buffer)
97+
print("--- END OF THE SIGNED DOCUMENT ---")
98+
print()
99+
print(
100+
"Saving the signature to GRADESCOPE.md and adding the signed document to submission zips..."
101+
)
102+
Path("GRADESCOPE.md").write_text(buffer)
103+
add_to_submission()
104+
print("Run this script again if you create new submission zips.")
105+
106+
107+
if __name__ == "__main__":
108+
try:
109+
main()
110+
except KeyboardInterrupt:
111+
print("\nthe sign process was aborted")

0 commit comments

Comments
 (0)