Skip to content

Commit

Permalink
advance version code and add chatkey to output
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliciano Long committed Jun 8, 2018
1 parent 8f49379 commit 67e51ef
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

from dns_cache import _set_dns_cache

GRADER_VERSION = '1.3.'
GRADER_VERSION = '1.3.3'

if __name__ == '__main__':
report_logger.info("QiwuGrader ver {0}".format(GRADER_VERSION))
Expand Down
2 changes: 1 addition & 1 deletion controller/private_msg_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def handle_chat(self, from_name, msg, login_wait=None):
# Pre process and check if we really need to handle this message
if self.pre_chat(from_name, msg):
# Process the message and give a response
result = self.process_chat(from_name, msg, login_wait=None)
result = self.process_chat(from_name, msg, login_wait=login_wait)

self.logging.debug('Robot Response: {0} for chatkey {1}'.format(result, from_name))

Expand Down
8 changes: 7 additions & 1 deletion grader.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def test_robot(self, name, questions, answers):
else:
question_str = question
response = test_service.handle_chat(uid, question_str, login_wait=self.question_interval)
chat_key = None
if hasattr(test_service, 'tokens'):
chat_key = test_service.tokens[uid]
process_time = time.time() - process_time

correct = True
Expand Down Expand Up @@ -120,7 +123,10 @@ def test_robot(self, name, questions, answers):
test_logger.info("Question {0}: {1}".format(i, question_str))

response = to_str(response)
test_logger.info("Response :" + response)
if chat_key:
test_logger.info("Response: {0}, chatkey: {1}".format(response, chat_key))
else:
test_logger.info("Response :" + response)

if self.print_correct_answer or not correct:
answer_str = to_str(answer_str)
Expand Down

0 comments on commit 67e51ef

Please sign in to comment.