chromesetting
daiao 5 years ago
parent 664b3b22db
commit 5745ff8c28

@ -1,6 +1,8 @@
class Admins::ShixunFeedbackMessagesController < Admins::BaseController
def index
default_sort('created_at', 'desc')
@params_page = params[:page] || 1
@discusses = paginate Discuss.where(:dis_type => 'Shixun').preload(:user)
end
end

@ -35,7 +35,7 @@ class HackUserLastestCodesController < ApplicationController
# 提交结果显示
def result
if @my_hack.submit_status == 1
render json: {status:0, message: "正在评测中"}
render json: {status: 1, message: "正在评测中"}
else
@mode = params[:mode]
@result =

@ -9,6 +9,6 @@
<% end %>
</div>
<div class="box admin-list-container">
<%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {}) %>
<div class="box admin-list-container shixun_feedback_messages-list-container">
<%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {discusses: @discusses}) %>
</div>

@ -0,0 +1 @@
$(".shixun_feedback_messages-list-container").html("<%= j render partial: "admins/shixun_feedback_messages/shared/list", locals: {shixun_settings:@discusses} %>")

@ -1,24 +1,28 @@
<table class="table table-hover text-center">
<thead class="thead-light">
<tr>
<th width="6%">ID</th>
<th width="10%">标识</th>
<th width="22%" class="text-left">实训名称</th>
<th width="10%">实训老师</th>
<th width="6%">完成</th>
<th width="6%">经验值</th>
<th width="10%">学员姓名</th>
<th width="16%" class="text-left">学员单位</th>
<th width="14%">11</th>
<th width="5%">序号</th>
<th width="25%" class="text-left">实训名称</th>
<th width="50%" class="text-left">评论内容</th>
<th width="10%">评论者</th>
<th width="10%">评论时间</th>
</tr>
</thead>
<tbody>
<% if true %>
<% if discusses.present? %>
<% discusses.each_with_index do |discuss, index| %>
<tr>
<td><%= (@params_page.to_i - 1) * 20 + index + 1 %></td>
<td class="text-left"><%= discuss.dis.name %></td>
<td class="text-left"><%= content_safe discuss.content %></td>
<td><%= discuss.user.show_real_name %></td>
<td><%= format_time discuss.created_at %></td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%#= render partial: 'admins/shared/paginate', locals: { objects: myshixuns } %>
<%= render partial: 'admins/shared/paginate', locals: { objects: discusses } %>

@ -1,7 +1,12 @@
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
json.status 0
json.message "评测成功"
json.data do
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
# 提交模式多了一个预计输出
if @mode == "submit"
json.expected_output @result.expected_output
if @mode == "submit"
json.expected_output @result.expected_output
end
end

@ -1,5 +1,5 @@
# 编程内容
json.(@hack, :name, :description, :language, :difficult, :category, :time_limit)
json.(@hack, :name, :description, :language, :difficult, :category, :time_limit, :open_or_not)
# 代码
json.language @hack.language

Loading…
Cancel
Save