From e36a8a2feca7552d236c0f6e89ac73e7e690e7b1 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Tue, 12 Jan 2016 13:14:49 +0100 Subject: Return number of passed/total tests from Prolog test functions --- prolog/problems/sorting/is_sorted_1/common.py | 3 +-- prolog/problems/sorting/isort_2/common.py | 3 +-- prolog/problems/sorting/pivoting_4/common.py | 3 +-- prolog/problems/sorting/quick_sort_2/common.py | 3 +-- prolog/problems/sorting/sins_3/common.py | 3 +-- prolog/problems/sorting/slowest_sort_ever_2/common.py | 3 +-- 6 files changed, 6 insertions(+), 12 deletions(-) (limited to 'prolog/problems/sorting') 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 -- cgit v1.2.1