dev_forum
cxt 6 years ago
parent 5b4d9e17d3
commit 41da5389de

@ -122,7 +122,7 @@ class GraduationTasksController < ApplicationController
@work_count = @work_list.count @work_count = @work_list.count
@work_excel = @work_list @work_excel = @work_list
@work_list = @work_list.page(page).limit(limit) @work_list = @work_list.page(page).per(limit)
respond_to do |format| respond_to do |format|
format.json format.json
format.xlsx{ format.xlsx{

@ -316,10 +316,13 @@ class HomeworkCommonsController < ApplicationController
compelete_status = 1 compelete_status = 1
end end
end end
if setting_time.end_time > Time.now games.each do |game|
work.update_attributes(:work_status => 1, :late_penalty => 0, :commit_time => myshixun.updated_at, :update_time => myshixun.updated_at, :myshixun_id => myshixun.id, :compelete_status => compelete_status) unless game.nil?
else pass_consume_time += (game.cost_time / 60.0).to_f
work.update_attributes(:work_status => ((myshixun.is_complete? && (myshixun.done_time < setting_time.end_time)) ? 1 : 2), :late_penalty => (myshixun.is_complete? && (myshixun.done_time < setting_time.end_time) ? 0 : homework.late_penalty), :commit_time => myshixun.updated_at, :update_time => myshixun.updated_at, :myshixun_id => myshixun.id, :compelete_status => compelete_status) user_total_score += game.final_score.to_i < 0 ? 0 : game.challenge.score.to_i
adjust_score = work.challenge_work_scores.where(:challenge_id => setting.challenge_id).last
final_score += adjust_score.present? ? adjust_score.score : (homework.homework_detail_manual.answer_open_evaluation ? setting.score : (game.final_score > 0 ? game.real_score(setting.score) : 0))
end
end end
end end
end end

@ -43,7 +43,7 @@ class StudentWorksController < ApplicationController
def search_member_list def search_member_list
# 统一设置的作业取所有学生,否则取已发布的分班学生 # 统一设置的作业取所有学生,否则取已发布的分班学生
students = @homework.unified_setting? ? @course.students : @course.students.where(course_group_id: @homework.published_settings.pluck(:course_group_id)) students = @homework.unified_setting? ? @course.students : @course.students.where(course_group_id: @homework.published_settings.pluck(:course_group_id))
unless params[:search].blank? if !params[:search].blank?
@members = students.joins(user: :user_extension).where("course_members.user_id != #{current_user.id} and (concat(users.lastname, users.firstname) @members = students.joins(user: :user_extension).where("course_members.user_id != #{current_user.id} and (concat(users.lastname, users.firstname)
like ? or user_extensions.student_id like ?)", "%#{params[:search]}%", "%#{params[:search]}%") like ? or user_extensions.student_id like ?)", "%#{params[:search]}%", "%#{params[:search]}%")
else else

Loading…
Cancel
Save