diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-04-08 15:17:41 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-04-08 15:17:41 +0200 |
commit | b35f019d0bf65ff3c096b354ef5ad19cc83faba7 (patch) | |
tree | afa4f7091dc00d450550d2487fb61f274c44a969 /server/prolog_session.py | |
parent | 8aa81e8599eb59532cafc5432b99a8fb39e303bb (diff) |
Revert "Experiment: prolog_hints"
This reverts commit 8bd1bb649e4b66ad9f07ab0f04649d4ce7cdd615.
Diffstat (limited to 'server/prolog_session.py')
-rw-r--r-- | server/prolog_session.py | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/server/prolog_session.py b/server/prolog_session.py index f6a011c..5dd848b 100644 --- a/server/prolog_session.py +++ b/server/prolog_session.py @@ -121,14 +121,6 @@ class PrologSession(server.LanguageSession): problem_module = load_problem(problem.language, problem.group, problem.identifier, 'common') aux_code = self._aux_code(session.get_uid(), problem, program) - # experiment: Prolog hints - allowed_hints = 'all' - for experiment in session.get_experiments(): - if experiment.get('id') == 'prolog_hints': - allowed_hints = experiment.get('group') - break - # end of experiment: Prolog hints - # check if the program is correct n_correct, n_all, msgs = problem_module.test(program, aux_code=aux_code) if n_correct == n_all: @@ -137,17 +129,9 @@ class PrologSession(server.LanguageSession): hints = [] 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'): - if not hints and hasattr(problem_module, 'hint') and allowed_hints in ('all', 'manual_hints'): + if not hints and hasattr(problem_module, 'hint'): hints = problem_module.hint(program, aux_code=aux_code) - # end of experiment: Prolog hints - - # experiment: Prolog hints - #if not hints and problem_id in _edits: - if not hints and problem_id in _edits and allowed_hints in ('all', 'automatic_hints'): - # end of experiment: Prolog hints + if not hints and problem_id in _edits: # Testing function for monkey. def tester(code): n_correct, n_all, _ = problem_module.test(code, aux_code=aux_code) @@ -156,10 +140,8 @@ 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) |