Ejemplo n.º 1
0
class VMGrader(Grader):
	def __init__(self, studentDir, studentID, project):
		Grader.__init__(self, studentID, studentDir, project)
		print "init : %s"%(studentID)
		self.dueDay = 31
		self.dueMonth = 10
		self.studentID = studentID
		self.clearReports = False
	
	def test(self, studentDir):
		self.testSuite = VMTestSuite(studentDir)
		print self.testSuite.tests
		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 
		self.testSuiteEC = VMTestSuiteEC(studentDir)
		print self.testSuiteEC.tests
		self.testSuiteEC.run()
		self.testSuiteEC.cleanup()
	
	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.testSuiteEC.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.testSuiteEC.ecReport.score))
		fileHandle.flush()
Ejemplo n.º 2
0
	def test(self, studentDir):
		self.testSuite = VMTestSuite(studentDir)
		print self.testSuite.tests
		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 
		self.testSuiteEC = VMTestSuiteEC(studentDir)
		print self.testSuiteEC.tests
		self.testSuiteEC.run()
		self.testSuiteEC.cleanup()