class ShellGrader(Grader): def __init__(self, studentDir, studentID, project): Grader.__init__(self, studentID, studentDir, project) print "init : %s"%(studentID) self.dueDay = 22 self.dueMonth = 2 self.studentID = studentID self.clearReports = False def test(self, studentDir): self.testSuite = ShellTestSuite(studentDir) self.testSuite.run() self.testSuite.cleanup() self.totalScore = self.testSuite.report.score + self.testSuite.hiddenReport.score self.maxScore = self.testSuite.report.totalScore + self.testSuite.hiddenReport.totalScore def appendGradingReport(self, fileHandle): # writes out in to the file in the format - section, uname, submission delay, visible_score, hidden_score, ec_score content = ("%s, %s, %s, %s, %s, %s\n"%(self.section, self.studentID, self.lateDays, self.testSuite.report.score, self.testSuite.hiddenReport.score, self.testSuite.ecReport.score)) fileHandle.write(content) fileHandle.flush() def appendPartnerGradingReport(self, fileHandle): if self.partner == None: return # writes out in to the file in the format - section, uname, submission delay, visible_score, hidden_score, ec_score fileHandle.write("%s, %s, %s, %s, %s, %s\n"%(self.partnerSection, self.partner, self.lateDays, self.testSuite.report.score, self.testSuite.hiddenReport.score, self.testSuite.ecReport.score)) fileHandle.flush()
def test(self, studentDir): self.testSuite = ShellTestSuite(studentDir) self.testSuite.run() self.testSuite.cleanup() self.totalScore = self.testSuite.report.score + self.testSuite.hiddenReport.score self.maxScore = self.testSuite.report.totalScore + self.testSuite.hiddenReport.totalScore