diff --git a/README.md b/README.md index 27e0eb7..9276597 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [PDP: Programming and Discussion Portal](https://github.com/vbsinha/pdp-judge) +# [autojudge: An Online Judge for Coding contests](https://github.com/vbsinha/pdp-judge) [![CircleCI](https://circleci.com/gh/vbsinha/pdp-judge.svg?style=svg&circle-token=779cf1772a65883845be7ded61285e17a63141de)](https://circleci.com/gh/vbsinha/pdp-judge) diff --git a/pdpjudge/__init__.py b/autojudge/__init__.py similarity index 100% rename from pdpjudge/__init__.py rename to autojudge/__init__.py diff --git a/pdpjudge/settings.py b/autojudge/settings.py similarity index 97% rename from pdpjudge/settings.py rename to autojudge/settings.py index 219167a..2aeaf45 100644 --- a/pdpjudge/settings.py +++ b/autojudge/settings.py @@ -1,5 +1,5 @@ """ -Django settings for pdpjudge project. +Django settings for autojudge project. Generated by 'django-admin startproject' using Django 2.2. @@ -57,7 +57,7 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -ROOT_URLCONF = 'pdpjudge.urls' +ROOT_URLCONF = 'autojudge.urls' TEMPLATES = [ { @@ -77,7 +77,7 @@ }, ] -WSGI_APPLICATION = 'pdpjudge.wsgi.application' +WSGI_APPLICATION = 'autojudge.wsgi.application' # Database diff --git a/pdpjudge/urls.py b/autojudge/urls.py similarity index 96% rename from pdpjudge/urls.py rename to autojudge/urls.py index 7dbca96..84cb4a2 100644 --- a/pdpjudge/urls.py +++ b/autojudge/urls.py @@ -1,4 +1,4 @@ -"""pdpjudge URL Configuration +"""autojudge URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.2/topics/http/urls/ diff --git a/pdpjudge/wsgi.py b/autojudge/wsgi.py similarity index 73% rename from pdpjudge/wsgi.py rename to autojudge/wsgi.py index b795b8e..b25d1ae 100644 --- a/pdpjudge/wsgi.py +++ b/autojudge/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for pdpjudge project. +WSGI config for autojudge project. It exposes the WSGI callable as a module-level variable named ``application``. @@ -11,6 +11,6 @@ from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pdpjudge.settings') +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'autojudge.settings') application = get_wsgi_application() diff --git a/docs/source/conf.py b/docs/source/conf.py index d9ea1eb..951cc69 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -8,7 +8,7 @@ sys.path.insert(0, os.path.abspath('../..')) -os.environ["DJANGO_SETTINGS_MODULE"] = "pdpjudge.settings" +os.environ["DJANGO_SETTINGS_MODULE"] = "autojudge.settings" django.setup() # -- Project information ----------------------------------------------------- diff --git a/judge/admin.py b/judge/admin.py index bcefe22..f97f214 100644 --- a/judge/admin.py +++ b/judge/admin.py @@ -1,9 +1,8 @@ from django.contrib import admin # Register your models here. -from .models import Contest, Problem, Person -from .models import Submission, ContestPerson, TestCase, SubmissionTestCase, Comment -from .models import PersonProblemFinalScore +from .models import Contest, Problem, Person, Submission, TestCase, Comment +from .models import ContestPerson, SubmissionTestCase, PersonProblemFinalScore class ContestAdmin(admin.ModelAdmin): @@ -14,8 +13,8 @@ class ContestAdmin(admin.ModelAdmin): admin.site.register(Problem) admin.site.register(Person) admin.site.register(Submission) -admin.site.register(ContestPerson) admin.site.register(TestCase) -admin.site.register(SubmissionTestCase) admin.site.register(Comment) +admin.site.register(ContestPerson) +admin.site.register(SubmissionTestCase) admin.site.register(PersonProblemFinalScore) diff --git a/judge/handler.py b/judge/handler.py index 4985ba2..e2471b0 100644 --- a/judge/handler.py +++ b/judge/handler.py @@ -340,9 +340,9 @@ def update_poster_score(submission_id: str, new_score: int): """ try: submission = models.Submission.objects.get(pk=submission_id) - submission.final_score -= submission.ta_score - submission.ta_score = new_score - submission.final_score += submission.ta_score + submission.final_score -= submission.poster_score + submission.poster_score = new_score + submission.final_score += submission.poster_score submission.save() highest_scoring_submission = models.Submission.objects.filter( @@ -627,7 +627,8 @@ def get_submission_status(person: str, problem: str, submission): Second dictionary: Key: Submission ID - Value: :code:`(judge_score, ta_score, linter_score, final_score, timestamp, file_type)` + Value: :code:`(judge_score, poster_score, linter_score, + final_score, timestamp, file_type)` In case :attr:`submission` is not ``None``, the passed parameters :attr:`person` and :attr:`problem` are ignored and so ``None`` is accepted. @@ -654,7 +655,7 @@ def get_submission_status(person: str, problem: str, submission): score_dict = dict() for submission in sub_list: - score_dict[submission.pk] = (submission.judge_score, submission.ta_score, + score_dict[submission.pk] = (submission.judge_score, submission.poster_score, submission.linter_score, submission.final_score, submission.timestamp, submission.file_type) verdict_dict[submission.pk] = [] @@ -729,7 +730,7 @@ def get_submission_status_mini(submission: str) -> Tuple[bool, Any]: Value: :code:`(Verdict, Time_taken, Memory_taken, ispublic, message)` Tuple: - :code:`(judge_score, ta_score, linter_score, final_score, timestamp, file_type)` + :code:`(judge_score, poster_score, linter_score, final_score, timestamp, file_type)` """ try: s = models.Submission.objects.get(pk=submission) @@ -742,7 +743,7 @@ def get_submission_status_mini(submission: str) -> Tuple[bool, Any]: submission=s, testcase=testcase) verdict_dict[testcase.pk] = (st.get_verdict_display, st.time_taken, st.memory_taken, testcase.public, st.message) - score_tuple = (s.judge_score, s.ta_score, s.linter_score, s.final_score, + score_tuple = (s.judge_score, s.poster_score, s.linter_score, s.final_score, s.timestamp, s.file_type) return (True, (verdict_dict, score_tuple)) except Exception as e: diff --git a/judge/migrations/0001_initial.py b/judge/migrations/0001_initial.py index b944773..e47cd15 100644 --- a/judge/migrations/0001_initial.py +++ b/judge/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2 on 2019-05-01 06:08 +# Generated by Django 2.2 on 2019-05-21 14:44 import datetime from django.db import migrations, models @@ -66,7 +66,7 @@ class Migration(migrations.Migration): ('submission_file', models.FileField(upload_to=judge.models.submission_upload_location)), ('timestamp', models.DateTimeField()), ('judge_score', models.PositiveSmallIntegerField(default=0)), - ('ta_score', models.PositiveSmallIntegerField(default=0)), + ('poster_score', models.SmallIntegerField(default=0)), ('linter_score', models.FloatField(default=0.0)), ('final_score', models.FloatField(default=0.0)), ('participant', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='judge.Person')), diff --git a/judge/models.py b/judge/models.py index d03f695..0fb6683 100644 --- a/judge/models.py +++ b/judge/models.py @@ -185,8 +185,8 @@ class Submission(models.Model): judge_score = models.PositiveSmallIntegerField(default=0) """Judge score""" - ta_score = models.SmallIntegerField(default=0) - """TA score""" + poster_score = models.SmallIntegerField(default=0) + """Poster score""" linter_score = models.FloatField(default=0.0) """Linter score""" diff --git a/judge/templates/judge/contest_persons.html b/judge/templates/judge/contest_persons.html index fdc69ac..91f7550 100644 --- a/judge/templates/judge/contest_persons.html +++ b/judge/templates/judge/contest_persons.html @@ -9,9 +9,9 @@ {% block scripts %} {% endblock %} @@ -29,13 +29,13 @@