Skip to content

Commit 002a80f

Browse files
committed
Merge branch 'master' of github.com:Submitty/Tutorial
2 parents 3b7bcf5 + c42c780 commit 002a80f

File tree

14 files changed

+301
-59
lines changed

14 files changed

+301
-59
lines changed

examples/13_cmake_compilation/config/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
// *************** TEST CASES *****************
1717
{
18-
"title" : "Run cube program hw4",
18+
"title" : "Test Output",
1919
"command" : "./a.out",
2020
"points" : 6,
2121
"validation" :
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Hello world. This was compiled using cmake.
22
Hello! I am a simple object which was created using a .h and .cpp.
3-
These were included in the cmakelists.txt file. My name is Jan
3+
These were included in the cmakelists.txt file. My name is Submitty

examples/13_cmake_compilation/submissions/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

examples/13_cmake_compilation/submissions/SimpleObject.cpp

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/13_cmake_compilation/submissions/SimpleObject.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

examples/13_cmake_compilation/submissions/main.cpp

Lines changed: 0 additions & 12 deletions
This file was deleted.
Binary file not shown.
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
{
3+
"resource_limits" : {
4+
// Allow the submission to run for 10 seconds.
5+
"RLIMIT_CPU" : 10,
6+
// Allow up to 20 additional processes launched by the student code.
7+
"RLIMIT_NPROC" : 20
8+
},
9+
"allow_system_calls" : [
10+
"ALLOW_SYSTEM_CALL_CATEGORY_COMMUNICATIONS_AND_NETWORKING_SIGNALS",
11+
"ALLOW_SYSTEM_CALL_CATEGORY_COMMUNICATIONS_AND_NETWORKING_SOCKETS",
12+
"ALLOW_SYSTEM_CALL_CATEGORY_COMMUNICATIONS_AND_NETWORKING_SOCKETS_MINIMAL",
13+
"ALLOW_SYSTEM_CALL_CATEGORY_FILE_MANAGEMENT_RARE",
14+
"ALLOW_SYSTEM_CALL_CATEGORY_PROCESS_CONTROL_NEW_PROCESS_THREAD"
15+
],
16+
"testcases" : [
17+
{
18+
"title" : "Actions Example",
19+
//The expected python program creates a window using tkinter
20+
//This window is a simple dialog box, which echoes input.
21+
//To grade this, we want to type "Submitty" into a text
22+
//field, click the ok box, then click the exit button.
23+
//To do this, we will use the actions defined below.
24+
"command" : ["python3 *.py" ],
25+
//*************** Actions *********************
26+
//Actions allow you to interface GUI programs
27+
//via submitty. Note that in order to run such
28+
//applications, it is required that you have
29+
//set up a "Submitty with a screen;" a machine
30+
//running submitty with a monitor. This machine
31+
//must also run only one grading thread at a
32+
//time. For more information, please visit the
33+
//submitty wiki.
34+
"actions" : [
35+
//it is recommended that programs with GUIs begin with
36+
//an extra delay to allow student code time to fully
37+
//initialize.
38+
"delay 2",
39+
//This command will screenshot the student's window.
40+
//Pair it with the validation below to show it to
41+
//display it to the students.
42+
"screenshot",
43+
//The type command will submitty the provided characters
44+
//as keyboard input to the student's window.
45+
"type 'Submitty'",
46+
//This screenshot should show the effects of the type command
47+
//above
48+
"screenshot",
49+
//We will now move the mouse (in pixels relative to the upper
50+
//left hand corner of the screen). This location correlates with
51+
//where the student's ok button should be. Note that we could have
52+
//required the student to map the button to a specific hotkey and typed
53+
//that instead.
54+
"mouse move 200 75",
55+
//This delay is added merely so that instructors can watch the grading
56+
//happen, in practice it is unnecessary.
57+
"delay 1",
58+
//now we click the ok button.
59+
"click",
60+
//This screenshot should show the effect of the previous command.
61+
"screenshot",
62+
"delay 1",
63+
//The no clamp option allows us to move the mouse 'outside' of the window
64+
//It is recommended that this option only be used after much testing to avoid
65+
//unwelcome interactions. In this case, it was necessary to access the 'x' in
66+
//border of the student's screen.
67+
"mouse move no clamp 10 -10",
68+
"click"],
69+
// Point value of this testcase.
70+
"points" : 10,
71+
//These validation steps check for the screenshots taken above, which are created
72+
//with sequential labels starting at 0. For more information, please visit the submitty wiki.
73+
"validation" : [
74+
{
75+
"actual_file": "0.png",
76+
"description": "Screenshot of an empty echo",
77+
"method": "fileExists",
78+
"show_actual": "always",
79+
"show_message": "always"
80+
},
81+
{
82+
"actual_file": "1.png",
83+
"description": "Screenshot of Submitty in dialog box.",
84+
"method": "fileExists",
85+
"show_actual": "always",
86+
"show_message": "always"
87+
},
88+
{
89+
"actual_file": "2.png",
90+
"description": "Screenshot of echoed Submitty.",
91+
"method": "fileExists",
92+
"show_actual": "always",
93+
"show_message": "always"
94+
}
95+
]
96+
}
97+
]
98+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env python3
2+
3+
import sys
4+
from tkinter import *
5+
from tkinter import ttk
6+
7+
8+
def echo(*args):
9+
global displayed_text
10+
try:
11+
displayed_text.set(user_text.get())
12+
except ValueError:
13+
pass
14+
15+
root = Tk()
16+
root.title("Echo Input")
17+
18+
program_window = ttk.Frame(root, padding="3 3 12 12")
19+
program_window.grid(column=0, row=0, sticky=(N, W, E, S))
20+
program_window.columnconfigure(0, weight=1)
21+
program_window.rowconfigure(0, weight=1)
22+
23+
user_text = StringVar()
24+
displayed_text = StringVar()
25+
26+
user_text = ttk.Entry(program_window, width=7, textvariable=user_text)
27+
user_text.grid(column=2, row=1, sticky=(W, E))
28+
29+
#ttk.Label(program_window, textvariable=meters).grid(column=2, row=2, sticky=(W, E))
30+
ttk.Button(program_window, text="Echo", command=echo).grid(column=3, row=3, sticky=W)
31+
32+
ttk.Label(program_window, text="Input").grid(column=3, row=1, sticky=W)
33+
ttk.Label(program_window, text="You Entered: ").grid(column=1, row=2, sticky=E)
34+
label = ttk.Label(program_window, textvar=displayed_text)
35+
label.grid(column=2, row=2, sticky=W)
36+
37+
for child in program_window.winfo_children(): child.grid_configure(padx=5, pady=5)
38+
39+
user_text.focus()
40+
root.bind('<Return>', echo)
41+
42+
root.mainloop()

examples/15_GLFW/config/config.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
{
2+
"max_submission_size" : 1000000,
3+
"testcases" : [
4+
5+
// *************** COMPILATION *****************
6+
{
7+
"type" : "Compilation",
8+
"title" : "Compilation",
9+
//Note the two step compilation.
10+
"command" : ["cmake .", "make"],
11+
"executable_name" : "a.out",
12+
"points" : 1
13+
},
14+
// *************** TEST CASES *****************
15+
{
16+
"title" : "Graphics program 1",
17+
"command" : "./a.out -input sierpinski_triangle.txt -size 400 -iters 0 -cubes",
18+
//*************** Actions *********************
19+
//Actions allow you to interface GUI programs
20+
//via submitty. Note that in order to run such
21+
//applications, it is required that you have
22+
//set up a "Submitty with a screen;" a machine
23+
//running submitty with a monitor. This machine
24+
//must also run only one grading thread at a
25+
//time. For more information, please visit the
26+
//submitty wiki.
27+
"actions" : [
28+
//It is recommended that the first action be a delay to allow student
29+
//programs additional time to initialize. Actions are taken beginning
30+
//at window load time. Note that all actions are padded with a .1 sec
31+
//delay.
32+
"delay 1",
33+
//The click and drag delta command moves a specific distance from the
34+
//current mouse position. For additional information about actions
35+
//and their syntax, please view the submitty wiki.
36+
"click and drag delta 100 0",
37+
//This program uses many unecessarily delays. Experiment by removing
38+
//them.
39+
"delay 1",
40+
"click and drag delta -100 0",
41+
"delay 1",
42+
"click and drag delta 0 100",
43+
"delay 1",
44+
"click and drag delta 0 -100",
45+
"delay 1",
46+
"click and drag delta 1000 0",
47+
"delay 1",
48+
"click and drag delta -1000 0",
49+
"delay 1",
50+
"click and drag delta 0 160",
51+
"delay 1",
52+
"click and drag delta 0 -160",
53+
"delay 1",
54+
"click and drag delta 300 300",
55+
"delay 1",
56+
//moves the mouse to 0,0 (upper left) on the window.
57+
"origin",
58+
"delay 1",
59+
//Centers the mouse on the screen
60+
"center",
61+
"delay 1",
62+
"mouse move 10 200",
63+
"delay 1",
64+
"click and drag 10 10 150 150",
65+
"delay 1",
66+
"click and drag 160 160",
67+
//takes a screenshot, labeled sequentially starting from 0.
68+
"screenshot",
69+
//In the provided application, q indicates a program quit.
70+
"type 'q'"],
71+
"points" : 1,
72+
"validation": [
73+
{
74+
//In this validation example, we merely check that the screenshot
75+
//taken above exists.
76+
"actual_file": "0.png",
77+
"description": "screenshot a",
78+
"method": "fileExists",
79+
"show_actual": "always",
80+
"show_message": "always"
81+
}
82+
]
83+
},
84+
{
85+
"title" : "Graphics program 1",
86+
"command" : "./a.out -input sierpinski_triangle.txt -size 400 -iters 0 -cubes",
87+
"actions" : [
88+
"click and drag delta 50 -125",
89+
"delay 1",
90+
"screenshot",
91+
"type 'q'"
92+
],
93+
"points" : 1,
94+
"validation": [
95+
{
96+
"actual_file": "0.png",
97+
"description": "screenshot a",
98+
"method": "fileExists",
99+
"show_actual": "always",
100+
"show_message": "always"
101+
}
102+
]
103+
}
104+
]
105+
}

0 commit comments

Comments
 (0)