ygrader 2.6.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ygrader-2.6.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Jeff Goeders
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
ygrader-2.6.4/PKG-INFO ADDED
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: ygrader
3
+ Version: 2.6.4
4
+ Summary: Grading scripts used in BYU's Electrical and Computer Engineering Department
5
+ Home-page: https://github.com/byu-cpe/ygrader
6
+ Author: Jeff Goeders
7
+ Author-email: jeff.goeders@gmail.com
8
+ License: MIT
9
+ License-File: LICENSE
10
+ Requires-Dist: pandas>=1.0.0
11
+ Requires-Dist: pyyaml
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: home-page
15
+ Dynamic: license
16
+ Dynamic: license-file
17
+ Dynamic: requires-dist
18
+ Dynamic: summary
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
ygrader-2.6.4/setup.py ADDED
@@ -0,0 +1,14 @@
1
+ from setuptools import setup
2
+
3
+ setup(
4
+ name="ygrader",
5
+ packages=["ygrader"],
6
+ package_data={"ygrader": ["*.ahk"]},
7
+ version="2.6.4",
8
+ description="Grading scripts used in BYU's Electrical and Computer Engineering Department",
9
+ author="Jeff Goeders",
10
+ author_email="jeff.goeders@gmail.com",
11
+ license="MIT",
12
+ url="https://github.com/byu-cpe/ygrader",
13
+ install_requires=["pandas>=1.0.0", "pyyaml"],
14
+ )
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/python3
2
+
3
+ import unittest
4
+ import pathlib
5
+ import sys
6
+ import time
7
+
8
+
9
+ ROOT_PATH = pathlib.Path(__file__).resolve().parent.parent
10
+ sys.path.append(str(ROOT_PATH))
11
+
12
+ from ygrader import Grader, CodeSource
13
+
14
+ TEST_PATH = ROOT_PATH / "test"
15
+ TEST_RESOURCES_PATH = TEST_PATH / "resources"
16
+
17
+
18
+ def run_on_lab(**kwargs):
19
+ print("run_on_lab")
20
+ time.sleep(1)
21
+
22
+
23
+ def run_on_milestone(**kwargs):
24
+ print("run_on_milestone")
25
+ time.sleep(1)
26
+
27
+
28
+ def test_me():
29
+ grader = Grader(
30
+ lab_name="lab1",
31
+ grades_csv_path=TEST_RESOURCES_PATH / "grades1.csv",
32
+ work_path=TEST_PATH / "temp",
33
+ )
34
+ grader.add_item_to_grade(
35
+ "lab1",
36
+ run_on_milestone,
37
+ 10,
38
+ )
39
+ grader.add_item_to_grade(
40
+ "lab1m2",
41
+ run_on_milestone,
42
+ )
43
+ grader.set_submission_system_learning_suite(TEST_RESOURCES_PATH / "submissions.zip")
44
+ grader.set_other_options(prep_fcn=run_on_lab)
45
+ grader.run()
46
+
47
+
48
+ if __name__ == "__main__":
49
+ test_me()
@@ -0,0 +1,139 @@
1
+ #!/usr/bin/python3
2
+
3
+ import unittest
4
+ import pathlib
5
+ import sys
6
+ import filecmp
7
+ import doctest
8
+
9
+ ROOT_PATH = pathlib.Path(__file__).resolve().parent.parent
10
+ sys.path.append(str(ROOT_PATH))
11
+
12
+ import ygrader.student_repos
13
+ from ygrader import Grader, CodeSource
14
+
15
+ TEST_PATH = ROOT_PATH / "test"
16
+ TEST_RESOURCES_PATH = TEST_PATH / "resources"
17
+ TEST_OUTPUT_PATH = TEST_PATH / "grades"
18
+
19
+
20
+ def load_tests(loader, tests, ignore):
21
+ tests.addTests(doctest.DocTestSuite(ygrader.student_repos))
22
+ return tests
23
+
24
+
25
+ class TestGithub(unittest.TestCase):
26
+ def test_me(self):
27
+ class_list_csv_path = TEST_RESOURCES_PATH / "class_list_1.csv"
28
+ deductions1_golden_path = TEST_RESOURCES_PATH / "deductions1_golden.yaml"
29
+ deductions2_golden_path = TEST_RESOURCES_PATH / "deductions2_golden.yaml"
30
+ deductions1_yaml_path = TEST_OUTPUT_PATH / "deductions1.yaml"
31
+ deductions2_yaml_path = TEST_OUTPUT_PATH / "deductions2.yaml"
32
+
33
+ grader = Grader(
34
+ lab_name="github_test",
35
+ class_list_csv_path=class_list_csv_path,
36
+ work_path=TEST_PATH / "temp_github",
37
+ )
38
+ grader.add_item_to_grade(
39
+ "lab1",
40
+ self.runner,
41
+ max_points=10,
42
+ deductions_yaml_path=deductions1_yaml_path,
43
+ )
44
+ grader.add_item_to_grade(
45
+ "lab1m2",
46
+ self.runner,
47
+ max_points=20,
48
+ deductions_yaml_path=deductions2_yaml_path,
49
+ )
50
+ grader.set_submission_system_github(
51
+ "main", TEST_RESOURCES_PATH / "github.csv", use_https=True
52
+ )
53
+ grader.run()
54
+
55
+ self.assertTrue(filecmp.cmp(deductions1_yaml_path, deductions1_golden_path))
56
+ self.assertTrue(filecmp.cmp(deductions2_yaml_path, deductions2_golden_path))
57
+
58
+ def runner(self, **kw):
59
+ if kw["item_name"] == "lab1m2":
60
+ return [("New feedback", 2)]
61
+ return []
62
+
63
+
64
+ class TestLearningSuite(unittest.TestCase):
65
+ def test_me(self):
66
+ class_list_csv_path = TEST_RESOURCES_PATH / "class_list_2.csv"
67
+ deductions_path = TEST_OUTPUT_PATH / "learningsuite_deductions.yaml"
68
+ deductions_golden_path = (
69
+ TEST_RESOURCES_PATH / "learningsuite_deductions_golden.yaml"
70
+ )
71
+
72
+ grader = Grader(
73
+ lab_name="learningsuite_test",
74
+ class_list_csv_path=class_list_csv_path,
75
+ work_path=TEST_PATH / "temp_learningsuite",
76
+ )
77
+ grader.add_item_to_grade(
78
+ item_name="lab1",
79
+ grading_fcn=self.runner,
80
+ deductions_yaml_path=deductions_path,
81
+ max_points=10,
82
+ )
83
+ grader.set_submission_system_learning_suite(
84
+ TEST_RESOURCES_PATH / "submissions.zip"
85
+ )
86
+ grader.run()
87
+
88
+ self.assertTrue(filecmp.cmp(deductions_path, deductions_golden_path))
89
+
90
+ def runner(self, student_code_path, **kw):
91
+ self.assertIn("section", kw)
92
+ self.assertIn("homework_id", kw)
93
+ if (student_code_path / "file_1.txt").is_file() and (
94
+ student_code_path / "file_2.txt"
95
+ ).is_file():
96
+ return []
97
+ else:
98
+ return [("Missing files", 10)]
99
+
100
+ def test_groups(self):
101
+ class_list_csv_path = TEST_RESOURCES_PATH / "class_list_3.csv"
102
+ deductions1_path = TEST_OUTPUT_PATH / "groups_l1.yaml"
103
+ deductions2_path = TEST_OUTPUT_PATH / "groups_l2.yaml"
104
+ deductions3_path = TEST_OUTPUT_PATH / "groups_l3.yaml"
105
+ deductions1_golden_path = TEST_RESOURCES_PATH / "groups_l1_golden.yaml"
106
+ deductions2_golden_path = TEST_RESOURCES_PATH / "groups_l2_golden.yaml"
107
+ deductions3_golden_path = TEST_RESOURCES_PATH / "groups_l3_golden.yaml"
108
+
109
+ grader = Grader(
110
+ "groups_test",
111
+ class_list_csv_path=class_list_csv_path,
112
+ work_path=TEST_PATH / "temp_groups",
113
+ )
114
+ grader.add_item_to_grade(
115
+ item_name="l1",
116
+ grading_fcn=self.group_grader_1,
117
+ deductions_yaml_path=deductions1_path,
118
+ max_points=10,
119
+ )
120
+ grader.add_item_to_grade(
121
+ item_name="l2",
122
+ grading_fcn=self.group_grader_2,
123
+ deductions_yaml_path=deductions2_path,
124
+ max_points=10,
125
+ )
126
+ grader.set_submission_system_learning_suite(
127
+ TEST_RESOURCES_PATH / "submissions2.zip"
128
+ )
129
+ grader.set_learning_suite_groups(TEST_RESOURCES_PATH / "groups3.csv")
130
+ grader.run()
131
+
132
+ self.assertTrue(filecmp.cmp(deductions1_path, deductions1_golden_path))
133
+ self.assertTrue(filecmp.cmp(deductions2_path, deductions2_golden_path))
134
+
135
+ def group_grader_1(self, **kw):
136
+ return []
137
+
138
+ def group_grader_2(self, **kw):
139
+ return [("Did not follow instructions", 5)]
@@ -0,0 +1,11 @@
1
+ """Default imports for package"""
2
+
3
+ from .grader import Grader, CodeSource
4
+ from .upstream_merger import UpstreamMerger
5
+ from .utils import CallbackFailed
6
+ from .grading_item_config import (
7
+ LearningSuiteColumn,
8
+ LearningSuiteColumnParseError,
9
+ )
10
+ from .feedback import assemble_grades
11
+ from .remote import run_remote_build, RemoteBuildError