comparison src/plugins/plugin_misc_quiz.py @ 660:69a8bfd266a5

core, plugins: fixed bad use of children instead of elements() for domish.Element instances.
author Goffi <goffi@goffi.org>
date Tue, 15 Oct 2013 19:28:34 +0200
parents 0b914394e74f
children 2805fa3f4bdf
comparison
equal deleted inserted replaced
659:b6c22d9f593a 660:69a8bfd266a5
144 def __answer_result_to_signal_args(self, answer_result_elt): 144 def __answer_result_to_signal_args(self, answer_result_elt):
145 """Parse answer result element and return a tuple of signal arguments 145 """Parse answer result element and return a tuple of signal arguments
146 @param answer_result_elt: answer result element 146 @param answer_result_elt: answer result element
147 @return: (player, good_answer, score)""" 147 @return: (player, good_answer, score)"""
148 score = {} 148 score = {}
149 for score_elt in answer_result_elt.children: 149 for score_elt in answer_result_elt.elements():
150 score[score_elt['player']] = int(score_elt['score']) 150 score[score_elt['player']] = int(score_elt['score'])
151 return (answer_result_elt['player'], answer_result_elt['good_answer'] == str(True), score) 151 return (answer_result_elt['player'], answer_result_elt['good_answer'] == str(True), score)
152 152
153 def __answer_result(self, player_answering, good_answer, game_data): 153 def __answer_result(self, player_answering, good_answer, game_data):
154 """Convert a domish an answer_result element 154 """Convert a domish an answer_result element