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/father_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/father_2')
-rw-r--r-- | prolog/problems/family_relations/father_2/common.py | 21 | ||||
-rw-r--r-- | prolog/problems/family_relations/father_2/en.py | 2 | ||||
-rw-r--r-- | prolog/problems/family_relations/father_2/sl.py | 21 |
3 files changed, 26 insertions, 18 deletions
diff --git a/prolog/problems/family_relations/father_2/common.py b/prolog/problems/family_relations/father_2/common.py index e1b46fd..81191d3 100644 --- a/prolog/problems/family_relations/father_2/common.py +++ b/prolog/problems/family_relations/father_2/common.py @@ -1,8 +1,14 @@ # coding=utf-8 -id = 999 # TODO: new id has to be defined for this problem +import socket +import prolog.engine +import prolog.util +from server.hints import Hint, HintSequence +import server.problems + +id = 181 group = 'family_relations' -number = 999 # TODO: this should be problem #2 +number = 2 visible = True facts = 'family_relations' @@ -12,9 +18,14 @@ father(X, Y) :- male(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_male': Hint('x_must_be_male'), + '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) diff --git a/prolog/problems/family_relations/father_2/en.py b/prolog/problems/family_relations/father_2/en.py index 108bb9b..59857a8 100644 --- a/prolog/problems/family_relations/father_2/en.py +++ b/prolog/problems/family_relations/father_2/en.py @@ -1,6 +1,6 @@ # coding=utf-8 -id = 94 +id = 181 name = 'mother/2' slug = 'the mother-child relation' diff --git a/prolog/problems/family_relations/father_2/sl.py b/prolog/problems/family_relations/father_2/sl.py index c9c38b7..8fb66c5 100644 --- a/prolog/problems/family_relations/father_2/sl.py +++ b/prolog/problems/family_relations/father_2/sl.py @@ -1,11 +1,12 @@ # coding=utf-8 -id = 94 -name = 'mother/2' -slug = 'X je mama od Y' +id = 181 +name = 'father/2' +slug = 'X je oče od Y' +# TODO fix example description = '''\ -<p><code>mother(X, Y)</code>: <code>X</code> je mama od <code>Y</code>.</p> +<p><code>father(X, Y)</code>: <code>X</code> je oče od <code>Y</code>.</p> <pre> ?- mother(tina, william). true. @@ -15,19 +16,15 @@ description = '''\ </pre>''' hint = { - 'general_hint_1': '''\ + 'general_hint': ['''\ <p><img src="Father-1.png" /></p> <p>Loni naj zbriše imena relacij (parent, mother) s te slike!</p> -''', - - 'general_hint_2': '''\ +''', '''\ <p><img src="Father-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> |