|
|
|
@ -1554,7 +1554,7 @@ class CoursesController < ApplicationController
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
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 +
|
|
|
|
|
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})
|
|
|
|
|