summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/problems/introduction/ballistics/common.py4
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/common.py3
-rw-r--r--python/problems/introduction/fahrenheit_to_celsius/sl.py10
-rw-r--r--python/problems/introduction/pythagorean_theorem/en.py2
-rw-r--r--python/sl.py4
5 files changed, 16 insertions, 7 deletions
diff --git a/python/problems/introduction/ballistics/common.py b/python/problems/introduction/ballistics/common.py
index eaf230d..8773dab 100644
--- a/python/problems/introduction/ballistics/common.py
+++ b/python/problems/introduction/ballistics/common.py
@@ -66,7 +66,7 @@ def test(python, code):
'10.05',
'3.49',
'3.49',
- '13.94',
+ '13.96',
'0'
]
@@ -78,7 +78,7 @@ def test(python, code):
tin = None
for i, (output, correct) in enumerate(zip(outputs, test_out)):
print (output, float(correct))
- if string_almost_equal(output, float(correct)):
+ if string_almost_equal(output, float(correct), prec=2):
n_correct += 1
else:
tin = test_in[i][1].replace('\n', ' ')
diff --git a/python/problems/introduction/fahrenheit_to_celsius/common.py b/python/problems/introduction/fahrenheit_to_celsius/common.py
index df426d3..6549c32 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/common.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/common.py
@@ -22,6 +22,7 @@ hint_type = {
'name_error': Hint('name_error'),
'unsupported_operand': Hint('unsupported_operand'),
'not_callable': Hint('not_callable'),
+ 'final_hint': Hint('final_hint'),
}
def test(python, code):
@@ -58,6 +59,8 @@ def test(python, code):
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_in)}}]
if tin:
hints.append({'id': 'problematic_test_case', 'args': {'testin': str(tin), 'testout': str(tout)}})
+ if passed:
+ hints.append({'id': 'final_hint'})
return passed, hints
def hint(python, code):
diff --git a/python/problems/introduction/fahrenheit_to_celsius/sl.py b/python/problems/introduction/fahrenheit_to_celsius/sl.py
index f8ca977..b61c436 100644
--- a/python/problems/introduction/fahrenheit_to_celsius/sl.py
+++ b/python/problems/introduction/fahrenheit_to_celsius/sl.py
@@ -57,8 +57,8 @@ plan = ['''\
<li>Izpis temperature v Celzijih (izpiši C).</li>
</ol>''',
no_input_call,
-
-
+ expressions_python,
+ printing
]
hint = {
@@ -121,4 +121,10 @@ C = 5/9 * (F – 32).
</pre>
<p>Python ne zna izpuščati znaka za množenje, kot to delamo pri matematiki.</p>'''
],
+
+ 'final_hint' : [
+ '''\
+<p>Odlično, program deluje! <br>
+Pri tej nalogi si se naučil a) uporabljati funkcijo <code>input</code>,
+b) kako spremeniti niz v število, c) računanja v Pythonu in d) izpisati rezultat!</p>''']
}
diff --git a/python/problems/introduction/pythagorean_theorem/en.py b/python/problems/introduction/pythagorean_theorem/en.py
index 72e83aa..b3c6117 100644
--- a/python/problems/introduction/pythagorean_theorem/en.py
+++ b/python/problems/introduction/pythagorean_theorem/en.py
@@ -8,8 +8,6 @@ description = '''\
<p>(translation missing)'''
hint = {
- 'plan': '''\
-<p>(translation missing)</p>''',
'no_input_call': '''\
<p>(translation missing)</p>''',
diff --git a/python/sl.py b/python/sl.py
index 250cb88..2600480 100644
--- a/python/sl.py
+++ b/python/sl.py
@@ -47,7 +47,9 @@ hint = {
'''],
'problematic_test_case': ['''\
-<p>Primer, kjer program ne dela pravilno: [%=testin%], pravilen rezultat: [%=testout%]</p>
+<p>Program ne dela pravilno!<br>
+Poskusi vnesti: [%=testin%] <br>
+pravilen rezultat: [%=testout%]</p>
'''],
'no_func_name': ['''\