Skip to content

Commit

Permalink
include testname in summary results
Browse files Browse the repository at this point in the history
this is the "problem name"; previously was only including the
brief description

this changes the format of the CSV slightly (only the
"preamble" at the beginning of the results)
  • Loading branch information
daveho committed Jan 27, 2017
1 parent 194135c commit 2fd5347
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CloudCoder/src/org/cloudcoder/app/server/admin/Problems.java
Expand Up @@ -71,7 +71,10 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp)
if (problemURLInfo.getProblemId() < 0) {
summarizeProblems(user, course, resp);
} else {
// Load the problem (is this actually necessary?)
// Load the problem.
// This is necessary because the returned CSV data
// may include problem metadata (such as testname and
// brief description.)
Problem problem = new Problem();
problem.setProblemId(problemURLInfo.getProblemId());
if (!Database.getInstance().reloadModelObject(problem)) {
Expand Down Expand Up @@ -158,10 +161,11 @@ private void summarizeStudentWorkOnProblem(User user, Course course, int section
@SuppressWarnings("resource")
CSVWriter writer = new CSVWriter(resp.getWriter());

String problemName = Database.getInstance().getProblem(problem.getProblemId()).getBriefDescription();
String problemName = problem.getTestname();
String briefDesc = problem.getBriefDescription();
int numTests = Database.getInstance().getTestCasesForProblem(problem.getProblemId()).size();

writer.writeNext(new String[]{course.getName(), problemName});
writer.writeNext(new String[]{course.getName(), problemName, briefDesc});
writer.writeNext(new String[]{});
writer.writeNext(BEST_SUBMISSION_HEADER);

Expand Down

0 comments on commit 2fd5347

Please sign in to comment.