Navigation Menu

Skip to content

Commit

Permalink
Update examples for new validator library
Browse files Browse the repository at this point in the history
  • Loading branch information
troeger committed Nov 30, 2017
1 parent bf1cb1e commit 5c79939
Show file tree
Hide file tree
Showing 16 changed files with 161 additions and 464 deletions.
20 changes: 0 additions & 20 deletions examples/hello_world/validateHelloWorld.py

This file was deleted.

6 changes: 6 additions & 0 deletions examples/helloworld/helloworld.c
@@ -0,0 +1,6 @@
#include <stdio.h>

int main(int argc, char** argv) {
printf("Hello World\n");
return 0;
}
23 changes: 23 additions & 0 deletions examples/helloworld/validator.py
@@ -0,0 +1,23 @@
'''
Example for an OpenSubmit validator.
Install opensubmit-exec and try it out:
opensubmit-exec test examples/helloworld/
When something goes wrong, an exception is generated by
the functions below. The root cause for this exception,
such as timeout or unsuccessful compilation,
is reported to the student.
When no exception occured until the end of validate(),
a positive feedback is sent.
'''

def validate(job):
# Build the input files provided by the student
# with GCC, and generate an output file 'helloworld'.
job.run_build(inputs=['helloworld.c'], output='helloworld')

# Run the compilation result.
job.run_program('./helloworld')
7 changes: 7 additions & 0 deletions examples/helloworld_broken/helloworld.c
@@ -0,0 +1,7 @@
#include <stdio.h>

int main(int argc, char** argv) {
// Semikolon is missing
printf("Hello World\n")
return 0;
}
23 changes: 23 additions & 0 deletions examples/helloworld_broken/validator.py
@@ -0,0 +1,23 @@
'''
Example for an OpenSubmit validator.
Install opensubmit-exec and try it out:
opensubmit-exec test examples/helloworld_broken/
When something goes wrong, an exception is generated by
the functions below. The root cause for this exception,
such as timeout or unsuccessful compilation,
is reported to the student.
When no exception occured until the end of validate(),
a positive feedback is sent.
'''

def validate(job):
# Build the input files provided by the student
# with GCC, and generate an output file 'helloworld'.
job.run_build(inputs=['helloworld.c'], output='helloworld')

# Run the compilation result.
job.run_program('./helloworld')
Binary file removed examples/hpi/assignment1.pdf
Binary file not shown.
123 changes: 0 additions & 123 deletions examples/hpi/gradeDinner.py

This file was deleted.

119 changes: 0 additions & 119 deletions examples/hpi/gradeParSum.py

This file was deleted.

0 comments on commit 5c79939

Please sign in to comment.