Skip to content

Commit

Permalink
feature: add some kindly hints about the identical answers
Browse files Browse the repository at this point in the history
  • Loading branch information
tc-imba committed Jul 1, 2019
1 parent be65edb commit c3bdbf8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 5 deletions.
40 changes: 35 additions & 5 deletions vj4/ui/templates/record_detail_case.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,65 @@
</script>#}
<div class="row">
<div class="medium-12 columns">
<div class="section visible" id="status">
<div class="section visible" id="notes">
<div class="section__header">
<h1 class="section__title">
Notes
</h1>
</div>
<div class="section__body typo">
This function is in alpha test. Please help improve it in the issues
This function is in beta test. Please help improve it in the issues
<a href="https://github.com/joint-online-judge/cb4/issues/22" target="_blank">here</a>.
</div>
</div>
</div>
<div class="medium-12 columns">
<div class="section visible" id="status">
<div class="section visible" id="stderr">
<div class="section__header">
<h1 class="section__title">
<span
class="icon record-status--icon {{ vj4.constant.record.STATUS_CODES[vj4.constant.record.STATUS_JUDGING] }}"></span>
<span
class="record-status--text {{ vj4.constant.record.STATUS_CODES[vj4.constant.record.STATUS_JUDGING] }}">Stderr</span>
<a class="tool-button" href="{{ reverse_url('wiki_help') }}#stderr"><span class="icon icon-help"></span></a>
</h1>
</div>
<div class="section__body">
<pre class="compiler-text">{{ rcdoc['stderr'] }}</pre>
</div>
</div>
</div>
{% if rcdoc['stdout'] == rcdoc['answer'] and rcdoc['status'] != vj4.constant.record.STATUS_ACCEPTED %}
<div class="medium-12 columns">
<div class="section visible" id="hints">
<div class="section__header">
<h1 class="section__title">
Hints
</h1>
</div>
<div class="section__body typo">
<p>Your answer is identical to the JOJ answer in the first several lines.</p>
{% if rcdoc['status'] == vj4.constant.record.STATUS_WRONG_ANSWER %}
<p>However, you still get <span
class="record-status--text {{ vj4.constant.record.STATUS_CODES[rcdoc['status']] }}">
{{ vj4.constant.record.STATUS_TEXTS[rcdoc['status']] }}</span>
because the complete output may be longer and there might be errors in the future lines.</p>
{% else %}
<p>However, the problem is
<span class="record-status--text {{ vj4.constant.record.STATUS_CODES[rcdoc['status']] }}">
{{ vj4.constant.record.STATUS_TEXTS[rcdoc['status']] }}</span>.
{% if rcdoc['execute_status'] != 0 %}
And the exit code of your program is {{ rcdoc['execute_status'] }}, which should be 0.
{% endif %}
</p>
{% endif %}
<p>Please double check your code to solve this problem and try again.</p>
</div>
</div>
</div>
{% endif %}
<div class="medium-6 columns">
<div class="section visible" id="status">
<div class="section visible" id="stdout">
<div class="section__header">
<h1 class="section__title">
<span class="icon record-status--icon {{ vj4.constant.record.STATUS_CODES[rcdoc['status']] }}"></span>
Expand All @@ -49,7 +79,7 @@ <h1 class="section__title">
</div>
</div>
<div class="medium-6 columns">
<div class="section visible" id="status">
<div class="section visible" id="answer">
<div class="section__header">
<h1 class="section__title">
<span
Expand Down
10 changes: 10 additions & 0 deletions vj4/ui/templates/wiki_help.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ <h1 class="section__title" id="status" data-heading>{{ _('Judge Status') }}</h1>
<blockquote class="note">有“成绩取消”字样则说明管理员手动标记此记录为取消,可能违反了服务条款,比如代码被发现与其他用户的代码十分相似。</blockquote>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
<div class="section__header">
<h1 class="section__title" id="stderr" data-heading>Stderr</h1>
</div>
<div class="section__body typo">
{{ _('no_translation_warn')|safe }}
<p>stderr shows the debug message outputed to the standard error file (STDERR_FILENO: 2)</p>
<p>For example, in C++, it is std::cerr</p>
</div>
</div>
<div class="section" data-heading-extract-to="#menu-item-wiki_help">
<div class="section__header">
<h1 class="section__title" id="ce" data-heading>{{ _('Compile Error') }}</h1>
Expand Down

0 comments on commit c3bdbf8

Please sign in to comment.