From 47b94aeba09083cb94d996c6758fa0d5ab64ecf3 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Sat, 12 Mar 2016 10:05:55 +0100 Subject: prolog_session: check for generic hints after specific --- server/prolog_session.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server') diff --git a/server/prolog_session.py b/server/prolog_session.py index e07a63c..3491a1c 100644 --- a/server/prolog_session.py +++ b/server/prolog_session.py @@ -137,8 +137,8 @@ class PrologSession(server.LanguageSession): session.update_solution(problem_id, done=True) else: hints = [] - if not hints and hasattr(language_module, 'hint'): - hints = language_module.hint(program, aux_code=aux_code) + if not hints and hasattr(language_module, 'check_syntax'): + hints = language_module.check_syntax(program, aux_code=aux_code) # experiment: Prolog hints #if not hints and hasattr(problem_module, 'hint'): @@ -158,6 +158,10 @@ class PrologSession(server.LanguageSession): program, _edits[problem_id], tester, timeout=3) if solution and steps: hints = [{'id': 'monkey_main'}] + monkey.fix_hints(program, steps) + + if not hints and hasattr(language_module, 'hint'): + hints = language_module.hint(program, aux_code=aux_code) + if hints: msgs.extend(hints) -- cgit v1.2.1