添加功能:pretest discuss user dashboard statistics

This commit is contained in:
undefined committed 2020-04-27 12:18:36 +08:00
1 parent 61cba6f180
commit 15d43636c0
41 files changed
+920 -523

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
<div class="medium-9 columns">
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Create Discussion in {0}').format(vnode['title']) }}</h1>
<h1 class="section__title">{{ _('Create Discussion in {0}').format(title) }}</h1>
</div>
<div class="section__body">
<form method="post">
@@ -1,60 +0,0 @@
{% extends "domain_base.html" %}
{% block domain_content %}
{% if join_settings != None %}
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Information') }}</h1>
</div>
<div class="section__body typo">
<p>{{ _('User can join this domain by visiting the following URL') }}:</p>
<pre><code class="language-data">{{ handler.ui_context['url_prefix'] }}{{ reverse_url('domain_join') }}</code></pre>
{% if join_settings['method'] == vj4.constant.domain.JOIN_METHOD_CODE %}
<p>{{ _('Or, with automatically filled invitation code') }}:</p>
<pre><code class="language-data">{{ handler.ui_context['url_prefix'] }}{{ reverse_url('domain_join') }}?code={{ join_settings['code']|urlencode }}</code></pre>
{% endif %}
{% if join_settings['expire'] != None %}
<br/>
<blockquote class="note">
{{ (_('The link will be expired at {0}').format(datetime_span(join_settings['expire'], relative=false)))|safe }}
</blockquote>
{% endif %}
</div>
</div>
{% endif %}
<div class="section">
<div class="section__header">
<h1 class="section__title">{{ _('Settings') }}</h1>
</div>
<div class="section__body">
<form method="POST">
{{ form.form_radio(
options=vj4.constant.domain.JOIN_METHOD_RANGE.items(),
label='Method',
name='method',
value=join_settings['method']|default(vj4.constant.domain.JOIN_METHOD_NONE),
columns=8) }}
{{ form.form_select(
options=roles_with_text,
label='Role Assignment',
name='role',
help_text='The role to assign when user joining the domain.',
value=join_settings['role']|default('')) }}
{{ form.form_select(
options=expirations.items(),
label='Expire',
name='expire',
help_text='User will no longer be allowed to join the domain after expiration.'
) }}
{{ form.form_text(
label='Invitation Code',
name='invitation_code',
help_text='The invitation code to enter to successfully join the domain. You can only use letters and numbers in the code and it should not be longer than 64 characters.',
value=join_settings['code']|default('')) }}
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
<button class="rounded primary button" role="submit">
{{ _('Update Settings') }}
</button>
</form>
</div>
</div>
{% endblock %}
+1 -1
View File
@@ -36,7 +36,7 @@
{% for role in roles %}
<td class="col--p">
<label class="compact checkbox">
<input name="{{ role }}" data-checkbox-group="{{ role }}" data-checkbox-range value="{{ perm.key }}" type="checkbox"{% if bitand(handler.domain['roles'][role], perm.key) == perm.key %} checked{% endif %}>
<input name="{{ role }}" data-checkbox-group="{{ role }}" data-checkbox-range value="{{ perm.key }}" type="checkbox"{% if roles[role].includes(perm.key) or roles[role] == '-' %} checked{% endif %}>
</label>
</td>
{% endfor %}
+6 -1
View File
@@ -9,7 +9,12 @@
<blockquote class="note">
<p>{{ _('Role name can only contains numbers, letters and underscores.') }}</p>
</blockquote>
{{ form.form_text(columns=None, label='Name', name='role', autofocus=True) }}
{{ form.form_text({
columns:None,
label:'Name',
name:'role',
autofocus:true
}) }}
</div></div>
</div>
</div>
+22 -4
View File
@@ -1,6 +1,24 @@
{% import "components/form.html" as form with context %}
{% if ddoc['highlight'] or handler.hasPerm(perm.PERM_HIGHLIGHT_DISCUSSION) %}
{{ form.form_checkbox(label='Highlight', name='highlight', value=ddoc['highlight']|default(false)) }}
{% if ddoc.highlight or handler.hasPerm(perm.PERM_HIGHLIGHT_DISCUSSION) %}
{{ form.form_checkbox({
label:'Highlight',
name:'highlight',
value:ddoc.highlight|default(false))
}) }}
{% endif %}
{{ form.form_text(label='Title', name='title', value=ddoc['title']|default(''), autofocus=true, required=true) }}
{{ form.form_textarea(columns=12, label='Content', name='content', value=ddoc['content']|default(''), hotkeys='ctrl+enter:submit', markdown=true, required=true) }}
{{ form.form_text({
label:'Title',
name:'title',
value:ddoc.title|default(''),
autofocus:true,
required:true
}) }}
{{ form.form_textarea({
columns:12,
label:'Content',
name:'content',
value:ddoc.content|default(''),
hotkeys:'ctrl+enter:submit',
markdown:true,
required:true
}) }}
+42 -42
View File
@@ -1,46 +1,46 @@
{% import "components/nothing.html" as nothing with context %}
{% import "components/user.html" as user with context %}
{% import "components/paginator.html" as paginator with context %}
{% if not ddocs %}
{{ nothing.render('no discussion yet...') }}
{% else %}
<ol class="section__list discussion__list">
{% for ddoc in ddocs %}
<li class="section__list__item discussion__item{% if ddoc['highlight'] %} highlight{% endif %}">
<div class="media">
<div class="media__left">
<div class="discussion__replies numbox">
<div class="numbox__num large">{{ ddoc['num_replies'] }}</div>
<div class="numbox__text">{{ _('Comments') }}</div>
</div>
</div>
<div class="media__body top">
<h1 class="discussion__title"><a href="{{ reverse_url('discussion_detail', did=ddoc['doc_id']) }}#{{ handler.datetime_stamp(ddoc['update_at']) if ddoc['update_at'] else '' }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
<ul class="supplementary list">
<li>
<a class="discussion-node-tag" href="{{ vj4.handler.discussion.node_url(handler, 'discussion_node', vj4.model.adaptor.discussion.node_id(ddoc)) }}">
{% if ddoc['parent_doc_type'] == vj4.model.document.TYPE_DISCUSSION_NODE %}
<span class="v-center icon icon-tag"></span>
{% elif ddoc['parent_doc_type'] == vj4.model.document.TYPE_CONTEST %}
<span class="v-center icon icon-award"></span>
{% else %}
<span class="v-center icon icon-flag"></span>
{% endif %}
{{ vndict[vj4.model.adaptor.discussion.node_id(ddoc)]['title']|default(_('(missing)')) }}
</a>
</li>
<li>
{{ user.render_inline(udict[ddoc['owner']], badge=false) }}
@
{{ datetime_span(ddoc['update_at'] or ddoc['_id'].generationTime) }}
</li>
</ul>
</div>
{% if not ddocs.length %}
{{ nothing.render('no discussion yet...') }}
{% else %}
<ol class="section__list discussion__list">
{% for ddoc in ddocs %}
<li class="section__list__item discussion__item{% if ddoc.highlight %} highlight{% endif %}">
<div class="media">
<div class="media__left">
<div class="discussion__replies numbox">
<div class="numbox__num large">{{ ddoc.nReply }}</div>
<div class="numbox__text">{{ _('Comments') }}</div>
</div>
</li>
{% endfor %}
</ol>
{% if page != undefined and dpcount != undefined %}
{{ paginator.render(page, dpcount) }}
{% endif %}
{% endif %}
</div>
<div class="media__body top">
<h1 class="discussion__title"><a href="/discuss/{{ ddoc._id }}#{{ handler.datetime_stamp(ddoc.updateAt) if ddoc.update_at else '' }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
<ul class="supplementary list">
<li>
<a class="discussion-node-tag" href="/discuss/{{ ddoc.parentType }}/{{ ddoc.parentId }}">
{% if ddoc.parentType == 'node' %}
<span class="v-center icon icon-tag"></span>
{% elif ddoc.parentType == 'contest' %}
<span class="v-center icon icon-award"></span>
{% else %}
<span class="v-center icon icon-flag"></span>
{% endif %}
{{ vndict[ddoc.parentId].title|default(_('(missing)')) }}
</a>
</li>
<li>
{{ user.render_inline(udict[ddoc.owner], badge=false) }}
@
{{ datetime_span(ddoc.updateAt)|safe }}
</li>
</ul>
</div>
</div>
</li>
{% endfor %}
</ol>
{% if page != undefined and dpcount != undefined %}
{{ paginator.render(page, dpcount) }}
{% endif %}
{% endif %}
+8 -8
View File
@@ -1,10 +1,10 @@
<div data-fragment-id="problem_lucky">
<p>
<a href="/problem/random{% if category %}?category={{ category }}{% endif %}" class="expanded button" target="_blank">
<span class="icon icon-feeling-lucky"></span> {{ _('Lucky') }}
</a>
</p>
<div class="typo supplementary">
<p>{{ _('Pick a problem randomly based on current filter') }}</p>
</div>
<p>
<a href="/problem/random{% if category %}?category={{ category }}{% endif %}" class="expanded button" target="_blank">
<span class="icon icon-feeling-lucky"></span> {{ _('Lucky') }}
</a>
</p>
<div class="typo supplementary">
<p>{{ _('Pick a problem randomly based on current filter') }}</p>
</div>
</div>
+1 -1
View File
@@ -1,3 +1,3 @@
<div class="section__body" data-fragment-id="problem_stat">
<p>{{ _('{0} problems').format(pcount) }}</p>
<p>{{ _('{0} problems').format(pcount) }}</p>
</div>
+2 -2
View File
@@ -2,13 +2,13 @@
{
"_id": 1,
"title": "最初的最初 - A+B Problem",
"require_nids": [],
"requireNids": [],
"pids": [1000, "56c52ade2fefd90539000005"]
},
{
"_id": 2,
"title": "最初的进阶",
"require_nids": [1],
"requireNids": [1],
"pids": [1001, 1002]
}
]
+9 -8
View File
@@ -8,17 +8,17 @@
{{ _('no_translation_warn')|safe }}
<p>每个用户可以创建自己的域。比如,老师可以为课程创建一个域,然后把题目和学生加入到此域中。再如,可以把域作为团队功能。</p>
<p>通过合理的设置角色及其权限,可以把域设为公开或私有。</p>
<p>默认域为Vijos,用户直接访问Vijos域名就会访问此域,点击Vijos Logo会从任意域跳转回Vijos域。</p>
<p>默认域为Hydro,用户直接访问Hydro域名就会访问此域,点击Hydro Logo会从任意域跳转回Hydro域。</p>
<p>每个域的题库、讨论、训练以及比赛是独立且自治的。</p>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
<div class="section__header">
<h1 class="section__title" id="compiler" data-heading>{{ _('Compilers\' Version and Parameters') }}</h1>
<h1 class="section__title" id="compiler" data-heading>{{ _("Compilers' Version and Parameters") }}</h1>
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>Vijos使用<a href="https://github.com/vijos/jd4">jd4</a>进行评测,以docker镜像的形式安装至评测机。所使用的编译器均为创建镜像时<a href="https://wiki.debian.org/DebianTesting">debian testing</a>分支的最新版。编译参数如下:</p>
<p>Hydro使用<a href="https://github.com/hydro-dev/HydroJudger">HydroJudger</a>进行评测,以docker镜像的形式安装至评测机。所使用的编译器均为创建镜像时<a href="https://wiki.debian.org/DebianTesting">debian testing</a>分支的最新版。编译参数如下:</p>
<blockquote><ul>
<li>Free Pascal <pre>fpc -O2 -o/out/foo /in/foo.pas</pre></li>
<li>C <pre>gcc -O2 -Wall -std=c99 -o /out/foo /in/foo.c -lm</pre></li>
@@ -38,7 +38,8 @@
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>Vijos 评测机使用进程的CPU时间计算时间消耗,时间的限定为题目中评测点所指定的时间。</p><p>Vijos 评测机使用进程虚拟内存与物理内存总和计算内存空间消耗。内存空间默认限定为256MiB,题目中特别指明的,限定为题目中评测点所指定的内存空间。</p>
<p>Hydro 评测机使用进程的CPU时间计算时间消耗,时间的限定为题目中评测点所指定的时间。</p>
<p>Hydro 评测机使用进程虚拟内存与物理内存总和计算内存空间消耗。内存空间默认限定为256MiB,题目中特别指明的,限定为题目中评测点所指定的内存空间。</p>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
@@ -47,7 +48,7 @@
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>Vijos 支持且仅支持标准输入输出(控制台输入输出,屏幕输入输出,STD I/O),不支持文件输入输出。</p>
<p>若无特殊说明,Hydro 使用标准输入输出(控制台输入输出,屏幕输入输出,STD I/O)。</p>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
@@ -130,7 +131,7 @@
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>通过率的影响极其恶劣,现在 Vijos 不提供也不承认通过率。</p>
<p>通过率的影响极其恶劣,现在 Hydro 不提供也不承认通过率。</p>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
@@ -139,7 +140,7 @@
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>Vijos RP 分为固定 RP 与浮动 RP ,固定 RP 可由活动、比赛等的奖励获得,浮动 RP 由一般性通过题目获得。</p>
<p>Hydro RP 分为固定 RP 与浮动 RP ,固定 RP 可由活动、比赛等的奖励获得,浮动 RP 由一般性通过题目获得。</p>
<p>浮动 RP 是一个动态的数值,每个用户在每道题上获得的 RP 都不一样,并且未来也不固定(即浮动之意)。</p>
<blockquote class="note">每道题的浮动 RP 由该题通过总人数与该用户通过此题的名次计算得来。</blockquote>
</div>
@@ -150,7 +151,7 @@
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>Vijos 中题目的难度,根据递交数、通过率以及每个递交的递交时间和评测结果,通过算法计算得出。</p>
<p>Hydro 中题目的难度,根据递交数、通过率以及每个递交的递交时间和评测结果,通过算法计算得出。</p>
<p>因此,请注意以下几点:</p>
<ul>
<li>0. 一般地,难度的数值越大,该题目越难。</li>