summaryrefslogtreecommitdiff
path: root/python/problems/introduction/fahrenheit_to_celsius/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/problems/introduction/fahrenheit_to_celsius/common.py')
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/common.py17
1 files changed, 12 insertions, 5 deletions
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.