diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 403119e20..0c82edad7 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1233,7 +1233,12 @@ 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 + ) 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 FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id @@ -1247,7 +1252,12 @@ 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 + ) 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 FROM members JOIN students_for_courses ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id diff --git a/app/views/courses/_course_student.html.erb b/app/views/courses/_course_student.html.erb index 8da3987a8..db0aabc3b 100644 --- a/app/views/courses/_course_student.html.erb +++ b/app/views/courses/_course_student.html.erb @@ -1,10 +1,8 @@ -
- +
+ <%= render :partial => 'searchmembers' %>
-
+
<%= render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups} %>
@@ -12,5 +10,4 @@
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
-
-
\ No newline at end of file +
\ No newline at end of file diff --git a/app/views/courses/_new_groups_name.html.erb b/app/views/courses/_new_groups_name.html.erb index 6ffbb6dd2..81799360a 100644 --- a/app/views/courses/_new_groups_name.html.erb +++ b/app/views/courses/_new_groups_name.html.erb @@ -1,56 +1,41 @@ \ No newline at end of file diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 08df18175..31bc91589 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -11,15 +11,144 @@
<% if members.any? %> - <% if @result_count %> -

- <%= l(:label_search_member_count) %> - <%= @result_count %> - <%= l(:label_member_people) %> + + + + + + + + + + + + + + + <% 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;'%> + <% if @sort_type == "student_id" && @score_sort_by == 'desc' %> + + <% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %> + + <% 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;'%> + <% 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, :style => 'color:#000000;'%> + <% if @sort_type == "act_score" && @score_sort_by == 'desc' %> + + <% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %> + + <% end %> +
+

积分规则
+ 资源发布:资源数 x 5
+ 问答发布:发帖数 x 2
+ 通知发布:通知数 x 1
+ 问答回复:回复数 x 1
+ 作业留言:留言数 x 1
+ 通知留言:留言数 x 1
+ 班级留言:留言数 x 1
+ 总得分为以上得分之和

-
+
+
总得分 +
+

积分规则
+ 作业得分+测评得分+社区得分

+
+
分班
<%= 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 %> + + <%= user.user_extensions.student_id %> + + <%= link_to format("%0.2f", hw_score), { + :action => 'show_member_score', + :member_id => member.id, + :remote => true}, + :class => "" %> + <%= ex_score %> + <%= link_to act_score, { + :action => 'show_member_act_score', + :member_id => member.id, + :remote => true}, + :class => '' %> + + <%= format("%0.2f", sum) %> +
+ +

+ <%= user.show_name %>
+ 资源    发布数:1
+ 问答    发布数:1回复数:1
+ 通知    提交数:1留言数:1
+ 作业    提交数:1留言数:1
+ 班级    留言数:1
+ 测验    提交数:1 +

+
+
+ <% 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 %> + <%=member.course_group_id == 0 ? "暂无" : member.course_group.name %> + <% end %> + <% end %> +
+<% else%> +

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

+<% end %> +<% if members.any? %>