summaryrefslogtreecommitdiff
path: root/python/problems/while_and_if/consumers_anonymous
diff options
context:
space:
mode:
Diffstat (limited to 'python/problems/while_and_if/consumers_anonymous')
-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
3 files changed, 49 insertions, 9 deletions
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]