Ejemplo n.º 1
0
    model_solution = models.ForeignKey(ModelSolution, on_delete=models.CASCADE)


submission_statuses.register('CE', _("Compilation failed"))
submission_statuses.register('RE', _("Runtime error"))
submission_statuses.register('WA', _("Wrong answer"))
submission_statuses.register('TLE', _("Time limit exceeded"))
submission_statuses.register('MLE', _("Memory limit exceeded"))
submission_statuses.register('OLE', _("Output limit exceeded"))
submission_statuses.register('SE', _("System error"))
submission_statuses.register('RV', _("Rule violation"))

submission_statuses.register('INI_OK', _("Initial tests: OK"))
submission_statuses.register('INI_ERR', _("Initial tests: failed"))

submission_kinds.register('USER_OUTS', _("Generate user out"))

submission_report_kinds.register('INITIAL', _("Initial report"))
submission_report_kinds.register('NORMAL', _("Normal report"))
submission_report_kinds.register('FULL', _("Full report"))
submission_report_kinds.register('HIDDEN',
                                 _("Hidden report (for admins only)"))
submission_report_kinds.register('USER_OUTS', _("Report with user out"))


class CompilationReport(models.Model):
    submission_report = models.ForeignKey(SubmissionReport,
                                          on_delete=models.CASCADE)
    status = EnumField(submission_statuses)
    compiler_output = models.TextField()
Ejemplo n.º 2
0
from nose.tools import nottest
from django.conf import settings
from django.db import models
from oioioi.contests.models import submission_kinds, SubmissionReport, \
    submission_statuses, submission_report_kinds
from django.utils.translation import ugettext_lazy as _
from oioioi.programs.models import ProgramSubmission
from oioioi.filetracker.fields import FileField
from oioioi.base.fields import EnumField
from oioioi.problems.models import Problem, ProblemInstance

submission_statuses.register('TESTRUN_OK', _("No error"))
submission_kinds.register('TESTRUN', _("Test run"))
submission_report_kinds.register('TESTRUN', _("Test run report"))


@nottest
class TestRunConfig(models.Model):
    """Represents a test run config for problem.

       Test run for program is enabled iff this model exits.
    """
    problem = models.OneToOneField(Problem,
                        verbose_name=_("problem"),
                        related_name='test_run_config')

    time_limit = models.IntegerField(verbose_name=_("time limit (ms)"),
            null=True, blank=True)
    memory_limit = models.IntegerField(verbose_name=_("memory limit (KiB)"),
            null=True, blank=True)
Ejemplo n.º 3
0
class ModelProgramSubmission(ProgramSubmission):
    model_solution = models.ForeignKey(ModelSolution, on_delete=models.CASCADE)

submission_statuses.register('CE', _("Compilation failed"))
submission_statuses.register('RE', _("Runtime error"))
submission_statuses.register('WA', _("Wrong answer"))
submission_statuses.register('TLE', _("Time limit exceeded"))
submission_statuses.register('MLE', _("Memory limit exceeded"))
submission_statuses.register('OLE', _("Output limit exceeded"))
submission_statuses.register('SE', _("System error"))
submission_statuses.register('RV', _("Rule violation"))

submission_statuses.register('INI_OK', _("Initial tests: OK"))
submission_statuses.register('INI_ERR', _("Initial tests: failed"))

submission_kinds.register('USER_OUTS', _("Generate user out"))

submission_report_kinds.register('INITIAL', _("Initial report"))
submission_report_kinds.register('NORMAL', _("Normal report"))
submission_report_kinds.register('FULL', _("Full report"))
submission_report_kinds.register('HIDDEN',
                                 _("Hidden report (for admins only)"))
submission_report_kinds.register('USER_OUTS', _("Report with user out"))


class CompilationReport(models.Model):
    submission_report = models.ForeignKey(SubmissionReport,
                                          on_delete=models.CASCADE)
    status = EnumField(submission_statuses)
    compiler_output = models.TextField()
Ejemplo n.º 4
0
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _

from oioioi.base.fields import EnumField
from oioioi.contests.models import (SubmissionReport, submission_kinds,
                                    submission_report_kinds,
                                    submission_statuses)
from oioioi.filetracker.fields import FileField
from oioioi.problems.models import Problem, ProblemInstance
from oioioi.programs.models import ProgramSubmission

submission_statuses.register('TESTRUN_OK', _("No error"))
submission_kinds.register('TESTRUN', _("Test run"))
submission_report_kinds.register('TESTRUN', _("Test run report"))


class TestRunConfig(models.Model):
    """Represents a test run config for problem.

       Test run for program is enabled iff this model exits.
    """
    __test__ = False
    problem = models.OneToOneField(Problem,
                                   verbose_name=_("problem"),
                                   related_name='test_run_config',
                                   on_delete=models.CASCADE)

    time_limit = models.IntegerField(verbose_name=_("time limit (ms)"),
            null=True, blank=True)
    memory_limit = models.IntegerField(verbose_name=_("memory limit (KiB)"),
Ejemplo n.º 5
0
from nose.tools import nottest
from django.db import models
from oioioi.contests.models import submission_kinds, SubmissionReport, submission_statuses, submission_report_kinds
from django.utils.translation import ugettext_lazy as _
from oioioi.programs.models import ProgramSubmission
from oioioi.filetracker.fields import FileField
from oioioi.base.fields import EnumField
from oioioi.problems.models import Problem

submission_statuses.register("TESTRUN_OK", _("No error"))
submission_kinds.register("TESTRUN", _("Test run"))
submission_report_kinds.register("TESTRUN", _("Test run report"))


@nottest
class TestRunConfig(models.Model):
    """Represents a test run config for problem.

       Test run for program is enabled iff this model exits.
    """

    problem = models.OneToOneField(Problem, verbose_name=_("problem"), related_name="test_run_config")

    time_limit = models.IntegerField(verbose_name=_("time limit (ms)"), null=True, blank=True)
    memory_limit = models.IntegerField(verbose_name=_("memory limit (KiB)"), null=True, blank=True)

    class Meta(object):
        verbose_name = _("test run config")
        verbose_name_plural = _("test run configs")