diff options
Diffstat (limited to 'prolog/problems/family_relations/sister_2')
-rw-r--r-- | prolog/problems/family_relations/sister_2/common.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py index 90039e3..a6dff43 100644 --- a/prolog/problems/family_relations/sister_2/common.py +++ b/prolog/problems/family_relations/sister_2/common.py @@ -57,7 +57,7 @@ def test(code, aux_code): hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}] return passed, hints -def hint(program, solved_problems): +def hint(code, aux_code): # how do I know which general hints were already shown? # how do I know enough time has elapsed for general hints to be shown? # how do I know whether the hint button was pressed? @@ -83,14 +83,10 @@ def hint(program, solved_problems): # tokenize (and similar) only if *needed* for a given exercise # to reduce server processor load - tokens = prolog.util.tokenize(program) - - code = (program + '\n' + - server.problems.solutions_for_problems('prolog', solved_problems) + '\n' + - server.problems.load_facts('prolog', facts).facts) + tokens = prolog.util.tokenize(code) try: - engine_id, output = prolog.engine.create(code=code, timeout=1.0) + engine_id, output = prolog.engine.create(code=code+aux_code, timeout=1.0) # X must be female if prolog.engine.ask_truth(engine_id, 'male(X), sister(X, _)'): |