def handle_query(challenge, solver): """Handle a general query challenge""" answers = {} for question in challenge.questions: answer = solver.answer_query(question.question) answers[question.tid] = answer submission = {'challengeId': challenge.info.cid, 'answers': answers} result = webhandler.post_standard_submission(submission) print("Mark = {}%".format(result.mark))
def handle_rpn(challenge, rpn_evaluator): """Handle an RPN challenge""" answers = {} for question in challenge.questions: answer = rpn_evaluator.evaluate_rpn(question.question) answers[question.tid] = answer submission = {'challengeId': challenge.info.cid, 'answers': answers} result = webhandler.post_standard_submission(submission) print("Mark = {}%".format(result.mark))