summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-12 10:05:55 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-12 10:05:55 +0100
commit47b94aeba09083cb94d996c6758fa0d5ab64ecf3 (patch)
tree85c4dc9bd8a8ac27c8522c56d99057264c0142b4
parent312b57ac25e083c890c9dd01a25e9313d3068f0b (diff)
prolog_session: check for generic hints after specific
-rw-r--r--server/prolog_session.py8
1 files changed, 6 insertions, 2 deletions
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)