From 9bfb749e705411b5e17ef6643a4ee8e1e9d47384 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Sep 2016 10:17:45 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E8=AF=BE=E5=86=85=E6=90=9C=E7=B4=A2=E6=94=B9?= =?UTF-8?q?=E6=88=90=E7=8F=AD=E5=86=85=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_course_file.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 045eec6f7..1157961fe 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -98,7 +98,7 @@
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %> <%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%> - <%= submit_tag "课内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %> + <%= submit_tag "班内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %> <%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite" %> <% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %> From 42afe33dab280adc715113d25ebc1d59faa6ee3a Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Sep 2016 11:12:01 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0=E5=8F=AA=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=80=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_homework_post_brief.html.erb | 2 +- .../student_work/_student_work_list.html.erb | 4 ---- app/views/student_work/index.html.erb | 23 ------------------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/app/views/student_work/_homework_post_brief.html.erb b/app/views/student_work/_homework_post_brief.html.erb index 6b3c0d542..310b4118b 100644 --- a/app/views/student_work/_homework_post_brief.html.erb +++ b/app/views/student_work/_homework_post_brief.html.erb @@ -42,7 +42,7 @@
-
+
<%= homework.description.html_safe %>
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb index 6bcb2bb5e..77517f747 100644 --- a/app/views/student_work/_student_work_list.html.erb +++ b/app/views/student_work/_student_work_list.html.erb @@ -54,10 +54,6 @@
From 0e8df56c9aee1467e647ecfd23ae615958f8d4ee Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Sep 2016 14:38:07 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_evaluation_un_group_member_work.html.erb | 21 ++++++++++--------- .../student_work/_evaluation_un_work.html.erb | 10 ++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index 842e1c899..3ee9ec891 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -1,8 +1,9 @@ +<% is_expand = st.student_work_projects.empty? %>
  • -
    +
    > <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %> - <% if !st.student_work_projects.empty? %> + <% if !is_expand %> (组长) @@ -11,10 +12,10 @@ 学号:<%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%> <% else %> - + -
    - +
diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index bb87bfde1..2a2b7faee 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -95,19 +95,19 @@ <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <% unless score.nil?%> -
+
作品最终评分为 -  <%= student_work.final_score%> 分。 +  <%= student_work.final_score%> 
迟交扣分   <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %> -  分, +  分
缺评扣分   <%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%> -  分, +  分
最终成绩为 -  <%= format("%.1f",score<0 ? 0 : score)%> 分。 +  <%= format("%.1f",score<0 ? 0 : score)%> 
<% end%> From 4db59ea0d328d2a56443fab6c2bd7366a1ab3fc1 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 26 Sep 2016 15:07:25 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E6=88=91=E7=9A=84=E9=A2=98=E5=BA=93=20?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=A4=E6=AC=A1=E5=90=8E=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E4=B8=A2=E5=A4=B1=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 87dc127a0..792ba4690 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -625,7 +625,7 @@ class UsersController < ApplicationController visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")" @homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}") end - @type = params[:type] + @type = params[:type] ? params[:type] : '1' @limit = 10 @is_remote = true @hw_count = @homeworks.count @@ -808,7 +808,7 @@ class UsersController < ApplicationController #@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}") end end - @type = params[:type] + @type = params[:type] ? params[:type] : '1' @property = params[:property] @is_import = params[:is_import] @limit = params[:is_import].to_i == 1 ? 15 : 10 From 03fac1900e341173df707fa8464d7861c1cc6f62 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 28 Sep 2016 10:00:01 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E5=88=86=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 14 +- app/views/courses/_course_student.html.erb | 11 +- app/views/courses/_new_groups_name.html.erb | 61 +++---- app/views/courses/_new_member_list.html.erb | 172 ++++++++++++++++++-- app/views/courses/_searchmembers.html.erb | 44 +++-- app/views/courses/addgroups.js.erb | 4 +- app/views/courses/member.html.erb | 48 ++++-- public/images/sy/sy_icons02.png | Bin 0 -> 199603 bytes public/javascripts/course.js | 3 +- public/stylesheets/css/common.css | 2 +- public/stylesheets/css/courses.css | 2 +- public/stylesheets/syllabus.css | 37 +++++ 12 files changed, 308 insertions(+), 90 deletions(-) create mode 100644 public/images/sy/sy_icons02.png 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 @@
    -
  • 分班:
  • -
  • +
  • 分班:
  • +
  • <%= 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%> +
  • <% unless course_groups.nil? %> <% course_groups.each do |group| %> - <% group_name = " #{ group.name}( #{group.members.count.to_s}人)".html_safe %> -
  • - <%= link_to group_name, searchgroupmembers_course_path(@course,:group_id => group.id), method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%> + <%# group_name = " #{ group.name}( #{group.members.count.to_s}人)".html_safe %> +
  • + <%= link_to group.name, searchgroupmembers_course_path(@course,:group_id => group.id), class: 'fl mr5', method: 'get', remote: true,:onclick => "checkclass('group_name_#{group.id}')"%> + (<%=group.members.count.to_s %>人) <% if @canShowCode%> + <% if group.members.empty?%> <%= link_to '', deletegroup_course_path(:group_id => group.id), :method => 'delete', :remote => true, :data => {confirm: l(:label_delete_group)}, - :class => 'f_1', - :style => "width: 11px;height: 16px;margin-top:3px;margin-left:5px;background: url(/images/pic_del.gif) no-repeat 0 0;" - %> + :class => 'sy_icons_del fl' + %> <% else%> - - 删除班级 - + <% end%> - - 编辑班级 - - <% end %> -
  • - -
  • - <% if @canShowCode%> - <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %> - - <% end %> <% end %>
  • <% end %> - <% end %> - - <% if @canShowCode %> -
  • - +添加分班 -
  • -
  • - + + <% if @canShowCode%> +
  • + <%= form_tag(updategroupname_course_path(@course), method: 'get', remote:true, :id => 'update_group_form') do %> + + + 确定 + 取消 + <% end %>
  • + <% end %> <% end %>
\ 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? %>