summaryrefslogtreecommitdiff
path: root/prolog/problems/lists
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/lists
parentf2eaf692038294572e0e5453595c45bc1da92cb6 (diff)
Return number of passed/total tests from Prolog test functions
Diffstat (limited to 'prolog/problems/lists')
-rw-r--r--prolog/problems/lists/conc_3/common.py3
-rw-r--r--prolog/problems/lists/count_3/common.py3
-rw-r--r--prolog/problems/lists/del_3/common.py3
-rw-r--r--prolog/problems/lists/divide_3/common.py3
-rw-r--r--prolog/problems/lists/dup_2/common.py3
-rw-r--r--prolog/problems/lists/evenlen_1_+_oddlen_1/common.py3
-rw-r--r--prolog/problems/lists/insert_3/common.py3
-rw-r--r--prolog/problems/lists/len_2/common.py3
-rw-r--r--prolog/problems/lists/max_2/common.py3
-rw-r--r--prolog/problems/lists/memb_2/common.py3
-rw-r--r--prolog/problems/lists/min_2/common.py3
-rw-r--r--prolog/problems/lists/palindrome_1/common.py3
-rw-r--r--prolog/problems/lists/permute_2/common.py3
-rw-r--r--prolog/problems/lists/rev_2/common.py3
-rw-r--r--prolog/problems/lists/shiftleft_2/common.py3
-rw-r--r--prolog/problems/lists/shiftright_2/common.py3
-rw-r--r--prolog/problems/lists/sublist_2/common.py3
-rw-r--r--prolog/problems/lists/sum_2/common.py3
18 files changed, 18 insertions, 36 deletions
diff --git a/prolog/problems/lists/conc_3/common.py b/prolog/problems/lists/conc_3/common.py
index 81b9915..7ee44b5 100644
--- a/prolog/problems/lists/conc_3/common.py
+++ b/prolog/problems/lists/conc_3/common.py
@@ -40,9 +40,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/lists/count_3/common.py b/prolog/problems/lists/count_3/common.py
index 2177e25..d260b05 100644
--- a/prolog/problems/lists/count_3/common.py
+++ b/prolog/problems/lists/count_3/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/lists/del_3/common.py b/prolog/problems/lists/del_3/common.py
index 0bce133..5be6599 100644
--- a/prolog/problems/lists/del_3/common.py
+++ b/prolog/problems/lists/del_3/common.py
@@ -38,9 +38,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/lists/divide_3/common.py b/prolog/problems/lists/divide_3/common.py
index 10873cc..b522254 100644
--- a/prolog/problems/lists/divide_3/common.py
+++ b/prolog/problems/lists/divide_3/common.py
@@ -43,9 +43,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/lists/dup_2/common.py b/prolog/problems/lists/dup_2/common.py
index fb97531..36e31f8 100644
--- a/prolog/problems/lists/dup_2/common.py
+++ b/prolog/problems/lists/dup_2/common.py
@@ -40,9 +40,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/lists/evenlen_1_+_oddlen_1/common.py b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
index 9f64c62..ea86b40 100644
--- a/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
+++ b/prolog/problems/lists/evenlen_1_+_oddlen_1/common.py
@@ -46,9 +46,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/lists/insert_3/common.py b/prolog/problems/lists/insert_3/common.py
index a380280..ac8437b 100644
--- a/prolog/problems/lists/insert_3/common.py
+++ b/prolog/problems/lists/insert_3/common.py
@@ -40,9 +40,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/lists/len_2/common.py b/prolog/problems/lists/len_2/common.py
index 5ef52d1..2c4fea8 100644
--- a/prolog/problems/lists/len_2/common.py
+++ b/prolog/problems/lists/len_2/common.py
@@ -39,9 +39,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/lists/max_2/common.py b/prolog/problems/lists/max_2/common.py
index e06558b..1f6969b 100644
--- a/prolog/problems/lists/max_2/common.py
+++ b/prolog/problems/lists/max_2/common.py
@@ -43,9 +43,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/lists/memb_2/common.py b/prolog/problems/lists/memb_2/common.py
index aa3ed32..fea670b 100644
--- a/prolog/problems/lists/memb_2/common.py
+++ b/prolog/problems/lists/memb_2/common.py
@@ -36,9 +36,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/lists/min_2/common.py b/prolog/problems/lists/min_2/common.py
index 6c9a72c..4ab3e65 100644
--- a/prolog/problems/lists/min_2/common.py
+++ b/prolog/problems/lists/min_2/common.py
@@ -43,9 +43,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/lists/palindrome_1/common.py b/prolog/problems/lists/palindrome_1/common.py
index c9097a7..cf1a15b 100644
--- a/prolog/problems/lists/palindrome_1/common.py
+++ b/prolog/problems/lists/palindrome_1/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/lists/permute_2/common.py b/prolog/problems/lists/permute_2/common.py
index 1102cd8..1c16bd9 100644
--- a/prolog/problems/lists/permute_2/common.py
+++ b/prolog/problems/lists/permute_2/common.py
@@ -42,9 +42,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/lists/rev_2/common.py b/prolog/problems/lists/rev_2/common.py
index acb4342..b8dbbe3 100644
--- a/prolog/problems/lists/rev_2/common.py
+++ b/prolog/problems/lists/rev_2/common.py
@@ -42,9 +42,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/lists/shiftleft_2/common.py b/prolog/problems/lists/shiftleft_2/common.py
index 0fbc0b3..9973e52 100644
--- a/prolog/problems/lists/shiftleft_2/common.py
+++ b/prolog/problems/lists/shiftleft_2/common.py
@@ -40,9 +40,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/lists/shiftright_2/common.py b/prolog/problems/lists/shiftright_2/common.py
index a9170ff..09c4067 100644
--- a/prolog/problems/lists/shiftright_2/common.py
+++ b/prolog/problems/lists/shiftright_2/common.py
@@ -40,9 +40,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/lists/sublist_2/common.py b/prolog/problems/lists/sublist_2/common.py
index 7b6ea64..b5f6b89 100644
--- a/prolog/problems/lists/sublist_2/common.py
+++ b/prolog/problems/lists/sublist_2/common.py
@@ -43,9 +43,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/lists/sum_2/common.py b/prolog/problems/lists/sum_2/common.py
index 3f5ff8c..026533f 100644
--- a/prolog/problems/lists/sum_2/common.py
+++ b/prolog/problems/lists/sum_2/common.py
@@ -39,9 +39,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