Add memory unit to problem admin

This commit is contained in:
cuom1999 2022-08-31 00:23:23 -05:00
parent dddaf69fb7
commit 7f3e22e3bf
6 changed files with 175 additions and 134 deletions

View file

@ -256,7 +256,11 @@ urlpatterns = [
problem.ProblemPdfView.as_view(), problem.ProblemPdfView.as_view(),
name="problem_pdf", name="problem_pdf",
), ),
url(r"^/pdf_description$", problem.ProblemPdfDescriptionView.as_view(), name="problem_pdf_description"), url(
r"^/pdf_description$",
problem.ProblemPdfDescriptionView.as_view(),
name="problem_pdf_description",
),
url(r"^/clone", problem.ProblemClone.as_view(), name="problem_clone"), url(r"^/clone", problem.ProblemClone.as_view(), name="problem_clone"),
url(r"^/submit$", problem.problem_submit, name="problem_submit"), url(r"^/submit$", problem.problem_submit, name="problem_submit"),
url( url(

View file

@ -33,11 +33,14 @@ from judge.widgets import (
HeavyPreviewPageDownWidget, HeavyPreviewPageDownWidget,
) )
MEMORY_UNITS = (("KB", "KB"), ("MB", "MB"))
class ProblemForm(ModelForm): class ProblemForm(ModelForm):
change_message = forms.CharField( change_message = forms.CharField(
max_length=256, label="Edit reason", required=False max_length=256, label="Edit reason", required=False
) )
memory_unit = forms.ChoiceField(choices=MEMORY_UNITS)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ProblemForm, self).__init__(*args, **kwargs) super(ProblemForm, self).__init__(*args, **kwargs)
@ -51,6 +54,12 @@ class ProblemForm(ModelForm):
} }
) )
def clean(self):
memory_unit = self.cleaned_data.get("memory_unit", "KB")
if memory_unit == "MB":
self.cleaned_data["memory_limit"] *= 1024
return self.cleaned_data
class Meta: class Meta:
widgets = { widgets = {
"authors": AdminHeavySelect2MultipleWidget( "authors": AdminHeavySelect2MultipleWidget(
@ -94,13 +103,28 @@ class ProblemCreatorListFilter(admin.SimpleListFilter):
class LanguageLimitInlineForm(ModelForm): class LanguageLimitInlineForm(ModelForm):
memory_unit = forms.ChoiceField(choices=MEMORY_UNITS, label=_("Memory unit"))
class Meta: class Meta:
widgets = {"language": AdminSelect2Widget} widgets = {
"language": AdminSelect2Widget,
"memory_limit": TextInput(attrs={"size": "10"}),
}
def clean(self):
if not self.cleaned_data.get("language"):
self.cleaned_data["DELETE"] = True
if (
self.cleaned_data.get("memory_limit")
and self.cleaned_data.get("memory_unit") == "MB"
):
self.cleaned_data["memory_limit"] *= 1024
return self.cleaned_data
class LanguageLimitInline(admin.TabularInline): class LanguageLimitInline(admin.TabularInline):
model = LanguageLimit model = LanguageLimit
fields = ("language", "time_limit", "memory_limit") fields = ("language", "time_limit", "memory_limit", "memory_unit")
form = LanguageLimitInlineForm form = LanguageLimitInlineForm
@ -204,7 +228,7 @@ class ProblemAdmin(CompareVersionAdmin):
), ),
(_("Taxonomy"), {"fields": ("types", "group")}), (_("Taxonomy"), {"fields": ("types", "group")}),
(_("Points"), {"fields": (("points", "partial"), "short_circuit")}), (_("Points"), {"fields": (("points", "partial"), "short_circuit")}),
(_("Limits"), {"fields": ("time_limit", "memory_limit")}), (_("Limits"), {"fields": ("time_limit", ("memory_limit", "memory_unit"))}),
(_("Language"), {"fields": ("allowed_languages",)}), (_("Language"), {"fields": ("allowed_languages",)}),
(_("Justice"), {"fields": ("banned_users",)}), (_("Justice"), {"fields": ("banned_users",)}),
(_("History"), {"fields": ("change_message",)}), (_("History"), {"fields": ("change_message",)}),

View file

@ -8,18 +8,24 @@ import judge.utils.problem_data
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('judge', '0129_auto_20220622_1424'), ("judge", "0129_auto_20220622_1424"),
] ]
operations = [ operations = [
migrations.AddField( migrations.AddField(
model_name='problem', model_name="problem",
name='pdf_description', name="pdf_description",
field=models.FileField(blank=True, null=True, storage=judge.utils.problem_data.ProblemDataStorage(), upload_to=judge.models.problem.problem_directory_file, verbose_name='pdf statement'), field=models.FileField(
blank=True,
null=True,
storage=judge.utils.problem_data.ProblemDataStorage(),
upload_to=judge.models.problem.problem_directory_file,
verbose_name="pdf statement",
),
), ),
migrations.AlterField( migrations.AlterField(
model_name='problem', model_name="problem",
name='description', name="description",
field=models.TextField(blank=True, verbose_name='problem body'), field=models.TextField(blank=True, verbose_name="problem body"),
), ),
] ]

View file

@ -18,7 +18,10 @@ from judge.models.profile import Organization, Profile
from judge.models.runtime import Language from judge.models.runtime import Language
from judge.user_translations import gettext as user_gettext from judge.user_translations import gettext as user_gettext
from judge.utils.raw_sql import RawSQLColumn, unique_together_left_join from judge.utils.raw_sql import RawSQLColumn, unique_together_left_join
from judge.models.problem_data import problem_data_storage, problem_directory_file_helper from judge.models.problem_data import (
problem_data_storage,
problem_directory_file_helper,
)
__all__ = [ __all__ = [
"ProblemGroup", "ProblemGroup",
@ -32,9 +35,11 @@ __all__ = [
"TranslatedProblemForeignKeyQuerySet", "TranslatedProblemForeignKeyQuerySet",
] ]
def problem_directory_file(data, filename): def problem_directory_file(data, filename):
return problem_directory_file_helper(data.code, filename) return problem_directory_file_helper(data.code, filename)
class ProblemType(models.Model): class ProblemType(models.Model):
name = models.CharField( name = models.CharField(
max_length=20, verbose_name=_("problem category ID"), unique=True max_length=20, verbose_name=_("problem category ID"), unique=True

View file

@ -417,9 +417,7 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View):
response.content = f.read() response.content = f.read()
response["Content-Type"] = "application/pdf" response["Content-Type"] = "application/pdf"
response["Content-Disposition"] = "inline; filename=%s.pdf" % ( response["Content-Disposition"] = "inline; filename=%s.pdf" % (problem.code,)
problem.code,
)
return response return response

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: lqdoj2\n" "Project-Id-Version: lqdoj2\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-31 11:06+0700\n" "POT-Creation-Date: 2022-08-31 12:22+0700\n"
"PO-Revision-Date: 2021-07-20 03:44\n" "PO-Revision-Date: 2021-07-20 03:44\n"
"Last-Translator: Icyene\n" "Last-Translator: Icyene\n"
"Language-Team: Vietnamese\n" "Language-Team: Vietnamese\n"
@ -175,7 +175,7 @@ msgstr ""
msgid "Access" msgid "Access"
msgstr "Truy cập" msgstr "Truy cập"
#: judge/admin/contest.py:203 judge/admin/problem.py:209 #: judge/admin/contest.py:203 judge/admin/problem.py:233
msgid "Justice" msgid "Justice"
msgstr "Xử phạt" msgstr "Xử phạt"
@ -247,24 +247,28 @@ msgstr ""
msgid "diff" msgid "diff"
msgstr "" msgstr ""
#: judge/admin/organization.py:59 judge/admin/problem.py:266 #: judge/admin/organization.py:59 judge/admin/problem.py:290
#: judge/admin/profile.py:116 #: judge/admin/profile.py:116
msgid "View on site" msgid "View on site"
msgstr "Xem trên trang" msgstr "Xem trên trang"
#: judge/admin/problem.py:50 #: judge/admin/problem.py:53
msgid "Describe the changes you made (optional)" msgid "Describe the changes you made (optional)"
msgstr "Mô tả các thay đổi (tùy chọn)" msgstr "Mô tả các thay đổi (tùy chọn)"
#: judge/admin/problem.py:202 #: judge/admin/problem.py:106
msgid "Memory unit"
msgstr "Đơn vị bộ nhớ"
#: judge/admin/problem.py:226
msgid "Social Media" msgid "Social Media"
msgstr "Mạng Xã Hội" msgstr "Mạng Xã Hội"
#: judge/admin/problem.py:205 #: judge/admin/problem.py:229
msgid "Taxonomy" msgid "Taxonomy"
msgstr "" msgstr ""
#: judge/admin/problem.py:206 judge/admin/problem.py:402 #: judge/admin/problem.py:230 judge/admin/problem.py:426
#: templates/contest/contest.html:84 templates/problem/data.html:475 #: templates/contest/contest.html:84 templates/problem/data.html:475
#: templates/problem/list.html:20 templates/problem/list.html:44 #: templates/problem/list.html:20 templates/problem/list.html:44
#: templates/user/base-users-table.html:10 templates/user/user-about.html:36 #: templates/user/base-users-table.html:10 templates/user/user-about.html:36
@ -272,65 +276,65 @@ msgstr ""
msgid "Points" msgid "Points"
msgstr "Điểm" msgstr "Điểm"
#: judge/admin/problem.py:207 #: judge/admin/problem.py:231
msgid "Limits" msgid "Limits"
msgstr "Giới hạn" msgstr "Giới hạn"
#: judge/admin/problem.py:208 judge/admin/submission.py:353 #: judge/admin/problem.py:232 judge/admin/submission.py:353
#: templates/stats/base.html:14 templates/submission/list.html:342 #: templates/stats/base.html:14 templates/submission/list.html:342
msgid "Language" msgid "Language"
msgstr "Ngôn ngữ" msgstr "Ngôn ngữ"
#: judge/admin/problem.py:210 #: judge/admin/problem.py:234
msgid "History" msgid "History"
msgstr "Lịch sử" msgstr "Lịch sử"
#: judge/admin/problem.py:262 templates/problem/list-base.html:106 #: judge/admin/problem.py:286 templates/problem/list-base.html:106
msgid "Authors" msgid "Authors"
msgstr "Các tác giả" msgstr "Các tác giả"
#: judge/admin/problem.py:283 #: judge/admin/problem.py:307
#, python-format #, python-format
msgid "%d problem successfully marked as public." msgid "%d problem successfully marked as public."
msgid_plural "%d problems successfully marked as public." msgid_plural "%d problems successfully marked as public."
msgstr[0] "%d bài tập đã được đánh dấu công khai." msgstr[0] "%d bài tập đã được đánh dấu công khai."
#: judge/admin/problem.py:290 #: judge/admin/problem.py:314
msgid "Mark problems as public" msgid "Mark problems as public"
msgstr "Công khai bài tập" msgstr "Công khai bài tập"
#: judge/admin/problem.py:299 #: judge/admin/problem.py:323
#, python-format #, python-format
msgid "%d problem successfully marked as private." msgid "%d problem successfully marked as private."
msgid_plural "%d problems successfully marked as private." msgid_plural "%d problems successfully marked as private."
msgstr[0] "%d bài tập đã được đánh dấu riêng tư." msgstr[0] "%d bài tập đã được đánh dấu riêng tư."
#: judge/admin/problem.py:306 #: judge/admin/problem.py:330
msgid "Mark problems as private" msgid "Mark problems as private"
msgstr "Đánh dấu các bài tập là riêng tư" msgstr "Đánh dấu các bài tập là riêng tư"
#: judge/admin/problem.py:396 judge/admin/submission.py:316 #: judge/admin/problem.py:420 judge/admin/submission.py:316
#: templates/problem/list.html:16 templates/problem/list.html:33 #: templates/problem/list.html:16 templates/problem/list.html:33
msgid "Problem code" msgid "Problem code"
msgstr "Mã bài" msgstr "Mã bài"
#: judge/admin/problem.py:408 judge/admin/submission.py:322 #: judge/admin/problem.py:432 judge/admin/submission.py:322
msgid "Problem name" msgid "Problem name"
msgstr "Tên bài" msgstr "Tên bài"
#: judge/admin/problem.py:414 #: judge/admin/problem.py:438
#, fuzzy #, fuzzy
#| msgid "contest rating" #| msgid "contest rating"
msgid "Voter rating" msgid "Voter rating"
msgstr "rating kỳ thi" msgstr "rating kỳ thi"
#: judge/admin/problem.py:420 #: judge/admin/problem.py:444
#, fuzzy #, fuzzy
#| msgid "Total points" #| msgid "Total points"
msgid "Voter point" msgid "Voter point"
msgstr "Tổng điểm" msgstr "Tổng điểm"
#: judge/admin/problem.py:426 #: judge/admin/problem.py:450
msgid "Vote" msgid "Vote"
msgstr "" msgstr ""
@ -568,7 +572,7 @@ msgstr "Two Factor Authentication phải chứa 6 chữ số."
msgid "Invalid Two Factor Authentication token." msgid "Invalid Two Factor Authentication token."
msgstr "Token Two Factor Authentication không hợp lệ." msgstr "Token Two Factor Authentication không hợp lệ."
#: judge/forms.py:266 judge/models/problem.py:154 #: judge/forms.py:266 judge/models/problem.py:159
msgid "Problem code must be ^[a-z0-9]+$" msgid "Problem code must be ^[a-z0-9]+$"
msgstr "Mã bài phải có dạng ^[a-z0-9]+$" msgstr "Mã bài phải có dạng ^[a-z0-9]+$"
@ -631,7 +635,7 @@ msgstr "người bình luận"
msgid "associated page" msgid "associated page"
msgstr "trang tương ứng" msgstr "trang tương ứng"
#: judge/models/comment.py:53 judge/models/problem.py:724 #: judge/models/comment.py:53 judge/models/problem.py:729
msgid "votes" msgid "votes"
msgstr "bình chọn" msgstr "bình chọn"
@ -651,7 +655,7 @@ msgstr "bình luận"
msgid "comments" msgid "comments"
msgstr "" msgstr ""
#: judge/models/comment.py:160 judge/models/problem.py:692 #: judge/models/comment.py:160 judge/models/problem.py:697
#, python-format #, python-format
msgid "Editorial for %s" msgid "Editorial for %s"
msgstr "" msgstr ""
@ -769,7 +773,7 @@ msgstr ""
msgid "description" msgid "description"
msgstr "mô tả" msgstr "mô tả"
#: judge/models/contest.py:118 judge/models/problem.py:587 #: judge/models/contest.py:118 judge/models/problem.py:592
#: judge/models/runtime.py:216 #: judge/models/runtime.py:216
msgid "problems" msgid "problems"
msgstr "bài tập" msgstr "bài tập"
@ -782,8 +786,8 @@ msgstr "thời gian bắt đầu"
msgid "end time" msgid "end time"
msgstr "thời gian kết thúc" msgstr "thời gian kết thúc"
#: judge/models/contest.py:123 judge/models/problem.py:207 #: judge/models/contest.py:123 judge/models/problem.py:212
#: judge/models/problem.py:632 #: judge/models/problem.py:637
msgid "time limit" msgid "time limit"
msgstr "giới hạn thời gian" msgstr "giới hạn thời gian"
@ -794,7 +798,7 @@ msgstr ""
"Định dạng hh:mm:ss (giờ:phút:giây). Ví dụ, nếu muốn tạo kỳ thi dài 2h, hãy " "Định dạng hh:mm:ss (giờ:phút:giây). Ví dụ, nếu muốn tạo kỳ thi dài 2h, hãy "
"nhập 02:00:00" "nhập 02:00:00"
#: judge/models/contest.py:131 judge/models/problem.py:246 #: judge/models/contest.py:131 judge/models/problem.py:251
msgid "publicly visible" msgid "publicly visible"
msgstr "công khai" msgstr "công khai"
@ -893,12 +897,12 @@ msgstr ""
"kỳ thi, hãy bỏ đánh dấu ô này và chấm lại tất cả các bài." "kỳ thi, hãy bỏ đánh dấu ô này và chấm lại tất cả các bài."
#: judge/models/contest.py:211 judge/models/interface.py:92 #: judge/models/contest.py:211 judge/models/interface.py:92
#: judge/models/problem.py:303 #: judge/models/problem.py:308
msgid "private to organizations" msgid "private to organizations"
msgstr "riêng tư với các tổ chức" msgstr "riêng tư với các tổ chức"
#: judge/models/contest.py:216 judge/models/interface.py:88 #: judge/models/contest.py:216 judge/models/interface.py:88
#: judge/models/problem.py:299 judge/models/profile.py:125 #: judge/models/problem.py:304 judge/models/profile.py:125
msgid "organizations" msgid "organizations"
msgstr "tổ chức" msgstr "tổ chức"
@ -906,7 +910,7 @@ msgstr "tổ chức"
msgid "If private, only these organizations may see the contest" msgid "If private, only these organizations may see the contest"
msgstr "Nếu riêng tư, chỉ những tổ chức này thấy được kỳ thi" msgstr "Nếu riêng tư, chỉ những tổ chức này thấy được kỳ thi"
#: judge/models/contest.py:220 judge/models/problem.py:277 #: judge/models/contest.py:220 judge/models/problem.py:282
msgid "OpenGraph image" msgid "OpenGraph image"
msgstr "Hình ảnh OpenGraph" msgstr "Hình ảnh OpenGraph"
@ -927,7 +931,7 @@ msgstr "số lượng thí sinh thi trực tiếp"
msgid "contest summary" msgid "contest summary"
msgstr "tổng kết kỳ thi" msgstr "tổng kết kỳ thi"
#: judge/models/contest.py:242 judge/models/problem.py:283 #: judge/models/contest.py:242 judge/models/problem.py:288
msgid "Plain-text, shown in meta description tag, e.g. for social media." msgid "Plain-text, shown in meta description tag, e.g. for social media."
msgstr "" msgstr ""
@ -943,7 +947,7 @@ msgstr ""
"Mật khẩu truy cập cho các thí sinh muốn tham gia kỳ thi. Để trống nếu không " "Mật khẩu truy cập cho các thí sinh muốn tham gia kỳ thi. Để trống nếu không "
"dùng." "dùng."
#: judge/models/contest.py:257 judge/models/problem.py:265 #: judge/models/contest.py:257 judge/models/problem.py:270
msgid "personae non gratae" msgid "personae non gratae"
msgstr "" msgstr ""
@ -1088,14 +1092,14 @@ msgid "contest participations"
msgstr "lần tham gia kỳ thi" msgstr "lần tham gia kỳ thi"
#: judge/models/contest.py:739 judge/models/contest.py:783 #: judge/models/contest.py:739 judge/models/contest.py:783
#: judge/models/contest.py:845 judge/models/problem.py:586 #: judge/models/contest.py:845 judge/models/problem.py:591
#: judge/models/problem.py:593 judge/models/problem.py:624 #: judge/models/problem.py:598 judge/models/problem.py:629
#: judge/models/problem.py:655 judge/models/problem_data.py:50 #: judge/models/problem.py:660 judge/models/problem_data.py:50
msgid "problem" msgid "problem"
msgstr "bài tập" msgstr "bài tập"
#: judge/models/contest.py:747 judge/models/contest.py:795 #: judge/models/contest.py:747 judge/models/contest.py:795
#: judge/models/problem.py:230 #: judge/models/problem.py:235
msgid "points" msgid "points"
msgstr "điểm" msgstr "điểm"
@ -1227,7 +1231,7 @@ msgstr "mục cha"
msgid "post title" msgid "post title"
msgstr "tiêu đề bài đăng" msgstr "tiêu đề bài đăng"
#: judge/models/interface.py:75 judge/models/problem.py:681 #: judge/models/interface.py:75 judge/models/problem.py:686
msgid "authors" msgid "authors"
msgstr "tác giả" msgstr "tác giả"
@ -1235,7 +1239,7 @@ msgstr "tác giả"
msgid "slug" msgid "slug"
msgstr "slug" msgstr "slug"
#: judge/models/interface.py:77 judge/models/problem.py:679 #: judge/models/interface.py:77 judge/models/problem.py:684
msgid "public visibility" msgid "public visibility"
msgstr "khả năng hiển thị công khai" msgstr "khả năng hiển thị công khai"
@ -1299,140 +1303,140 @@ msgstr "thời gian gửi"
msgid "messages in the thread" msgid "messages in the thread"
msgstr "tin nhắn trong chuỗi" msgstr "tin nhắn trong chuỗi"
#: judge/models/problem.py:40 #: judge/models/problem.py:45
msgid "problem category ID" msgid "problem category ID"
msgstr "mã của nhóm bài" msgstr "mã của nhóm bài"
#: judge/models/problem.py:43 #: judge/models/problem.py:48
msgid "problem category name" msgid "problem category name"
msgstr "tên nhóm bài" msgstr "tên nhóm bài"
#: judge/models/problem.py:51 #: judge/models/problem.py:56
msgid "problem type" msgid "problem type"
msgstr "dạng bài" msgstr "dạng bài"
#: judge/models/problem.py:52 judge/models/problem.py:197 #: judge/models/problem.py:57 judge/models/problem.py:202
#: judge/models/volunteer.py:28 #: judge/models/volunteer.py:28
msgid "problem types" msgid "problem types"
msgstr "dạng bài" msgstr "dạng bài"
#: judge/models/problem.py:57 #: judge/models/problem.py:62
msgid "problem group ID" msgid "problem group ID"
msgstr "mã của nhóm bài" msgstr "mã của nhóm bài"
#: judge/models/problem.py:59 #: judge/models/problem.py:64
msgid "problem group name" msgid "problem group name"
msgstr "tên nhóm bài" msgstr "tên nhóm bài"
#: judge/models/problem.py:66 judge/models/problem.py:202 #: judge/models/problem.py:71 judge/models/problem.py:207
msgid "problem group" msgid "problem group"
msgstr "nhóm bài" msgstr "nhóm bài"
#: judge/models/problem.py:67 #: judge/models/problem.py:72
msgid "problem groups" msgid "problem groups"
msgstr "nhóm bài" msgstr "nhóm bài"
#: judge/models/problem.py:74 #: judge/models/problem.py:79
msgid "key" msgid "key"
msgstr "" msgstr ""
#: judge/models/problem.py:77 #: judge/models/problem.py:82
msgid "link" msgid "link"
msgstr "đường dẫn" msgstr "đường dẫn"
#: judge/models/problem.py:78 #: judge/models/problem.py:83
msgid "full name" msgid "full name"
msgstr "tên đầy đủ" msgstr "tên đầy đủ"
#: judge/models/problem.py:82 judge/models/profile.py:38 #: judge/models/problem.py:87 judge/models/profile.py:38
#: judge/models/runtime.py:34 #: judge/models/runtime.py:34
msgid "short name" msgid "short name"
msgstr "tên ngắn" msgstr "tên ngắn"
#: judge/models/problem.py:83 #: judge/models/problem.py:88
msgid "Displayed on pages under this license" msgid "Displayed on pages under this license"
msgstr "Được hiển thị trên các trang theo giấy phép này" msgstr "Được hiển thị trên các trang theo giấy phép này"
#: judge/models/problem.py:88 #: judge/models/problem.py:93
msgid "icon" msgid "icon"
msgstr "icon" msgstr "icon"
#: judge/models/problem.py:89 #: judge/models/problem.py:94
msgid "URL to the icon" msgid "URL to the icon"
msgstr "Đường dẫn icon" msgstr "Đường dẫn icon"
#: judge/models/problem.py:91 #: judge/models/problem.py:96
msgid "license text" msgid "license text"
msgstr "văn bản giấy phép" msgstr "văn bản giấy phép"
#: judge/models/problem.py:100 #: judge/models/problem.py:105
msgid "license" msgid "license"
msgstr "" msgstr ""
#: judge/models/problem.py:101 #: judge/models/problem.py:106
msgid "licenses" msgid "licenses"
msgstr "" msgstr ""
#: judge/models/problem.py:151 #: judge/models/problem.py:156
msgid "problem code" msgid "problem code"
msgstr "mã bài" msgstr "mã bài"
#: judge/models/problem.py:157 #: judge/models/problem.py:162
msgid "A short, unique code for the problem, used in the url after /problem/" msgid "A short, unique code for the problem, used in the url after /problem/"
msgstr "Mã bài ngắn, độc nhất cho bài tập, được dùng trong url sau /problem/" msgstr "Mã bài ngắn, độc nhất cho bài tập, được dùng trong url sau /problem/"
#: judge/models/problem.py:162 #: judge/models/problem.py:167
msgid "problem name" msgid "problem name"
msgstr "Tên bài" msgstr "Tên bài"
#: judge/models/problem.py:164 #: judge/models/problem.py:169
msgid "The full name of the problem, as shown in the problem list." msgid "The full name of the problem, as shown in the problem list."
msgstr "Tên đầy đủ của bài, như được hiển thị trên danh sách bài tập" msgstr "Tên đầy đủ của bài, như được hiển thị trên danh sách bài tập"
#: judge/models/problem.py:166 #: judge/models/problem.py:171
msgid "problem body" msgid "problem body"
msgstr "Nội dung" msgstr "Nội dung"
#: judge/models/problem.py:169 #: judge/models/problem.py:174
msgid "creators" msgid "creators"
msgstr "" msgstr ""
#: judge/models/problem.py:173 #: judge/models/problem.py:178
msgid "These users will be able to edit the problem, and be listed as authors." msgid "These users will be able to edit the problem, and be listed as authors."
msgstr "" msgstr ""
"Những người dùng này sẽ có thể chỉnh sửa bài tập, và nằm trong danh sách các " "Những người dùng này sẽ có thể chỉnh sửa bài tập, và nằm trong danh sách các "
"tác giả" "tác giả"
#: judge/models/problem.py:178 #: judge/models/problem.py:183
msgid "curators" msgid "curators"
msgstr "" msgstr ""
#: judge/models/problem.py:182 #: judge/models/problem.py:187
msgid "" msgid ""
"These users will be able to edit the problem, but not be listed as authors." "These users will be able to edit the problem, but not be listed as authors."
msgstr "" msgstr ""
"Những người dùng này sẽ có thể chỉnh sửa bài tập, nhưng không nằm trong danh " "Những người dùng này sẽ có thể chỉnh sửa bài tập, nhưng không nằm trong danh "
"sách các tác giả" "sách các tác giả"
#: judge/models/problem.py:188 #: judge/models/problem.py:193
msgid "testers" msgid "testers"
msgstr "" msgstr ""
#: judge/models/problem.py:192 #: judge/models/problem.py:197
msgid "These users will be able to view the private problem, but not edit it." msgid "These users will be able to view the private problem, but not edit it."
msgstr "" msgstr ""
"Những người dùng này sẽ thấy được bài tập này (dù riêng tư), nhưng không " "Những người dùng này sẽ thấy được bài tập này (dù riêng tư), nhưng không "
"chỉnh sửa được" "chỉnh sửa được"
#: judge/models/problem.py:198 judge/models/volunteer.py:29 #: judge/models/problem.py:203 judge/models/volunteer.py:29
msgid "The type of problem, as shown on the problem's page." msgid "The type of problem, as shown on the problem's page."
msgstr "Dạng bài, giống như trên trang bài tập" msgstr "Dạng bài, giống như trên trang bài tập"
#: judge/models/problem.py:204 #: judge/models/problem.py:209
msgid "The group of problem, shown under Category in the problem list." msgid "The group of problem, shown under Category in the problem list."
msgstr "Nhóm bài, hiện ở mục Nhóm bài trong danh sách bài tập" msgstr "Nhóm bài, hiện ở mục Nhóm bài trong danh sách bài tập"
#: judge/models/problem.py:209 #: judge/models/problem.py:214
msgid "" msgid ""
"The time limit for this problem, in seconds. Fractional seconds (e.g. 1.5) " "The time limit for this problem, in seconds. Fractional seconds (e.g. 1.5) "
"are supported." "are supported."
@ -1440,11 +1444,11 @@ msgstr ""
"Giới hạn thời gian cho bài tập này, theo đơn vị giây. Có thể nhập số thực " "Giới hạn thời gian cho bài tập này, theo đơn vị giây. Có thể nhập số thực "
"(ví dụ 1.5)" "(ví dụ 1.5)"
#: judge/models/problem.py:218 judge/models/problem.py:639 #: judge/models/problem.py:223 judge/models/problem.py:644
msgid "memory limit" msgid "memory limit"
msgstr "Giới hạn bộ nhớ" msgstr "Giới hạn bộ nhớ"
#: judge/models/problem.py:220 #: judge/models/problem.py:225
msgid "" msgid ""
"The memory limit for this problem, in kilobytes (e.g. 256mb = 262144 " "The memory limit for this problem, in kilobytes (e.g. 256mb = 262144 "
"kilobytes)." "kilobytes)."
@ -1452,7 +1456,7 @@ msgstr ""
"Giới hạn bộ nhớ cho bài này, theo đơn vị kilobytes (ví dụ 256mb = 262144 " "Giới hạn bộ nhớ cho bài này, theo đơn vị kilobytes (ví dụ 256mb = 262144 "
"kilobytes)" "kilobytes)"
#: judge/models/problem.py:232 #: judge/models/problem.py:237
msgid "" msgid ""
"Points awarded for problem completion. Points are displayed with a 'p' " "Points awarded for problem completion. Points are displayed with a 'p' "
"suffix if partial." "suffix if partial."
@ -1460,155 +1464,155 @@ msgstr ""
"Điểm thưởng khi hoàn thành bài tập. Điểm có thêm chữ 'p' ở sau cùng nếu như " "Điểm thưởng khi hoàn thành bài tập. Điểm có thêm chữ 'p' ở sau cùng nếu như "
"chấp nhận cho điểm thành phần (có điểm ngay khi không đúng toàn bộ test)" "chấp nhận cho điểm thành phần (có điểm ngay khi không đúng toàn bộ test)"
#: judge/models/problem.py:238 #: judge/models/problem.py:243
msgid "allows partial points" msgid "allows partial points"
msgstr "cho phép điểm thành phần" msgstr "cho phép điểm thành phần"
#: judge/models/problem.py:242 #: judge/models/problem.py:247
msgid "allowed languages" msgid "allowed languages"
msgstr "các ngôn ngữ được cho phép" msgstr "các ngôn ngữ được cho phép"
#: judge/models/problem.py:243 #: judge/models/problem.py:248
msgid "List of allowed submission languages." msgid "List of allowed submission languages."
msgstr "Danh sách các ngôn ngữ lập trình cho phép" msgstr "Danh sách các ngôn ngữ lập trình cho phép"
#: judge/models/problem.py:249 #: judge/models/problem.py:254
msgid "manually managed" msgid "manually managed"
msgstr "" msgstr ""
#: judge/models/problem.py:252 #: judge/models/problem.py:257
msgid "Whether judges should be allowed to manage data or not." msgid "Whether judges should be allowed to manage data or not."
msgstr "" msgstr ""
#: judge/models/problem.py:255 #: judge/models/problem.py:260
msgid "date of publishing" msgid "date of publishing"
msgstr "Ngày công bố" msgstr "Ngày công bố"
#: judge/models/problem.py:260 #: judge/models/problem.py:265
msgid "" msgid ""
"Doesn't have magic ability to auto-publish due to backward compatibility" "Doesn't have magic ability to auto-publish due to backward compatibility"
msgstr "" msgstr ""
#: judge/models/problem.py:267 #: judge/models/problem.py:272
msgid "Bans the selected users from submitting to this problem." msgid "Bans the selected users from submitting to this problem."
msgstr "Cấm những người dùng được chọn nộp bài tập này." msgstr "Cấm những người dùng được chọn nộp bài tập này."
#: judge/models/problem.py:274 #: judge/models/problem.py:279
msgid "The license under which this problem is published." msgid "The license under which this problem is published."
msgstr "Giấy phép xuất bản bài tập" msgstr "Giấy phép xuất bản bài tập"
#: judge/models/problem.py:281 #: judge/models/problem.py:286
msgid "problem summary" msgid "problem summary"
msgstr "Tóm tắt bài tập" msgstr "Tóm tắt bài tập"
#: judge/models/problem.py:287 #: judge/models/problem.py:292
msgid "number of users" msgid "number of users"
msgstr "" msgstr ""
#: judge/models/problem.py:289 #: judge/models/problem.py:294
msgid "The number of users who solved the problem." msgid "The number of users who solved the problem."
msgstr "Số lượng người dùng đã giải được bài" msgstr "Số lượng người dùng đã giải được bài"
#: judge/models/problem.py:291 #: judge/models/problem.py:296
msgid "solve rate" msgid "solve rate"
msgstr "Tỉ lệ giải đúng" msgstr "Tỉ lệ giải đúng"
#: judge/models/problem.py:300 #: judge/models/problem.py:305
msgid "If private, only these organizations may see the problem." msgid "If private, only these organizations may see the problem."
msgstr "Nếu bài riêng tư, chỉ những tổ chức này thấy được" msgstr "Nếu bài riêng tư, chỉ những tổ chức này thấy được"
#: judge/models/problem.py:306 #: judge/models/problem.py:311
msgid "pdf statement" msgid "pdf statement"
msgstr "Đề bài bằng file pdf" msgstr "Đề bài bằng file pdf"
#: judge/models/problem.py:598 judge/models/problem.py:629 #: judge/models/problem.py:603 judge/models/problem.py:634
#: judge/models/problem.py:660 judge/models/runtime.py:161 #: judge/models/problem.py:665 judge/models/runtime.py:161
msgid "language" msgid "language"
msgstr "" msgstr ""
#: judge/models/problem.py:601 #: judge/models/problem.py:606
msgid "translated name" msgid "translated name"
msgstr "" msgstr ""
#: judge/models/problem.py:603 #: judge/models/problem.py:608
msgid "translated description" msgid "translated description"
msgstr "" msgstr ""
#: judge/models/problem.py:607 #: judge/models/problem.py:612
msgid "problem translation" msgid "problem translation"
msgstr "" msgstr ""
#: judge/models/problem.py:608 #: judge/models/problem.py:613
msgid "problem translations" msgid "problem translations"
msgstr "" msgstr ""
#: judge/models/problem.py:613 #: judge/models/problem.py:618
msgid "clarified problem" msgid "clarified problem"
msgstr "" msgstr ""
#: judge/models/problem.py:615 #: judge/models/problem.py:620
msgid "clarification body" msgid "clarification body"
msgstr "" msgstr ""
#: judge/models/problem.py:617 #: judge/models/problem.py:622
msgid "clarification timestamp" msgid "clarification timestamp"
msgstr "" msgstr ""
#: judge/models/problem.py:648 #: judge/models/problem.py:653
msgid "language-specific resource limit" msgid "language-specific resource limit"
msgstr "" msgstr ""
#: judge/models/problem.py:649 #: judge/models/problem.py:654
msgid "language-specific resource limits" msgid "language-specific resource limits"
msgstr "" msgstr ""
#: judge/models/problem.py:662 judge/models/submission.py:246 #: judge/models/problem.py:667 judge/models/submission.py:246
msgid "source code" msgid "source code"
msgstr "mã nguồn" msgstr "mã nguồn"
#: judge/models/problem.py:666 #: judge/models/problem.py:671
msgid "language-specific template" msgid "language-specific template"
msgstr "" msgstr ""
#: judge/models/problem.py:667 #: judge/models/problem.py:672
msgid "language-specific templates" msgid "language-specific templates"
msgstr "" msgstr ""
#: judge/models/problem.py:674 #: judge/models/problem.py:679
msgid "associated problem" msgid "associated problem"
msgstr "" msgstr ""
#: judge/models/problem.py:680 #: judge/models/problem.py:685
msgid "publish date" msgid "publish date"
msgstr "" msgstr ""
#: judge/models/problem.py:682 #: judge/models/problem.py:687
msgid "editorial content" msgid "editorial content"
msgstr "nội dung lời giải" msgstr "nội dung lời giải"
#: judge/models/problem.py:696 #: judge/models/problem.py:701
msgid "solution" msgid "solution"
msgstr "lời giải" msgstr "lời giải"
#: judge/models/problem.py:697 #: judge/models/problem.py:702
msgid "solutions" msgid "solutions"
msgstr "lời giải" msgstr "lời giải"
#: judge/models/problem.py:702 #: judge/models/problem.py:707
#, fuzzy #, fuzzy
#| msgid "point value" #| msgid "point value"
msgid "proposed point value" msgid "proposed point value"
msgstr "điểm" msgstr "điểm"
#: judge/models/problem.py:703 #: judge/models/problem.py:708
msgid "The amount of points you think this problem deserves." msgid "The amount of points you think this problem deserves."
msgstr "Bạn nghĩ bài này đáng bao nhiêu điểm?" msgstr "Bạn nghĩ bài này đáng bao nhiêu điểm?"
#: judge/models/problem.py:717 #: judge/models/problem.py:722
msgid "The time this vote was cast" msgid "The time this vote was cast"
msgstr "" msgstr ""
#: judge/models/problem.py:723 #: judge/models/problem.py:728
msgid "vote" msgid "vote"
msgstr "" msgstr ""
@ -2891,41 +2895,41 @@ msgstr "Hướng dẫn cho {0}"
msgid "Editorial for <a href=\"{1}\">{0}</a>" msgid "Editorial for <a href=\"{1}\">{0}</a>"
msgstr "Hướng dẫn cho <a href=\"{1}\">{0}</a>" msgstr "Hướng dẫn cho <a href=\"{1}\">{0}</a>"
#: judge/views/problem.py:428 templates/contest/contest.html:79 #: judge/views/problem.py:426 templates/contest/contest.html:79
#: templates/organization/org-left-sidebar.html:4 #: templates/organization/org-left-sidebar.html:4
#: templates/user/user-about.html:28 templates/user/user-tabs.html:5 #: templates/user/user-about.html:28 templates/user/user-tabs.html:5
#: templates/user/users-table.html:29 #: templates/user/users-table.html:29
msgid "Problems" msgid "Problems"
msgstr "Bài tập" msgstr "Bài tập"
#: judge/views/problem.py:798 #: judge/views/problem.py:796
msgid "Problem feed" msgid "Problem feed"
msgstr "Bài tập" msgstr "Bài tập"
#: judge/views/problem.py:1032 #: judge/views/problem.py:1030
msgid "Banned from submitting" msgid "Banned from submitting"
msgstr "Bị cấm nộp bài" msgstr "Bị cấm nộp bài"
#: judge/views/problem.py:1034 #: judge/views/problem.py:1032
msgid "" msgid ""
"You have been declared persona non grata for this problem. You are " "You have been declared persona non grata for this problem. You are "
"permanently barred from submitting this problem." "permanently barred from submitting this problem."
msgstr "Bạn đã bị cấm nộp bài này." msgstr "Bạn đã bị cấm nộp bài này."
#: judge/views/problem.py:1057 #: judge/views/problem.py:1055
msgid "Too many submissions" msgid "Too many submissions"
msgstr "Quá nhiều lần nộp" msgstr "Quá nhiều lần nộp"
#: judge/views/problem.py:1059 #: judge/views/problem.py:1057
msgid "You have exceeded the submission limit for this problem." msgid "You have exceeded the submission limit for this problem."
msgstr "Bạn đã vượt quá số lần nộp cho bài này." msgstr "Bạn đã vượt quá số lần nộp cho bài này."
#: judge/views/problem.py:1138 judge/views/problem.py:1143 #: judge/views/problem.py:1136 judge/views/problem.py:1141
#, python-format #, python-format
msgid "Submit to %(problem)s" msgid "Submit to %(problem)s"
msgstr "Nộp bài cho %(problem)s" msgstr "Nộp bài cho %(problem)s"
#: judge/views/problem.py:1166 #: judge/views/problem.py:1164
msgid "Clone Problem" msgid "Clone Problem"
msgstr "Nhân bản bài tập" msgstr "Nhân bản bài tập"