summaryrefslogtreecommitdiff
path: root/python/problems/while_and_if
diff options
context:
space:
mode:
authorMartin <martin@leo.fri1.uni-lj.si>2015-10-02 16:14:24 +0200
committerMartin <martin@leo.fri1.uni-lj.si>2015-10-02 16:14:24 +0200
commit4e7b80974d7433f96fa1908293e5faee9d8de519 (patch)
tree9137c6a2fb801a7f0527530f0909976e39728ef6 /python/problems/while_and_if
parentdf229fbab5f8cf2b310bc44e1501f03149fceb65 (diff)
Removed unnecessary HintSequences.
Diffstat (limited to 'python/problems/while_and_if')
-rw-r--r--python/problems/while_and_if/buy_five/common.py2
-rw-r--r--python/problems/while_and_if/checking_account/common.py2
-rw-r--r--python/problems/while_and_if/competition/common.py9
-rw-r--r--python/problems/while_and_if/consumers_anonymous/common.py9
-rw-r--r--python/problems/while_and_if/consumers_anonymous/en.py48
-rw-r--r--python/problems/while_and_if/consumers_anonymous/sl.py1
-rw-r--r--python/problems/while_and_if/minimax/common.py2
-rw-r--r--python/problems/while_and_if/top_shop/common.py2
8 files changed, 60 insertions, 15 deletions
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 = '''\
<p>(translation missing)</p>'''
+
+main_plan = ['''\
+''']
+
+while_condition = ['''\
+''']
+
+while_clause = ['''\
+'''
+]
+
+plan = [main_plan,
+ while_condition]
+
hint = {
- 'plan': '''\
-<p>(translation missing)</p>''',
+ 'while_clause': while_clause,
+
+ 'while_condition': while_condition,
+
+ 'printing': ['''\
+'''],
- 'no_input_call': '''\
-<p>(translation missing)</p>''',
+ 'nonumber': ['''<p><p>'''],
+
+ 'summation': ['''<p><p>'''],
+
+ 'counting': ['''<p><p>'''],
+
+ '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
</pre>
''']
-
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'