From df2e7033ff1a4336d7cc404a845e3c214ee7ddfd Mon Sep 17 00:00:00 2001 From: Martin Date: Tue, 15 Sep 2015 15:26:28 +0200 Subject: Improved hints for pythagorean theorem. --- python/problems/introduction/fahrenheit_to_celsius/common.py | 5 +---- python/problems/introduction/fahrenheit_to_celsius/sl.py | 7 ------- 2 files changed, 1 insertion(+), 11 deletions(-) (limited to 'python/problems/introduction/fahrenheit_to_celsius') diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py index 79cdff3..0bb6468 100644 --- a/python/problems/introduction/fahrenheit_to_celsius/common.py +++ b/python/problems/introduction/fahrenheit_to_celsius/common.py @@ -22,7 +22,6 @@ hint_type = { 'name_error': HintSequence('name_error', 4), 'unsupported_operand': HintSequence('unsupported_operand', 4), 'not_callable': HintSequence('not_callable', 4), - 'indentation_error': HintSequence('indentation_error', 3), } def test(python, code): @@ -66,14 +65,12 @@ def hint(python, code): return [{'id':'unsupported_operand', 'args': {'message': exc}}] elif 'TypeError' in exc: return [{'id':'unsupported_operand', 'args': {'message': exc}}] - elif 'IndentationError' in exc: - return [{'id':'indentation_error', 'args': {'message': exc}}] # the trick is to decide when to show the plan and when the first hint. # I implemented a simple idea: show plan, when code contains something from the # solution, but not input. - if not code or (not has_token_sequence(code, ['input']) and + if len(code.strip()) < 5 or (not has_token_sequence(code, ['input']) and (has_token_sequence(code, ['32']) or has_token_sequence(code, ['=', '5']) or has_token_sequence(code, ['print']))): diff --git a/python/problems/introduction/fahrenheit_to_celsius/sl.py b/python/problems/introduction/fahrenheit_to_celsius/sl.py index 41aab7a..1c73cce 100644 --- a/python/problems/introduction/fahrenheit_to_celsius/sl.py +++ b/python/problems/introduction/fahrenheit_to_celsius/sl.py @@ -128,11 +128,4 @@ C = 5/9 * (F – 32).

Python ne zna izpuščati znaka za množenje, kot to delamo pri matematiki.

'''], - 'syntax_error' : [general_exception['error_head'], general_exception['general'], - general_exception['type_error'], ''' -

Ste mogoče pozabili na kakšen zaklepaj?

'''], - - 'indentation_error' : [general_exception['error_head'], general_exception['general'], - general_exception['indentation_error']], - } -- cgit v1.2.1