diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 0c82edad7..e9b49b6fd 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -184,14 +184,24 @@ class CoursesController < ApplicationController if params[:incourse] results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q) elsif params[:ingroup] - @group = CourseGroup.find(params[:search_group_id]) - results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q) + if params[:search_group_id] == "-1" + @group = -1 + results = searchmember_by_name(student_homework_score(-1,0,0,"desc"), q) + else + @group = CourseGroup.find(params[:search_group_id]) + results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q) + end end @is_remote = true #@result_count = results.count #@results = paginateHelper results, 10 @results = results @search_name = q + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @results.count + @mem_pages = Paginator.new @members_count, @limit, @page + @results = paginateHelper @results, @limit end def addgroups @@ -208,6 +218,12 @@ class CoursesController < ApplicationController @is_remote = true @members = student_homework_score(0,0, 10,@score_sort_by) @course_groups = @course.course_groups + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @members.count + @no_group_count = @members_count - @course.members.where("course_group_id != 0").count + @mem_pages = Paginator.new @members_count, @limit, @page + @members = paginateHelper @members, @limit end def deletegroup @@ -219,6 +235,12 @@ class CoursesController < ApplicationController @score_sort_by = "desc" @members = student_homework_score(0,0, 10,@score_sort_by) @course_groups = @course.course_groups + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @members.count + @no_group_count = @members_count - @course.members.where("course_group_id != 0").count + @mem_pages = Paginator.new @members_count, @limit, @page + @members = paginateHelper @members, @limit end def updategroupname @@ -232,6 +254,12 @@ class CoursesController < ApplicationController @is_remote = true @members = student_homework_score(0,0, 10,"desc") @course_groups = @course.course_groups + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @members.count + @no_group_count = @members_count - @course.members.where("course_group_id != 0").count + @mem_pages = Paginator.new @members_count, @limit, @page + @members = paginateHelper @members, @limit end def valid_ajax @@ -268,6 +296,7 @@ class CoursesController < ApplicationController member.course_group_id = params[:course_group_id].to_i member.save @course_groups = @course.course_groups + @no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' respond_to do |format| format.js @@ -283,6 +312,7 @@ class CoursesController < ApplicationController @group = group @course_groups = @course.course_groups + @no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count search_group_members group end @@ -294,6 +324,7 @@ class CoursesController < ApplicationController member.save @group = group @course_groups = @course.course_groups + @no_group_count = @course.student.count - @course.members.where("course_group_id != 0").count search_group_members group end @@ -304,14 +335,22 @@ class CoursesController < ApplicationController @is_remote = true @sort_type = 'score' @score_sort_by = "desc" - if params[:group_id] && params[:group_id] != "0" + if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1" @group = CourseGroup.find(params[:group_id]) @results = student_homework_score(@group.id,0, 0,"desc") # @results = paginateHelper @results, 10 + elsif params[:group_id] && params[:group_id] == "-1" + @group = -1 + @results = student_homework_score(-1, 0, 10,"desc") else page_from = params[:page].nil? ? 0 : (params[:page].to_i - 1) @results = student_homework_score(0,page_from, 10,"desc") end + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @results.count + @mem_pages = Paginator.new @members_count, @limit, @page + @results = paginateHelper @results, @limit end def member @@ -332,10 +371,14 @@ class CoursesController < ApplicationController @members = @all_members when '2' if @course.open_student == 1 || User.current.member_of_course?(@course) || User.current.admin? + @limit = 50 @subPage_title = l :label_student_list - page = params[:page].nil? ? 0 : (params['page'].to_i - 1) - @all_members = student_homework_score(0,page, 10,@score_sort_by,@sort_type) - @members = @all_members + @page = params[:page].nil? ? 1 : params['page'].to_i + @all_members = student_homework_score(0, @page - 1, @limit, @score_sort_by, @sort_type) + @members_count = @all_members.count + @no_group_count = @members_count - @course.members.where("course_group_id != 0").count + @mem_pages = Paginator.new @members_count, @limit, @page + @members = paginateHelper @all_members, @limit else render_403 return @@ -378,25 +421,35 @@ class CoursesController < ApplicationController group_id = params[:group_id] if !@search_name.nil? if group_id == '0' - page = params[:page].nil? ? 0 : (params['page'].to_i - 1) + #page = params[:page].nil? ? 0 : (params['page'].to_i - 1) @results = searchmember_by_name(student_homework_score(0,0,0,@score_sort_by,@sort_type), @search_name) - @result_count = @results.count # @results = paginateHelper @results, 10 + elsif group_id == '-1' + @group = -1 + @results = searchmember_by_name(student_homework_score(-1,0,0,@score_sort_by,@sort_type), @search_name) else @group = CourseGroup.find(group_id) @results = searchmember_by_name(student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type),@search_name) - @result_count = @results.count # @results = paginateHelper @results, 10 end else if group_id == '0' page = params[:page].nil? ? 0 : (params['page'].to_i - 1) @results = student_homework_score(0,page, 10,@score_sort_by,@sort_type) + elsif group_id == '-1' + @group = -1 + @results = student_homework_score(-1,0, 10,@score_sort_by,@sort_type) else @group = CourseGroup.find(group_id) @results = student_homework_score(group_id, 0, 0,@score_sort_by,@sort_type) end end + @limit = 50 + @page = params[:page].nil? ? 1 : params['page'].to_i + @members_count = @results.count + @no_group_count = @members_count - @course.members.where("course_group_id != 0").count + @mem_pages = Paginator.new @members_count, @limit, @page + @results = paginateHelper @results, @limit end # 显示每个学生的作业评分详情 def show_member_score @@ -1223,7 +1276,6 @@ class CoursesController < ApplicationController def student_homework_score(groupid,start_from, nums, score_sort_by, sort_type = 'score') start_from = start_from * nums - sql_select = "" if groupid == 0 sql_select = "SELECT members.*,( SELECT SUM(student_works.work_score) @@ -1233,16 +1285,47 @@ class CoursesController < ApplicationController AND student_works.user_id = members.user_id ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id - ) AS act_score,(SELECT SUM(exercise_users.score) - FROM exercise_users,exercises - WHERE exercise_users.exercise_id = exercises.id - AND exercises.course_id = #{@course.id} - AND exercise_users.user_id = members.user_id - ) AS ex_score + ) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id + AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score, + (SELECT student_id FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id, + (SELECT message_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num, + (SELECT message_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num, + (SELECT news_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num, + (SELECT news_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num, + (SELECT resource_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num, + (SELECT journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num, + (SELECT homework_journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num, + (SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num, + (SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id WHERE members.course_id = #{@course.id} ORDER BY #{sort_type} #{score_sort_by}" + elsif groupid == -1 + sql_select = "SELECT members.*,( + SELECT SUM(student_works.work_score) + FROM student_works,homework_commons + WHERE student_works.homework_common_id = homework_commons.id + AND homework_commons.course_id = #{@course.id} + AND student_works.user_id = members.user_id + ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id + ) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id + AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score, + (SELECT student_id FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id, + (SELECT message_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num, + (SELECT message_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num, + (SELECT news_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num, + (SELECT news_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num, + (SELECT resource_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num, + (SELECT journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num, + (SELECT homework_journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num, + (SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num, + (SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num + FROM members + JOIN students_for_courses + ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id + WHERE members.course_id = #{@course.id} AND members.course_group_id = 0 ORDER BY #{sort_type} #{score_sort_by}" else sql_select = "SELECT members.*,( SELECT SUM(student_works.work_score) @@ -1252,12 +1335,18 @@ class CoursesController < ApplicationController AND student_works.user_id = members.user_id ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id - ) AS act_score,(SELECT SUM(exercise_users.score) - FROM exercise_users,exercises - WHERE exercise_users.exercise_id = exercises.id - AND exercises.course_id = #{@course.id} - AND exercise_users.user_id = members.user_id - ) AS ex_score + ) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id + AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score, + (SELECT student_id FROM user_extensions WHERE user_extensions.user_id = members.user_id) AS student_id, + (SELECT message_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_num, + (SELECT message_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS message_reply_num, + (SELECT news_reply_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_reply_num, + (SELECT news_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS news_num, + (SELECT resource_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS resource_num, + (SELECT journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS journal_num, + (SELECT homework_journal_num FROM course_contributor_scores AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id) AS homework_journal_num, + (SELECT COUNT(ss.id) FROM student_works AS ss ,homework_commons AS hc WHERE ss.homework_common_id = hc.id AND hc.course_id = #{@course.id} AND ss.work_status != 0 AND ss.user_id = members.user_id) AS homework_num, + (SELECT COUNT(eu.id) FROM exercise_users AS eu,exercises WHERE eu.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercises.end_time >= eu.created_at AND eu.user_id = members.user_id) AS exercise_num FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id @@ -1310,8 +1399,10 @@ class CoursesController < ApplicationController for i in 0 ... homeworks.count sheet1[5,i+4] = "第"+(i+1).to_s+"次" end - sheet1[5,homeworks.count+4] = "总成绩" - sheet1[5,homeworks.count+5] = "活跃度" + sheet1[5,homeworks.count+4] = "作业得分" + sheet1[5,homeworks.count+5] = "测评得分" + sheet1[5,homeworks.count+6] = "社区得分" + sheet1[5,homeworks.count+7] = "总得分" count_row = 6 members.each_with_index do |member, i| sheet1[count_row,0]= i+1 @@ -1328,8 +1419,14 @@ class CoursesController < ApplicationController sheet1[count_row,j+4] = score <0 ? 0:score.round(2) end end - sheet1[count_row,homeworks.count+4] = member.score.nil? ? 0:member.score.round(2) - sheet1[count_row,homeworks.count+5] = member.act_score.nil? ? 0:member.act_score + hw_score = member.score.nil? ? 0 : member.score + ex_score = member.ex_score.nil? ? 0 : member.ex_score + act_score = member.act_score.nil? ? 0 : member.act_score + sum = hw_score + ex_score + act_score + sheet1[count_row,homeworks.count+4] = hw_score.round(2) + sheet1[count_row,homeworks.count+5] = ex_score + sheet1[count_row,homeworks.count+6] = act_score + sheet1[count_row,homeworks.count+7] = sum.round(2) count_row += 1 end diff --git a/app/views/courses/_course_student.html.erb b/app/views/courses/_course_student.html.erb index db0aabc3b..59c0dc641 100644 --- a/app/views/courses/_course_student.html.erb +++ b/app/views/courses/_course_student.html.erb @@ -1,5 +1,7 @@
- <%= render :partial => 'searchmembers' %> +
+ <%= render :partial => 'searchmembers' %> +
diff --git a/app/views/courses/_new_groups_name.html.erb b/app/views/courses/_new_groups_name.html.erb index 81799360a..24be067ba 100644 --- a/app/views/courses/_new_groups_name.html.erb +++ b/app/views/courses/_new_groups_name.html.erb @@ -3,8 +3,9 @@
  • <%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
  • -
  • - <%= link_to '未分班', searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%> +
  • + <%= link_to "未分班", searchgroupmembers_course_path(@course,:group_id => -1), :onclick => "checkclass('course_group_0')", method: 'get', remote: true, :class => 'fl mr5'%> + (<%=@no_group_count %>人)
  • <% unless course_groups.nil? %> diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 31bc91589..c5d04c45c 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -1,23 +1,11 @@ - -
    - <% if User.current.logged? && User.current.member_of_course?(@course) && @group %> - <%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %> - - <%= l(:label_current_group)%>:  - <%= @group.name %> - - <% end %> -
    -
    - <% if members.any? %> - +
    - <% members.each_with_index do |member, i| %> - + <% user = member.user %> <% hw_score = member.score.nil? ? 0 : member.score %> <% ex_score = member.ex_score.nil? ? 0 : member.ex_score %> <% act_score = member.act_score.nil? ? 0 : member.act_score %> <% sum = hw_score + ex_score + act_score %> - + - <% end %>
    序号 姓名 - <%= link_to '学号', member_score_sort_course_path(:sort_type => 'student_id', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> + <%= link_to '学号', member_score_sort_course_path(:sort_type => 'student_id', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> <% if @sort_type == "student_id" && @score_sort_by == 'desc' %> <% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %> @@ -25,7 +13,7 @@ <% end %> - <%= link_to '作业得分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> + <%= link_to '作业得分', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> <% if @sort_type == "score" && @score_sort_by == 'desc' %> <% elsif @sort_type == "score" && @score_sort_by == 'asc' %> @@ -36,14 +24,20 @@ 班级作业的得分总和

    测评得分 + + <%= link_to '测评得分', member_score_sort_course_path(:sort_type => 'ex_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :search_name => (@search_name ? @search_name : nil)), :result => members, method: 'get', remote: true, :style => 'color:#000000;'%> + <% if @sort_type == "ex_score" && @score_sort_by == 'desc' %> + + <% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %> + + <% end %>

    积分规则
    班级测验的得分总和

    - <%= link_to '社区得分', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :style => 'color:#000000;'%> + <%= link_to '社区得分', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :style => 'color:#000000;'%> <% if @sort_type == "act_score" && @score_sort_by == 'desc' %> <% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %> @@ -73,13 +67,13 @@
    <%= i + 1 %><%= (@page - 1) * @limit + i + 1 %> <%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30"), user_path(member.user_id), :class => 'sy_class_users_st fl mt4 mr5' ,:alt => "用户头像" %> <%= user.show_name %> @@ -102,142 +96,58 @@ :remote => true}, :class => '' %> + <%= format("%0.2f", sum) %> -
    +

    <%= user.show_name %>
    - 资源    发布数:1
    - 问答    发布数:1回复数:1
    - 通知    提交数:1留言数:1
    - 作业    提交数:1留言数:1
    - 班级    留言数:1
    - 测验    提交数:1 + 资源    发布数:<%= member.resource_num %>
    + 问答    发布数:<%= member.message_num %>回复数:<%= member.message_reply_num %>
    + 通知    提交数:<%= member.news_num %>留言数:<%= member.news_reply_num %>
    + 作业    提交数:<%= member.homework_num %>留言数:<%= member.homework_journal_num %>
    + 班级    留言数:<%= member.journal_num %>
    + 测验    提交数:<%= member.exercise_num %>

    - <% unless @course.course_groups.empty? %> - <% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? || User.current == user %> - <% if @course.course_groups.nil? || @group %> - <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> - <% else %> - <%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %> -
    - <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> - -
    - <%= select( :name,:group_id, course_group_option(@course), - { :include_blank => false,:selected => member.course_group_id}, - {:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w100 undis class-edit sy_fenban_select", :style => "margin-left: 5px;"}) %> - <% end %> - <% end %> - <% else %> + <% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? || User.current == user %> + <% if @course.course_groups.empty? %> <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> + <% else %> + <%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %> +
    + <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> + +
    + <%= select( :name,:group_id, course_group_option(@course), + { :include_blank => false,:selected => member.course_group_id}, + {:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w100 undis class-edit sy_fenban_select", :style => "margin-left: 5px;"}) %> + <% end %> <% end %> + <% else %> + <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> <% end %>
    +
    +
    +
      + <%= pagination_links_full @mem_pages, @members_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%> +
    +
    +
    +
    <% else%>

    <%= l(:label_no_data) %>

    <% end %> -<% if members.any? %> -
    -
      -
    • 姓名
    • -
    • 学号
    • - <% unless @course.course_groups.empty? %> -
    • 分班
    • - <% end %> -
    • - <%= link_to '英雄榜', member_score_sort_course_path(:sort_type => 'score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml35'%> - <% if @sort_type == "score" && @score_sort_by == 'desc' %> - - <% elsif @sort_type == "score" && @score_sort_by == 'asc' %> - - <% end %> -
    • -
    • - <%= link_to '活跃度', member_score_sort_course_path(:sort_type => 'act_score', :sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true, :class => 'ml35'%> - <% if @sort_type == "act_score" && @score_sort_by == 'desc' %> - - <% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %> - - <% end %> -
    • -
    • 加入时间
    • -
    -
    - - <% members.each do |member| %> -
    - - <%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %> - -
      -
    • - <%= link_to("#{l(:label_bidding_user_studentname)}:".html_safe,user_path(member.user)) %> -
    • -
      - <% unless member.user.user_extensions.student_id == ''%> -
    • <%= link_to("#{l(:label_bidding_user_studentcode)}:".html_safe,user_path(member.user)) %>
    • - <% end%> -
    - <% unless @course.course_groups.empty? %> - <% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %> - <% if @course.course_groups.nil? || @group %> -
    - -
    - <% else %> - <%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %> -
    - -
    - <%= select( :name,:group_id, course_group_option(@course), - { :include_blank => false,:selected => member.course_group_id}, - {:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 5px;"}) %> - <% end %> - <% end %> - <% else %> -
    - -
    - <% end %> - <% end %> - <%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), { - :action => 'show_member_score', - :member_id => member.id, - :remote => true}, - :class => "st_list_score c_red #{@course.course_groups.empty? ? 'ml130' : ''}" %> - <%= link_to member.act_score.nil? ? 0 : member.act_score.to_s, { - :action => 'show_member_act_score', - :member_id => member.id, - :remote => true}, - :class => 'st_list_score c_red' %> - <%= format_date(member.created_on)%> - <%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %> -
    -
    - <% end; reset_cycle %> -
    - - -<% else%> -

    - <%= l(:label_no_data) %> -

    -<% end%> -