diff options
author | Timotej Lazar <timotej.lazar@araneo.org> | 2015-09-10 22:29:24 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@araneo.org> | 2015-09-10 22:29:24 +0200 |
commit | 1b64321fda0bbf1f5a678671c1344eb2b87b5c74 (patch) | |
tree | 918743053a5b0b9a1ab45d6228c21e18af1132dc /prolog/problems/family_relations/mother_2 | |
parent | ee50df2225a974857e74d5ecb7c5f503e1c6b18a (diff) |
Use Hint classes for hints from the last commit
Also move the language-specific hint method for Prolog to prolog.common.
Diffstat (limited to 'prolog/problems/family_relations/mother_2')
-rw-r--r-- | prolog/problems/family_relations/mother_2/common.py | 20 | ||||
-rw-r--r-- | prolog/problems/family_relations/mother_2/sl.py | 12 |
2 files changed, 18 insertions, 14 deletions
diff --git a/prolog/problems/family_relations/mother_2/common.py b/prolog/problems/family_relations/mother_2/common.py index 613b721..09a641a 100644 --- a/prolog/problems/family_relations/mother_2/common.py +++ b/prolog/problems/family_relations/mother_2/common.py @@ -1,5 +1,11 @@ # coding=utf-8 +import socket +import prolog.engine +import prolog.util +from server.hints import Hint, HintSequence +import server.problems + id = 94 group = 'family_relations' number = 1 @@ -12,9 +18,14 @@ mother(X, Y) :- female(X). ''' -import prolog.engine -import prolog.util -import server.problems +hint_defs = { + 'general_hint': HintSequence('general_hint', 3), + 'or_instead_of_and': Hint('or_instead_of_and'), + 'x_must_be_female': Hint('x_must_be_female'), + 'x_must_be_parent': Hint('x_must_be_parent'), + 'y_can_be_of_any_gender': Hint('y_can_be_of_any_gender'), + 'y_need_not_be_parent': Hint('y_need_not_be_parent'), +} def test(session, program): # TODO: change queries and answers (these are for sister/2) @@ -46,9 +57,6 @@ def test(session, program): return n_correct, len(queries) -def general_hint(): - pass - def hint(session, program): tokens = prolog.util.tokenize(program) diff --git a/prolog/problems/family_relations/mother_2/sl.py b/prolog/problems/family_relations/mother_2/sl.py index 8923eb5..5922d6c 100644 --- a/prolog/problems/family_relations/mother_2/sl.py +++ b/prolog/problems/family_relations/mother_2/sl.py @@ -15,19 +15,15 @@ description = '''\ </pre>''' hint = { - 'general_hint_1': '''\ + 'general_hint': ['''\ <p><img src="Mother-1.png" /></p> <p>Loni naj zbriše imena relacij (parent, mother) s te slike!</p> -''', - - 'general_hint_2': '''\ +''', '''\ <p><img src="Mother-1.png" /></p> -''', - - 'general_hint_3': '''\ +''', '''\ <p>Če je <code>X</code> ženska in je hkrati <code>X</code> starš od <code>Y</code>, potem je <code>X</code> mama od <code>Y</code>.</p> -''', +'''], 'or_instead_of_and': '''\ <p>Si morda uporabil podpičje (ki pomeni ALI) namesto vejice (ki pomeni IN)?</p> |