diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-12 13:14:49 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-01-12 13:14:49 +0100 |
commit | e36a8a2feca7552d236c0f6e89ac73e7e690e7b1 (patch) | |
tree | 646bc6c943461d872bd0226e70ffe4e1567e44cc /prolog/problems/family_relations | |
parent | f2eaf692038294572e0e5453595c45bc1da92cb6 (diff) |
Return number of passed/total tests from Prolog test functions
Diffstat (limited to 'prolog/problems/family_relations')
10 files changed, 10 insertions, 20 deletions
diff --git a/prolog/problems/family_relations/ancestor_2/common.py b/prolog/problems/family_relations/ancestor_2/common.py index 1a79f80..1ad1d4f 100644 --- a/prolog/problems/family_relations/ancestor_2/common.py +++ b/prolog/problems/family_relations/ancestor_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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/aunt_2/common.py b/prolog/problems/family_relations/aunt_2/common.py index 058f6f7..6ad8b05 100644 --- a/prolog/problems/family_relations/aunt_2/common.py +++ b/prolog/problems/family_relations/aunt_2/common.py @@ -58,9 +58,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/brother_2/common.py b/prolog/problems/family_relations/brother_2/common.py index 876e3bc..c8ceb75 100644 --- a/prolog/problems/family_relations/brother_2/common.py +++ b/prolog/problems/family_relations/brother_2/common.py @@ -52,9 +52,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/connected_3/common.py b/prolog/problems/family_relations/connected_3/common.py index 31d0d12..eee1df5 100644 --- a/prolog/problems/family_relations/connected_3/common.py +++ b/prolog/problems/family_relations/connected_3/common.py @@ -43,6 +43,5 @@ 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 diff --git a/prolog/problems/family_relations/cousin_2/common.py b/prolog/problems/family_relations/cousin_2/common.py index eb75ca4..e53ef99 100644 --- a/prolog/problems/family_relations/cousin_2/common.py +++ b/prolog/problems/family_relations/cousin_2/common.py @@ -65,9 +65,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/descendant_2/common.py b/prolog/problems/family_relations/descendant_2/common.py index 3c2af16..eae7c42 100644 --- a/prolog/problems/family_relations/descendant_2/common.py +++ b/prolog/problems/family_relations/descendant_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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/father_2/common.py b/prolog/problems/family_relations/father_2/common.py index 40a0f1a..363eaa2 100644 --- a/prolog/problems/family_relations/father_2/common.py +++ b/prolog/problems/family_relations/father_2/common.py @@ -55,9 +55,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/grandparent_2/common.py b/prolog/problems/family_relations/grandparent_2/common.py index eaae7a5..3d187d9 100644 --- a/prolog/problems/family_relations/grandparent_2/common.py +++ b/prolog/problems/family_relations/grandparent_2/common.py @@ -56,9 +56,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/mother_2/common.py b/prolog/problems/family_relations/mother_2/common.py index 95fd36a..cb8ddee 100644 --- a/prolog/problems/family_relations/mother_2/common.py +++ b/prolog/problems/family_relations/mother_2/common.py @@ -56,9 +56,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): tokens = prolog.util.tokenize(code) diff --git a/prolog/problems/family_relations/sister_2/common.py b/prolog/problems/family_relations/sister_2/common.py index a6dff43..0466a3d 100644 --- a/prolog/problems/family_relations/sister_2/common.py +++ b/prolog/problems/family_relations/sister_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): # how do I know which general hints were already shown? |