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