summaryrefslogtreecommitdiff
path: root/python/problems/introduction/fahrenheit_to_celsius
diff options
context:
space:
mode:
Diffstat (limited to 'python/problems/introduction/fahrenheit_to_celsius')
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/common.py5
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/sl.py7
2 files changed, 1 insertions, 11 deletions
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).
</pre>
<p> Python ne zna izpuščati znaka za množenje, kot to delamo pri matematiki.</p> '''],
- 'syntax_error' : [general_exception['error_head'], general_exception['general'],
- general_exception['type_error'], '''
-<p> Ste mogoče pozabili na kakšen zaklepaj? </p>'''],
-
- 'indentation_error' : [general_exception['error_head'], general_exception['general'],
- general_exception['indentation_error']],
-
}