Repository navigation
hulqBASH
A source code evaluation REST service that downloads two files from the S3 bucket used for AES, parses out the command line argument sets and test configuration from the solution file (in the format specified below), then executes them against each other through bash scripts.
We are hosting an independent service (on a separate EC2 instance) to compile, execute, and evaluate source code.
Languages Currently Supported: Java(8)[.java], C[.c], C++[.cpp], C#[.cs]
Evaluation is done in a Docker container to prevent users from executing commands that might be harmful for the system.
An S3 bucket in Amazon uses a key instead of a filename to reference a specific file.
the names of these keys are unimportant with regard to hulqBASH, as the application will rename them internally based on the specifications provided in the config.
Use the following schema to define configuration for evaluation:
@Config
mathmode:false
trimwhitespace:false
extractwhitespace:false
caseignore:false
grosserrormargin:0.0
caseerrormargin:0.0
keyfilename:key.cpp
testfilename:test
mathmode(boolean): indicates that outputs should be numeric, grading will be relative difference of the key output, candidate will recieve 100% if key output is non numeric, 0% if candidate output is non numeric
values: true, false
default: false
trimwhitespace(boolean): indicates that whitespace should be trimmed from both ends of output (for both candidate and key)
values: true, false
default: false
extractwhitespace(boolean): indicates that whitespace should be removed from interior of output (for both candidate and key)
values: true, false
default: false
caseignore(boolean): indicates that case should be ignored for output (for both candidate and key)
values: true, false default: false
grosserrormargin(double): indicates the threshold of error of all executions for which a candidate can still receive a non zero grade (applies same logic as caseerrormargin to overall grade)
values: 0.0 - 1.0
default: 0.0
caseerrormargin(double): indicates the threshold of error for a single execution for which a candidate can still receive a non zero grade (ex: key result = 4, candidate result = 5, caseerrormargin:0.90, grade = 0%)
values: 0.0 - 1.0
default: 0.0
keyfilename(string): the name that the key file needs to have in order to be compiled and executed MUST include file extension
testfilename(string): the name that the candidates file should be named in order to be compiled and executed MUST NOT include file extension
Use the following schema to define command line arguments (note: individual command line arguments cannot contain white space, single quotes, double quotes, or back-ticks). The comment block should be in the solution file.
Also, for the purposes of grading, only the OUTPUT of a file will be compared to the output of the solution for grading. Thus, the solution file MUST include a system.out.println(), << cout, printf(), etc. And the prompt should indicate that the submitted file must include the same for grading purposes.
/*
@ArgSet(1)
5 % Seconds before an executing command in timedout
@ArgSet(2)
argument1 % Comment about argument1
argument2 % Comment about argument2
argument3 % Comment about argument3
argument4 % Comment about argument4
@ArgSet(3)
argument1 % Comment about argument1
argument2 % Comment about argument2
@ArgSet(4)
argument1 % Comment about argument1
argument2 % Comment about argument2
argument3 % Comment about argument3
*/
Each @ArgSet(X) defines a test case Except for the first case, that is for the seconds before the code is timedout. For example, if we want to test a Palindrome class, we would use
java Palindrome argument1 argument2 argument3 argument4
for ArgSet(2),
java Palindrome argument1 argument2
for ArgSet(3), and
java Palindrome argument1 argument2 argument3
for ArgSet(4).
public class Palindrome
{
public static boolean isPalindrome(String s)
{
if(s.length()==0)
return false;
else if(s.length()==1)
return true;
else if(s.length()==2)
{
if(s.charAt(0)==s.charAt(1))
return true;
else
return false;
}
else if(s.charAt(0)==s.charAt(s.length()-1))
return isPalindrome(s.substring(1,s.length()-1));
else
return false;
}
public static void main(String[] args)
{
System.out.println(isPalindrome(args[0]));
}
}
/*
@Config
mathmode:false
trimwhitespace:false
extractwhitespace:false
caseignore:false
grosserrormargin:0.0
caseerrormargin:0.0
keyfilename:key.java
testfilename:test
@ArgSet(1)
racecar % true
@ArgSet(2)
thisisnotapalindrome % false
bob % this second argument is ignored
@ArgSet(3)
anna % true
@ArgSet(4)
raceCar % false (capitalization)
*/
> java Palindrome racecar
true
> java Palindrome thisisnotapalindrome bob
false
> java Palindrome anna
true
> java Palindrome raceCar
false
hulqBASH v2 includes several major improvements, the most important of which is the modularity of language implementation. The BASH source implements config files for each language, and includes a readme file that enumerates the specifications for adding new configurations to the system.
URL http://<url>:<port>/submission
Body {"submission":"<UserInputFile>","solution":"<SolutionFile>"}