Skip to content

Commit

Permalink
Merge pull request #154 from Bram-Hub/batch-grader-issue149-show-puzz…
Browse files Browse the repository at this point in the history
…le-type

Adjustments made to Batch Grader
  • Loading branch information
Chase-Grajeda authored Jun 23, 2022
2 parents c0cf0f0 + e9c9742 commit 9e52ea5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/main/java/edu/rpi/legup/ui/LegupUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -555,12 +555,15 @@ private void traverseDir(File folder, BufferedWriter writer, String path) throws
facade = GameBoardFacade.getInstance();
Puzzle puzzle = facade.getPuzzleModule();

// Write data
// Write data
writer.append(fName).append(",");
if(puzzle.isPuzzleComplete()) writer.append("1,Solved\n");
else writer.append("0,Unsolved\n");
writer.append(puzzle.getName()).append(",");
if (puzzle.isPuzzleComplete())
writer.append("1,Solved\n");
else
writer.append("0,Unsolved\n");
} catch (InvalidFileFormatException e) {
writer.append(fName).append(" - invalid type,,Ungradeable\n");
writer.append(fName).append(",Invalid,,Ungradeable\n");
}
} else {
LOGGER.debug("Failed to run sim");
Expand Down Expand Up @@ -591,10 +594,10 @@ private void checkProofAll() {
folderBrowser.showOpenDialog(this);
File folder = folderBrowser.getSelectedFile();

// Write csv file (Path,File-Name,Score,Solved?)
// Write csv file (Path,File-Name,Puzzle-Type,Score,Solved?)
File resultFile = new File(folder.getAbsolutePath() + File.separator + "result.csv");
try (BufferedWriter writer = new BufferedWriter(new FileWriter(resultFile))) {
writer.append("Name,File Name,Score,Solved?\n");
writer.append("Name,File Name,Puzzle Type,Score,Solved?\n");

// Go through student folders
for (final File folderEntry : Objects.requireNonNull(folder.listFiles(File::isDirectory))) {
Expand Down

0 comments on commit 9e52ea5

Please sign in to comment.