def stack_failure(self, question): return self.stack and stringify(question) != stringify(self.stack[-1][0])
def record(self, q, correct, time): self.outFile.write("%(tag)s %(time).3f %(grade)s\n" % { 'tag': stringify(q), 'time': time, 'grade': '1' if correct else '0', })
def record(self, q, correct, time): self.outFile.write("%(tag)s %(time).3f %(grade)s\n" % { 'tag': stringify(q), 'time':time, 'grade':'1' if correct else '0', })
def stack_failure(self, question): return (self.stack and stringify(question) != stringify(self.stack[-1][0]))