Skip to content

Commit 67e51ef

Browse files
author
Feliciano Long
committed
advance version code and add chatkey to output
1 parent 8f49379 commit 67e51ef

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from dns_cache import _set_dns_cache
1919

20-
GRADER_VERSION = '1.3.'
20+
GRADER_VERSION = '1.3.3'
2121

2222
if __name__ == '__main__':
2323
report_logger.info("QiwuGrader ver {0}".format(GRADER_VERSION))

controller/private_msg_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def handle_chat(self, from_name, msg, login_wait=None):
102102
# Pre process and check if we really need to handle this message
103103
if self.pre_chat(from_name, msg):
104104
# Process the message and give a response
105-
result = self.process_chat(from_name, msg, login_wait=None)
105+
result = self.process_chat(from_name, msg, login_wait=login_wait)
106106

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

grader.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ def test_robot(self, name, questions, answers):
7373
else:
7474
question_str = question
7575
response = test_service.handle_chat(uid, question_str, login_wait=self.question_interval)
76+
chat_key = None
77+
if hasattr(test_service, 'tokens'):
78+
chat_key = test_service.tokens[uid]
7679
process_time = time.time() - process_time
7780

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

122125
response = to_str(response)
123-
test_logger.info("Response :" + response)
126+
if chat_key:
127+
test_logger.info("Response: {0}, chatkey: {1}".format(response, chat_key))
128+
else:
129+
test_logger.info("Response :" + response)
124130

125131
if self.print_correct_answer or not correct:
126132
answer_str = to_str(answer_str)

0 commit comments

Comments
 (0)