def _judgeLogout(self, judge): """Called when the judge logouts""" name = judge.userid log.info('SM: judge %s logouts - re-assigning submissions' % name) queue = self._judge_queue[name] del self._judge_queue[name] for submission in queue: # resubmit self._submit(submission)
def stopContest(self): """stop the contest""" if self.isrunning() is False: return self._duration = None self._ts_start = None # Tell avatars for avatarId, avatar in self.liveavatars.items(): avatar.contestStopped() log.info('Contest stopped')
def startContest(self, duration): """Start accepting submissions @param duration: Duration (in seconds) before stopping the contest""" if self.isrunning(): return self._duration = duration self._ts_start = int(time.time()) reactor.callLater(duration, self.stopContest) for avatarId, avatar in self.liveavatars.items(): avatar.contestStarted() log.info('Contest started with duration=%d seconds' % duration)
def _judgeLogin(self, judge): """Called when the judge logins""" log.info('SM: judge %s logins' % judge.userid) self._judge_queue[judge.userid] = []