Submission¶
Qualified name: tin.apps.submissions.models.Submission
- class Submission(*args, **kwargs)[source]¶
Bases:
Model
A single submission for an assignment.
- Parameters:
id (BigAutoField) – Primary key: ID
date_submitted (DateTimeField) – Date submitted
last_run (DateTimeField) – Last run
has_been_graded (BooleanField) – Has been graded
complete (BooleanField) – Complete
kill_requested (BooleanField) – Kill requested
grader_pid (IntegerField) – Grader pid
grader_start_time (FloatField) – Grader start time
points_received (DecimalField) – Points received
file (FileField) – File
grader_output (CharField) – Grader output
grader_errors (CharField) – Grader errors
Relationship fields:
- Parameters:
assignment (
ForeignKey
toAssignment
) – Assignment (related name:submissions
)student (
ForeignKey
toUser
) – Student (related name:submissions
)
Reverse relationships:
- Parameters:
final_submission (Reverse
OneToOneField
fromPublishedSubmission
) – The final submission of this submission (related name ofsubmission
)comments (Reverse
ForeignKey
fromComment
) – All comments of this submission (related name ofsubmission
)
Methods
Create a backup copy of the student's code submission
get_absolute_url
get_next_by_date_submitted
Finds next instance based on
date_submitted
.get_previous_by_date_submitted
Finds previous instance based on
date_submitted
.publish
rerun
Save the student's code submission to a file
Unpublish a submission
Attributes
assignment
Type:
ForeignKey
toAssignment
assignment_id
Internal field, use
assignment
instead.backup_file_path
channel_group_name
comments
Type: Reverse
ForeignKey
fromComment
complete
Type:
BooleanField
date_submitted
Type:
DateTimeField
file
Type:
FileField
file_header
file_path
file_text
file_text_with_header
final_submission
Type: Reverse
OneToOneField
fromPublishedSubmission
formatted_grade
grade_percent
grade_percent_num
grader_errors
Type:
CharField
grader_output
Type:
CharField
grader_pid
Type:
IntegerField
grader_start_time
Type:
FloatField
has_been_graded
Type:
BooleanField
id
Type:
BigAutoField
is_latest
is_latest_publish
is_on_time
is_published
kill_requested
Type:
BooleanField
last_run
Type:
DateTimeField
objects
point_override
points
points_possible
points_received
Type:
DecimalField
published_submission
rerun_color
student
Type:
ForeignKey
toUser
student_id
Internal field, use
student
instead.wrapper_file_path
- exception DoesNotExist¶
Bases:
ObjectDoesNotExist
- exception MultipleObjectsReturned¶
Bases:
MultipleObjectsReturned
- create_backup_copy(submission_text: str) None [source]¶
Create a backup copy of the student’s code submission
- save_file(submission_text: str) None [source]¶
Save the student’s code submission to a file
Warning
Writing to files in directories not controlled by us without some form of sandboxing is a security risk. Most notably, users can use symbolic links to trick you into writing to another file, outside the directory. This solution is very hacky, but we don’t have another good way of doing this.