summaryrefslogtreecommitdiff
path: root/python/problems/introduction/fahrenheit_to_celsius
diff options
context:
space:
mode:
authorMartin <martin@leo.fri1.uni-lj.si>2015-09-15 15:26:28 +0200
committerMartin <martin@leo.fri1.uni-lj.si>2015-09-15 15:26:28 +0200
commitdf2e7033ff1a4336d7cc404a845e3c214ee7ddfd (patch)
treed1fe6e408f0c312fbce5bdf19f9b63fef255aad4 /python/problems/introduction/fahrenheit_to_celsius
parent7234dbb956f61a3592e029d463cd130ae6461c23 (diff)
Improved hints for pythagorean theorem.
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']],
-
}