Conversation
…e permissions in install_system.sh
…tils Author: Evan Maicus <emaicus@outlook.com>
… prep for pull request.
* add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id
progress on issue #674
…r closure), defaults to true (#1014)
* Looks better when there are zero numeric fields * Looks better when there are zero numeric fields
…ructor has grading (#1026) * add sorting options for labs, default viewing options for labs * sorting for registration and rotation grading * sort by more than just id * changed function names * now user id not left aligned * remove unneeded code
* Added a row for total points. * total row is functional * is updated when you make a gradeable from a template * made suggested changes and fixed a typo. * all updates made * corrected some unnecessary changes
…rmissions (#1030) * just starting * progress * a bit more * edits to check_everything script * more checks * change requests * rearrange logic * add to travis after_script
* Penalty, extra, and normal credit look diffirent now * Extra credit and penalty have colors and icons * The icons are now on the left
* Added checks for the form for the user * updated with requested changes * updated with requested changes
…ms (#1050) replace 'assignment' with 'gradeable' in grade_students.sh (improves consistency) better error message for attempted use of system programs that are not on the whitelist now scrapes the config.json for names of compiled_executables to improve the check for local programs if the config.json uses an unacceptable local, now it complains at BUILD time (not delaying to submission debugging as before) fix autograding test failures disabled seccomp because it's broken :( will make a new issue & fix that next, in a new PR #1051.
…tils Author: Evan Maicus <emaicus@outlook.com>
… prep for pull request.
Merge branch 'Actions' of https://github.com/Submitty/Submitty into Actions
bmcutler
requested changes
Jun 20, 2017
Member
bmcutler
left a comment
There was a problem hiding this comment.
Comments place to the right of code are harder to read, and if they are long, they wrap badly with narrower displays. Please put most of these comments above the code, on a line without code.
grading/execute.cpp
Outdated
|
|
||
| // for graphics/window interaction | ||
| { "scrot", "/usr/bin/scrot"}, | ||
| { "xdotool", "/usr/bin/xdotool"} |
grading/execute.cpp
Outdated
| bool window_mode = false; //Tells us if the process is expected to spawn a window. (additional support later) | ||
|
|
||
| if(actions.size() > 0){ //right now, we assume if there are actions, there will be a window. | ||
| std::cout << "Recieved " << actions.size() << " actions" << std::endl; //useful debug line. |
grading/window_utils.cpp
Outdated
|
|
||
| /* | ||
| * At the moment, this method finds any window names associated with the child's pid. This works fine. | ||
| * However, it is concieveable that the child could fork/generate a window with its own pid. In this case |
grading/window_utils.cpp
Outdated
| continue; | ||
| } | ||
|
|
||
| if(std::regex_match(window, match, regex)){ //get the third collumn (the pid, view example output above) |
grading/window_utils.cpp
Outdated
| } | ||
| } | ||
|
|
||
| if(!found) //we are inside of the box (gauranteed by clamp) so move |
Member
|
Also, please pull master & fix merge conflicts & re-test w/ graphics & non graphics programs. |
bmcutler
reviewed
Jun 21, 2017
grading/execute.cpp
Outdated
| { "xdotool", "/usr/bin/xdotool"} | ||
| { "scrot", "/usr/bin/scrot"}, //screenshot utility | ||
| { "xdotool", "/usr/bin/xdotool"}, //keyboard/mouse input | ||
| { "xdotool", "/usr/bin/wmctrl"}, //bring window into focus |
Contributor
Author
There was a problem hiding this comment.
Good catch. I just pushed an update.
bmcutler
approved these changes
Jun 26, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1000
Brief: Adds support for scripted keyboard and mouse interaction, screenshots, and delays for use in interactive programs. While developing, some modifications were made to execute.cpp, maincompile.cpp, etc. but most major changes take place in the added window_utils.cpp file. I have added documentation on Submitty.org under the Assignment Configuration heading (the section is called Types of Action) which specifies the interactions I have implemented and the commands needed to utilize them.
Breakdown:
When the execute function in execute.cpp is called, the first thing that happens is a check if the instructor has specified any actions. If they have, we assume that a window will be created to use them on. The process forks as it did before, with the child running the student's code. The parent, however, begins looking for the expected window every 1/10th second (only if a window is expected, 1/10th second was the value specified before, and all memory/time checks on the student's program are still in place). If the window is found (for now, if a window is spawned with a pid matching the child's), the program begins taking actions, one every 1/10th second. While there are still actions to take, the execute function calls the takeAction function in window_utils.cpp, which routes the provided command to the proper function (e.g., if the next action is a delay of the form "delay 4", the takeAction function will parse it and forward it to the delay function). If a delay is invoked, it is broken into 1/10th second portions, with memory and time checks performed when appropriate (per the previous implementation of execute). Before any action is taken, a check is performed to see if the student's window still exists. if it does, the mouse is centered on the student's window and the window is brought into focus before the action is taken. If the student's window has failed, the action is not taken. All mouse commands should be clamped to within the student's window minus a one pixel boundary, meaning that unless the mouse is physically manipulated, it should not be able to leave the student's window and interact with the pc.
Known Issues: