summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-08-26 13:45:10 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-08-26 13:45:10 +0200
commitbba9b22af18da1ec25b71c05399636ef9f325399 (patch)
tree0cb85e69b71894f66d2c182b551c9e0dfe57d52f
parent079dd21edc4490bc6bb3f6c6c752a12b2581a9e1 (diff)
Do not include facts when loading Prolog solutions
Fact library is not a part of the solution, and is loaded separately when running queries or tests for a particular problem.
-rw-r--r--server/problems.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/server/problems.py b/server/problems.py
index bce72fe..f54237d 100644
--- a/server/problems.py
+++ b/server/problems.py
@@ -68,19 +68,13 @@ def solutions_for_problems(language, tuples):
if not tuples:
return ''
modules = load_problems(language, tuples, 'common')
- solutions = set()
- facts = set()
+ solutions = []
for module in modules:
try:
- solution = module.solution
+ solutions.append(module.solution)
except AttributeError as me:
pass
- else:
- solutions.add(solution)
- f = get_facts(language, module)
- if f:
- facts.add(f)
- return '\n'.join(facts) + '\n' + '\n'.join(solutions)
+ return '\n'.join(solutions)
def list_problems_in_groups(language):
conn = get_connection()