Submission

Qualified name: tin.apps.submissions.models.Submission

class Submission(*args, **kwargs)[source]

Bases: Model

A single submission for an assignment.

Parameters:

Relationship fields:

Parameters:

Reverse relationships:

Parameters:
  • final_submission (Reverse OneToOneField from PublishedSubmission) – The final submission of this submission (related name of submission)

  • comments (Reverse ForeignKey from Comment) – All comments of this submission (related name of submission)

Methods

create_backup_copy

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_file

Save the student's code submission to a file

unpublish

Unpublish a submission

Attributes

assignment

Type: ForeignKey to Assignment

assignment_id

Internal field, use assignment instead.

backup_file_path

channel_group_name

comments

Type: Reverse ForeignKey from Comment

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 from PublishedSubmission

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 to User

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.

unpublish()[source]

Unpublish a submission