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

updates

parent 06d07c1c
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 ...@@ -270,7 +270,7 @@ What happens behind the scenes when we set `self.title` is that the result is pr
### Caching computations ### 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: 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 ```python
# example_framework/instructor/cs102/report2.py # example_framework/instructor/cs102/report2_test.py
class Question2(UTestCase): class Question2(UTestCase):
@cache @cache
def my_reversal(self, ls): def my_reversal(self, ls):
......
# report2.py # report2_test.py
self.title = f"Checking if reverse_list({ls}) = {reverse}" # Programmatically set the title self.title = f"Checking if reverse_list({ls}) = {reverse}" # Programmatically set the title
def ex_test_output_capture(self): def ex_test_output_capture(self):
......
# report2.py # report2_test.py
class Week1Titles(UTestCase): class Week1Titles(UTestCase):
......
# report2.py # report2_test.py
class Question2(UTestCase): class Question2(UTestCase):
@cache @cache
def my_reversal(self, ls): def my_reversal(self, ls):
......
# example_framework/instructor/cs102/report2.py # example_framework/instructor/cs102/report2_test.py
from unitgrade import UTestCase, cache from unitgrade import UTestCase, cache
class Week1(UTestCase): class Week1(UTestCase):
......
# example_framework/instructor/cs102/report2.py # example_framework/instructor/cs102/report2_test.py
class Week1Titles(UTestCase): class Week1Titles(UTestCase):
""" The same problem as before with nicer titles """ """ The same problem as before with nicer titles """
def test_add(self): def test_add(self):
......
# example_framework/instructor/cs102/report2.py # example_framework/instructor/cs102/report2_test.py
class Question2(UTestCase): class Question2(UTestCase):
@cache @cache
def my_reversal(self, ls): 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 unitgrade_private.hidden_create_files import setup_grade_file_report
from snipper.snip_dir import snip_dir from snipper.snip_dir import snip_dir
......
...@@ -4,14 +4,14 @@ from unitgrade_private.docker_helpers import compile_docker_image ...@@ -4,14 +4,14 @@ from unitgrade_private.docker_helpers import compile_docker_image
if __name__ == "__main__": if __name__ == "__main__":
## Step 1. Deploy the report file. ## 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 unitgrade_private.hidden_create_files import setup_grade_file_report
from snipper.snip_dir import snip_dir from snipper.snip_dir import snip_dir
from unitgrade import version from unitgrade import version
print("version", version.__version__) print("version", version.__version__)
# Set up the instructor _grade script and all files needed for the tests. # Set up the instructor _grade script and all files needed for the tests.
setup_grade_file_report(Report2, with_coverage=False) setup_grade_file_report(Report2, with_coverage=False, bzip=True)
snip_dir("./", "../../students/cs102_autolab", clean_destination_dir=True, exclude=['*.token', 'deploy_autolab.py', '*_grade.py', 'tmp', '*.tar']) 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 # 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). download_docker_images("../docker") # Download docker images from gitlab (only do this once).
...@@ -23,14 +23,14 @@ if __name__ == "__main__": ...@@ -23,14 +23,14 @@ if __name__ == "__main__":
instructor_base = f"." instructor_base = f"."
student_base = f"../../students/cs102_autolab" student_base = f"../../students/cs102_autolab"
from report2 import Report2 from report2_test import Report2
# INSTRUCTOR_GRADE_FILE = # 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_REPORT_CLASS=Report2,
INSTRUCTOR_BASE=instructor_base, 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_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, autograde_image_tag=autograde_image,
student_should_upload_token=False, student_should_upload_token=False,
homework_file="homework1.py") #!s 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