autograder.model.config
1import typing 2 3import edq.config.app 4import edq.util.crypto 5import edq.util.time 6import lms.model.constants 7 8import autograder.filespec 9 10class Config(edq.config.app.BaseApplicationConfig): 11 """ 12 An application config for the autograder. 13 14 This config encompasses most of what will be read on the command-line and config files. 15 This includes both more persistent options (like server, username, and password), 16 and single command options like the target course or user. 17 Config options not represented here should be available in edq.config.app.BaseApplicationConfig._extra. 18 """ 19 20 def __init__(self, 21 active: typing.Union[bool, None] = None, 22 allow_late: typing.Union[bool, None] = None, 23 assignment: typing.Union[str, None] = None, 24 auth_pass: typing.Union[edq.util.crypto.Secret, None] = None, 25 auth_user: typing.Union[str, None] = None, 26 bcc: typing.Union[typing.List[str], None] = None, 27 body: typing.Union[str, None] = None, 28 cc: typing.Union[typing.List[str], None] = None, 29 clear: typing.Union[bool, None] = None, 30 course: typing.Union[str, None] = None, 31 dry_run: typing.Union[bool, None] = None, 32 filespec: typing.Union[autograder.filespec.FileSpec, None] = None, 33 filespec_path: typing.Union[str, None] = None, 34 filespec_reference: typing.Union[str, None] = None, 35 filespec_token: typing.Union[str, None] = None, 36 filespec_type: typing.Union[str, None] = None, 37 filespec_username: typing.Union[str, None] = None, 38 files: typing.Union[typing.List[str], None] = None, 39 force: typing.Union[bool, None] = None, 40 force_compute: typing.Union[bool, None] = None, 41 email_html: typing.Union[bool, None] = None, 42 include_extra_fields: typing.Union[bool, None] = None, 43 message: typing.Union[str, None] = None, 44 name: typing.Union[str, None] = None, 45 new_course_role: typing.Union[str, None] = None, 46 new_course: typing.Union[str, None] = None, 47 new_email: typing.Union[str, None] = None, 48 new_lms_id: typing.Union[str, None] = None, 49 new_name: typing.Union[str, None] = None, 50 new_pass: typing.Union[str, None] = None, 51 new_role: typing.Union[str, None] = None, 52 out_dir: typing.Union[str, None] = None, 53 output_format: typing.Union[lms.model.constants.OutputFormat, None] = None, 54 overwrite_records: typing.Union[bool, None] = None, 55 path: typing.Union[str, None] = None, 56 pretty_headers: typing.Union[bool, None] = None, 57 proxy_email: typing.Union[str, None] = None, 58 proxy_time: typing.Union[edq.util.time.Timestamp, None] = None, 59 query_after: typing.Union[edq.util.time.Timestamp, None] = None, 60 query_before: typing.Union[edq.util.time.Timestamp, None] = None, 61 query_level: typing.Union[str, None] = None, 62 query_limit: typing.Union[int, None] = None, 63 query_metric_type: typing.Union[str, None] = None, 64 query_past: typing.Union[str, None] = None, 65 query_sort: typing.Union[int, None] = None, 66 query_target_assignment: typing.Union[str, None] = None, 67 query_target_course: typing.Union[str, None] = None, 68 query_target_email: typing.Union[str, None] = None, 69 query_use_testing_data: typing.Union[bool, None] = None, 70 query_where: typing.Union[typing.Dict[str, str], None] = None, 71 raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 72 raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 73 regrade_cutoff: typing.Union[int, None] = None, 74 send_emails: typing.Union[bool, None] = None, 75 server: typing.Union[str, None] = None, 76 skip_build_images: typing.Union[bool, None] = None, 77 skip_emails: typing.Union[bool, None] = None, 78 skip_headers: typing.Union[bool, None] = None, 79 skip_inserts: typing.Union[bool, None] = None, 80 skip_lms_sync: typing.Union[bool, None] = None, 81 skip_rows: typing.Union[int, None] = None, 82 skip_source_sync: typing.Union[bool, None] = None, 83 skip_template_files: typing.Union[bool, None] = None, 84 skip_updates: typing.Union[bool, None] = None, 85 subject: typing.Union[str, None] = None, 86 submission_specs: typing.Union[typing.List[str], None] = None, 87 target_assignments: typing.Union[typing.List[str], None] = None, 88 target_email: typing.Union[str, None] = None, 89 target_owner: typing.Union[str, None] = None, 90 target_submission: typing.Union[str, None] = None, 91 target_users: typing.Union[typing.List[str], None] = None, 92 target_user: typing.Union[str, None] = None, 93 testing_mode: typing.Union[bool, None] = None, 94 token_id: typing.Union[str, None] = None, 95 to: typing.Union[typing.List[str], None] = None, 96 wait_for_completion: typing.Union[bool, None] = None, 97 **kwargs: typing.Any) -> None: 98 super().__init__(**kwargs) 99 100 self.active: typing.Union[bool, None] = active 101 """ Mark the course as active. """ 102 103 self.allow_late: typing.Union[bool, None] = allow_late 104 """ Allow this submission to be graded, even if it is late. """ 105 106 self.assignment: typing.Union[str, None] = assignment 107 """ The ID of the assignment to make this request to. """ 108 109 # Sidestep using the `pass` keyword. 110 if (auth_pass is None): 111 auth_pass = kwargs.get('pass', None) 112 113 self.auth_pass: typing.Union[edq.util.crypto.Secret, None] = auth_pass 114 """ The password of the user making this request. """ 115 116 if (auth_user is None): 117 auth_user = kwargs.get('user', None) 118 119 self.auth_user: typing.Union[str, None] = auth_user 120 """ The email of the user making this request. """ 121 122 self.bcc: typing.Union[typing.List[str], None] = bcc 123 """ A list of email addresses. Accepts course user references. """ 124 125 self.body: typing.Union[str, None] = body 126 """ The email body. """ 127 128 self.cc: typing.Union[typing.List[str], None] = cc 129 """ A list of email addresses. Accepts course user references. """ 130 131 self.clear: typing.Union[bool, None] = clear 132 """ Remove all course statuses the caller has permission to remove. """ 133 134 self.course: typing.Union[str, None] = course 135 """ The ID of the course to make this request to. """ 136 137 self.dry_run: typing.Union[bool, None] = dry_run 138 """ Do not commit/finalize the operation, just do all the steps and state what the result would look like. """ 139 140 self.filespec: typing.Union[autograder.filespec.FileSpec, None] = filespec 141 """ A filespec pointing to a course to upload. """ 142 143 self.filespec_path: typing.Union[str, None] = filespec_path 144 """ The path the filespec points to. """ 145 146 self.filespec_reference: typing.Union[str, None] = filespec_reference 147 """ The reference (e.g., git commit/branch) of the filespec. """ 148 149 self.filespec_token: typing.Union[str, None] = filespec_token 150 """ The token for filespec authentication. """ 151 152 self.filespec_type: typing.Union[str, None] = filespec_type 153 """ The type of filespec. """ 154 155 self.filespec_username: typing.Union[str, None] = filespec_username 156 """ The username for filespec authentication. """ 157 158 self.files: typing.Union[typing.List[str], None] = files 159 """ The path to your submission file(s). """ 160 161 self.force: typing.Union[bool, None] = force 162 """ Overwrite an existing course status set by the caller. """ 163 164 self.force_compute: typing.Union[bool, None] = force_compute 165 """ Force the server to compute the result, ignoring any existing cache. """ 166 167 self.email_html: typing.Union[bool, None] = email_html 168 """ Indicates the email body contains HTML. """ 169 170 self.include_extra_fields: typing.Union[bool, None] = include_extra_fields 171 """ Include non-common (usually LMS-specific) fields in results. """ 172 173 self.message: typing.Union[str, None] = message 174 """ An optional message to attach to the request. """ 175 176 self.name: typing.Union[str, None] = name 177 """ An optional name to use. """ 178 179 self.new_course_role: typing.Union[str, None] = new_course_role 180 """ The course role for the new user. """ 181 182 self.new_course: typing.Union[str, None] = new_course 183 """ An optional course to enroll the new user in """ 184 185 self.new_email: typing.Union[str, None] = new_email 186 """ The email for the new user. """ 187 188 self.new_lms_id: typing.Union[str, None] = new_lms_id 189 """ The LMS ID for the new user. """ 190 191 self.new_name: typing.Union[str, None] = new_name 192 """ The name for the new user. """ 193 194 self.new_pass: typing.Union[str, None] = new_pass 195 """ The new password. """ 196 197 self.new_role: typing.Union[str, None] = new_role 198 """ The server role for the new user. """ 199 200 self.out_dir: typing.Union[str, None] = out_dir 201 """ A directory to write output in. """ 202 203 self.output_format: typing.Union[lms.model.constants.OutputFormat, None] = output_format 204 """ The format to display the output as. """ 205 206 self.overwrite_records: typing.Union[bool, None] = overwrite_records 207 """ Replace any existing records that match the current operation (e.g. re-do existing results). """ 208 209 self.path: typing.Union[str, None] = path 210 """ The path to your course material. """ 211 212 self.pretty_headers: typing.Union[bool, None] = pretty_headers 213 """ When displaying headers, try to make them look "pretty". """ 214 215 self.proxy_email: typing.Union[str, None] = proxy_email 216 """ The email of the user the request is pretending to be made under (the submission will be made on behalf of this user). """ 217 218 self.proxy_time: typing.Union[edq.util.time.Timestamp, None] = proxy_time 219 """ The proxy timestamp that will be applied to the request. """ 220 221 self.query_after: typing.Union[edq.util.time.Timestamp, None] = query_after 222 """ If supplied, only return records after this timestamp. """ 223 224 self.query_before: typing.Union[edq.util.time.Timestamp, None] = query_before 225 """ If supplied, only return records before this timestamp. """ 226 227 self.query_level: typing.Union[str, None] = query_level 228 """ The minimum level of log records to return. """ 229 230 self.query_limit: typing.Union[int, None] = query_limit 231 """ The maximum number of records to return. """ 232 233 self.query_metric_type: typing.Union[str, None] = query_metric_type 234 """ The type of metric to query for. See: https://github.com/edulinq/autograder-server/blob/main/internal/stats/metrics.go#L29 """ 235 236 self.query_past: typing.Union[str, None] = query_past 237 """ If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s"). """ 238 239 self.query_sort: typing.Union[int, None] = query_sort 240 """ Sort the results. -1 for ascending, 0 for no sorting, 1 for descending. """ 241 242 self.query_target_assignment: typing.Union[str, None] = query_target_assignment 243 """ If supplied, only return records for this assignment. """ 244 245 self.query_target_course: typing.Union[str, None] = query_target_course 246 """ If supplied, only return records for this course. """ 247 248 self.query_target_email: typing.Union[str, None] = query_target_email 249 """ If supplied, only return records for this email. """ 250 251 self.query_use_testing_data: typing.Union[bool, None] = query_use_testing_data 252 """ Query from hard-coded testing data (instead of real data). """ 253 254 self.query_where: typing.Union[typing.Dict[str, str], None] = query_where 255 """ Only includes records with a patching key/value pair. """ 256 257 self.raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_course_users 258 """ Raw course users to operate on. """ 259 260 self.raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_server_users 261 """ Raw server users to operate on. """ 262 263 self.regrade_cutoff: typing.Union[int, None] = regrade_cutoff 264 """ All submissions occurring before the cutoff time will be regraded. """ 265 266 self.send_emails: typing.Union[bool, None] = send_emails 267 """ Send any relevant emails to users affected by this operation (e.g., a user being enrolled in a course). """ 268 269 self.server: typing.Union[str, None] = server 270 """ The URL of the autograder server to communicate with. """ 271 272 self.skip_build_images: typing.Union[bool, None] = skip_build_images 273 """ Skip building assignment Docker images. """ 274 275 self.skip_emails: typing.Union[bool, None] = skip_emails 276 """ Skip sending any emails. """ 277 278 self.skip_headers: typing.Union[bool, None] = skip_headers 279 """ Skip headers when outputting results, will not apply to all formats. """ 280 281 self.skip_inserts: typing.Union[bool, None] = skip_inserts 282 """ Skip insert operations. """ 283 284 self.skip_lms_sync: typing.Union[bool, None] = skip_lms_sync 285 """ Skip syncing with the LMS. """ 286 287 self.skip_rows: typing.Union[int, None] = skip_rows 288 """ The number of header rows to skip. """ 289 290 self.skip_source_sync: typing.Union[bool, None] = skip_source_sync 291 """ Skip syncing (updating with) the course source. """ 292 293 self.skip_template_files: typing.Union[bool, None] = skip_template_files 294 """ Skip fetching assignment template files. """ 295 296 self.skip_updates: typing.Union[bool, None] = skip_updates 297 """ Skip update operations. """ 298 299 self.subject: typing.Union[str, None] = subject 300 """ The email subject. """ 301 302 self.submission_specs: typing.Union[typing.List[str], None] = submission_specs 303 """ A list of submission specifications. """ 304 305 self.target_assignments: typing.Union[typing.List[str], None] = target_assignments 306 """ A list of assignment IDs. """ 307 308 self.target_email: typing.Union[str, None] = target_email 309 """ The email of the user that is the target of this request. """ 310 311 self.target_owner: typing.Union[str, None] = target_owner 312 """ The email of the course status owner that is the target of this request. """ 313 314 self.target_submission: typing.Union[str, None] = target_submission 315 """ The ID of the submission (default to the most recent submission). """ 316 317 self.target_users: typing.Union[typing.List[str], None] = target_users 318 """ A list of user references. """ 319 320 self.target_user: typing.Union[str, None] = target_user 321 """ The user that is the target of this request (defaults to you). """ 322 323 self.testing_mode: typing.Union[bool, None] = testing_mode 324 """ If we should run as if we are in a test. """ 325 326 self.token_id: typing.Union[str, None] = token_id 327 """ The id of the token to target. """ 328 329 self.to: typing.Union[typing.List[str], None] = to 330 """ A list of email addresses. """ 331 332 self.wait_for_completion: typing.Union[bool, None] = wait_for_completion 333 """ Wait for the full job to complete before returning. """
11class Config(edq.config.app.BaseApplicationConfig): 12 """ 13 An application config for the autograder. 14 15 This config encompasses most of what will be read on the command-line and config files. 16 This includes both more persistent options (like server, username, and password), 17 and single command options like the target course or user. 18 Config options not represented here should be available in edq.config.app.BaseApplicationConfig._extra. 19 """ 20 21 def __init__(self, 22 active: typing.Union[bool, None] = None, 23 allow_late: typing.Union[bool, None] = None, 24 assignment: typing.Union[str, None] = None, 25 auth_pass: typing.Union[edq.util.crypto.Secret, None] = None, 26 auth_user: typing.Union[str, None] = None, 27 bcc: typing.Union[typing.List[str], None] = None, 28 body: typing.Union[str, None] = None, 29 cc: typing.Union[typing.List[str], None] = None, 30 clear: typing.Union[bool, None] = None, 31 course: typing.Union[str, None] = None, 32 dry_run: typing.Union[bool, None] = None, 33 filespec: typing.Union[autograder.filespec.FileSpec, None] = None, 34 filespec_path: typing.Union[str, None] = None, 35 filespec_reference: typing.Union[str, None] = None, 36 filespec_token: typing.Union[str, None] = None, 37 filespec_type: typing.Union[str, None] = None, 38 filespec_username: typing.Union[str, None] = None, 39 files: typing.Union[typing.List[str], None] = None, 40 force: typing.Union[bool, None] = None, 41 force_compute: typing.Union[bool, None] = None, 42 email_html: typing.Union[bool, None] = None, 43 include_extra_fields: typing.Union[bool, None] = None, 44 message: typing.Union[str, None] = None, 45 name: typing.Union[str, None] = None, 46 new_course_role: typing.Union[str, None] = None, 47 new_course: typing.Union[str, None] = None, 48 new_email: typing.Union[str, None] = None, 49 new_lms_id: typing.Union[str, None] = None, 50 new_name: typing.Union[str, None] = None, 51 new_pass: typing.Union[str, None] = None, 52 new_role: typing.Union[str, None] = None, 53 out_dir: typing.Union[str, None] = None, 54 output_format: typing.Union[lms.model.constants.OutputFormat, None] = None, 55 overwrite_records: typing.Union[bool, None] = None, 56 path: typing.Union[str, None] = None, 57 pretty_headers: typing.Union[bool, None] = None, 58 proxy_email: typing.Union[str, None] = None, 59 proxy_time: typing.Union[edq.util.time.Timestamp, None] = None, 60 query_after: typing.Union[edq.util.time.Timestamp, None] = None, 61 query_before: typing.Union[edq.util.time.Timestamp, None] = None, 62 query_level: typing.Union[str, None] = None, 63 query_limit: typing.Union[int, None] = None, 64 query_metric_type: typing.Union[str, None] = None, 65 query_past: typing.Union[str, None] = None, 66 query_sort: typing.Union[int, None] = None, 67 query_target_assignment: typing.Union[str, None] = None, 68 query_target_course: typing.Union[str, None] = None, 69 query_target_email: typing.Union[str, None] = None, 70 query_use_testing_data: typing.Union[bool, None] = None, 71 query_where: typing.Union[typing.Dict[str, str], None] = None, 72 raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 73 raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 74 regrade_cutoff: typing.Union[int, None] = None, 75 send_emails: typing.Union[bool, None] = None, 76 server: typing.Union[str, None] = None, 77 skip_build_images: typing.Union[bool, None] = None, 78 skip_emails: typing.Union[bool, None] = None, 79 skip_headers: typing.Union[bool, None] = None, 80 skip_inserts: typing.Union[bool, None] = None, 81 skip_lms_sync: typing.Union[bool, None] = None, 82 skip_rows: typing.Union[int, None] = None, 83 skip_source_sync: typing.Union[bool, None] = None, 84 skip_template_files: typing.Union[bool, None] = None, 85 skip_updates: typing.Union[bool, None] = None, 86 subject: typing.Union[str, None] = None, 87 submission_specs: typing.Union[typing.List[str], None] = None, 88 target_assignments: typing.Union[typing.List[str], None] = None, 89 target_email: typing.Union[str, None] = None, 90 target_owner: typing.Union[str, None] = None, 91 target_submission: typing.Union[str, None] = None, 92 target_users: typing.Union[typing.List[str], None] = None, 93 target_user: typing.Union[str, None] = None, 94 testing_mode: typing.Union[bool, None] = None, 95 token_id: typing.Union[str, None] = None, 96 to: typing.Union[typing.List[str], None] = None, 97 wait_for_completion: typing.Union[bool, None] = None, 98 **kwargs: typing.Any) -> None: 99 super().__init__(**kwargs) 100 101 self.active: typing.Union[bool, None] = active 102 """ Mark the course as active. """ 103 104 self.allow_late: typing.Union[bool, None] = allow_late 105 """ Allow this submission to be graded, even if it is late. """ 106 107 self.assignment: typing.Union[str, None] = assignment 108 """ The ID of the assignment to make this request to. """ 109 110 # Sidestep using the `pass` keyword. 111 if (auth_pass is None): 112 auth_pass = kwargs.get('pass', None) 113 114 self.auth_pass: typing.Union[edq.util.crypto.Secret, None] = auth_pass 115 """ The password of the user making this request. """ 116 117 if (auth_user is None): 118 auth_user = kwargs.get('user', None) 119 120 self.auth_user: typing.Union[str, None] = auth_user 121 """ The email of the user making this request. """ 122 123 self.bcc: typing.Union[typing.List[str], None] = bcc 124 """ A list of email addresses. Accepts course user references. """ 125 126 self.body: typing.Union[str, None] = body 127 """ The email body. """ 128 129 self.cc: typing.Union[typing.List[str], None] = cc 130 """ A list of email addresses. Accepts course user references. """ 131 132 self.clear: typing.Union[bool, None] = clear 133 """ Remove all course statuses the caller has permission to remove. """ 134 135 self.course: typing.Union[str, None] = course 136 """ The ID of the course to make this request to. """ 137 138 self.dry_run: typing.Union[bool, None] = dry_run 139 """ Do not commit/finalize the operation, just do all the steps and state what the result would look like. """ 140 141 self.filespec: typing.Union[autograder.filespec.FileSpec, None] = filespec 142 """ A filespec pointing to a course to upload. """ 143 144 self.filespec_path: typing.Union[str, None] = filespec_path 145 """ The path the filespec points to. """ 146 147 self.filespec_reference: typing.Union[str, None] = filespec_reference 148 """ The reference (e.g., git commit/branch) of the filespec. """ 149 150 self.filespec_token: typing.Union[str, None] = filespec_token 151 """ The token for filespec authentication. """ 152 153 self.filespec_type: typing.Union[str, None] = filespec_type 154 """ The type of filespec. """ 155 156 self.filespec_username: typing.Union[str, None] = filespec_username 157 """ The username for filespec authentication. """ 158 159 self.files: typing.Union[typing.List[str], None] = files 160 """ The path to your submission file(s). """ 161 162 self.force: typing.Union[bool, None] = force 163 """ Overwrite an existing course status set by the caller. """ 164 165 self.force_compute: typing.Union[bool, None] = force_compute 166 """ Force the server to compute the result, ignoring any existing cache. """ 167 168 self.email_html: typing.Union[bool, None] = email_html 169 """ Indicates the email body contains HTML. """ 170 171 self.include_extra_fields: typing.Union[bool, None] = include_extra_fields 172 """ Include non-common (usually LMS-specific) fields in results. """ 173 174 self.message: typing.Union[str, None] = message 175 """ An optional message to attach to the request. """ 176 177 self.name: typing.Union[str, None] = name 178 """ An optional name to use. """ 179 180 self.new_course_role: typing.Union[str, None] = new_course_role 181 """ The course role for the new user. """ 182 183 self.new_course: typing.Union[str, None] = new_course 184 """ An optional course to enroll the new user in """ 185 186 self.new_email: typing.Union[str, None] = new_email 187 """ The email for the new user. """ 188 189 self.new_lms_id: typing.Union[str, None] = new_lms_id 190 """ The LMS ID for the new user. """ 191 192 self.new_name: typing.Union[str, None] = new_name 193 """ The name for the new user. """ 194 195 self.new_pass: typing.Union[str, None] = new_pass 196 """ The new password. """ 197 198 self.new_role: typing.Union[str, None] = new_role 199 """ The server role for the new user. """ 200 201 self.out_dir: typing.Union[str, None] = out_dir 202 """ A directory to write output in. """ 203 204 self.output_format: typing.Union[lms.model.constants.OutputFormat, None] = output_format 205 """ The format to display the output as. """ 206 207 self.overwrite_records: typing.Union[bool, None] = overwrite_records 208 """ Replace any existing records that match the current operation (e.g. re-do existing results). """ 209 210 self.path: typing.Union[str, None] = path 211 """ The path to your course material. """ 212 213 self.pretty_headers: typing.Union[bool, None] = pretty_headers 214 """ When displaying headers, try to make them look "pretty". """ 215 216 self.proxy_email: typing.Union[str, None] = proxy_email 217 """ The email of the user the request is pretending to be made under (the submission will be made on behalf of this user). """ 218 219 self.proxy_time: typing.Union[edq.util.time.Timestamp, None] = proxy_time 220 """ The proxy timestamp that will be applied to the request. """ 221 222 self.query_after: typing.Union[edq.util.time.Timestamp, None] = query_after 223 """ If supplied, only return records after this timestamp. """ 224 225 self.query_before: typing.Union[edq.util.time.Timestamp, None] = query_before 226 """ If supplied, only return records before this timestamp. """ 227 228 self.query_level: typing.Union[str, None] = query_level 229 """ The minimum level of log records to return. """ 230 231 self.query_limit: typing.Union[int, None] = query_limit 232 """ The maximum number of records to return. """ 233 234 self.query_metric_type: typing.Union[str, None] = query_metric_type 235 """ The type of metric to query for. See: https://github.com/edulinq/autograder-server/blob/main/internal/stats/metrics.go#L29 """ 236 237 self.query_past: typing.Union[str, None] = query_past 238 """ If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s"). """ 239 240 self.query_sort: typing.Union[int, None] = query_sort 241 """ Sort the results. -1 for ascending, 0 for no sorting, 1 for descending. """ 242 243 self.query_target_assignment: typing.Union[str, None] = query_target_assignment 244 """ If supplied, only return records for this assignment. """ 245 246 self.query_target_course: typing.Union[str, None] = query_target_course 247 """ If supplied, only return records for this course. """ 248 249 self.query_target_email: typing.Union[str, None] = query_target_email 250 """ If supplied, only return records for this email. """ 251 252 self.query_use_testing_data: typing.Union[bool, None] = query_use_testing_data 253 """ Query from hard-coded testing data (instead of real data). """ 254 255 self.query_where: typing.Union[typing.Dict[str, str], None] = query_where 256 """ Only includes records with a patching key/value pair. """ 257 258 self.raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_course_users 259 """ Raw course users to operate on. """ 260 261 self.raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_server_users 262 """ Raw server users to operate on. """ 263 264 self.regrade_cutoff: typing.Union[int, None] = regrade_cutoff 265 """ All submissions occurring before the cutoff time will be regraded. """ 266 267 self.send_emails: typing.Union[bool, None] = send_emails 268 """ Send any relevant emails to users affected by this operation (e.g., a user being enrolled in a course). """ 269 270 self.server: typing.Union[str, None] = server 271 """ The URL of the autograder server to communicate with. """ 272 273 self.skip_build_images: typing.Union[bool, None] = skip_build_images 274 """ Skip building assignment Docker images. """ 275 276 self.skip_emails: typing.Union[bool, None] = skip_emails 277 """ Skip sending any emails. """ 278 279 self.skip_headers: typing.Union[bool, None] = skip_headers 280 """ Skip headers when outputting results, will not apply to all formats. """ 281 282 self.skip_inserts: typing.Union[bool, None] = skip_inserts 283 """ Skip insert operations. """ 284 285 self.skip_lms_sync: typing.Union[bool, None] = skip_lms_sync 286 """ Skip syncing with the LMS. """ 287 288 self.skip_rows: typing.Union[int, None] = skip_rows 289 """ The number of header rows to skip. """ 290 291 self.skip_source_sync: typing.Union[bool, None] = skip_source_sync 292 """ Skip syncing (updating with) the course source. """ 293 294 self.skip_template_files: typing.Union[bool, None] = skip_template_files 295 """ Skip fetching assignment template files. """ 296 297 self.skip_updates: typing.Union[bool, None] = skip_updates 298 """ Skip update operations. """ 299 300 self.subject: typing.Union[str, None] = subject 301 """ The email subject. """ 302 303 self.submission_specs: typing.Union[typing.List[str], None] = submission_specs 304 """ A list of submission specifications. """ 305 306 self.target_assignments: typing.Union[typing.List[str], None] = target_assignments 307 """ A list of assignment IDs. """ 308 309 self.target_email: typing.Union[str, None] = target_email 310 """ The email of the user that is the target of this request. """ 311 312 self.target_owner: typing.Union[str, None] = target_owner 313 """ The email of the course status owner that is the target of this request. """ 314 315 self.target_submission: typing.Union[str, None] = target_submission 316 """ The ID of the submission (default to the most recent submission). """ 317 318 self.target_users: typing.Union[typing.List[str], None] = target_users 319 """ A list of user references. """ 320 321 self.target_user: typing.Union[str, None] = target_user 322 """ The user that is the target of this request (defaults to you). """ 323 324 self.testing_mode: typing.Union[bool, None] = testing_mode 325 """ If we should run as if we are in a test. """ 326 327 self.token_id: typing.Union[str, None] = token_id 328 """ The id of the token to target. """ 329 330 self.to: typing.Union[typing.List[str], None] = to 331 """ A list of email addresses. """ 332 333 self.wait_for_completion: typing.Union[bool, None] = wait_for_completion 334 """ Wait for the full job to complete before returning. """
An application config for the autograder.
This config encompasses most of what will be read on the command-line and config files. This includes both more persistent options (like server, username, and password), and single command options like the target course or user. Config options not represented here should be available in edq.config.app.BaseApplicationConfig._extra.
21 def __init__(self, 22 active: typing.Union[bool, None] = None, 23 allow_late: typing.Union[bool, None] = None, 24 assignment: typing.Union[str, None] = None, 25 auth_pass: typing.Union[edq.util.crypto.Secret, None] = None, 26 auth_user: typing.Union[str, None] = None, 27 bcc: typing.Union[typing.List[str], None] = None, 28 body: typing.Union[str, None] = None, 29 cc: typing.Union[typing.List[str], None] = None, 30 clear: typing.Union[bool, None] = None, 31 course: typing.Union[str, None] = None, 32 dry_run: typing.Union[bool, None] = None, 33 filespec: typing.Union[autograder.filespec.FileSpec, None] = None, 34 filespec_path: typing.Union[str, None] = None, 35 filespec_reference: typing.Union[str, None] = None, 36 filespec_token: typing.Union[str, None] = None, 37 filespec_type: typing.Union[str, None] = None, 38 filespec_username: typing.Union[str, None] = None, 39 files: typing.Union[typing.List[str], None] = None, 40 force: typing.Union[bool, None] = None, 41 force_compute: typing.Union[bool, None] = None, 42 email_html: typing.Union[bool, None] = None, 43 include_extra_fields: typing.Union[bool, None] = None, 44 message: typing.Union[str, None] = None, 45 name: typing.Union[str, None] = None, 46 new_course_role: typing.Union[str, None] = None, 47 new_course: typing.Union[str, None] = None, 48 new_email: typing.Union[str, None] = None, 49 new_lms_id: typing.Union[str, None] = None, 50 new_name: typing.Union[str, None] = None, 51 new_pass: typing.Union[str, None] = None, 52 new_role: typing.Union[str, None] = None, 53 out_dir: typing.Union[str, None] = None, 54 output_format: typing.Union[lms.model.constants.OutputFormat, None] = None, 55 overwrite_records: typing.Union[bool, None] = None, 56 path: typing.Union[str, None] = None, 57 pretty_headers: typing.Union[bool, None] = None, 58 proxy_email: typing.Union[str, None] = None, 59 proxy_time: typing.Union[edq.util.time.Timestamp, None] = None, 60 query_after: typing.Union[edq.util.time.Timestamp, None] = None, 61 query_before: typing.Union[edq.util.time.Timestamp, None] = None, 62 query_level: typing.Union[str, None] = None, 63 query_limit: typing.Union[int, None] = None, 64 query_metric_type: typing.Union[str, None] = None, 65 query_past: typing.Union[str, None] = None, 66 query_sort: typing.Union[int, None] = None, 67 query_target_assignment: typing.Union[str, None] = None, 68 query_target_course: typing.Union[str, None] = None, 69 query_target_email: typing.Union[str, None] = None, 70 query_use_testing_data: typing.Union[bool, None] = None, 71 query_where: typing.Union[typing.Dict[str, str], None] = None, 72 raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 73 raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = None, 74 regrade_cutoff: typing.Union[int, None] = None, 75 send_emails: typing.Union[bool, None] = None, 76 server: typing.Union[str, None] = None, 77 skip_build_images: typing.Union[bool, None] = None, 78 skip_emails: typing.Union[bool, None] = None, 79 skip_headers: typing.Union[bool, None] = None, 80 skip_inserts: typing.Union[bool, None] = None, 81 skip_lms_sync: typing.Union[bool, None] = None, 82 skip_rows: typing.Union[int, None] = None, 83 skip_source_sync: typing.Union[bool, None] = None, 84 skip_template_files: typing.Union[bool, None] = None, 85 skip_updates: typing.Union[bool, None] = None, 86 subject: typing.Union[str, None] = None, 87 submission_specs: typing.Union[typing.List[str], None] = None, 88 target_assignments: typing.Union[typing.List[str], None] = None, 89 target_email: typing.Union[str, None] = None, 90 target_owner: typing.Union[str, None] = None, 91 target_submission: typing.Union[str, None] = None, 92 target_users: typing.Union[typing.List[str], None] = None, 93 target_user: typing.Union[str, None] = None, 94 testing_mode: typing.Union[bool, None] = None, 95 token_id: typing.Union[str, None] = None, 96 to: typing.Union[typing.List[str], None] = None, 97 wait_for_completion: typing.Union[bool, None] = None, 98 **kwargs: typing.Any) -> None: 99 super().__init__(**kwargs) 100 101 self.active: typing.Union[bool, None] = active 102 """ Mark the course as active. """ 103 104 self.allow_late: typing.Union[bool, None] = allow_late 105 """ Allow this submission to be graded, even if it is late. """ 106 107 self.assignment: typing.Union[str, None] = assignment 108 """ The ID of the assignment to make this request to. """ 109 110 # Sidestep using the `pass` keyword. 111 if (auth_pass is None): 112 auth_pass = kwargs.get('pass', None) 113 114 self.auth_pass: typing.Union[edq.util.crypto.Secret, None] = auth_pass 115 """ The password of the user making this request. """ 116 117 if (auth_user is None): 118 auth_user = kwargs.get('user', None) 119 120 self.auth_user: typing.Union[str, None] = auth_user 121 """ The email of the user making this request. """ 122 123 self.bcc: typing.Union[typing.List[str], None] = bcc 124 """ A list of email addresses. Accepts course user references. """ 125 126 self.body: typing.Union[str, None] = body 127 """ The email body. """ 128 129 self.cc: typing.Union[typing.List[str], None] = cc 130 """ A list of email addresses. Accepts course user references. """ 131 132 self.clear: typing.Union[bool, None] = clear 133 """ Remove all course statuses the caller has permission to remove. """ 134 135 self.course: typing.Union[str, None] = course 136 """ The ID of the course to make this request to. """ 137 138 self.dry_run: typing.Union[bool, None] = dry_run 139 """ Do not commit/finalize the operation, just do all the steps and state what the result would look like. """ 140 141 self.filespec: typing.Union[autograder.filespec.FileSpec, None] = filespec 142 """ A filespec pointing to a course to upload. """ 143 144 self.filespec_path: typing.Union[str, None] = filespec_path 145 """ The path the filespec points to. """ 146 147 self.filespec_reference: typing.Union[str, None] = filespec_reference 148 """ The reference (e.g., git commit/branch) of the filespec. """ 149 150 self.filespec_token: typing.Union[str, None] = filespec_token 151 """ The token for filespec authentication. """ 152 153 self.filespec_type: typing.Union[str, None] = filespec_type 154 """ The type of filespec. """ 155 156 self.filespec_username: typing.Union[str, None] = filespec_username 157 """ The username for filespec authentication. """ 158 159 self.files: typing.Union[typing.List[str], None] = files 160 """ The path to your submission file(s). """ 161 162 self.force: typing.Union[bool, None] = force 163 """ Overwrite an existing course status set by the caller. """ 164 165 self.force_compute: typing.Union[bool, None] = force_compute 166 """ Force the server to compute the result, ignoring any existing cache. """ 167 168 self.email_html: typing.Union[bool, None] = email_html 169 """ Indicates the email body contains HTML. """ 170 171 self.include_extra_fields: typing.Union[bool, None] = include_extra_fields 172 """ Include non-common (usually LMS-specific) fields in results. """ 173 174 self.message: typing.Union[str, None] = message 175 """ An optional message to attach to the request. """ 176 177 self.name: typing.Union[str, None] = name 178 """ An optional name to use. """ 179 180 self.new_course_role: typing.Union[str, None] = new_course_role 181 """ The course role for the new user. """ 182 183 self.new_course: typing.Union[str, None] = new_course 184 """ An optional course to enroll the new user in """ 185 186 self.new_email: typing.Union[str, None] = new_email 187 """ The email for the new user. """ 188 189 self.new_lms_id: typing.Union[str, None] = new_lms_id 190 """ The LMS ID for the new user. """ 191 192 self.new_name: typing.Union[str, None] = new_name 193 """ The name for the new user. """ 194 195 self.new_pass: typing.Union[str, None] = new_pass 196 """ The new password. """ 197 198 self.new_role: typing.Union[str, None] = new_role 199 """ The server role for the new user. """ 200 201 self.out_dir: typing.Union[str, None] = out_dir 202 """ A directory to write output in. """ 203 204 self.output_format: typing.Union[lms.model.constants.OutputFormat, None] = output_format 205 """ The format to display the output as. """ 206 207 self.overwrite_records: typing.Union[bool, None] = overwrite_records 208 """ Replace any existing records that match the current operation (e.g. re-do existing results). """ 209 210 self.path: typing.Union[str, None] = path 211 """ The path to your course material. """ 212 213 self.pretty_headers: typing.Union[bool, None] = pretty_headers 214 """ When displaying headers, try to make them look "pretty". """ 215 216 self.proxy_email: typing.Union[str, None] = proxy_email 217 """ The email of the user the request is pretending to be made under (the submission will be made on behalf of this user). """ 218 219 self.proxy_time: typing.Union[edq.util.time.Timestamp, None] = proxy_time 220 """ The proxy timestamp that will be applied to the request. """ 221 222 self.query_after: typing.Union[edq.util.time.Timestamp, None] = query_after 223 """ If supplied, only return records after this timestamp. """ 224 225 self.query_before: typing.Union[edq.util.time.Timestamp, None] = query_before 226 """ If supplied, only return records before this timestamp. """ 227 228 self.query_level: typing.Union[str, None] = query_level 229 """ The minimum level of log records to return. """ 230 231 self.query_limit: typing.Union[int, None] = query_limit 232 """ The maximum number of records to return. """ 233 234 self.query_metric_type: typing.Union[str, None] = query_metric_type 235 """ The type of metric to query for. See: https://github.com/edulinq/autograder-server/blob/main/internal/stats/metrics.go#L29 """ 236 237 self.query_past: typing.Union[str, None] = query_past 238 """ If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s"). """ 239 240 self.query_sort: typing.Union[int, None] = query_sort 241 """ Sort the results. -1 for ascending, 0 for no sorting, 1 for descending. """ 242 243 self.query_target_assignment: typing.Union[str, None] = query_target_assignment 244 """ If supplied, only return records for this assignment. """ 245 246 self.query_target_course: typing.Union[str, None] = query_target_course 247 """ If supplied, only return records for this course. """ 248 249 self.query_target_email: typing.Union[str, None] = query_target_email 250 """ If supplied, only return records for this email. """ 251 252 self.query_use_testing_data: typing.Union[bool, None] = query_use_testing_data 253 """ Query from hard-coded testing data (instead of real data). """ 254 255 self.query_where: typing.Union[typing.Dict[str, str], None] = query_where 256 """ Only includes records with a patching key/value pair. """ 257 258 self.raw_course_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_course_users 259 """ Raw course users to operate on. """ 260 261 self.raw_server_users: typing.Union[typing.List[typing.Dict[str, typing.Any]], None] = raw_server_users 262 """ Raw server users to operate on. """ 263 264 self.regrade_cutoff: typing.Union[int, None] = regrade_cutoff 265 """ All submissions occurring before the cutoff time will be regraded. """ 266 267 self.send_emails: typing.Union[bool, None] = send_emails 268 """ Send any relevant emails to users affected by this operation (e.g., a user being enrolled in a course). """ 269 270 self.server: typing.Union[str, None] = server 271 """ The URL of the autograder server to communicate with. """ 272 273 self.skip_build_images: typing.Union[bool, None] = skip_build_images 274 """ Skip building assignment Docker images. """ 275 276 self.skip_emails: typing.Union[bool, None] = skip_emails 277 """ Skip sending any emails. """ 278 279 self.skip_headers: typing.Union[bool, None] = skip_headers 280 """ Skip headers when outputting results, will not apply to all formats. """ 281 282 self.skip_inserts: typing.Union[bool, None] = skip_inserts 283 """ Skip insert operations. """ 284 285 self.skip_lms_sync: typing.Union[bool, None] = skip_lms_sync 286 """ Skip syncing with the LMS. """ 287 288 self.skip_rows: typing.Union[int, None] = skip_rows 289 """ The number of header rows to skip. """ 290 291 self.skip_source_sync: typing.Union[bool, None] = skip_source_sync 292 """ Skip syncing (updating with) the course source. """ 293 294 self.skip_template_files: typing.Union[bool, None] = skip_template_files 295 """ Skip fetching assignment template files. """ 296 297 self.skip_updates: typing.Union[bool, None] = skip_updates 298 """ Skip update operations. """ 299 300 self.subject: typing.Union[str, None] = subject 301 """ The email subject. """ 302 303 self.submission_specs: typing.Union[typing.List[str], None] = submission_specs 304 """ A list of submission specifications. """ 305 306 self.target_assignments: typing.Union[typing.List[str], None] = target_assignments 307 """ A list of assignment IDs. """ 308 309 self.target_email: typing.Union[str, None] = target_email 310 """ The email of the user that is the target of this request. """ 311 312 self.target_owner: typing.Union[str, None] = target_owner 313 """ The email of the course status owner that is the target of this request. """ 314 315 self.target_submission: typing.Union[str, None] = target_submission 316 """ The ID of the submission (default to the most recent submission). """ 317 318 self.target_users: typing.Union[typing.List[str], None] = target_users 319 """ A list of user references. """ 320 321 self.target_user: typing.Union[str, None] = target_user 322 """ The user that is the target of this request (defaults to you). """ 323 324 self.testing_mode: typing.Union[bool, None] = testing_mode 325 """ If we should run as if we are in a test. """ 326 327 self.token_id: typing.Union[str, None] = token_id 328 """ The id of the token to target. """ 329 330 self.to: typing.Union[typing.List[str], None] = to 331 """ A list of email addresses. """ 332 333 self.wait_for_completion: typing.Union[bool, None] = wait_for_completion 334 """ Wait for the full job to complete before returning. """
Do not commit/finalize the operation, just do all the steps and state what the result would look like.
Replace any existing records that match the current operation (e.g. re-do existing results).
The email of the user the request is pretending to be made under (the submission will be made on behalf of this user).
The proxy timestamp that will be applied to the request.
If supplied, only return records after this timestamp.
If supplied, only return records before this timestamp.
The type of metric to query for. See: https://github.com/edulinq/autograder-server/blob/main/internal/stats/metrics.go#L29
If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s").
Send any relevant emails to users affected by this operation (e.g., a user being enrolled in a course).