summaryrefslogtreecommitdiff
path: root/prolog/problems/sorting
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-01-12 13:14:49 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-01-12 13:14:49 +0100
commite36a8a2feca7552d236c0f6e89ac73e7e690e7b1 (patch)
tree646bc6c943461d872bd0226e70ffe4e1567e44cc /prolog/problems/sorting
parentf2eaf692038294572e0e5453595c45bc1da92cb6 (diff)
Return number of passed/total tests from Prolog test functions
Diffstat (limited to 'prolog/problems/sorting')
-rw-r--r--prolog/problems/sorting/is_sorted_1/common.py3
-rw-r--r--prolog/problems/sorting/isort_2/common.py3
-rw-r--r--prolog/problems/sorting/pivoting_4/common.py3
-rw-r--r--prolog/problems/sorting/quick_sort_2/common.py3
-rw-r--r--prolog/problems/sorting/sins_3/common.py3
-rw-r--r--prolog/problems/sorting/slowest_sort_ever_2/common.py3
6 files changed, 6 insertions, 12 deletions
diff --git a/prolog/problems/sorting/is_sorted_1/common.py b/prolog/problems/sorting/is_sorted_1/common.py
index 7f4dc54..b4ae92d 100644
--- a/prolog/problems/sorting/is_sorted_1/common.py
+++ b/prolog/problems/sorting/is_sorted_1/common.py
@@ -48,9 +48,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO
diff --git a/prolog/problems/sorting/isort_2/common.py b/prolog/problems/sorting/isort_2/common.py
index 9e77d8b..5acd971 100644
--- a/prolog/problems/sorting/isort_2/common.py
+++ b/prolog/problems/sorting/isort_2/common.py
@@ -47,9 +47,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO
diff --git a/prolog/problems/sorting/pivoting_4/common.py b/prolog/problems/sorting/pivoting_4/common.py
index 995f759..92403c3 100644
--- a/prolog/problems/sorting/pivoting_4/common.py
+++ b/prolog/problems/sorting/pivoting_4/common.py
@@ -44,9 +44,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO
diff --git a/prolog/problems/sorting/quick_sort_2/common.py b/prolog/problems/sorting/quick_sort_2/common.py
index e2ba63d..94677de 100644
--- a/prolog/problems/sorting/quick_sort_2/common.py
+++ b/prolog/problems/sorting/quick_sort_2/common.py
@@ -53,9 +53,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO
diff --git a/prolog/problems/sorting/sins_3/common.py b/prolog/problems/sorting/sins_3/common.py
index 87e8c5d..b466743 100644
--- a/prolog/problems/sorting/sins_3/common.py
+++ b/prolog/problems/sorting/sins_3/common.py
@@ -45,9 +45,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO
diff --git a/prolog/problems/sorting/slowest_sort_ever_2/common.py b/prolog/problems/sorting/slowest_sort_ever_2/common.py
index b291a26..93367bb 100644
--- a/prolog/problems/sorting/slowest_sort_ever_2/common.py
+++ b/prolog/problems/sorting/slowest_sort_ever_2/common.py
@@ -54,9 +54,8 @@ def test(code, aux_code):
if engine_id:
prolog.engine.destroy(engine_id)
- passed = n_correct == len(test_cases)
hints = [{'id': 'test_results', 'args': {'passed': n_correct, 'total': len(test_cases)}}]
- return passed, hints
+ return n_correct, len(test_cases), hints
def hint(code, aux_code):
# TODO