chromesetting
daiao 6 years ago
parent 664b3b22db
commit 5745ff8c28

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

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

@ -9,6 +9,6 @@
<% end %> <% end %>
</div> </div>
<div class="box admin-list-container"> <div class="box admin-list-container shixun_feedback_messages-list-container">
<%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {}) %> <%= render(partial: 'admins/shixun_feedback_messages/shared/list', locals: {discusses: @discusses}) %>
</div> </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"> <table class="table table-hover text-center">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th width="6%">ID</th> <th width="5%">序号</th>
<th width="10%">标识</th> <th width="25%" class="text-left">实训名称</th>
<th width="22%" class="text-left">实训名称</th> <th width="50%" class="text-left">评论内容</th>
<th width="10%">实训老师</th> <th width="10%">评论者</th>
<th width="6%">完成</th> <th width="10%">评论时间</th>
<th width="6%">经验值</th>
<th width="10%">学员姓名</th>
<th width="16%" class="text-left">学员单位</th>
<th width="14%">11</th>
</tr> </tr>
</thead> </thead>
<tbody> <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 %> <% else %>
<%= render 'admins/shared/no_data_for_table' %> <%= render 'admins/shared/no_data_for_table' %>
<% end %> <% end %>
</tbody> </tbody>
</table> </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, json.status 0
:input, :output, :execute_time, :execute_memory) json.message "评测成功"
json.data do
json.(@result, :id, :status, :error_line, :error_msg,
:input, :output, :execute_time, :execute_memory)
# 提交模式多了一个预计输出 # 提交模式多了一个预计输出
if @mode == "submit" if @mode == "submit"
json.expected_output @result.expected_output json.expected_output @result.expected_output
end
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 json.language @hack.language

Loading…
Cancel
Save