Skip to content
Snippets Groups Projects
Commit edfbb0c2 authored by tuhe's avatar tuhe
Browse files

Autolab score computation working

parent bceb1c3f
Branches
No related tags found
No related merge requests found
Showing
with 1282 additions and 860 deletions
File added
This diff is collapsed.
No preview for this file type
No preview for this file type
This diff is collapsed.
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -5,3 +5,5 @@ from snipper.snip_dir import snip_dir
if __name__ == "__main__":
setup_grade_file_report(Report2)
snip_dir("./", "../../students/cs102", clean_destination_dir=True, exclude=['*.token', 'deploy.py'])
# from unitgrade import evaluate_report_student
# evaluate_report_student(Report2())
\ No newline at end of file
......@@ -22,7 +22,9 @@ class Week1Titles(UTestCase): #!s=b
def test_add(self):
""" Test the addition method add(a,b) """
self.assertEqualC(add(2,2))
print("output generated by test")
self.assertEqualC(add(-100, 5))
# self.assertEqual(2,3, msg="This test automatically fails.")
def test_reverse(self):
ls = [1, 2, 3]
......@@ -57,8 +59,8 @@ class Question2(UTestCase): #!s=c
import cs102
class Report2(Report):
title = "CS 101 Report 2"
questions = [(Week1, 10), (Week1Titles, 8)]
title = "CS 102 Report 2"
questions = [(Week1, 10), (Week1Titles, 6)]
pack_imports = [cs102]
if __name__ == "__main__":
......
No preview for this file type
No preview for this file type
......@@ -4,7 +4,9 @@ class Week1Titles(UTestCase):
def test_add(self):
""" Test the addition method add(a,b) """
self.assertEqualC(add(2,2))
print("output generated by test")
self.assertEqualC(add(-100, 5))
# self.assertEqual(2,3, msg="This test automatically fails.")
def test_reverse(self):
ls = [1, 2, 3]
......
This diff is collapsed.
def reverse_list(mylist): #!f #!s;keeptags
def reverse_list(mylist):
"""
Given a list 'mylist' returns a list consisting of the same elements in reverse order. E.g.
reverse_list([1,2,3]) should return [3,2,1] (as a list).
"""
ls = []
for l in mylist:
ls = [l] + ls
return ls
# return list(reversed(mylist))
# TODO: 1 lines missing.
raise NotImplementedError("Implement function body")
def add(a,b): #!f
def add(a,b):
""" Given two numbers `a` and `b` this function should simply return their sum:
> add(a,b) = a+b """
sum2 = a + b
return sum2
# TODO: 1 lines missing.
raise NotImplementedError("Implement function body")
if __name__ == "__main__":
# Example usage:
print(f"Your result of 2 + 2 = {add(2,2)}")
print(f"Reversing a small list", reverse_list([2,3,5,7])) #!s
print(f"Reversing a small list", reverse_list([2,3,5,7]))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment