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

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

Allow this submission to be graded, even if it is late.

assignment: Optional[str]

The ID of the assignment to make this request to.

auth_pass: Optional[edq.util.crypto.Secret]

The password of the user making this request.

auth_user: Optional[str]

The email of the user making this request.

bcc: Optional[List[str]]

A list of email addresses. Accepts course user references.

body: Optional[str]

The email body.

cc: Optional[List[str]]

A list of email addresses. Accepts course user references.

course: Optional[str]

The ID of the course to make this request to.

dry_run: Optional[bool]

Do not commit/finalize the operation, just do all the steps and state what the result would look like.

filespec: Optional[autograder.filespec.FileSpec]

A filespec pointing to a course to upload.

filespec_path: Optional[str]

The path the filespec points to.

filespec_reference: Optional[str]

The reference (e.g., git commit/branch) of the filespec.

filespec_token: Optional[str]

The token for filespec authentication.

filespec_type: Optional[str]

The type of filespec.

filespec_username: Optional[str]

The username for filespec authentication.

files: Optional[List[str]]

The path to your submission file(s).

force_compute: Optional[bool]

Force the server to compute the result, ignoring any existing cache.

email_html: Optional[bool]

Indicates the email body contains HTML.

include_extra_fields: Optional[bool]

Include non-common (usually LMS-specific) fields in results.

message: Optional[str]

An optional message to attach to the submission.

name: Optional[str]

An optional name to use.

new_course_role: Optional[str]

The course role for the new user.

new_course: Optional[str]

An optional course to enroll the new user in

new_email: Optional[str]

The email for the new user.

new_lms_id: Optional[str]

The LMS ID for the new user.

new_name: Optional[str]

The name for the new user.

new_pass: Optional[str]

The new password.

new_role: Optional[str]

The server role for the new user.

out_dir: Optional[str]

A directory to write output in.

output_format: Optional[lms.model.constants.OutputFormat]

The format to display the output as.

overwrite_records: Optional[bool]

Replace any existing records that match the current operation (e.g. re-do existing results).

path: Optional[str]

The path to your course material.

pretty_headers: Optional[bool]

When displaying headers, try to make them look "pretty".

proxy_email: Optional[str]

The email of the user the request is pretending to be made under (the submission will be made on behalf of this user).

proxy_time: Optional[edq.util.time.Timestamp]

The proxy timestamp that will be applied to the request.

query_after: Optional[edq.util.time.Timestamp]

If supplied, only return records after this timestamp.

query_before: Optional[edq.util.time.Timestamp]

If supplied, only return records before this timestamp.

query_level: Optional[str]

The minimum level of log records to return.

query_limit: Optional[int]

The maximum number of records to return.

query_metric_type: Optional[str]
query_past: Optional[str]

If supplied, only return log records in this duration (using "h", "m", or "s" suffixes) (e.g., "24h", "10m", or "1h10m10s").

query_sort: Optional[int]

Sort the results. -1 for ascending, 0 for no sorting, 1 for descending.

query_target_assignment: Optional[str]

If supplied, only return records for this assignment.

query_target_course: Optional[str]

If supplied, only return records for this course.

query_target_email: Optional[str]

If supplied, only return records for this email.

query_use_testing_data: Optional[bool]

Query from hard-coded testing data (instead of real data).

query_where: Optional[Dict[str, str]]

Only includes records with a patching key/value pair.

raw_course_users: Optional[List[Dict[str, Any]]]

Raw course users to operate on.

raw_server_users: Optional[List[Dict[str, Any]]]

Raw server users to operate on.

regrade_cutoff: Optional[int]

All submissions occurring before the cutoff time will be regraded.

send_emails: Optional[bool]

Send any relevant emails to users affected by this operation (e.g., a user being enrolled in a course).

server: Optional[str]

The URL of the autograder server to communicate with.

skip_build_images: Optional[bool]

Skip building assignment Docker images.

skip_emails: Optional[bool]

Skip sending any emails.

skip_headers: Optional[bool]

Skip headers when outputting results, will not apply to all formats.

skip_inserts: Optional[bool]

Skip insert operations.

skip_lms_sync: Optional[bool]

Skip syncing with the LMS.

skip_rows: Optional[int]

The number of header rows to skip.

skip_source_sync: Optional[bool]

Skip syncing (updating with) the course source.

skip_template_files: Optional[bool]

Skip fetching assignment template files.

skip_updates: Optional[bool]

Skip update operations.

subject: Optional[str]

The email subject.

submission_specs: Optional[List[str]]

A list of submission specifications.

target_assignments: Optional[List[str]]

A list of assignment IDs.

target_email: Optional[str]

The email of the user that is the target of this request.

target_submission: Optional[str]

The ID of the submission (default to the most recent submission).

target_users: Optional[List[str]]

A list of user references.

target_user: Optional[str]

The user that is the target of this request (defaults to you).

testing_mode: Optional[bool]

If we should run as if we are in a test.

token_id: Optional[str]

The id of the token to target.

to: Optional[List[str]]

A list of email addresses.

wait_for_completion: Optional[bool]

Wait for the full job to complete before returning.