<commit_before>from django.db import models
import datetime

class GraderStatus():
    failure="F"
    success="S"

class SubmissionState():
    being_graded="C"
    waiting_to_be_graded="W"
    finished="F"

GRADER_TYPE = (
    ('ML', 'ML'),
    ('IN', 'Instructor'),
    ('PE', 'Peer'),
    ('SE', 'Self'),
    ('NA', 'None'),
    )

STATUS_CODES = (
    (GraderStatus.success, "Success"),
    (GraderStatus.failure, "Failure"),
    )

STATE_CODES = (
    (SubmissionState.being_graded, "Currently being Graded"),
    (SubmissionState.waiting_to_be_graded, "Waiting to be Graded"),
    (SubmissionState.finished, "Finished" )
    )

CHARFIELD_LEN_SMALL = 128

class Submission(models.Model):
    # controller state
    next_grader_type = models.CharField(max_length=2, choices=GRADER_TYPE, default="NA")
    previous_grader_type = models.CharField(max_length=2, choices=GRADER_TYPE, default="NA")
    state = models.CharField(max_length=1, choices=STATE_CODES)
    grader_settings = models.TextField(default="")

    # data about the submission
    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField(auto_now=True)
    prompt = models.TextField(default="")
    rubric = models.TextField(default="")
    student_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)

    # specified in the input type--can be reused between many different
    # problems.  (Should perhaps be named something like problem_type)
    problem_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)

    # passed by the LMS
    location = models.CharField(max_length=CHARFIELD_LEN_SMALL, default="")
    max_score = models.IntegerField(default=1)
    course_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)
    student_response = models.TextField(default="")<commit_msg>comments from Dave<commit_after>from django.db import models
import datetime

class GraderStatus():
    failure="F"
    success="S"

class SubmissionState():
    being_graded="C"
    waiting_to_be_graded="W"
    finished="F"

GRADER_TYPE = (
    ('ML', 'ML'),
    ('IN', 'Instructor'),
    ('PE', 'Peer'),
    ('SE', 'Self'),
    ('NA', 'None'),
    )

STATUS_CODES = (
    (GraderStatus.success, "Success"),
    (GraderStatus.failure, "Failure"),
    )

STATE_CODES = (
    (SubmissionState.being_graded, "Currently being Graded"),
    (SubmissionState.waiting_to_be_graded, "Waiting to be Graded"),
    (SubmissionState.finished, "Finished" )
    )

CHARFIELD_LEN_SMALL = 128

# TODO: DB settings -- utf-8, innodb, store everything in UTC

class Submission(models.Model):
    # controller state
    next_grader_type = models.CharField(max_length=2, choices=GRADER_TYPE, default="NA")
    previous_grader_type = models.CharField(max_length=2, choices=GRADER_TYPE, default="NA")
    state = models.CharField(max_length=1, choices=STATE_CODES)
    grader_settings = models.TextField(default="")

    # data about the submission
    date_created = models.DateTimeField(auto_now_add=True)
    date_modified = models.DateTimeField(auto_now=True)
    prompt = models.TextField(default="")
    rubric = models.TextField(default="")
    # TODO: is this good enough?  unique per problem/student?
    student_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)

    # specified in the input type--can be reused between many different
    # problems.  (Should perhaps be named something like problem_type)
    problem_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)

    # passed by the LMS
    location = models.CharField(max_length=CHARFIELD_LEN_SMALL, default="")
    max_score = models.IntegerField(default=1)
    course_id = models.CharField(max_length=CHARFIELD_LEN_SMALL)
    student_response = models.TextField(default="")
{'fraction_non_alphanumeric': 0.12077294685990338, 'fraction_numerical': 0.004025764895330112, 'mean_word_length': 4.521481481481482, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6232843', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1200, 'n_words': 236}