算法评测平台前端。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.8 KiB

<% this.title = problem.title + ' - 题目' %>
8 years ago
<% include header %>
<div class="ui center aligned grid">
<div class="row">
<h1 class="ui header"><%= problem.title %><% if (problem.allowedEdit && !problem.is_public) { %><span class="ui tiny red label">未公开</span><% } %></h1>
</div>
<div class="row" style="margin-top: -15px">
<span class="ui label">内存限制: <%= problem.memory_limit %> MiB</span>
<span class="ui label">时间限制: <%= problem.time_limit %> ms</span>
</div>
<div class="row" style="margin-top: -23px">
8 years ago
<% if (problem.file_io) { %>
<span class="ui label">输入文件: <%= problem.file_io_input_name %></span>
<span class="ui label">输出文件: <%= problem.file_io_output_name %></span>
8 years ago
<% } else { %>
<span class="ui label">标准输入输出</span>
8 years ago
<% } %>
</div>
8 years ago
</div>
<div class="ui grid">
<div class="row">
<div class="column">
<div class="ui buttons">
<a class="small ui primary button" href="<%= syzoj.utils.makeUrl(['submit', problem.id]) %>">提交</a>
<a class="small ui positive button" href="<%= syzoj.utils.makeUrl(['judge_state'], { problem_id: problem.id }) %>">提交记录</a>
<a class="small ui yellow button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'download']) %>">下载测试数据</a>
8 years ago
<% if (problem.allowedEdit) { %>
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'edit']) %>">编辑题面</a>
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'upload']) %>">上传测试数据</a>
8 years ago
<% } %>
<% if (user && user.is_admin) { %>
<% if (problem.is_public) { %>
<button class="small ui button" id="dis_public">取消公开</button>
<% } else { %>
<button class="small ui button" id="public">公开</button>
<% } %>
8 years ago
<% } %>
</div>
8 years ago
</div>
</div>
<div class="row">
<div class="column">
<h4 class="ui top attached block header">题目描述</h4>
<div class="ui bottom attached segment" id="description"><%- problem.description %></div>
</div>
</div>
<div class="row">
<div class="column">
<h4 class="ui top attached block header">输入格式</h4>
<div class="ui bottom attached segment" id="input"><%- problem.input_format %></div>
</div>
</div>
<div class="row">
<div class="column">
<h4 class="ui top attached block header">输出格式</h4>
<div class="ui bottom attached segment" id="output"><%- problem.output_format %></div>
</div>
</div>
<div class="row">
<div class="column">
<h4 class="ui top attached block header">测试样例</h4>
<div class="ui bottom attached segment" id="example"><%- problem.example %></div>
</div>
</div>
<div class="row">
<div class="column">
<h4 class="ui top attached block header">数据范围与提示</h4>
<div class="ui bottom attached segment" id="hint"><%- problem.limit_and_hint %></div>
8 years ago
</div>
</div>
</div>
<script type="text/javascript">
function public_problem() {
$.ajax({
url: '<%= syzoj.utils.makeUrl(['api', 'problem', problem.id, 'public']) %>',
type: 'POST',
complete: function () { location.reload(true) },
async: true
8 years ago
});
}
function dis_public_problem() {
$.ajax({
url: '<%= syzoj.utils.makeUrl(['api', 'problem', problem.id, 'public']) %>',
type: 'DELETE',
complete: function () { location.reload(true) },
async: true
8 years ago
});
}
$(document).ready(function(){
$("#public").click(function(){
public_problem();
});
$("#dis_public").click(function(){
dis_public_problem();
});
});
</script>
<% include footer %>