diff options
author | Martin <martin@leo.fri1.uni-lj.si> | 2015-10-06 17:58:54 +0200 |
---|---|---|
committer | Martin <martin@leo.fri1.uni-lj.si> | 2015-10-06 17:58:54 +0200 |
commit | 5a1b4202dfa99bb88fab6b1f23594bd2def811c6 (patch) | |
tree | dc1ed85c4ab92079acc001f477e57766ed3b7758 /python/problems/introduction | |
parent | a7ac5a3ce2c2ad4549fec5600acab90a4c823bda (diff) |
Changes some text descriptions and added a final hint to Fahrenheit.
Diffstat (limited to 'python/problems/introduction')
4 files changed, 13 insertions, 6 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>''', |