From 4e7b80974d7433f96fa1908293e5faee9d8de519 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 2 Oct 2015 16:14:24 +0200 Subject: Removed unnecessary HintSequences. --- python/problems/while_and_if/buy_five/common.py | 2 +- .../while_and_if/checking_account/common.py | 2 +- python/problems/while_and_if/competition/common.py | 9 +++- .../while_and_if/consumers_anonymous/common.py | 9 ++-- .../while_and_if/consumers_anonymous/en.py | 48 ++++++++++++++++++++-- .../while_and_if/consumers_anonymous/sl.py | 1 - python/problems/while_and_if/minimax/common.py | 2 +- python/problems/while_and_if/top_shop/common.py | 2 +- 8 files changed, 60 insertions(+), 15 deletions(-) (limited to 'python/problems/while_and_if') diff --git a/python/problems/while_and_if/buy_five/common.py b/python/problems/while_and_if/buy_five/common.py index 9f335af..ba44f5b 100644 --- a/python/problems/while_and_if/buy_five/common.py +++ b/python/problems/while_and_if/buy_five/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 185 group = 'while_and_if' diff --git a/python/problems/while_and_if/checking_account/common.py b/python/problems/while_and_if/checking_account/common.py index 610bbfc..ee1e3ee 100644 --- a/python/problems/while_and_if/checking_account/common.py +++ b/python/problems/while_and_if/checking_account/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 200 group = 'while_and_if' diff --git a/python/problems/while_and_if/competition/common.py b/python/problems/while_and_if/competition/common.py index a7471df..fff96ed 100644 --- a/python/problems/while_and_if/competition/common.py +++ b/python/problems/while_and_if/competition/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 192 group = 'while_and_if' @@ -19,9 +19,14 @@ print('Vsota:', vsota) ''' hint_type = { - 'plan': HintSequence('plan', 1), + 'read_before_while': Hint('read_before_while'), + 'while_clause': Hint('while_clause'), + 'printing': Hint('printing'), + 'summation': Hint('summation'), + 'nonumber': Hint('nonumber'), } + def test(python, code): # List of inputs: (expression to eval, stdin). test_in = [ diff --git a/python/problems/while_and_if/consumers_anonymous/common.py b/python/problems/while_and_if/consumers_anonymous/common.py index d1428d8..ff3f928 100644 --- a/python/problems/while_and_if/consumers_anonymous/common.py +++ b/python/problems/while_and_if/consumers_anonymous/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 201 group = 'while_and_if' @@ -30,8 +30,9 @@ hint_type = { 'nonumber': Hint('nonumber'), 'while_condition': Hint('while_condition'), 'final_hint': Hint('final_hint'), - 'summation': Hint('final_hint'), - 'counting': Hint('final_hint'), + 'summation': Hint('summation'), + 'counting': Hint('counting'), + 'problematic_test_case': Hint('problematic_test_case'), } def test(python, code): @@ -69,7 +70,7 @@ def test(python, code): tout = correct passed = n_correct == len(test_in) - hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_in)}}] + hints = [{'id': 'test_results', 'args': {'passed': str(n_correct), 'total': str(len(test_in))}}] if tin: hints.append({'id': 'problematic_test_case', 'args': {'testin': str(tin), 'sum': str(tout[0]), diff --git a/python/problems/while_and_if/consumers_anonymous/en.py b/python/problems/while_and_if/consumers_anonymous/en.py index 94ea662..6331570 100644 --- a/python/problems/while_and_if/consumers_anonymous/en.py +++ b/python/problems/while_and_if/consumers_anonymous/en.py @@ -1,4 +1,6 @@ # coding=utf-8 +import server +mod = server.problems.load_language('python', 'sl') id = 201 name = 'Consumers Anonymous' @@ -7,10 +9,48 @@ slug = 'Consumers Anonymous' description = '''\

(translation missing)

''' + +main_plan = ['''\ +'''] + +while_condition = ['''\ +'''] + +while_clause = ['''\ +''' +] + +plan = [main_plan, + while_condition] + hint = { - 'plan': '''\ -

(translation missing)

''', + 'while_clause': while_clause, + + 'while_condition': while_condition, + + 'printing': ['''\ +'''], - 'no_input_call': '''\ -

(translation missing)

''', + 'nonumber': ['''

'''], + + 'summation': ['''

'''], + + 'counting': ['''

'''], + + 'name_error' : [mod.general_msg['error_head'], + mod.general_msg['general_exception'], + mod.general_msg['name_error'], + '''\ +'''], + + 'problematic_test_case': ['''\ +'''], + + 'final_hint': ['''\ +'''], + + 'eof_error':[mod.general_msg['eof_error'], + '''\ +'''] } + diff --git a/python/problems/while_and_if/consumers_anonymous/sl.py b/python/problems/while_and_if/consumers_anonymous/sl.py index 4b1348b..ee2700c 100644 --- a/python/problems/while_and_if/consumers_anonymous/sl.py +++ b/python/problems/while_and_if/consumers_anonymous/sl.py @@ -63,7 +63,6 @@ cena != 0 and vsota < 100 and artiklov < 10 '''] - plan = [main_plan, while_condition] diff --git a/python/problems/while_and_if/minimax/common.py b/python/problems/while_and_if/minimax/common.py index 6155024..71632b7 100644 --- a/python/problems/while_and_if/minimax/common.py +++ b/python/problems/while_and_if/minimax/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 199 group = 'while_and_if' diff --git a/python/problems/while_and_if/top_shop/common.py b/python/problems/while_and_if/top_shop/common.py index db98212..115dc9e 100644 --- a/python/problems/while_and_if/top_shop/common.py +++ b/python/problems/while_and_if/top_shop/common.py @@ -2,7 +2,7 @@ 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, HintSequence +from server.hints import Hint id = 198 group = 'while_and_if' -- cgit v1.2.1