Exemplo n.º 1
0
Arquivo: rpc.py Projeto: jamslevy/PQ
  def start_quiz(self, *args):
	quiz_session = QuizSession()
	token = quiz_session.initiate()
	profNames = args[0] # only one right now
	response = quiz_session.load_quiz_items(profNames, token)
	if not response: return False
	else: return {'token': token, 'quiz_item': quiz_session.next_quiz_item(token)}
Exemplo n.º 2
0
Arquivo: rpc.py Projeto: jamslevy/PQ
  def continue_quiz(self, *args):
		quiz_session = QuizSession()
		picked_answer = str(args[0])
		try: float(args[1])
		except: return logging.warning('Unable to convert timer status %s to float' % str(args[1]))
		timer_status = args[1]
		token = args[2]
		vendor = args[3]
		quiz_session.add_score(picked_answer, timer_status, token, vendor)
		# add score with args
		return {'quiz_item': quiz_session.next_quiz_item(token)}