From 3e88d62ba66dff6c0dd626b2a07306545ef0503d Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 4 Jul 2015 14:57:17 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/mailer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/mailer.rb b/app/models/mailer.rb index 226ce02bb..5ae9df001 100644 --- a/app/models/mailer.rb +++ b/app/models/mailer.rb @@ -121,7 +121,7 @@ class Mailer < ActionMailer::Base count = count - 1 for i in 0..count do bids = courses[i].homework_commons.where("homework_commons.created_at between '#{date_from}' and '#{date_to}'").order("homework_commons.created_at desc") - attachments = courses[i].attachments.where("attachments.created_on between '#{date_from}' and '#{date_to}'").order("attachments.created_on DESC' ") + attachments = courses[i].attachments.where("attachments.created_on between '#{date_from}' and '#{date_to}'") @bids += bids if bids.count > 0 @attachments += attachments if attachments.count > 0 end From e46ccda8e6cb87a65731e246019991e9704f7639 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 4 Jul 2015 15:09:08 +0800 Subject: [PATCH 2/6] 1111 --- app/helpers/homework_attach_helper.rb | 294 +++++++++++++------------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/app/helpers/homework_attach_helper.rb b/app/helpers/homework_attach_helper.rb index 72d381b28..bd2bec80c 100644 --- a/app/helpers/homework_attach_helper.rb +++ b/app/helpers/homework_attach_helper.rb @@ -1,149 +1,149 @@ module HomeworkAttachHelper - #判断是否具有删除的权限 - def attach_delete(project) - if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id) - true - else - false - end - end - #作业添加、编辑界面的tab页 - def homework_settings_tabs f - @f = f - tabs = [{:name => 'info', :partial => 'homework_attach/edit_homework', :label => :label_information_plural}, - {:name => 'members', :partial => 'homework_attach/homework_member', :label => :label_member_plural} - ] - end - - #作业可选成员列表分页 - def render_new_members_for_homework members - #scope = Principal.active.sorted.not_member_of(project).like(params[:q]) - #scope = project.members - #principals = paginateHelper members,10 - #principals = members - #principal_count = members.count - #limit = 10 - #principal_pages = Redmine::Pagination::Paginator.new principal_count, limit, params['page'] #by young - #offset ||= principal_pages.offset - #principals = members[offset, limit] - users = members.map(&:user) - s = content_tag('div', member_check_box_tags_ex('membership[user_ids][]', users), :id => 'principals') - links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false) {|text, parameters, options| - link_to text, get_homework_member_list_homework_attach_index_path( parameters.merge(:q => params[:q], bid_id: params[:id]||@homework)), :remote => true } - return s + content_tag('div', content_tag('ul', links), :class => 'pagination_new') - end - - #扩展的checkbox生成 - def member_check_box_tags_ex(name, principals) - s = '' - principals.each do |member| - s << "
" - end - s.html_safe - end - - def paginateHelper obj, pre_size=20 - @obj_count = obj.count - @obj_pages = Redmine::Pagination::Paginator.new @obj_count, pre_size, params['page'] - if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation - obj.limit(@obj_pages.per_page).offset(@obj_pages.offset) - elsif obj.kind_of? Array - obj[@obj_pages.offset, @obj_pages.per_page] - else - logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}" - raise RuntimeError, 'unknow type, Please input you type into this helper.' - end - end - - def user_projects_option - cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" - memberships = User.current.memberships.all(:conditions => cond) - projects = memberships.map(&:project) - not_have_project = [] - not_have_project << Setting.please_chose - not_have_project << 0 - type = [] - type << not_have_project - projects.each do |project| - if project != nil - option = [] - option << project.name - option << project.id - type << option - end - end - type - end - - #判断指定用户是不是已经赞过该作业 - def is_praise_homework user_id, obj_id - PraiseTread.where("user_id = #{user_id} AND praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").empty? - end - - #获取赞的总数 - def praise_homework_count obj_id - PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").count - end - - #获取用户对作业的评分 - def get_homework_score user, homework - temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}").first - @m_score = temp.nil? ? 0:temp.stars.to_i - end - - #获取评分对应的评论 - def get_homework_review homework,is_teacher,user - homework.journals_for_messages.where("is_comprehensive_evaluation = #{is_teacher ? 1 : 2} and user_id = #{user.id}").order("created_on DESC").first - end - - def convert_array array - ary = "(" - if array.nil? || array.count == 0 - return "()" - end - array.length.times do |i| - if i == array.length - 1 - ary += array[i].id.to_s + ")" - else - if !(array[i].nil? || array[i].id.nil? || array[i].id.to_s == "") - ary += array[i].id.to_s + "," - end - end - end - #array.each do |member| - # if member == array.last - # ary += member.id.to_s + ")" - # else - # ary += member.id.to_s + "," - # end - #end - ary - end - - def get_student_batch_homework_list bid,user - student_batch_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, - (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score, - (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score, - (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = 0) AS m_score - FROM homework_attaches - INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id - WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id} ORDER BY m_score DESC") - student_batch_homework_list - end - - ######################################################### - #sw - #获取学生未进行匿评的数量 - #param: bid => 作业 user => 用户 - #return 指定用户未进行匿评的作业的数量 - #user必须是学生用户 - ####################################################### - def get_student_not_batch_homework_list bid,user - HomeworkAttach.find_by_sql("SELECT * FROM(SELECT homework_attaches.*, - (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{user.id} AND is_teacher_score = 0) AS m_score - FROM homework_attaches - INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id - WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id}) AS table1 - WHERE table1.m_score IS NULL").count - end +# #判断是否具有删除的权限 +# def attach_delete(project) +# if User.current.logged? && (User.current.admin? || (!Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.nil? && (Member.where('user_id = ? and project_id = ?', User.current.id, project.bid.courses.first.id).first.roles&Role.where('id = ? or id = ?', 3, 7)).size >0) || project.user_id == User.current.id) +# true +# else +# false +# end +# end +# #作业添加、编辑界面的tab页 +# def homework_settings_tabs f +# @f = f +# tabs = [{:name => 'info', :partial => 'homework_attach/edit_homework', :label => :label_information_plural}, +# {:name => 'members', :partial => 'homework_attach/homework_member', :label => :label_member_plural} +# ] +# end +# +# #作业可选成员列表分页 +# def render_new_members_for_homework members +# #scope = Principal.active.sorted.not_member_of(project).like(params[:q]) +# #scope = project.members +# #principals = paginateHelper members,10 +# #principals = members +# #principal_count = members.count +# #limit = 10 +# #principal_pages = Redmine::Pagination::Paginator.new principal_count, limit, params['page'] #by young +# #offset ||= principal_pages.offset +# #principals = members[offset, limit] +# users = members.map(&:user) +# s = content_tag('div', member_check_box_tags_ex('membership[user_ids][]', users), :id => 'principals') +# links = pagination_links_full(@obj_pages, @obj_count, :per_page_links => false) {|text, parameters, options| +# link_to text, get_homework_member_list_homework_attach_index_path( parameters.merge(:q => params[:q], bid_id: params[:id]||@homework)), :remote => true } +# return s + content_tag('div', content_tag('ul', links), :class => 'pagination_new') +# end +# +# #扩展的checkbox生成 +# def member_check_box_tags_ex(name, principals) +# s = '' +# principals.each do |member| +# s << "
" +# end +# s.html_safe +# end +# +# def paginateHelper obj, pre_size=20 +# @obj_count = obj.count +# @obj_pages = Redmine::Pagination::Paginator.new @obj_count, pre_size, params['page'] +# if obj.kind_of? ActiveRecord::Base or obj.kind_of? ActiveRecord::Relation +# obj.limit(@obj_pages.per_page).offset(@obj_pages.offset) +# elsif obj.kind_of? Array +# obj[@obj_pages.offset, @obj_pages.per_page] +# else +# logger.error "[ApplicationController] Error : application_controller#paginateHelper ===> unknow category: #{obj.class}" +# raise RuntimeError, 'unknow type, Please input you type into this helper.' +# end +# end +# +# def user_projects_option +# cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1" +# memberships = User.current.memberships.all(:conditions => cond) +# projects = memberships.map(&:project) +# not_have_project = [] +# not_have_project << Setting.please_chose +# not_have_project << 0 +# type = [] +# type << not_have_project +# projects.each do |project| +# if project != nil +# option = [] +# option << project.name +# option << project.id +# type << option +# end +# end +# type +# end +# +# #判断指定用户是不是已经赞过该作业 +# def is_praise_homework user_id, obj_id +# PraiseTread.where("user_id = #{user_id} AND praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").empty? +# end +# +# #获取赞的总数 +# def praise_homework_count obj_id +# PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").count +# end +# +# #获取用户对作业的评分 +# def get_homework_score user, homework +# temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}").first +# @m_score = temp.nil? ? 0:temp.stars.to_i +# end +# +# #获取评分对应的评论 +# def get_homework_review homework,is_teacher,user +# homework.journals_for_messages.where("is_comprehensive_evaluation = #{is_teacher ? 1 : 2} and user_id = #{user.id}").order("created_on DESC").first +# end +# +# def convert_array array +# ary = "(" +# if array.nil? || array.count == 0 +# return "()" +# end +# array.length.times do |i| +# if i == array.length - 1 +# ary += array[i].id.to_s + ")" +# else +# if !(array[i].nil? || array[i].id.nil? || array[i].id.to_s == "") +# ary += array[i].id.to_s + "," +# end +# end +# end +# #array.each do |member| +# # if member == array.last +# # ary += member.id.to_s + ")" +# # else +# # ary += member.id.to_s + "," +# # end +# #end +# ary +# end +# +# def get_student_batch_homework_list bid,user +# student_batch_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*, +# (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 1 AND stars IS NOT NULL ORDER BY updated_at DESC limit 0,1) AS t_score, +# (SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND is_teacher_score = 0) AS s_score, +# (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{User.current.id} AND is_teacher_score = 0) AS m_score +# FROM homework_attaches +# INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id +# WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id} ORDER BY m_score DESC") +# student_batch_homework_list +# end +# +# ######################################################### +# #sw +# #获取学生未进行匿评的数量 +# #param: bid => 作业 user => 用户 +# #return 指定用户未进行匿评的作业的数量 +# #user必须是学生用户 +# ####################################################### +# def get_student_not_batch_homework_list bid,user +# HomeworkAttach.find_by_sql("SELECT * FROM(SELECT homework_attaches.*, +# (SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{user.id} AND is_teacher_score = 0) AS m_score +# FROM homework_attaches +# INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id +# WHERE homework_attaches.bid_id = #{bid.id} AND homework_evaluations.user_id = #{user.id}) AS table1 +# WHERE table1.m_score IS NULL").count +# end end \ No newline at end of file From be2b3a78d69501a21753781bf25d4bad91e63cb6 Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 4 Jul 2015 15:26:01 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=BC=95=E7=94=A8=E6=9C=AA=E9=80=89=E7=9D=80?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=97=B6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- config/locales/zh.yml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 09ca29178..a301a1e6c 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -388,7 +388,7 @@ class AttachmentsController < ApplicationController end rescue NoMethodError @save_flag = false - @save_message = [] << l(:label_course_empty_select) + @save_message = [] << l(:label_project_empty_select) respond_to do |format| format.js end diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 1e3be5895..ffa60f1f3 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1928,6 +1928,7 @@ zh: label_my_score: 我的评分 field_open_anonymous_evaluation: 是否使用匿评 label_course_empty_select: 尚未选择课程! + label_project_empty_select: 尚未选择项目! label_course_prompt: 课程: label_project_prompt: 项目: label_contain_resource: 已包含资源: From 4b2f2680fd3d601658306d3cc582d886f121ce15 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 4 Jul 2015 15:26:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?1=E3=80=81=E4=B8=BA=E5=BC=80=E5=90=AF?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E4=B8=9A=EF=BC=8C=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E6=8F=90=E7=A4=BA=E6=A1=86=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BD=8D=E7=BD=AE=E4=B8=8D=E6=AD=A3=E7=A1=AE=202=E3=80=81?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=88=97=E8=A1=A8=E6=88=90=E7=BB=A9=E6=98=AF?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E8=AF=84=E5=88=86=E8=80=8C=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E6=9C=80=E7=BB=88=E6=88=90=E7=BB=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- app/views/student_work/index.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 63d25acbd..cc858cc19 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -365,7 +365,7 @@ class StudentWorkController < ApplicationController sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,9] = homework.final_score.nil? ? l(:label_without_score) : format("%.2f",homework.final_score) + sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) sheet1[count_row,10] = format_time(homework.created_at) count_row += 1 end diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index e65b067d6..76ae71459 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -60,7 +60,7 @@ <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> <% end%> -
+
使用 winzip 工具进行解压可能会导致 From 602670b8419fadfc1f31824249edfb061316055e Mon Sep 17 00:00:00 2001 From: huang Date: Sat, 4 Jul 2015 15:42:03 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E6=8C=89=E5=A4=A9?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=9A=E4=BF=AE=E6=94=B9=E8=B4=B4=E5=90=A7?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E5=92=8C=E4=B8=AA=E4=BA=BA=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/mailer/send_for_user_activities.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/mailer/send_for_user_activities.html.erb b/app/views/mailer/send_for_user_activities.html.erb index 264a420cb..59dc1e674 100644 --- a/app/views/mailer/send_for_user_activities.html.erb +++ b/app/views/mailer/send_for_user_activities.html.erb @@ -420,7 +420,7 @@ <% unless @user_journal_messages.first.nil? %>
-

<%= l(:label_activities) %>

+

<%= l(:label_activities) %>

    @@ -451,7 +451,7 @@ <% end %> <% if @forums.first || @memos.first %>
    -

    <%= l(:lable_bar_active) %>

    +

    <%= l(:lable_bar_active) %>

    <% unless @forums.first.nil? %>
      From 2137cef98475cf0e876ec9764bf253c5cd57ecb3 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 4 Jul 2015 15:54:03 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E3=80=82=E8=80=81=E5=B8=88=E8=AF=84=E5=88=86=E4=B9=8B=E5=90=8E?= =?UTF-8?q?=EF=BC=8C=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/add_score.js.erb | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 4474ab3b5..9298de8fc 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -2,40 +2,36 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti $('#score_<%= @work.id%>').peSlider({range: 'min'}); <% if @is_new%> - $("#score_list_<%= @work.id%>").prepend("
      <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
      "); +$("#score_list_<%= @work.id%>").prepend("
      <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
      "); <% else %> - $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); +$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); <% end%> $("#score_list_<%= @work.id%>").removeAttr("style"); <% if @is_teacher %> - $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>"); +<% if @homework.homework_type == 1%> +$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>"); +<% else%> +$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>"); +<% end%> <% else %> - $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>"); +$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>"); <% end%> $(function(){ //匿评评分提示 $(".student_score_info").bind("mouseover",function(e){ - //alert($(this).html()); $(this).find("div").show(); -// $(this).find("div").css("top",e.pageY); -// $(this).find("div").css("left",e.pageX); }); $(".student_score_info").bind("mouseout",function(e){ - //alert($(this).html()); $(this).find("div").hide(); }); //最终成绩提示 $(".student_final_scor_info").bind("mouseover",function(e){ - //alert($(this).html()); $(this).find("div").show(); -// $(this).find("div").css("top",e.pageY); -// $(this).find("div").css("left",e.pageX); }); $(".student_final_scor_info").bind("mouseout",function(e){ - //alert($(this).html()); $(this).find("div").hide(); }); });