def recordButton(self, button): # don't record button presses before question display if self.displayPhrase: t = get_time() self.recordUniqueEvent( 'questionResponse', QuestionResponse(button, self.textAnswLeft, self.textAnswRight, self.textAnswCorrect, t - self.displayTime)) return True else: return False
def recordButton(self, button): # don't record button presses before question display if self.displayPhrase: t = get_time() self.recordUniqueEvent('questionResponse', QuestionResponse(button, self.textAnswLeft, self.textAnswRight, self.textAnswCorrect, t-self.displayTime)) return True else: return False
def debug(string, level=2): if level < 2: print("DISPLAY (%s): " % get_time()) + string
def debug(string, level=2): if level < 2: print ("DISPLAY (%s): "%get_time())+string
def recordQuestionDisplayEnd(self): self.displayTime = get_time() self.displayPhrase = True self.recordUniqueEvent('questionDisplayEnd', DisplayUpdateEnd('question')) return True
def recordQuestionDisplayStart(self): self.displayTime = get_time() self.recordUniqueEvent('questionDisplayStart', DisplayUpdateStart('question')) return True
def debug(string, level=2): if level < 2: print ("QUESTION (%s): "%get_time())+string
def debug(string, level=2): if level < 2: print("QUESTION (%s): " % get_time()) + string
def debug(string, level=2): if level < 2: print("HANDLER (%s): " % get_time()) + string
def recordUniqueEvent(self, name, val=None): t = get_time() if self.hasEvent(name): debug("Tried to add an event which has already been recorded.") return False self.events.append((t, name, val))
def debug(string, level=2): if level < 2: print ("HANDLER (%s): "%get_time())+string
def recordUniqueEvent(self, name, val=None): t = get_time() if self.hasEvent(name): debug("Tried to add an event which has already been recorded.") return False self.events.append( (t, name, val) )