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

updates to readme.md

parent e838a7cf
No related branches found
No related tags found
No related merge requests found
...@@ -209,7 +209,7 @@ When this is run, the titles are shown as follows: ...@@ -209,7 +209,7 @@ When this is run, the titles are shown as follows:
| | | |_ __ _| |_| | \/_ __ __ _ __| | ___ | | | |_ __ _| |_| | \/_ __ __ _ __| | ___
| | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \ | | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \
| |_| | | | | | |_| |_\ \ | | (_| | (_| | __/ | |_| | | | | | |_| |_\ \ | | (_| | (_| | __/
\___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.1.0, started: 09/09/2021 16:21:26 \___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.1.0, started: 09/09/2021 16:28:20
CS 101 Report 2 (use --help for options) CS 101 Report 2 (use --help for options)
Question 1: Week1 Question 1: Week1
...@@ -223,7 +223,7 @@ Question 2: The same problem as before with nicer titles ...@@ -223,7 +223,7 @@ Question 2: The same problem as before with nicer titles
* q2.2) Checking if reverse_list([1, 2, 3]) = [3, 2, 1]............................................................PASS * q2.2) Checking if reverse_list([1, 2, 3]) = [3, 2, 1]............................................................PASS
* q2) Total...................................................................................................... 8/8 * q2) Total...................................................................................................... 8/8
Total points at 16:21:26 (0 minutes, 0 seconds)....................................................................18/18 Total points at 16:28:20 (0 minutes, 0 seconds)....................................................................18/18
``` ```
What happens behind the scenes when we set `self.title` is that the result is pre-computed on the instructors machine and cached. This means the last test will display the correct result regardless of how `reverse_list` has been implemented by the student. The titles are also shown correctly when the method is run as a unittest. What happens behind the scenes when we set `self.title` is that the result is pre-computed on the instructors machine and cached. This means the last test will display the correct result regardless of how `reverse_list` has been implemented by the student. The titles are also shown correctly when the method is run as a unittest.
...@@ -287,10 +287,10 @@ Next we need to create students report and grade scripts. This can done as follo ...@@ -287,10 +287,10 @@ Next we need to create students report and grade scripts. This can done as follo
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
if __name__ == "__main__": if __name__ == "__main__":
# Step 1: Deploy the students files and return the directory they were written to # Step 1: Deploy the students files and return the directory they were written to
setup_grade_file_report(Report3, bzip=False) # Create report3_complete_grade.py setup_grade_file_report(Report3) # Create report3_complete_grade.py which tests everything
fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods
setup_grade_file_report(Report, bzip=False) # Create report3_grade.py setup_grade_file_report(Report) # Create report3_grade.py for the students
student_directory = "../../students/cs103" student_directory = "../../students/cs103"
snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*']) snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*'])
...@@ -324,7 +324,7 @@ To do that, you first have to install Docker (easy), and then build a Docker ima ...@@ -324,7 +324,7 @@ To do that, you first have to install Docker (easy), and then build a Docker ima
To build the Docker image simply run: To build the Docker image simply run:
```python ```python
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
# Step 3: Compile the Docker image (obviously you should only do this once; add your packages to requirements.txt). # Step 3: Compile the Docker image (obviously you should only do this once).
Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile" Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile"
os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .") os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .")
``` ```
...@@ -336,7 +336,7 @@ This takes about 3 minutes but only needs to be done once. If you are keeping tr ...@@ -336,7 +336,7 @@ This takes about 3 minutes but only needs to be done once. If you are keeping tr
Next we feed this into unitgrade: Next we feed this into unitgrade:
```python ```python
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
# Step 4: Test the students .token file and get the results-token-file. Compare the contents with the students_token_file: # Step 4: Test the students code in the .token file and get the results-token-file:
token = docker_run_token_file(Dockerfile_location=Dockerfile, token = docker_run_token_file(Dockerfile_location=Dockerfile,
host_tmp_dir=os.path.dirname(Dockerfile) + "/home", host_tmp_dir=os.path.dirname(Dockerfile) + "/home",
student_token_file=student_token_file, student_token_file=student_token_file,
......
...@@ -195,7 +195,7 @@ Just to show it works we will load both `.token`-files and print the results: ...@@ -195,7 +195,7 @@ Just to show it works we will load both `.token`-files and print the results:
``` ```
The results (shown in a `(points_obtained, possible_points)` format) will be printed as: The results (shown in a `(points_obtained, possible_points)` format) will be printed as:
```terminal ```terminal
{{docker_results_txt }} {{example_docker_docker_results_txt }}
``` ```
As expected, the (failed) hidden tests reduces the total points obtained. It will be easy to check, for instance by calling the hidden tests As expected, the (failed) hidden tests reduces the total points obtained. It will be easy to check, for instance by calling the hidden tests
`def test_something_hidden` when the regular test, `test_something`, passes and the hidden test fails. `def test_something_hidden` when the regular test, `test_something`, passes and the hidden test fails.
......
No preview for this file type
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
| | | |_ __ _| |_| | \/_ __ __ _ __| | ___ | | | |_ __ _| |_| | \/_ __ __ _ __| | ___
| | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \ | | | | '_ \| | __| | __| '__/ _` |/ _` |/ _ \
| |_| | | | | | |_| |_\ \ | | (_| | (_| | __/ | |_| | | | | | |_| |_\ \ | | (_| | (_| | __/
\___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.1.0, started: 09/09/2021 16:21:26 \___/|_| |_|_|\__|\____/_| \__,_|\__,_|\___| v0.1.0, started: 09/09/2021 16:28:20
CS 101 Report 2 (use --help for options) CS 101 Report 2 (use --help for options)
Question 1: Week1 Question 1: Week1
...@@ -17,4 +17,4 @@ Question 2: The same problem as before with nicer titles ...@@ -17,4 +17,4 @@ Question 2: The same problem as before with nicer titles
* q2.2) Checking if reverse_list([1, 2, 3]) = [3, 2, 1]............................................................PASS * q2.2) Checking if reverse_list([1, 2, 3]) = [3, 2, 1]............................................................PASS
* q2) Total...................................................................................................... 8/8 * q2) Total...................................................................................................... 8/8
Total points at 16:21:26 (0 minutes, 0 seconds)....................................................................18/18 Total points at 16:28:20 (0 minutes, 0 seconds)....................................................................18/18
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
if __name__ == "__main__": if __name__ == "__main__":
# Step 1: Deploy the students files and return the directory they were written to # Step 1: Deploy the students files and return the directory they were written to
setup_grade_file_report(Report3, bzip=False) # Create report3_complete_grade.py setup_grade_file_report(Report3) # Create report3_complete_grade.py which tests everything
fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods
setup_grade_file_report(Report, bzip=False) # Create report3_grade.py setup_grade_file_report(Report) # Create report3_grade.py for the students
student_directory = "../../students/cs103" student_directory = "../../students/cs103"
snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*']) snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*'])
\ No newline at end of file
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
# Step 3: Compile the Docker image (obviously you should only do this once; add your packages to requirements.txt). # Step 3: Compile the Docker image (obviously you should only do this once).
Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile" Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile"
os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .") os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .")
\ No newline at end of file
# example_docker/instructor/cs103/deploy.py # example_docker/instructor/cs103/deploy.py
# Step 4: Test the students .token file and get the results-token-file. Compare the contents with the students_token_file: # Step 4: Test the students code in the .token file and get the results-token-file:
token = docker_run_token_file(Dockerfile_location=Dockerfile, token = docker_run_token_file(Dockerfile_location=Dockerfile,
host_tmp_dir=os.path.dirname(Dockerfile) + "/home", host_tmp_dir=os.path.dirname(Dockerfile) + "/home",
student_token_file=student_token_file, student_token_file=student_token_file,
......
...@@ -9,10 +9,10 @@ from snipper.snip_dir import snip_dir ...@@ -9,10 +9,10 @@ from snipper.snip_dir import snip_dir
if __name__ == "__main__": #!s=docker_a if __name__ == "__main__": #!s=docker_a
# Step 1: Deploy the students files and return the directory they were written to # Step 1: Deploy the students files and return the directory they were written to
setup_grade_file_report(Report3, bzip=False) # Create report3_complete_grade.py setup_grade_file_report(Report3) # Create report3_complete_grade.py which tests everything
fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods fout, Report = remove_hidden_methods(Report3, outfile="report3.py") # Create report3.py without @hide-methods
setup_grade_file_report(Report, bzip=False) # Create report3_grade.py setup_grade_file_report(Report) # Create report3_grade.py for the students
student_directory = "../../students/cs103" student_directory = "../../students/cs103"
snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*']) #!s snip_dir("./", student_directory, exclude=['__pycache__', '*.token', 'deploy.py', 'report3_complete*.py', '.*']) #!s
...@@ -21,11 +21,11 @@ if __name__ == "__main__": #!s=docker_a ...@@ -21,11 +21,11 @@ if __name__ == "__main__": #!s=docker_a
os.system("cd ../../students && python -m cs103.report3_grade") #!s=docker_b os.system("cd ../../students && python -m cs103.report3_grade") #!s=docker_b
student_token_file = glob.glob(student_directory + "/*.token").pop() #!s student_token_file = glob.glob(student_directory + "/*.token").pop() #!s
# Step 3: Compile the Docker image (obviously you should only do this once; add your packages to requirements.txt). #!s=docker_c # Step 3: Compile the Docker image (obviously you should only do this once). #!s=docker_c
Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile" Dockerfile = os.path.dirname(__file__) + "/../../../../docker_images/unitgrade-docker/Dockerfile"
os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .") #!s os.system(f"cd {os.path.dirname(Dockerfile)} && docker build --tag unitgrade-docker .") #!s
# Step 4: Test the students .token file and get the results-token-file. Compare the contents with the students_token_file: #!s=docker_d # Step 4: Test the students code in the .token file and get the results-token-file: #!s=docker_d
token = docker_run_token_file(Dockerfile_location=Dockerfile, token = docker_run_token_file(Dockerfile_location=Dockerfile,
host_tmp_dir=os.path.dirname(Dockerfile) + "/home", host_tmp_dir=os.path.dirname(Dockerfile) + "/home",
student_token_file=student_token_file, student_token_file=student_token_file,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment