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/en.py1
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/sl.py3
3 files changed, 5 insertions, 4 deletions
diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py
index 6549c32..10a1067 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/common.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/common.py
@@ -3,9 +3,9 @@
from python.util import has_token_sequence, string_almost_equal, \
string_contains_number, get_tokens, get_numbers, get_exception_desc
from server.hints import Hint
+import re
id = 180
-group = 'introduction'
number = 1
visible = True
@@ -87,6 +87,9 @@ def hint(python, code):
if not has_token_sequence(tokens, ['input']):
return [{'id': 'no_input_call'}]
+ if not re.findall(r'=[^\n]*?input', code):
+ return [{'id': 'no_input_call'}]
+
# if tokens * or / or = are not in code, we have to teach them how to
# evaluate expressions.
if (not has_token_sequence(tokens, ['/']) or
diff --git a/python/problems/introduction/fahrenheit_to_celsius/en.py b/python/problems/introduction/fahrenheit_to_celsius/en.py
index a2af212..5d7522e 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/en.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/en.py
@@ -1,6 +1,5 @@
# coding=utf-8
-id = 180
name = 'Converting Fahrenheit to Celsius'
slug = 'Converting Fahrenheit to Celsius'
diff --git a/python/problems/introduction/fahrenheit_to_celsius/sl.py b/python/problems/introduction/fahrenheit_to_celsius/sl.py
index b61c436..f5ce4a4 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/sl.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/sl.py
@@ -2,7 +2,6 @@
import server
mod = server.problems.load_language('python', 'sl')
-id = 180
name = 'Pretvarjanje iz Fahrenheitov v Celzije'
slug = 'Pretvarjanje iz Fahrenheitov v Celzije'
@@ -12,7 +11,7 @@ stopinjah, program pa jo izpiše v Celzijevih. Med temperaturama pretvarjamo po
formuli C = 5/9 (F – 32).</p>'''
no_input_call = ['''\
-<p>Uporabnika nekaj vprašamo s funkcijo <code>input</code>.</p>''',
+<p>Uporabi funkcijo <code>input</code> in shrani rezultat.</p>''',
'''\
<p>Funkcija <code>input</code> sprejme niz (<em>angl.</em> string), ki se
prikaže uporabniku kot vprašanje in vrača, kar je uporabnik napisal. </p>''',