Merge branch 'cxt_course' into develop

This commit is contained in:
cxt 2016-09-30 14:49:57 +08:00
commit b28579a3a3
46 changed files with 745 additions and 450 deletions

View File

@ -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,11 +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
) 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)
@ -1247,7 +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
) 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
@ -1300,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
@ -1318,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

View File

@ -47,6 +47,9 @@ class MessagesController < ApplicationController
all_comments = []
@replies = get_all_children(all_comments, @topic)
@reply_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new(:subject => "RE: #{@message.subject}")
if @course
#@replies = @topic.children.
@ -57,7 +60,11 @@ class MessagesController < ApplicationController
#all
#@replies = paginateHelper messages_replies,10
@left_nav_type = 2
render :action => "show", :layout => "base_courses"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}
end
#render :action => "show", :layout => "base_courses"#by young
elsif @project
#@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
@ -66,8 +73,10 @@ class MessagesController < ApplicationController
# limit(@reply_pages.per_page).
# offset(@reply_pages.offset).
# all
render :action => "show", :layout => "base_projects"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_projects'}
end
else
# @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
@ -78,7 +87,10 @@ class MessagesController < ApplicationController
# all
@organization = @org_subfield.organization
render :action => "show", :layout => "base_org"#by young
respond_to do |format|
format.js
format.html {render :layout => 'base_org'}
end
end
end

View File

@ -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
@ -1033,7 +1033,7 @@ class UsersController < ApplicationController
update_org_activity(homework.class,homework.id)
flash[:notice] = l(:notice_successful_create)
redirect_to student_work_index_url(:homework => params[:homework])
redirect_to student_work_index_url(:homework => params[:homework], :tab => 2)
else
render_403
end

View File

@ -3311,17 +3311,32 @@ def get_reply_parents_no_root parents_rely, comment
parents_rely
end
def get_all_children_ex result, jour
if jour.kind_of? Message
jour.children.includes(:author, :praise_tread_cache).each do |jour_child|
result << jour_child
get_all_children_ex result, jour_child
end
elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
jour.children.each do |jour_child|
result << jour_child
get_all_children_ex result, jour_child
end
end
result
end
#获取所有子节点
def get_all_children result, jour
if jour.kind_of? Message
jour.children.includes(:author, :praise_tread_cache).each do |jour_child|
result << jour_child
get_all_children result, jour_child
get_all_children_ex result, jour_child
end
elsif (jour.kind_of? JournalsForMessage) || (jour.kind_of? BlogComment) || (jour.kind_of? OrgDocumentComment)
jour.children.each do |jour_child|
result << jour_child
get_all_children result, jour_child
get_all_children_ex result, jour_child
end
end
if jour.respond_to?(:created_on)

View File

@ -106,7 +106,8 @@
</div>
<div class="cl"></div>
<% all_comments = []%>
<% count=get_all_children(all_comments, @article).count %>
<% all_replies = get_all_children(all_comments, @article) %>
<% count= all_replies.count %>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复
@ -119,8 +120,7 @@
<div class="homepagePostReplyBannerTime"></div>
</div>
<% all_comments = []%>
<% comments = get_all_children(all_comments, @article) %>
<% comments = all_replies %>
<% if count > 0 %>
<div class="" id="reply_div_<%= @article.id %>">
<% comments.each do |comment| %>

View File

@ -46,12 +46,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_repies = get_all_children(all_comments, activity) %>
<% count = all_repies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 1} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_repies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 1, :user_id => activity.author_id}%>

View File

@ -1,10 +1,10 @@
<div class="st_list">
<div class="st_search" id="search_members">
<div class="sy_class_fenban clear">
<div id="search_members">
<%= render :partial => 'searchmembers' %>
</div>
<div class="cl"></div>
<div class="st_addclass" id="st_groups">
<div id="st_groups">
<%= render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups} %>
</div>
<div class="cl"></div>
@ -12,5 +12,4 @@
<div id="member_content">
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
</div>
</div> <!-- st_list end-->
<div class="cl"></div>
</div> <!-- st_list end-->

View File

@ -1,56 +1,42 @@
<ul>
<li style=" color:#8b8b8b;">分班:</li>
<li class="classbox" id="course_group_0">
<li class="fl mt5" style="color:#8b8b8b;">分班:</li>
<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" 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? %>
<% course_groups.each do |group| %>
<% group_name = " #{ group.name}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
<li class="classbox" style="margin-bottom: 5px;">
<%= 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}( <span class='c_red'>#{group.members.count.to_s}人</span>)".html_safe %>
<li class="fl sy_fenban_list clear mr10 mb10">
<%= 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}')"%>
<span class="fl sy_cgrey mr5">(<%=group.members.count.to_s %>人)</span>
<% if @canShowCode%>
<a href="javascript:void(0)" class="sy_icons_edit fl" onclick="$('#edit_group_name').val('<%= group.name%>');$('#edit_group_id').val('<%= group.id%>');$('#edit_group_form').slideToggle();"></a>
<% 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%>
<a href="javascript:" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" style="margin-right:4px;" >
<img src="/images/pic_del.gif" width="11" height="12" alt="删除班级" title="删除该班级" />
</a>
<a href="javascript:void(0)" onClick="alert('温馨提示:已有学生加入该班级,不能删除该班级,仅可编辑班级名称。');" class="sy_icons_del fl"></a>
<% end%>
<a href="javascript:void(0)" class="f_l" style="padding-left: 5px;" onclick="$('#group_name_<%= group.id %>').val('<%= group.name%>');$('#edit_group_<%= group.id %>').slideToggle();$('#new_group_name').hide();">
<img src="/images/pic_edit.png" width="14" height="15" alt="编辑班级" />
</a>
<% end %>
</li>
<!-- 编辑分班 -->
<li>
<% if @canShowCode%>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, :id => 'update_group_'+group.id.to_s) do %>
<span id="edit_group_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
<input type="text" id="group_name_<%= group.id%>" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="edit_group('group_name_<%= group.id%>','<%= valid_ajax_course_path%>','<%= @course.id%>','<%= group.id%>');"/>
</span>
<% end %>
<% end %>
</li>
<% end %>
<% end %>
<% if @canShowCode %>
<li style="margin-left:15px;margin-top: 2px;">
<a href="javascript:void(0)" class="st_add f_l" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();$('#edit_group_36').hide();">+添加分班</a>
</li>
<li >
<span id="new_group_name" style="display:none; vertical-align: middle;" class="ml10 f_l">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
<input type="text" id="group_name" name="group_name" size="20" class="isTxt w90 f_l" maxlength="20" />
<input type="button" class="submit f_l" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');"/>
<% end %>
</span>
<!-- 编辑分班 -->
<% if @canShowCode%>
<li id="edit_group_form" class="fl mr10 mb10 clear undis">
<%= form_tag(updategroupname_course_path(@course), method: 'get', remote:true, :id => 'update_group_form') do %>
<input type="hidden" name="group_id" id="edit_group_id"/>
<input class="fl mr5 sy_fenban_input" id="edit_group_name"name="group_name" size="20" maxlength="20"/>
<a href="javascript:void(0)" class="sy_btn_blue fl mr5" onclick="edit_group('edit_group_name','<%= valid_ajax_course_path%>','<%= @course.id%>','edit_group_id');">确定</a>
<a href="javascript:void(0)" class="sy_btn_grey fl" onclick="$('#edit_group_form').hide(); $('#edit_group_id').val(''); $('#edit_group_name').val('');">取消</a>
<% end %>
</li>
<% end %>
<% end %>
</ul>

View File

@ -1,123 +1,156 @@
<!-- 加入分班 -->
<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)%>:&nbsp;
<%= @group.name %>
</span>
<% end %>
</div>
<div class="cl"></div>
<% if members.any? %>
<% if @result_count %>
<p style="font-size: 18px;">
<%= l(:label_search_member_count) %>
<%= @result_count %>
<%= l(:label_member_people) %>
<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 == -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' %>
<a href="javascript:void(0)" class="sy_sortupbtn"></a>
<% 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 == -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' %>
<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 => '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 == -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' %>
<a href="javascript:" class= "sy_sortupbtn"></a>
<% end %>
<div class="sy_fenban_show undis" >
<p>积分规则<br/>
资源发布:资源数 x 5 <br>
问答发布:发帖数 x 2 <br>
通知发布:通知数 x 1 <br>
问答回复:回复数 x 1 <br>
作业留言:留言数 x 1 <br>
通知留言:留言数 x 1 <br>
班级留言:留言数 x 1 <br>
总得分为以上得分之和
</p>
<div class="cl"></div>
<% end %>
<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>
</th>
<th class="sy_th0 sy_fenban_tap">总得分
<div class="sy_fenban_show undis" style="width:180px;">
<p>积分规则<br/>
作业得分+测评得分+社区得分</p>
</div>
</th>
<th class="sy_th13">分班</th>
</tr>
</thead>
<tbody>
<% members.each_with_index do |member, i| %>
<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><%= (@page - 1) * @limit + i + 1 %></td>
<td>
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30", :style => "display:block;"), user_path(member.user_id), :class => 'sy_class_users_st fl mt5 mr5' ,:alt => "用户头像" %>
<span class="fl sy_class_users_st_name" title="<%= user.show_name %>"><%= user.show_name %></span>
</td>
<td>
<span class="sy_class_users_st_num" title="<%= user.user_extensions.student_id %>"><%= user.user_extensions.student_id %></span>
</td>
<td>
<%= link_to format("%0.2f", hw_score), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => "" %>
</td>
<td><%= ex_score %></td>
<td>
<%= link_to act_score, {
:action => 'show_member_act_score',
:member_id => member.id,
:remote => true},
:class => '' %>
</td>
<td class="pr">
<span class="sum_score_tip"><%= format("%0.2f", sum) %></span>
<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/>
资源&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.resource_num %><br/>
<font class="mr15">问答&nbsp;&nbsp;&nbsp;&nbsp;发布数:<%= member.message_num %></font>回复数:<%= member.message_reply_num %><br/>
<font class="mr15">通知&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.news_num %></font>留言数:<%= member.news_reply_num %><br/>
<font class="mr15">作业&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.homework_num %></font>留言数:<%= member.homework_journal_num %><br/>
班级&nbsp;&nbsp;&nbsp;&nbsp;留言数:<%= member.journal_num %><br />
测验&nbsp;&nbsp;&nbsp;&nbsp;提交数:<%= member.exercise_num %>
</p>
</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>-->
</td>
<td>
<% 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 %>
<div class="select-class-option">
<span class=""><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a href="javascript:void(0)" class="sy_icons_edit pic_edit_icon" alt="编辑"></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=>"w100 undis class-edit sy_fenban_select", :style => "margin-left: 5px;"}) %>
<% end %>
<% end %>
<% else %>
<%=member.course_group_id == 0 ? "暂无" : member.course_group.name %>
<% 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%>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% end %>
<script>
$(document).ready(function(){
/*$(".select-class-option").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".select-class-option").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});*/
$(".pic_edit2").click(function(){
$(".pic_edit_icon").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
@ -137,12 +170,33 @@
$('.class-edit').css('display','none');
$('.select-class-option').show();
});
$('.class-edit,.pic_edit2').bind('click',function(e){
$('.class-edit,.pic_edit_icon').bind('click',function(e){
stopPropagation(e);
});
});
function join_group_function(id){
$(id).submit();
}
$(".sum_score_tip").each(function(){
$(this).mouseenter(function(){
$(".sy_tips_box_inner").hide();
$(this).next().stop();
$(this).next().show();
});
$(this).mouseleave(function(){
$(this).next().delay(500).hide(0);
});
});
$(".sy_tips_box_inner").each(function(){
$(this).mouseover(function(){
$(this).stop();
$(this).show();
});
$(this).mouseout(function(){
$(this).delay(500).hide(0);
});
});
</script>

View File

@ -1,11 +1,35 @@
<%= form_tag( searchmembers_course_path(@course), method: 'get',:class => "f_l",:remote=>true,:id => "search_student") do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'st_search_input', :placeholder => '输入学生登录名、姓名、学号进行搜索'%>
<% if @group %>
<%= hidden_field "search_group_id", params[:search_group_id],:value => "#{@group.id}", name: 'search_group_id' %>
<input type="hidden" name="ingroup">
<% else %>
<input type="hidden" name="incourse">
<div class="clear mb10">
<% if @canShowCode %>
<a href="javascript:void(0)" class="sy_btn_green fl mr10" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();">添加分班</a>
<div class="fl" id="new_group_name" style="display:none; vertical-align: middle;">
<%= form_tag( addgroups_course_path(@course), method: 'get',:remote=>true,:id => 'add_group_name') do %>
<input type="text" id="group_name" name="group_name" size="20" class="fl mr5 sy_fenban_input" placeholder="例如A班" maxlength="20" />
<a href="javascript:void(0)" class="sy_btn_blue fl mr5" onclick="add_group('<%= valid_ajax_course_path%>','<%= @course.id%>');">确定</a>
<a href="javascript:void(0)" class="sy_btn_grey fl" onclick="$('#group_name').value='';$('#new_group_name').slideToggle();">取消</a>
<% end %>
</div>
<% end %>
<div class="hw_search_box fr">
<%= 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 == -1 ? -1 : @group.id}", name: 'search_group_id' %>
<input type="hidden" name="ingroup">
<% else %>
<input type="hidden" name="incourse">
<% end %>
<% end %>
<% end %>
<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
<a href="javascript:void(0)" class="hw_btn_search" onclick="$('#search_student').submit();"></a>
</div>
</div>
<script>
$(function(){
$("#search_member_input").keypress(function(e){
var name = $.trim($('#search_member_input').val());
if (e.keyCode == '13' && name != "" && name.length != 0) {
$(this).parent().submit();
}
})
});
</script>

View File

@ -1,2 +1,4 @@
$("#st_groups").html("<%= escape_javascript( render :partial => 'new_groups_name', locals: {:course_groups => @course_groups})%>");
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @members})%>");
$('#group_name').val('');
$('#new_group_name').hide();

View File

@ -1,17 +1,35 @@
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<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' %>
</span>
<% end %>
</div>
<% if @subPage_title == l(:label_student_list)%>
<%= render :partial => 'course_student', :locals => {:members => @members} %>
<% else%>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
<% end%>
<% if @role == 1 %>
<div class="courseRSide fl" id="homework_page_right">
<div class="project_r_h">
<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', :class => 'hw_more_li' %>
</span>
<% end %>
</div>
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
</div>
<% else %>
<div class="sy_class_r sy_class_nobg fr ml10">
<div class="sy_class_r_head mb10">
<h3><%= @subPage_title %></h3>
<div class="hw_more_box">
<ul>
<li class="hw_more_icons">
<ul class="hw_more_txt">
<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' %>
</li>
<% end %>
</ul>
</li>
</ul>
</div>
</div>
<%= render :partial => 'course_student', :locals => {:members => @members} %>
</div>
<% end %>

View File

@ -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>

View File

@ -98,7 +98,7 @@
<div class="reTop mb5">
<%= 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) ) %>
<input class="blueBtn fr mr5" value="上传资源" onclick="course_files_upload();">

View File

@ -1,6 +1,6 @@
<%= render :partial => 'users/user_homework_list', :locals => {:homework_commons => homework_commons,:page => 0,:course_id => course_id} %>
<div style="width:210px; text-align:center; margin:0 auto;">
<div style=" text-align:center;">
<ul class="wlist" style=" border:none; display:inline-block; float:none; margin-top:10px;">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
</ul>

View File

@ -47,7 +47,7 @@
<% elsif @homework.homework_type == 2 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。</p>
<% elsif @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。</p>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置(可扩大分组范围)。</p>
<% end %>
<% elsif stu_pro_count != 0 && @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。</p>

View File

@ -62,6 +62,9 @@
<li>
<%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
</li>
<li>
<%= link_to '我的课程',{:controller => "users", :action => "user_courselist", :id => User.current.id}, :class => "menuGrey" %>
</li>
<li>
<%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%>
</li>

View File

@ -95,58 +95,8 @@
</div>
<%# all_comments = []%>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<div class="" id="reply_div_<%= @topic.id %>">
<%= render :partial => "messages/course_show_replies" %>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,60 @@
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,59 @@
<% @replies.each_with_index do |reply, i| %>
<script type="text/javascript">
$(function () {
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:class => 'fr mr20',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id %>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -130,56 +130,7 @@
<%# all_comments = [] %>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each_with_index do |reply, i| %>
<script type="text/javascript">
$(function () {
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33, :height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply} %>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe %>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:class => 'fr mr20',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.course_destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id %>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<%= render :partial => "messages/org_show_replies" %>
</div>
<% end %>

View File

@ -160,57 +160,7 @@
<%# all_comments = []%>
<%# comments = get_all_children(all_comments, @topic) %>
<div class="" id="reply_div_<%= @topic.id %>">
<% @replies.each_with_index do |reply,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<%= render :partial => "messages/project_show_replies" %>
</div>
<div class="cl"></div>
<% if !@topic.locked? && authorize_for('messages', 'reply') %>

View File

@ -0,0 +1,60 @@
<% @replies.each_with_index do |reply,i| %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_message_description_<%= reply.id %>');
autoUrl('reply_message_description_<%= reply.id %>');
});
</script>
<div class="homepagePostReplyContainer" onmouseover="$('#reply_edit_menu_<%= reply.id%>').show();" onmouseout="$('#reply_edit_menu_<%= reply.id%>').hide();">
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply}%>
<div class="homepagePostReplyContent upload_img break_word table_maxWidth" id="reply_message_description_<%= reply.id %>">
<%= reply.content.html_safe%>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span id="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
</span>
<span style="position: relative" class="fr mr20">
<%= link_to(
l(:button_reply),
{:action => 'quote', :id => reply},
:remote => true,
:method => 'get',
:title => l(:button_reply)) if !@topic.locked? && authorize_for('messages', 'reply') %>
<span id="reply_iconup_<%= reply.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span>
<%= link_to(
l(:button_delete),
{:action => 'destroy', :id => reply},
:method => :post,
:id => "delete_reply_#{reply.id}",
:class => 'fr mr20 undis',
:data => {:confirm => l(:text_are_you_sure)},
:title => l(:button_delete)
) if reply.destroyable_by?(User.current) %>
</span>
<div class="cl"></div>
</div>
</div>
<p id="reply_message_<%= reply.id%>"></p>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @reply_count > @page * @limit + 10 %>
<div id="more_message_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', board_message_path(@topic.board_id, @topic, :page => @page),:remote=>true %>
</div>
</div>
<% end %>

View File

@ -0,0 +1,7 @@
<% if @project %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/project_show_replies')%>");
<% elsif @course %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/course_show_replies')%>");
<% else %>
$("#more_message_replies").replaceWith("<%= escape_javascript(render :partial => 'messages/org_show_replies')%>");
<% end %>

View File

@ -75,7 +75,8 @@
</div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, @document).count %>
<% all_replies = get_all_children(all_comments, @document) %>
<% count = all_replies.count %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= @document.id %>">
<%# if count > 0 %>
@ -88,8 +89,7 @@
</div>
</div>
<% all_comments = []%>
<% comments = get_all_children(all_comments, @document) %>
<% comments = all_replies %>
<div class="" id="reply_div_<%= @document.id %>">
<% comments.each do |comment| %>
<script type="text/javascript">

View File

@ -70,12 +70,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => 0,:is_board =>0} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => 0, :is_board =>0}%>

View File

@ -68,13 +68,13 @@
</div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, document).count %>
<% all_replies = get_all_children(all_comments, document) %>
<% count = all_replies.count %>
<div class="homepagePostReply fl" style="background-color: #f1f1f1;" id="<%= document.id %>">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => document, :user_activity_id => act.id} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, document)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= act.id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => act.id, :type => 'OrgDocumentComment', :activity_id =>document.id}%>

View File

@ -1,8 +1,9 @@
<% is_expand = st.student_work_projects.empty? %>
<ul id="syllabus_course_ul">
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
<div class="syllabus_class_w fontGrey3">
<div class="syllabus_class_w fontGrey3 student_work_<%= st.id%>" style="<%=!is_expand ? '' : 'cursor: pointer;' %>" <%= !is_expand ? '' : "onclick = "+"show_student_work('"+"#{student_work_path(st)}"+"')" %>>
<%= 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 %>
<span class="fl student_work_<%= st.id%>" style="width:135px;">
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
<span class="fl">(组长)</span>
@ -11,10 +12,10 @@
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
</span>
<% else %>
<span class="fl student_work_<%= st.id%>" style="width:135px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
<span class="fl student_work_<%= st.id%>" style="width:135px;">
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
</span>
<span class="fl student_work_<%= st.id%> mr15 hidden" style="width:90px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
<span class="fl student_work_<%= st.id%> mr15 hidden" style="width:90px;">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
</span>
<% end %>
@ -46,28 +47,31 @@
<div class="flex-cell">
<% score = st.work_score %>
<div class="<%= score_color score%> student_final_scor_info ml35 pr" style="display: inline">
<% if is_expand %>
<span style="position: absolute;top: -33px; color: #3b94d6" onclick = "show_student_work(<%= student_work_path(st)%>)">评分</span>
<% end %>
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="g_infoNi none width180">
<div class="g_infoNi none width180" style="line-height: 18px;">
作品最终评分为
<span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分
<span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分<br/>
迟交扣分
<span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
&nbsp;</span>分
&nbsp;</span>分<br/>
缺评扣分
<span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
&nbsp;</span>分
&nbsp;</span>分<br/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分
</div>
<% end%>
</div>
</div>
</div>
</div>
<div class="hworkTip" style="display: none; left:700px; top:20px; white-space:nowrap; right:auto;" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %></font></div>
<div class="hworkTip" style="display: none; left:700px; top:20px; white-space:nowrap; right:auto;" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击进行评分' %></font></div>
</li>
</ul>

View File

@ -95,19 +95,19 @@
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="infoNi none width180">
<div class="infoNi none width180" style="line-height: 18px;">
作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分<br/>
迟交扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
&nbsp;</span>分
&nbsp;</span>分<br/>
缺评扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
&nbsp;</span>分
&nbsp;</span>分<br/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分<br/>
</div>
<% end%>
</td>

View File

@ -54,10 +54,6 @@
<script type="text/javascript">
$(function(){
if($("#homework_info_hidden").is(":hidden"))
{
$("#homework_info_show").show();
}
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id || (@is_evaluation && @is_focus == 1) %>
<% if @message_student_work_id %>
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>

View File

@ -38,6 +38,6 @@
<script type="text/javascript">
function clickOK() {
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/student_work?homework=" + "<%= @homework.id%>&tab=2"
}
</script>

View File

@ -39,6 +39,6 @@
<script type="text/javascript">
function clickOK() {
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/student_work?homework=" + "<%= @homework.id%>&tab=2"
}
</script>

View File

@ -57,29 +57,6 @@
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
}
function show_or_hide_info(){
$("#homeworkInformation").toggle();
$("#homework_info_hidden").toggle();
$("#homework_info_show").toggle();
}
$(function(){
if($("#homework_description").height() > 54) {
$("#homeworkDetailShow").show();
}
$("#homeworkDetailShow").click(function(){
$("#homeworkDetail").toggleClass("max_h54");
$("#homeworkDetailShow").hide();
$("#homeworkDetailHide").show();
});
$("#homeworkDetailHide").click(function(){
$("#homeworkDetail").toggleClass("max_h54");
$("#homeworkDetailHide").hide();
$("#homeworkDetailShow").show();
});
});
</script>
<div class="homepageRight mt0 ml10">

View File

@ -12,5 +12,5 @@ window.location.href = '<%= edit_student_work_url(@work)%>';
function clickCanel() {
hideModal('#popbox02');
window.location.href = '<%= student_work_index_url(:homework => @homework.id)%>';
window.location.href= "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"+"/student_work?homework=" + "<%= @homework.id%>&tab=2"
}

View File

@ -41,12 +41,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>

View File

@ -81,12 +81,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>

View File

@ -82,14 +82,14 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<%# allow_delete = (activity.user == User.current || User.current.admin? || User.current.allowed_to?(:as_teacher,activity.course)) %>
<%# count = fetch_user_leaveWord_reply(activity).count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id,:is_course => is_course,:is_board =>is_board} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Message', :activity_id =>activity.id, :is_course => is_course, :is_board =>is_board}%>

View File

@ -42,12 +42,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id, :homepage => 0} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'BlogComment', :activity_id =>activity.id, :homepage => 0, :user_id => activity.author_id}%>

View File

@ -1,10 +1,10 @@
<div id="groupHomework">
<div> <span class="f14 mt5 fl fontGrey3 mr10">分组设置:</span>
<div class="mr50 fl"> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
<input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
<input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=not_allow_select ? "onchange = regex_scope(#{homework.homework_detail_group.min_num}, 1)" : '' %>/>人
</div>
<div class="fl"> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
<input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
<input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=not_allow_select ? "onchange = regex_scope(#{homework.homework_detail_group.max_num}, 2)" : '' %>/>人
</div>
<span class="c_red undis ml20 mt7 fl" id="min_max_num_notice"></span>
<div class="cl"></div>
@ -21,7 +21,29 @@
<div class="cl"></div>
<script>
if($.trim($("#base_on_project").val()) == 1) {
$("#base_on_project").attr('checked','checked');
}
$(function () {
if($.trim($("#base_on_project").val()) == 1) {
$("#base_on_project").attr('checked','checked');
}
<% if not_allow_select %>
$("#min_num").on('change', function() {
var min_num = <%=homework.homework_detail_group.min_num %>;
if(parseInt($(this).val()) > min_num) {
$(this).val(min_num);
$("#min_max_num_notice").html('分组范围不可缩小').show();
} else {
$("#min_max_num_notice").html('').hide();
}
});
$("#max_num").on('change', function() {
var max_num = <%=homework.homework_detail_group.max_num %>;
if(parseInt($(this).val()) < max_num) {
$(this).val(max_num);
$("#min_max_num_notice").html('分组范围不可缩小').show();
} else {
$("#min_max_num_notice").html('').hide();
}
});
<% end %>
});
</script>

View File

@ -7,7 +7,7 @@
var first_click = true;
$(function(){
$("#homework_type_option").on("change",function(){
var type = $(this).children('option:selected').val()
var type = $(this).children('option:selected').val();
if(type == "1"){
$("#homeworkSetting").addClass("undis");
$("#homeworkSetting").html("");

View File

@ -63,12 +63,12 @@
<div class="cl"></div>
</div>
<% all_comments = []%>
<% count=get_all_children(all_comments, activity).count %>
<% all_replies = get_all_children(all_comments, activity) %>
<% count = all_replies.count %>
<div class="homepagePostReply">
<%= render :partial => 'users/reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %>
<% all_comments = []%>
<% comments = get_all_children(all_comments, activity)[0..2] %>
<% comments = all_replies[0..2] %>
<% if count > 0 %>
<div class="" id="reply_div_<%= user_activity_id %>">
<%= render :partial => 'users/message_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'JournalsForMessage', :activity_id =>activity.id}%>

View File

@ -46,6 +46,7 @@ function add_group(url,course_id) {
function edit_group(id,url,course_id,group_id)
{
var group_name = $('#'+id).val();
var group_id = $('#'+group_id).val();
$.get(
url,
{
@ -56,7 +57,7 @@ function edit_group(id,url,course_id,group_id)
},
function (data) {
if (data.valid) {
$("#update_group_"+group_id).submit();
$("#update_group_form").submit();
}
else
{

View File

@ -81,7 +81,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
/* Float & Clear */
.clear{ zoom:1;}
.clear:after {content:".";height:0;visibility:hidden;display:block;clear:both;}
.clear:after {clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}
.cl{ clear:both; overflow:hidden; }
.fl{float:left;}
.fr{float:right;}

View File

@ -530,7 +530,7 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.courseR {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;}
/*20160310分班样式*/
.select-class-option {width:125px;}
.select-class-option {width:100px;}
/*20160520作品列表table*/
.hwork-table-wrap {width:720px; border-collapse:collapse; vertical-align:middle; table-layout:fixed;}

View File

@ -1404,6 +1404,7 @@ a:hover.comment_ding_link{ color:#269ac9;}
.orig_icon{ color:#888; margin-right:10px; font-size:14px; font-weight:bold;}
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
.detail_cont_hide{ text-align:center; width:690px; display:block; font-size:14px; color:#333; border-bottom:1px solid #e3e3e3; padding:8px 0; margin: 0px auto;}
/* 未登录的提示信息 */
.syllabusbox_tishi{

View File

@ -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;}
@ -634,3 +634,40 @@ a:hover.sy_class_ltitle{ color:#333;}
.sy_new_name{ display:block;max-width:120px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.sy_new_long_name{ display:block;width:180px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
.mt12{ margin-top:12px;}
/*20160919分班*/
.sy_class_nobg{ background-color:#eaebec;}
.sy_class_r_head{ border: 1px solid #e7e7e7; background-color: #fff; padding:10px 15px; position: relative;}
.sy_class_r_head h3{ font-size: 14px; color: #333;}
.sy_class_r_more{ display: block;}
.sy_class_fenban{border: 1px solid #e7e7e7; background-color: #fff; padding:15px;}
.sy_fenban_input{ height: 28px; background-color: #fff; border: 1px solid #d1d1d1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3;padding-left:5px; color:#888; box-shadow: inset 0px 0px 5px #dcdcdc; }
.sy_icons_edit{ display: inline-block; padding:9px;background:url(../images/sy/sy_icons02.png) 0 1px no-repeat; }
.sy_icons_del{ padding:9px;background:url(../images/sy/sy_icons02.png) 0 -21px no-repeat;}
.sy_icons_edit:hover{ background:url(../images/sy/sy_icons02.png) -20px 1px no-repeat; }
.sy_icons_del:hover{ background:url(../images/sy/sy_icons02.png) -20px -21px no-repeat;}
.sy_icons_tips{padding:9px;background:url(../images/sy/sy_icons02.png) 0 -66px no-repeat;}
.sy_sortupbtn{display: inline-block; width:15px; height:18px;background:url(../images/sy/sy_icons02.png) 0 -39px no-repeat;}
.sy_sortdownbtn{display: inline-block; width:15px; height:18px;background:url(../images/sy/sy_icons02.png) -22px -39px no-repeat;}
.sy_fenban_list{-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d2d8e6; padding:5px 10px;background: #f8f9fd}
.sy_fenban_list a{ color:#3b94d6;}
.sy_fenban_list a:hover{ color:#2788d0;}
.sy_class_users_st{ width:30px; }
.sy_class_users_st_name{ display: inline-block;width:70px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sy_class_users_st_num{ display: block;width:90px; overflow:hidden;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.sy_class_users_st img{ width:30px;height:30px; border: 1px solid #fff;-webkit-border-radius:50px;-moz-border-radius:50px;-o-border-radius:50px;border-radius:50px;}
.sy_fenban_select{height: 28px; background-color: #fff; border: 1px solid #d1d1d1;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; border:1px solid #d3d3d3;padding-left:5px; color:#888; box-shadow: inset 0px 0px 5px #dcdcdc; }
.sy_new_table_width tr th.sy_th10{ width: 10%; }
.sy_new_table_width tr th.sy_th0{ width: 12.5%; }
.sy_new_table_width tr th.sy_th15{ width: 15%; }
.sy_new_table_width tr th.sy_th7{ width: 7%;}
.sy_new_table_width tr th.sy_th13{ width: 13%;}
.sy_fenban_tap{ cursor: pointer; position: relative;}
.sy_fenban_tap:hover .sy_fenban_show{ display: block;}
.sy_fenban_show{ width:140px; z-index: 999;text-align: center; line-height:2.0; font-size:12px; font-weight: normal;color:#888;background-color:#fff; border:1px solid #eaeaea;border-radius:5px;position:absolute;left:20px; top:30px;padding:5px 0px;display:none; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.sy_tips_box{ position: relative; cursor: pointer;}
.sy_tips_box:hover .sy_tips_box_inner{ display: block;}
.sy_tips_box_inner{ position: absolute;line-height: 2.0;padding: 5px 10px; white-space: nowrap; background-color: #fff; left:30px; top: -5px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5);}
.sy_tips_box_inner span { display: block; border-width: 10px;position: absolute;top: 15px; left: -18px; border-style: dashed solid dashed dashed;border-color: transparent #fff transparent transparent;font-size: 0;line-height: 0;}
.hw_search_box a.hw_btn_search{display:block; width:20px; height:20px; background:url(../images/hw/icons_hw.png) 0 -57px no-repeat; position:absolute; right:5px; top:5px;}