diff options
Diffstat (limited to 'python/problems/introduction/fast_fingers_2')
-rw-r--r-- | python/problems/introduction/fast_fingers_2/common.py | 11 | ||||
-rw-r--r-- | python/problems/introduction/fast_fingers_2/sl.py | 18 |
2 files changed, 3 insertions, 26 deletions
diff --git a/python/problems/introduction/fast_fingers_2/common.py b/python/problems/introduction/fast_fingers_2/common.py index 958940d..386e251 100644 --- a/python/problems/introduction/fast_fingers_2/common.py +++ b/python/problems/introduction/fast_fingers_2/common.py @@ -31,9 +31,6 @@ random.randint = lambda x, y: {} hint_type = { 'random': Hint('random'), - 'name_error': Hint('name_error'), - 'type_error': Hint('type_error'), - 'error': Hint('error'), 'if_clause': Hint('if_clause'), 'final_hint': Hint('final_hint') } @@ -91,13 +88,7 @@ def hint(python, code): exc = answer[0][3] exc_hint = get_exception_desc(answer[0][3]) # if have an exception! - if exc: - if 'NameError' in exc: - return [{'id':'name_error', 'args': {'message': exc}}] - elif 'TypeError' in exc: - return [{'id':'type_error', 'args': {'message': exc}}] - else: - return exc_hint + return exc_hint # First: if student does not import random, tell him about that module if not has_token_sequence(tokens, ['random']) or \ diff --git a/python/problems/introduction/fast_fingers_2/sl.py b/python/problems/introduction/fast_fingers_2/sl.py index 8e7dd47..6472442 100644 --- a/python/problems/introduction/fast_fingers_2/sl.py +++ b/python/problems/introduction/fast_fingers_2/sl.py @@ -65,26 +65,12 @@ hint = { 'if_clause': if_clause, - 'final_hint': '''\ + 'final_hint': ['''\ <p><b>Odlično!</b> Za konec pa še zanimivost. Pri tej nalogi stavka <code>if</code> niti ne potrebujemo, saj bi lahko napisali le:</p> <pre> print(a*b == c) </pre> -<p>kar bi izpisalo rezultat tega izraza. Poskusi!</p>''', +<p>kar bi izpisalo rezultat tega izraza. Poskusi!</p>'''] - 'name_error' : [mod.general_msg['error_head'], mod.general_msg['general_exception'], - mod.general_msg['name_error'], ''' -<p>Verjetno uporabljate spremenljivko, ki nima vrednosti. Ali v izrazu za izračun - uporabljate napačno spremenljivko? Ali pri izpisu morda poskušate - izpisati napačno spremenljivko?</p>'''], - - 'type_error' : [mod.general_msg['error_head'], mod.general_msg['general_exception'], - mod.general_msg['type_error'], ''' -<p>Verjetni razlog: funkcija <code>input</code> vrača vrednost tipa niz, -ki jo moramo najprej pretvoriti v tip <code>float</code>, če želimo z njo računati:</p> -<pre> -v = float(input(" ... -</pre> -'''], } |