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

updates

parents 135aa846 0429c721
Branches
No related tags found
No related merge requests found
Showing
with 674 additions and 18 deletions
......@@ -270,7 +270,7 @@ What happens behind the scenes when we set `self.title` is that the result is pr
### Caching computations
The `@cache`-decorator offers a direct ways to compute the correct result on an instructors computer and submit it to the student. For instance:
```python
# example_framework/instructor/cs102/report2.py
# example_framework/instructor/cs102/report2_test.py
class Question2(UTestCase):
@cache
def my_reversal(self, ls):
......
# report2.py
# report2_test.py
self.title = f"Checking if reverse_list({ls}) = {reverse}" # Programmatically set the title
def ex_test_output_capture(self):
......
# report2.py
# report2_test.py
class Week1Titles(UTestCase):
......
# report2.py
# report2_test.py
class Question2(UTestCase):
@cache
def my_reversal(self, ls):
......
# example_framework/instructor/cs102/report2.py
# example_framework/instructor/cs102/report2_test.py
from unitgrade import UTestCase, cache
class Week1(UTestCase):
......
# example_framework/instructor/cs102/report2.py
# example_framework/instructor/cs102/report2_test.py
class Week1Titles(UTestCase):
""" The same problem as before with nicer titles """
def test_add(self):
......
# example_framework/instructor/cs102/report2.py
# example_framework/instructor/cs102/report2_test.py
class Question2(UTestCase):
@cache
def my_reversal(self, ls):
......
No preview for this file type
File added
File added
File added
File added
from cs102.report2 import Report2
from cs102_autolab.report2_test import Report2
from unitgrade_private.hidden_create_files import setup_grade_file_report
from snipper.snip_dir import snip_dir
......
......@@ -4,14 +4,14 @@ from unitgrade_private.docker_helpers import compile_docker_image
if __name__ == "__main__":
## Step 1. Deploy the report file.
from report2 import Report2
from report2_test import Report2
from unitgrade_private.hidden_create_files import setup_grade_file_report
from snipper.snip_dir import snip_dir
from unitgrade import version
print("version", version.__version__)
# Set up the instructor _grade script and all files needed for the tests.
setup_grade_file_report(Report2, with_coverage=False)
snip_dir("./", "../../students/cs102_autolab", clean_destination_dir=True, exclude=['*.token', 'deploy_autolab.py', '*_grade.py', 'tmp', '*.tar'])
setup_grade_file_report(Report2, with_coverage=False, bzip=True)
snip_dir("./", "../../students/cs102_autolab", clean_destination_dir=True, exclude=['*.token', 'deploy*.py', '*_grade.py', 'tmp', '*.tar'])
# Step 1: Download and compile docker grading image. You only need to do this once. #!s=a
download_docker_images("../docker") # Download docker images from gitlab (only do this once).
......@@ -23,14 +23,14 @@ if __name__ == "__main__":
instructor_base = f"."
student_base = f"../../students/cs102_autolab"
from report2 import Report2
from report2_test import Report2
# INSTRUCTOR_GRADE_FILE =
output_tar = new_deploy_assignment("cs105d", # Autolab name of assignment (and name of .tar file)
output_tar = new_deploy_assignment("cs105h", # Autolab name of assignment (and name of .tar file)
INSTRUCTOR_REPORT_CLASS=Report2,
INSTRUCTOR_BASE=instructor_base,
INSTRUCTOR_GRADE_FILE=f"{instructor_base}/report2_grade.py",
INSTRUCTOR_GRADE_FILE=f"{instructor_base}/report2_test_grade.py",
STUDENT_BASE=student_base,
STUDENT_GRADE_FILE=f"{instructor_base}/report2.py",
STUDENT_GRADE_FILE=f"{instructor_base}/report2_test.py",
autograde_image_tag=autograde_image,
student_should_upload_token=False,
homework_file="homework1.py") #!s
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment