pre_develop
cxt 6 years ago
parent 2968f969b3
commit c49f381345

@ -584,16 +584,16 @@ class StudentWorkController < ApplicationController
@stundet_works = @stundet_works.where(:work_status => @status)
end
@stundet_works = search_work_member @stundet_works, @name
if @stundet_works.size != 0
if @order == "student_id"
@stundet_works = @stundet_works.includes(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}")
@stundet_works = @stundet_works.joins(:user => {:user_extensions => []}).order("user_extensions.student_id #{@b_sort}")
else
@stundet_works = @stundet_works.order("#{@order} #{@b_sort}")
end
end
@stundet_works = search_work_member @stundet_works, @name
@score = @b_sort == "desc" ? "asc" : "desc"
# @is_focus = params[:is_focus] ? params[:is_focus].to_i : 0
# 消息传过来的ID
@ -615,6 +615,7 @@ class StudentWorkController < ApplicationController
_index
@stundet_works = paginateHelper @stundet_works, @limit
@members = @course.members.select([:user_id, :course_group_id])
if @stundet_works.size != 0
@stundet_works = if @homework.homework_type == 1
@stundet_works.includes(:student_works_scores, [user: :user_extensions])
@ -623,7 +624,6 @@ class StudentWorkController < ApplicationController
elsif @homework.homework_type == 4
@stundet_works.includes(:student_works_scores, [myshixun: :games], [user: :user_extensions])
end
@members = @course.members.where(user_id: @stundet_works.pluck(:user_id)).select([:user_id, :course_group_id])
end
respond_to do |format|
format.js

@ -199,14 +199,11 @@
<a href="javascript:void(0);" id="status_no_limit" class="<%= @status.blank? ? 'check_on' : '' %> pl10 pr10">不限</a>
</span>
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>>
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).count %>
)</label>
<label for="work_status_1" class="fl mr25">未提交(<%= @all_student_works.where(:work_status => 0).count %>)</label>
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>>
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).count %>
)</label>
<label for="work_status_2" class="fl mr25">按时提交(<%= student_works.where(:work_status => 1).count %>)</label>
<input id="work_status_3" class="magic-checkbox fl" type="checkbox" value="2" name="status[]" <%= !@status.blank? && @status.include?('2') ? 'checked' : '' %>>
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).count %>
)</label>
<label for="work_status_3" class="fl mr25">延时提交(<%= student_works.where(:work_status => 2).count %>)</label>
</li>
<li class="clearfix">

Loading…
Cancel
Save