班级内的分班
This commit is contained in:
parent
03fac1900e
commit
f6296377bd
|
@ -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]
|
||||
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
|
||||
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<div class="sy_class_fenban clear">
|
||||
<div id="search_members">
|
||||
<%= render :partial => 'searchmembers' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="st_groups">
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
<li class="fl sy_fenban_list mr10 mb10 ml10" id="course_group_0">
|
||||
<%= link_to l(:label_all), searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
|
||||
</li>
|
||||
<li class="fl sy_fenban_list mr10 mb10 ml10" id="course_group_1">
|
||||
<%= link_to '未分班', searchgroupmembers_course_path(@course,:group_id => 0), :onclick => "checkclass('course_group_0')", method: 'get', remote: true%>
|
||||
<li class="fl sy_fenban_list mr10 mb10" id="course_group_1">
|
||||
<%= link_to "未分班", searchgroupmembers_course_path(@course,:group_id => -1), :onclick => "checkclass('course_group_0')", method: 'get', remote: true, :class => 'fl mr5'%>
|
||||
<span class="fl sy_cgrey">(<%=@no_group_count %>人)</span>
|
||||
</li>
|
||||
|
||||
<% unless course_groups.nil? %>
|
||||
|
|
|
@ -1,23 +1,11 @@
|
|||
<!-- 加入分班 -->
|
||||
<div style="margin-left: 15px">
|
||||
<% if User.current.logged? && User.current.member_of_course?(@course) && @group %>
|
||||
<%= join_in_course_group(@course.course_groups,@group, User.current) unless @canShowCode %>
|
||||
<span style="font-size: 12px; float: left; margin-right: 5px">
|
||||
<%= l(:label_current_group)%>:
|
||||
<%= @group.name %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if members.any? %>
|
||||
<table class="sy_new_table clear mb15 sy_new_table_width" cellpadding="0" cellspacing="0">
|
||||
<table class="sy_new_table clear sy_new_table_width" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr class="clear">
|
||||
<th class="sy_th7">序号</th>
|
||||
<th class="sy_th15">姓名</th>
|
||||
<th class="sy_th15">
|
||||
<%= 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' %>
|
||||
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
|
||||
<% elsif @sort_type == "student_id" && @score_sort_by == 'asc' %>
|
||||
|
@ -25,7 +13,7 @@
|
|||
<% end %>
|
||||
</th>
|
||||
<th class="sy_th0 sy_fenban_tap">
|
||||
<%= 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' %>
|
||||
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
|
||||
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
|
||||
|
@ -36,14 +24,20 @@
|
|||
班级作业的得分总和</p>
|
||||
</div>
|
||||
</th>
|
||||
<th class="sy_th0 sy_fenban_tap">测评得分
|
||||
<th class="sy_th0 sy_fenban_tap">
|
||||
<%= 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' %>
|
||||
<a href="javascript:void(0)" class="sy_sortdownbtn"></a>
|
||||
<% elsif @sort_type == "ex_score" && @score_sort_by == 'asc' %>
|
||||
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
|
||||
<% end %>
|
||||
<div class="sy_fenban_show undis" >
|
||||
<p>积分规则<br/>
|
||||
班级测验的得分总和</p>
|
||||
</div>
|
||||
</th>
|
||||
<th class="sy_th0 sy_fenban_tap">
|
||||
<%= 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' %>
|
||||
<a href="javascript:" class= "sy_sortdownbtn"></a>
|
||||
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
|
||||
|
@ -73,13 +67,13 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
<% members.each_with_index do |member, i| %>
|
||||
<tr class="clear pr">
|
||||
<tr class="clear">
|
||||
<% 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 %>
|
||||
<td><%= i + 1 %></td>
|
||||
<td><%= (@page - 1) * @limit + i + 1 %></td>
|
||||
<td>
|
||||
<%= 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 => "用户头像" %>
|
||||
<span class="fl sy_class_users_st_name" title="<%= user.show_name %>"><%= user.show_name %></span>
|
||||
|
@ -102,25 +96,24 @@
|
|||
:remote => true},
|
||||
:class => '' %>
|
||||
</td>
|
||||
<td>
|
||||
<td class="pr">
|
||||
<span class="sum_score_tip"><%= format("%0.2f", sum) %></span>
|
||||
<div class="sy_tips_box_inner undis" style="left: 740px; top: -60px; text-align: left;">
|
||||
<div class="sy_tips_box_inner undis" style="left: 215px; top: -60px; text-align: left;">
|
||||
<span style="top: 75px;"></span>
|
||||
<p >
|
||||
<font class="fb"><%= user.show_name %></font><br/>
|
||||
资源 发布数:1<br/>
|
||||
<font class="mr15">问答 发布数:1</font>回复数:1<br/>
|
||||
<font class="mr15">通知 提交数:1</font>留言数:1<br/>
|
||||
<font class="mr15">作业 提交数:1</font>留言数:1<br/>
|
||||
班级 留言数:1<br />
|
||||
测验 提交数:1
|
||||
资源 发布数:<%= member.resource_num %><br/>
|
||||
<font class="mr15">问答 发布数:<%= member.message_num %></font>回复数:<%= member.message_reply_num %><br/>
|
||||
<font class="mr15">通知 提交数:<%= member.news_num %></font>留言数:<%= member.news_reply_num %><br/>
|
||||
<font class="mr15">作业 提交数:<%= member.homework_num %></font>留言数:<%= member.homework_journal_num %><br/>
|
||||
班级 留言数:<%= member.journal_num %><br />
|
||||
测验 提交数:<%= member.exercise_num %>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<% 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 %>
|
||||
<% 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 %>
|
||||
|
@ -136,108 +129,25 @@
|
|||
<% else %>
|
||||
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div style="text-align:center;">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @mem_pages, @members_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% else%>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<% if members.any? %>
|
||||
<div class="st_box">
|
||||
<ul class="st_box_top">
|
||||
<li class="ml50" style="padding-right: 5px;"><span class="fontGrey6 fb">姓名</span></li>
|
||||
<li class="ml10" style="padding-right: 15px;"><span class="fontGrey6 fb">学号</span></li>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<li style="padding-right: 55px; margin-left: 160px;"><span class="fontGrey6 fb">分班</span></li>
|
||||
<% end %>
|
||||
<li class="st_list_score <%= @course.course_groups.empty? ? 'ml250' : 'ml10' %>">
|
||||
<%= 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' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
<% elsif @sort_type == "score" && @score_sort_by == 'asc' %>
|
||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="st_list_score">
|
||||
<%= 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' %>
|
||||
<a id="pic" href="javascript:" class= "st_down"></a>
|
||||
<% elsif @sort_type == "act_score" && @score_sort_by == 'asc' %>
|
||||
<a id="pic" href="javascript:" class= "st_up"></a>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="ml20"><span class="fontGrey6 fb">加入时间</span></li>
|
||||
</ul>
|
||||
<div class="cl"></div><!--st_box_top end-->
|
||||
|
||||
<% members.each do |member| %>
|
||||
<div class="st_boxlist">
|
||||
<a href="javascript:" class="st_img">
|
||||
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
|
||||
</a>
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to("#{l(:label_bidding_user_studentname)}:<span class='hidden st_info_block'>#{member.user.show_name}</span>".html_safe,user_path(member.user)) %>
|
||||
</li>
|
||||
<br/>
|
||||
<% unless member.user.user_extensions.student_id == ''%>
|
||||
<li><%= link_to("#{l(:label_bidding_user_studentcode)}:<span class='hidden st_info_block'>#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
|
||||
<% end%>
|
||||
</ul>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
|
||||
<% if @course.course_groups.nil? || @group %>
|
||||
<div class="select-class-option fl" style="margin-left: 5px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% 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 %>
|
||||
<div class="select-class-option fl" style="margin-left: 5px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
|
||||
</div>
|
||||
<%= 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 %>
|
||||
<div class="select-class-option fl" style="margin-left: 5px;">
|
||||
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
|
||||
</div>
|
||||
<% 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' %>
|
||||
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
|
||||
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end; reset_cycle %>
|
||||
</div>
|
||||
|
||||
<!--<ul class="wlist">
|
||||
<% #= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>-->
|
||||
<% else%>
|
||||
<p class="nodata">
|
||||
<%= l(:label_no_data) %>
|
||||
</p>
|
||||
<% end%>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".pic_edit_icon").click(function(){
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
|
||||
<input class="hw_search-input" name="name" id="search_member_input" placeholder="输入学生登录名/姓名/学号进行搜索" type="text">
|
||||
<% if @group %>
|
||||
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
|
||||
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group == -1 ? -1 : @group.id}", name: 'search_group_id' %>
|
||||
<input type="hidden" name="ingroup">
|
||||
<% else %>
|
||||
<input type="hidden" name="incourse">
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
||||
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member' %>
|
||||
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member', :class => 'hw_more_li' %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<li><%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'), :class => 'hw_more_li'%></li>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<li>
|
||||
<%=link_to "成员管理", :controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member', :class => 'hw_more_li' %>
|
||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'hw_more_li' %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div class="courseRSide fl" id="homework_page_right">
|
||||
<div class="project_r_h">
|
||||
<div class="project_r_h" style="width:730px;">
|
||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
||||
</div>
|
||||
<script>
|
||||
|
|
|
@ -620,7 +620,7 @@ a:hover.sy_class_ltitle{ color:#333;}
|
|||
|
||||
/*20160918教师团队*/
|
||||
.sy_new_tablebox{ padding:15px; padding-bottom:none;}
|
||||
.sy_new_table{ width:100%; background:#fff; border:1px solid #e5e5e5; padding-bottom:30px;}
|
||||
.sy_new_table{ width:100%; background:#fff; border:1px solid #e5e5e5;}
|
||||
.sy_new_table thead tr{ height:40px; line-height:40px;}
|
||||
.sy_new_table thead tr th{ border-bottom:1px solid #e5e5e5;}
|
||||
.sy_new_table tbody tr:hover{ background:#f5f5f5;}
|
||||
|
|
Loading…
Reference in New Issue