@Override
public TestResult gradeAnAssignment(Assignment assignment)
{
TestResult runResult = new TestResult(assignment.ownerIdentification());
try
{
if(true == this.compile(assignment, runResult))
this.run(assignment, runResult);
}
catch(Exception e)
{
runResult.appendResult("RunResult", "ExceptionThrown");
runResult.setErrorMessage("exception raised -->" + e.toString());
Log.error(runResult.errorMessage());
e.printStackTrace();
}
try
{
SimpleFileIO.writeStringToTextFile(runResult.toString(), assignment.containerDirectory().getAbsolutePath() + File.separator + "runResult.txt");
}
catch(Exception e)
{
Log.error("Fail to write run result to " + assignment.containerDirectory().getAbsolutePath());
}