Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_static
tangjiang 5 years ago
commit 6a7657f07d

@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController
end end
def course_statistics course, max_exp, limit def course_statistics course, max_exp, limit
max_rate = max_exp.nil? ? 0 : 20.0 / max_exp max_rate = max_exp.nil? || max_exp <= 0 ? 0 : 20.0 / max_exp
sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num + sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num +
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate}) homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})

@ -17,7 +17,7 @@
</td> </td>
<td> <td>
<% if department.identifier.present? %> <% if department.identifier.present? %>
<%= link_to department.identifier.to_s, statistics_college_path(department.identifier), target: '_blank' %> <%= link_to department.identifier.to_s, "/colleges/#{department.identifier}/statistics", target: '_blank' %>
<% else %> <% else %>
-- --
<% end %> <% end %>

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

@ -8,6 +8,7 @@ json.hack do
json.submit_count @hack.submit_num json.submit_count @hack.submit_num
json.notes @my_hack.notes json.notes @my_hack.notes
json.modify_code @modify json.modify_code @modify
json.passed @my_hack.passed
json.comments_count @hack.discusses.count json.comments_count @hack.discusses.count
json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 json.user_praise @hack.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0
end end

Loading…
Cancel
Save