View | Details | Raw Unified | Return to bug 46870 | Differences between
and this patch

Collapse All | Expand All

(-)a/ucs-school-umc-exam/umc/python/schoolexam/__init__.py (-1 / +11 lines)
 Lines 68-73   class Instance(SchoolBaseModule): Link Here 
68
		SchoolBaseModule.__init__(self)
68
		SchoolBaseModule.__init__(self)
69
		self._tmpDir = None
69
		self._tmpDir = None
70
		self._progress_state = util.Progress()
70
		self._progress_state = util.Progress()
71
		self._last_progress_state = None
71
		self._lessons = SchoolLessons()
72
		self._lessons = SchoolLessons()
72
73
73
	def init(self):
74
	def init(self):
 Lines 148-154   class Instance(SchoolBaseModule): Link Here 
148
149
149
	@simple_response
150
	@simple_response
150
	def progress(self):
151
	def progress(self):
151
		return self._progress_state.poll()
152
		progress_state = self._progress_state.poll()
153
		timeout = 5
154
		seconds_elapsed = 0
155
		while progress_state == self._last_progress_state or timeout > seconds_elapsed:
156
			progress_state = self._progress_state.poll()
157
			time.sleep(1)
158
			seconds_elapsed += 1
159
		if progress_state['finished']:
160
			self._progress_state.reset()
161
		return progress_state
152
162
153
	@sanitize(
163
	@sanitize(
154
		name=StringSanitizer(required=True),
164
		name=StringSanitizer(required=True),

Return to bug 46870