|
| 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 | +} |
0 commit comments