From 816ffe9a13c4aa7e1d0d4ec95355e1dcd6e24faa Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 15 Sep 2015 14:37:35 +0200 Subject: Update hints for python/fahrenheit_to_celsius --- .../introduction/fahrenheit_to_celsius/common.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'python/problems/introduction/fahrenheit_to_celsius/common.py') diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py index 076d322..8362260 100644 --- a/python/problems/introduction/fahrenheit_to_celsius/common.py +++ b/python/problems/introduction/fahrenheit_to_celsius/common.py @@ -17,6 +17,13 @@ print("Temperatura je", c, "C") hint_type = { 'plan': Hint('plan'), 'no_input_call': Hint('no_input_call'), + 'expressions_python': Hint('expressions_python'), + 'printing': Hint('printing'), + 'name_error': HintSequence('name_error', 4), + 'unsupported_operand': HintSequence('unsupported_operand', 4), + 'not_callable': HintSequence('not_callable', 4), + 'syntax_error': HintSequence('syntax_error', 4), + 'indentation_error': HintSequence('indentation_error', 3), } def test(python, code): @@ -55,15 +62,15 @@ def hint(python, code): # have an exception! if exc: if 'NameError' in exc: - return [{'id':'name_error'}] + return [{'id':'name_error', 'args': {'message': exc}}] if 'not callable' in exc: - return [{'id':'not_callable'}] + return [{'id':'not_callable', 'args': {'message': exc}}] if 'unsupported operand' in exc: - return [{'id':'unsupported_operand'}] + return [{'id':'unsupported_operand', 'args': {'message': exc}}] if 'SyntaxError' in exc: - return [{'id':'syntax_error'}] + return [{'id':'syntax_error', 'args': {'message': exc}}] if 'IndentationError' in exc: - return [{'id':'indentation_error'}] + return [{'id':'indentation_error', 'args': {'message': exc}}] # the trick is to decide when to show the plan and when the first hint. -- cgit v1.2.1