Merge branch 'develop' into yuanke_youhua

This commit is contained in:
yuanke 2016-11-04 18:41:05 +08:00
commit 9b13efd912
63 changed files with 1130 additions and 403 deletions

View File

@ -1,3 +1,4 @@
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
@ -31,6 +32,74 @@ class AdminController < ApplicationController
@no_configuration_data = Redmine::DefaultData::Loader::no_data? @no_configuration_data = Redmine::DefaultData::Loader::no_data?
end end
def export_rep_static_users
rev = params[:rev]
cycle = params[:cycle]
cycle_name = (params[:cycle] == "admin_week" ? l(:label_per_week) : (params[:cycle] == "admin_month" ? l(:label_per_month) : l(:label_per_all)))
respond_to do |format|
format.html
format.xls{
filename = "#{l(:label_user_rep_xls)}_#{cycle_name}.xls"
send_data(admin_export_rep_xls(:rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
# 管理员界面导出所有项目代码、提交次数统计
def admin_export_rep_xls (options = {})
cycle = params[:cycle]
g = Gitlab.client
users_results = []
User.all.each do |user|
unless user.mail.nil?
user_mail = user.mail
user.projects.where("gpid is not null").each do |project|
begin
g.branches(project.gpid).each do |branch|
if cycle == "admin_week"
statics = g.admin_rep_stats_week(project.gpid, :rev => branch.name, :user_mail => user_mail)
elsif cycle == "admin_month"
statics = g.admin_rep_stats_month(project.gpid, :rev => branch.name, :user_mail => user_mail)
elsif cycle == "admin_all"
statics = g.admin_rep_stats_all(project.gpid, :rev => branch.name, :user_mail => user_mail)
end
unless statics.first.commits_num == "0"
user_details = {:user_id => user.id, :user_name => user.show_name, :project_id => project.id, :project_name => project.name,
:commits_num => statics.first.commits_num, :add => statics.first.add, :del => statics.first.del, :changes => statics.first.changes, :branch => branch.name}
users_results << user_details
end
end
rescue Exception => e
puts e
end
end
end
end
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => l(:project_module_repository)
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:label_rep_user_id),l(:label_rep_user_name),l(:label_rep_project_id),l(:label_rep_project_name),l(:rep_branch),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time)])
count_row = 1
users_results.each do |static|
sheet1[count_row,0] = static[:user_id]
sheet1[count_row,1] = static[:user_name]
sheet1[count_row,2] = static[:project_id]
sheet1[count_row,3] = static[:project_name]
sheet1[count_row,4] = static[:branch]
sheet1[count_row,5] = static[:commits_num]
sheet1[count_row,6] = static[:add]
sheet1[count_row,7] = static[:del]
sheet1[count_row,8] = static[:changes]
sheet1[count_row,9] = Time.now.strftime('%Y-%m-%d %H:%M:%S')
count_row += 1
end
book.write xls_report
xls_report.string
end
# 管理员界面 项目列表 # 管理员界面 项目列表
def projects def projects
=begin =begin

View File

@ -1516,9 +1516,8 @@ class CoursesController < ApplicationController
if student_works.empty? if student_works.empty?
sheet1[count_row,j+4] = 0 sheet1[count_row,j+4] = 0
else else
final_score = student_works.first.final_score.nil? ? 0 : student_works.first.final_score work_score = student_works.first.work_score.nil? ? 0 : student_works.first.work_score
score = final_score - student_works.first.absence_penalty - student_works.first.late_penalty sheet1[count_row,j+4] = work_score <0 ? 0:work_score.round(2)
sheet1[count_row,j+4] = score <0 ? 0:score.round(2)
end end
end end
hw_score = member.score.nil? ? 0 : member.score hw_score = member.score.nil? ? 0 : member.score

View File

@ -206,35 +206,35 @@ class HomeworkCommonController < ApplicationController
if @homework_detail_manual.comment_status == 1 if @homework_detail_manual.comment_status == 1
student_works = @homework.student_works.has_committed student_works = @homework.student_works.has_committed
if student_works && student_works.size >= 2 if student_works && student_works.size >= 2
# if @homework.homework_type == 3 if @homework.homework_type == 3
# student_work_projects = @homework.student_work_projects.where("student_work_id is not null") student_work_projects = @homework.student_work_projects.where("student_work_id is not null")
# student_work_projects.each_with_index do |pro_work, pro_index| student_work_projects.each_with_index do |pro_work, pro_index|
# n = @homework_detail_manual.evaluation_num n = @homework_detail_manual.evaluation_num
# n = n < student_works.size ? n : student_works.size - 1 n = (n < student_works.size && n != -1) ? n : student_works.size - 1
# work_index = -1 work_index = -1
# student_works.each_with_index do |stu_work, stu_index| student_works.each_with_index do |stu_work, stu_index|
# if stu_work.id.to_i == pro_work.student_work_id.to_i if stu_work.id.to_i == pro_work.student_work_id.to_i
# work_index = stu_index work_index = stu_index
# end end
# end end
# assigned_homeworks = get_assigned_homeworks(student_works, n, work_index) assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
# assigned_homeworks.each do |h| assigned_homeworks.each do |h|
# student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id) student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
# student_works_evaluation_distributions.save student_works_evaluation_distributions.save
# end end
# end end
# else else
student_works.each_with_index do |work, index| student_works.each_with_index do |work, index|
user = work.user user = work.user
n = @homework_detail_manual.evaluation_num n = @homework_detail_manual.evaluation_num
n = n < student_works.size ? n : student_works.size - 1 n = (n < student_works.size && n != -1) ? n : student_works.size - 1
assigned_homeworks = get_assigned_homeworks(student_works, n, index) assigned_homeworks = get_assigned_homeworks(student_works, n, index)
assigned_homeworks.each do |h| assigned_homeworks.each do |h|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
student_works_evaluation_distributions.save student_works_evaluation_distributions.save
end end
end end
#end end
@homework_detail_manual.update_column('comment_status', 2) @homework_detail_manual.update_column('comment_status', 2)
@homework_detail_manual.update_column('evaluation_start', Date.today) @homework_detail_manual.update_column('evaluation_start', Date.today)
@statue = 1 @statue = 1
@ -304,13 +304,15 @@ class HomeworkCommonController < ApplicationController
def alert_anonymous_comment def alert_anonymous_comment
@cur_size = 0 @cur_size = 0
@totle_size = 0 @totle_size = 0
@work_size = 0
if @homework_detail_manual.comment_status == 1 if @homework_detail_manual.comment_status == 1
@totle_size = @course.student.count @totle_size = @course.student.count
@cur_size = @homework.student_works.has_committed.size @cur_size = @homework.student_works.where("work_status != 0").size
@work_size = @homework.student_works.has_committed.size
elsif @homework_detail_manual.comment_status == 2 elsif @homework_detail_manual.comment_status == 2
@homework.student_works.has_committed.map { |work| @totle_size += work.student_works_evaluation_distributions.count} @homework.student_works.where("work_status != 0").map { |work| @totle_size += work.student_works_evaluation_distributions.count}
@cur_size = 0 @cur_size = 0
@homework.student_works.has_committed.map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count} @homework.student_works.where("work_status != 0").map { |work| @cur_size += work.student_works_scores.select("distinct user_id").where(:reviewer_role => 3).count}
end end
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100) @percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@ -394,7 +396,14 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_end = params[:evaluation_end] @homework_detail_manual.evaluation_end = params[:evaluation_end]
end end
@homework_detail_manual.evaluation_num = params[:evaluation_num] evaluation_num = @homework_detail_manual.evaluation_num
if params[:evaluation_limit].to_i == 1
@homework_detail_manual.evaluation_num = params[:evaluation_num]
@homework_detail_manual.absence_penalty = evaluation_num == -1 ? 5 : @homework_detail_manual.absence_penalty
else
@homework_detail_manual.evaluation_num = -1
@homework_detail_manual.absence_penalty = 0
end
@homework_detail_manual.save @homework_detail_manual.save
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i @hw_status = params[:hw_status].to_i

View File

@ -45,6 +45,9 @@ class JournalsController < ApplicationController
end end
def diff def diff
# 顶部导航
@project_menu_type = 2
@issue = @journal.issue @issue = @journal.issue
if params[:detail_id].present? if params[:detail_id].present?
@detail = @journal.details.find_by_id(params[:detail_id]) @detail = @journal.details.find_by_id(params[:detail_id])
@ -55,7 +58,7 @@ class JournalsController < ApplicationController
@diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value) @diff = Redmine::Helpers::Diff.new(@detail.value, @detail.old_value)
respond_to do |format| respond_to do |format|
format.html { format.html {
render :layout => 'new_base' render :layout => 'base_projects'
} }
end end
end end

View File

@ -104,6 +104,7 @@ class MembersController < ApplicationController
@applied_message = AppliedMessage.find(params[:applied_message_id]) @applied_message = AppliedMessage.find(params[:applied_message_id])
# @applied_message.update_attribute(:status, 3) # @applied_message.update_attribute(:status, 3)
applied_project = @applied_message.applied applied_project = @applied_message.applied
project = Project.find(@applied_message.project_id)
# 发送消息给被拒者,user_id对应的收到信息的用户 # 发送消息给被拒者,user_id对应的收到信息的用户
AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 4, AppliedMessage.create(:user_id => @applied_message.applied_user_id, :applied_type => "AppliedProject", :applied_id => applied_project.id ,:status => 4,
:viewed => false, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id) :viewed => false, :applied_user_id => @applied_message.user_id, :role => applied_project.role, :project_id => applied_project.project_id)

View File

@ -521,7 +521,7 @@ class PollController < ApplicationController
#显示某个学生某份问卷的填写结果 #显示某个学生某份问卷的填写结果
def poll_result def poll_result
@poll_questions = paginateHelper @poll.poll_questions,5 @poll_questions = @poll.poll_questions
@left_nav_type = 7 @left_nav_type = 7
respond_to do |format| respond_to do |format|
format.html{render :layout => 'base_courses'} format.html{render :layout => 'base_courses'}

View File

@ -72,6 +72,7 @@ class RepositoriesController < ApplicationController
end end
def export_rep_static def export_rep_static
# 管理员界面导出所有项目
@project = Project.find(params[:id]) @project = Project.find(params[:id])
gpid = @project.gpid gpid = @project.gpid
rev = params[:rev] rev = params[:rev]
@ -80,7 +81,7 @@ class RepositoriesController < ApplicationController
format.html format.html
format.xls{ format.xls{
filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls" filename = "#{@project.name.to_s}_#{l(:label_rep_xls)}.xls"
send_data(export_rep_xls(gpid, :rev => rev, :cycle => "1"), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename)) send_data(export_rep_xls(gpid, :rev => rev, :cycle => cycle), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
} }
end end
end end

View File

@ -5,7 +5,9 @@ class StudentWorkController < ApplicationController
include ApplicationHelper include ApplicationHelper
require 'bigdecimal' require 'bigdecimal'
require "base64" require "base64"
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,:search_course_students,:work_canrepeat] before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,
:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,
:search_course_students,:work_canrepeat,:add_group_member]
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment] before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work] before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
before_filter :author_of_work, :only => [:edit, :update, :destroy] before_filter :author_of_work, :only => [:edit, :update, :destroy]
@ -689,7 +691,7 @@ class StudentWorkController < ApplicationController
def show def show
@score = student_work_score @work,User.current @score = student_work_score @work,User.current
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
@student_work_scores = @work.student_works_scores.order("updated_at desc") @student_work_scores = student_work_score_record(@work)
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -827,22 +829,22 @@ class StudentWorkController < ApplicationController
case @new_score.reviewer_role case @new_score.reviewer_role
when 1 #教师评分:最后一个教师评分为最终评分 when 1 #教师评分:最后一个教师评分为最终评分
@work.teacher_score = @new_score.score @work.teacher_score = @new_score.score
if @is_group_leader if @is_group_leader && params[:same_score]
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score add_score_to_member @work, @homework, @new_score
end end
when 2 #教辅评分 教辅评分显示平均分 when 2 #教辅评分 教辅评分显示平均分
#@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f #@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f @work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
if @is_group_leader if @is_group_leader && params[:same_score]
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score add_score_to_member @work, @homework, @new_score
end end
when 3 #学生评分 学生评分显示平均分 when 3 #学生评分 学生评分显示平均分
#@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f #@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.student_score = stu_score.first.score.try(:round, 2).to_f @work.student_score = stu_score.first.score.try(:round, 2).to_f
if @is_group_leader if @is_group_leader
add_score_to_member @work, @homework, 3, 'student_score', @work.student_score add_score_to_member @work, @homework, @new_score
end end
end end
@homework.update_column('updated_at', Time.now) @homework.update_column('updated_at', Time.now)
@ -852,6 +854,7 @@ class StudentWorkController < ApplicationController
if @work.save if @work.save
@work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first @work = @homework.student_works.select("student_works.*,student_works.work_score as score").where(:id => @work.id).first
@count = @homework.student_works.has_committed.count @count = @homework.student_works.has_committed.count
@student_work_scores = student_work_score_record @work
respond_to do |format| respond_to do |format|
format.js format.js
end end
@ -973,7 +976,7 @@ class StudentWorkController < ApplicationController
unless @homework.late_penalty.to_s == params[:late_penalty].to_s unless @homework.late_penalty.to_s == params[:late_penalty].to_s
@homework.late_penalty = params[:late_penalty] @homework.late_penalty = params[:late_penalty]
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work| @homework.student_works.where("commit_time > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = @homework.late_penalty student_work.late_penalty = @homework.late_penalty
student_work.save student_work.save
end end
@ -984,7 +987,7 @@ class StudentWorkController < ApplicationController
if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
@homework.student_works.each do |student_work| @homework.student_works.each do |student_work|
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids} and reviewer_role = 3").count
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save student_work.save
end end
@ -993,7 +996,7 @@ class StudentWorkController < ApplicationController
homework_detail_manual.save if homework_detail_manual homework_detail_manual.save if homework_detail_manual
end end
teacher_priority = params[:teacher_priority] ? 1 : 0 teacher_priority = params[:teacher_priority].to_i
if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s) if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s)
homework_detail_manual.ta_proportion = params[:ta_proportion] homework_detail_manual.ta_proportion = params[:ta_proportion]
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
@ -1009,7 +1012,7 @@ class StudentWorkController < ApplicationController
end end
@homework.save @homework.save
if params[:student_path] if params[:student_path] && params[:student_path] == "true"
redirect_to student_work_index_url(:homework => @homework.id) redirect_to student_work_index_url(:homework => @homework.id)
else else
@user_activity_id = params[:user_activity_id].to_i @user_activity_id = params[:user_activity_id].to_i
@ -1149,6 +1152,41 @@ class StudentWorkController < ApplicationController
render :json => req render :json => req
end end
#作业截止后组长添加成员
def add_group_member
student_work = @homework.student_works.where("user_id = #{User.current.id}").first
if params[:member_id]
#为新增加的成员创建作品
for i in 1 .. params[:member_id].count do
work = StudentWork.find_by_homework_common_id_and_user_id(@homework.id, params[:member_id][i].to_i)
unless work
stu_work = StudentWork.new(:name => student_work.name, :description => student_work.description,:user_id =>params[:member_id][i].to_i, :homework_common_id => @homework.id,:project_id => student_work.project_id, :late_penalty => student_work.late_penalty,:work_status => 3, :commit_time => Time.now)
if stu_work.save
stu_project = StudentWorkProject.new(:homework_common_id => @homework.id, :student_work_id => student_work.id, :project_id => stu_work.project_id == 0 ? -1 : stu_work.project_id, :user_id => params[:member_id][i].to_i, :is_leader => 0)
stu_project.save
end
end
end
#未选择的成员删除作品
student_work_projects = @homework.student_work_projects.where("student_work_id=? and is_leader =?",student_work.id,0)
student_work_projects.each do |sp|
unless params[:member_id].include?(sp.user_id.to_s)
work = StudentWork.where("homework_common_id = #{@homework.id} and user_id = #{sp.user_id}").first
sp.destroy
if work
work.destroy
end
end
end
end
respond_to do |format|
format.html {
redirect_to student_work_index_url(:homework => @homework.id, :tab => 2)
}
end
end
private private
def searchstudent_by_name users, name def searchstudent_by_name users, name
mems = [] mems = []
@ -1444,11 +1482,11 @@ class StudentWorkController < ApplicationController
#成绩计算 #成绩计算
def set_final_score homework,student_work def set_final_score homework,student_work
if homework && homework.homework_detail_manual if homework && homework.homework_detail_manual
if homework.homework_type != 2 #匿评作业 if homework.homework_type != 2 #非编程作业
if homework.teacher_priority == 1 #教师优先 if homework.teacher_priority == 1 #教师优先
if student_work.teacher_score if student_work.teacher_score
student_work.final_score = student_work.teacher_score student_work.final_score = student_work.teacher_score
student_work.work_score = student_work.teacher_score student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
else else
if student_work.teaching_asistant_score.nil? if student_work.teaching_asistant_score.nil?
student_work.final_score = student_work.student_score student_work.final_score = student_work.student_score
@ -1491,7 +1529,7 @@ class StudentWorkController < ApplicationController
if homework.teacher_priority == 1 #教师优先 if homework.teacher_priority == 1 #教师优先
if student_work.teacher_score if student_work.teacher_score
student_work.final_score = student_work.teacher_score student_work.final_score = student_work.teacher_score
student_work.work_score = student_work.teacher_score student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
else else
if student_work.teaching_asistant_score.nil? #教辅未评分 if student_work.teaching_asistant_score.nil? #教辅未评分
if student_work.student_score.nil? if student_work.student_score.nil?

View File

@ -93,7 +93,7 @@ module ApplicationHelper
end end
xls_report = StringIO.new xls_report = StringIO.new
book = Spreadsheet::Workbook.new book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "版本库" sheet1 = book.create_worksheet :name => l(:project_module_repository)
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)]) sheet1.row(0).concat([l(:rep_branch),l(:rep_author),l(:rep_changeset),l(:rep_code_add),l(:rep_code_delete),l(:rep_code_modified),l(:rep_sode_time),l(:rep_sode_cycle),l(:rep_author_mail)])
@ -2905,7 +2905,7 @@ module ApplicationHelper
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red' link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
end end
else else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 && work.user_id == User.current.id #匿评作业,且作业状态不是在开启匿评之前 if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品" link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束" link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评已结束"

View File

@ -69,6 +69,15 @@ module StudentWorkHelper
str str
end end
#获取学生作品的评分记录:同一个教师或教辅只显示最后一次评分
def student_work_score_record work
sql = "SELECT MAX(id) id FROM student_works_scores WHERE (reviewer_role = 2 OR reviewer_role = 1) AND score IS NOT NULL AND student_work_id = #{work.id} GROUP BY user_id"
tea_ts_ids = StudentWorksScore.find_by_sql sql
tea_ts_ids = tea_ts_ids.empty? ? "(-1)" : "(" + tea_ts_ids.map{|tea| tea.id}.join(",") + ")"
scores = work.student_works_scores.where("score IS NULL or reviewer_role = 3 or id in #{tea_ts_ids}").order("updated_at desc")
return scores
end
#获取赞的总数 #获取赞的总数
def praise_homework_count obj_id def praise_homework_count obj_id
PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'StudentWork'").count PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'StudentWork'").count
@ -166,12 +175,19 @@ module StudentWorkHelper
return student_works return student_works
end end
def add_score_to_member student_work, homework, role, score_type, score def add_score_to_member student_work, homework, new_score
student_works = group_student_works student_work, homework student_works = group_student_works student_work, homework
student_works.each do |st_work| student_works.each do |st_work|
if st_work.student_works_scores.where("reviewer_role = #{role} and score is not null").empty? st_work.student_works_scores << StudentWorksScore.create(:user_id => new_score.user_id, :score => new_score.score, :reviewer_role => new_score.reviewer_role, :comment => new_score.comment)
st_work.update_attribute("#{score_type}", score) if new_score.reviewer_role == 1
st_work.teacher_score = new_score.score
elsif new_score.reviewer_role == 2
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{st_work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
st_work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
else
st_work.student_score = student_work.student_score
end end
st_work.save
end end
end end
end end

View File

@ -49,11 +49,11 @@ class StudentWork < ActiveRecord::Base
#成绩计算 #成绩计算
def set_final_score homework,student_work def set_final_score homework,student_work
if homework && homework.homework_detail_manual if homework && homework.homework_detail_manual
if homework.homework_type != 2 #匿评作业 if homework.homework_type != 2 #非编程作业
if homework.teacher_priority == 1 #教师优先 if homework.teacher_priority == 1 #教师优先
if student_work.teacher_score if student_work.teacher_score
student_work.final_score = student_work.teacher_score student_work.final_score = student_work.teacher_score
student_work.work_score = student_work.teacher_score student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
else else
if student_work.teaching_asistant_score.nil? if student_work.teaching_asistant_score.nil?
student_work.final_score = student_work.student_score student_work.final_score = student_work.student_score
@ -98,7 +98,7 @@ class StudentWork < ActiveRecord::Base
if homework.teacher_priority == 1 #教师优先 if homework.teacher_priority == 1 #教师优先
if student_work.teacher_score if student_work.teacher_score
student_work.final_score = student_work.teacher_score student_work.final_score = student_work.teacher_score
student_work.work_score = student_work.teacher_score student_work.work_score = student_work.teacher_score - student_work.absence_penalty - student_work.late_penalty
else else
if student_work.teaching_asistant_score.nil? #教辅未评分 if student_work.teaching_asistant_score.nil? #教辅未评分
if student_work.student_score.nil? if student_work.student_score.nil?

View File

@ -77,6 +77,11 @@
</div> </div>
<% html_title(l(:label_project_plural)) -%> <% html_title(l(:label_project_plural)) -%>
<div class="fr">项目代码/提交数统计:
<%= link_to "最近一周", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_week" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_month" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %><a style="color: #7f7f7f;">|</a>
<%= link_to "所有", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_all" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %>
</div>
<script> <script>
function delcfm() { function delcfm() {

View File

@ -21,7 +21,7 @@
<div class="homepageRight mt0 ml10"> <div class="homepageRight mt0 ml10">
<div class="homepageRightBanner"> <div class="homepageRightBanner">
<div class="NewsBannerName"> <div class="NewsBannerName break_word" style="width: 600px;">
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %> <%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
</div> </div>

View File

@ -6,9 +6,7 @@
<% members.each do |member| %> <% members.each do |member| %>
<div class="st_boxlist"> <div class="st_boxlist">
<a href="javascript:" class="st_img"> <%= link_to image_tag(url_to_avatar(member.user), :width => "32", :height => "32", :style => "display:block;"), user_path(member.user_id),:target => '_blank', :class => 'st_img' ,:alt => "用户头像" %>
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span> <span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %> <%= link_to(member.user.show_name, user_path(member.user),:class => "ml10 c_blue02") %>
<span class="fr c_grey"><%= format_date(member.created_on)%></span> <span class="fr c_grey"><%= format_date(member.created_on)%></span>

View File

@ -57,7 +57,8 @@
<li class="pollsbtn_tip fl ml5">已答</li--> <li class="pollsbtn_tip fl ml5">已答</li-->
<%#else%> <%#else%>
<%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%> <%= link_to (index.to_i+1).to_s+". "+exercise_name, exercise_path(exercise.id), :class => "polls_title polls_title_st fl c_dblue"%>
<% if exercise.end_time <= Time.now && has_commit_exercise?(exercise.id, User.current.id) %> <% eu = ExerciseUser.where("exercise_id=? and user_id=? and status=?",exercise.id, User.current.id, true).first %>
<% if exercise.end_time <= Time.now && eu && exercise.end_time >= eu.created_at %>
<li class="pollsbtn_tip fl ml5">已答</li> <li class="pollsbtn_tip fl ml5">已答</li>
<% end %> <% end %>
<%#end%> <%#end%>

View File

@ -1,44 +1,24 @@
<div id="popbox02"> <div id="muban_popup_box" style="width:550px;">
<div class="ni_con"> <div class="muban_popup_top">
<h3 class="fl">
<% if @homework_detail_manual.comment_status == 1%>
启动匿评提示
<% elsif @homework_detail_manual.comment_status == 2 %>
关闭匿评提示
<% end %>
</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con ml30 mr30 mt20 mb10 clear" >
<% if @homework_detail_manual.comment_status == 1%> <% if @homework_detail_manual.comment_status == 1%>
<h2>开启匿评功能</h2> <p class="mb10">开启匿评之后提交作品的学生及其作品,不能参与匿评,匿评评分将被记为 <span class="c_red">0</span> 分。</p>
<p> <p class="mb10">本次作业共<span class="c_red"> <%= @totle_size %>个 </span>学生,已有 <span class="c_red"><%= @cur_size %>个</span> 学生共提交了 <span class="c_red"><%= @work_size %></span> 份作品,占 <span class="c_red"><%= @percent %>%</span>,是否确定开启匿评?</p>
开启匿评后提交的作品将 <% elsif @homework_detail_manual.comment_status == 2 %>
<span class="c_blue">不能参与匿评</span> <p class="mb10">关闭匿评后学生将不能对作品进行匿评,且作品列表将会公开,</p>
匿评评分将被记为 <p class="mb10">目前分配了<span class="c_red"> <%= @totle_size %>份 </span>匿评作品,已评了 <span class="c_red"><%= @cur_size %>份</span> 作品,占 <span class="c_red"><%= @percent %>%</span>,是否确定关闭匿评?</p>
<span class="c_pink">0分</span>
。目前有
<span class="c_pink"><%= @totle_size%>个</span>
学生,共提交了
<span class="c_pink"><%= @cur_size %></span>
份作品,占
<span class="c_pink"><%= @percent %>%</span>
是否确定开启匿评?
</p>
<% elsif @homework_detail_manual.comment_status == 2 %>
<h2>关闭匿评功能</h2>
<p>
关闭匿评后学生将不能对作品进行
<span class="c_blue">匿评</span>
,且作品列表将会
<span class="c_blue">公开</span>
目前分配了
<span class="c_pink"><%= @totle_size%>份</span>
匿评作品,已评了
<span class="c_pink"><%= @cur_size %></span>
份作品,占
<span class="c_pink"><%= @percent %>%</span>
是否确定关闭匿评?
</p>
<% end %> <% end %>
<div class="ni_btn"> <a href="javascript:void(0);" class="fl sy_btn_blue mr5 ml160" onclick="clickOK('<%= alert_anonyoms_path @homework,@homework_detail_manual,@user_activity_id,@hw_status%>');">确定</a>
<a href="javascript:" class="tijiao" onclick="clickOK('<%= alert_anonyoms_path @homework,@homework_detail_manual,@user_activity_id,@hw_status%>');" style="margin-bottom: 20px;" > <a href="javascript:void(0);" class="fl sy_btn_grey" onclick="hideModal();">取消</a>
确&nbsp;&nbsp;定
</a>
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">
取&nbsp;&nbsp;消
</a>
</div>
</div> </div>
</div> </div>

View File

@ -1,53 +1,84 @@
<div class="markPopup" id="popbox02"> <div id="muban_popup_box" style="width:550px;">
<%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post",:remote => true) do |f|%> <%= form_for('new_form',:url => {:controller => 'homework_common',:action => 'set_evaluation_attr',:homework => @homework.id,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post",:remote => true) do |f|%>
<span class="uploadText">匿评设置</span> <div class="muban_popup_top">
<div class="cl"></div> <h3 class="fl">匿评设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="mt15">
<span class="f14 fontGrey3 fl mt5">开启匿评</span>
<div class="calendar_div fl ml10">
<input type="text" name="evaluation_start" id="evaluation_start_time" placeholder="开启匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_start%>"/>
<%#= calendar_for('evaluation_start_time')%>
</div>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_evaluation_start_time" class="c_red"></p>
</div> </div>
<div class="cl"></div>
<div class="mt15"> <div class="muban_popup_con clear">
<span class="f14 fontGrey3 fl mt5">关闭匿评</span> <div class="clear mt15 ml20">
<div class="calendar_div fl ml10"> <ul class="pro_newsetting_con fl">
<input type="text" name="evaluation_end" id="evaluation_end_time" placeholder="关闭匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_end%>"/> <li class="mb10 clear">
<%#= calendar_for('evaluation_end_time')%> <label class="fl pop_box_label">开启匿评&nbsp;&nbsp;:&nbsp;</label>
</div> <div class="calendar_div fl">
<input type="text" name="evaluation_start" id="evaluation_start_time" placeholder="开启匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_start%>"/>
<%#= calendar_for('evaluation_start_time')%>
</div>
<div class="cl"></div>
<p id="homework_evaluation_start_time" class="ml38 c_red"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">关闭匿评&nbsp;&nbsp;:&nbsp;</label>
<div class="calendar_div fl">
<input type="text" name="evaluation_end" id="evaluation_end_time" placeholder="关闭匿评日期" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= @homework_detail_manual.evaluation_end%>"/>
<%#= calendar_for('evaluation_end_time')%>
</div>
<div class="cl"></div>
<p id="homework_evaluation_end_time" class="ml38 c_red"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">&nbsp;匿评人数&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" name="evaluation_limit" id="limit"/>
<label for="limit" class="fl ml5">限定</label>
<input type="text" name="evaluation_num" id="evaluation_num" maxlength="2" class="radio-width90 fl ml10" value="<%= @homework_detail_manual.evaluation_num == -1 ? 3 : @homework_detail_manual.evaluation_num%>"/>
<div class="cl"></div>
<p id="evaluation_num_notice" class="c_red ml100"></p>
</li>
<li class="mb10 clear">
<label class="fl pop_box_label">&nbsp;&nbsp;</label>
<input type="radio" class="fl" value="0" name="evaluation_limit" id="no_limit"/>
<label for="no_limit" class="fl ml5">不限定</label>
</li>
</ul>
<ul class="fl ml35">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >系统自动开启匿评的时间</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >系统自动关闭匿评的时间</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >作品供指定数量的学生评阅</p>
</div>
<div class="popup_tip_box fontGrey2">
<em></em>
<span></span>
<p>作品供全部的学生评阅<br/>缺评扣分将被置零</p>
</div>
</ul>
<div class="cl"></div> <div class="cl"></div>
<p id="homework_evaluation_end_time" class="c_red"></p> <div class="alert alert-orange mb15 ml30 mr80 mt10">
</div> 注意:开启匿评时尚未提交作品的同学,将不参与匿评
<div class="cl"></div>
<div class="mt15 mb10">
<span class="f14 fontGrey3 mr10 fl mt5">匿评人数</span>
<input type="text" name="evaluation_num" id="evaluation_num" placeholder="默认匿评人数为3" maxlength="2" class="markInput fl" value="<%= @homework_detail_manual.evaluation_num%>"/>
<div class="cl"></div>
<p id="evaluation_num_notice" class="c_red"></p>
</div>
<div class="cl"></div>
<div class="mb20 none">
<span class="f14 fontGrey3 mr10">禁用匿评</span>
<input type="checkbox" />
<span class="f12 c_red ml10">禁用后将无法进行学生互评</span>
</div>
<div class="cl"></div>
<div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="sendSourceText" onclick="submit_set_evaluation_attr('<%= @homework.end_time%>');">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="hideModal();">取消</a>
</div> </div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr80" onclick="submit_set_evaluation_attr('<%= @homework.end_time%>');">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div> </div>
<div class="cl"></div>
<% end%> <% end%>
</div> </div>
<script>
$(function(){
<% if @homework_detail_manual.evaluation_num != -1 %>
$("#limit").attr("checked", "checked");
<% else %>
$("#no_limit").attr("checked", "checked");
<% end %>
});
</script>

View File

@ -0,0 +1,101 @@
<div id="muban_popup_box" style="width:550px;">
<div class="muban_popup_top">
<h3 class="fl">评分设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">缺评扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">&nbsp;&nbsp;</label>
<ul class="fl">
<li class="clear">
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
<label for="other_score" class="fl ml5">助教评分+学生匿评</label>
</li>
<li class="clear">
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
<span class="fl ml5">助教评分</span>
</li>
<li class="clear">
<input type="text" style="width: 49px; padding-left: 10px;" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion * 100).to_i%>%" class="fl ml15" readonly>
<span class="fl ml5">学生匿评</span>
</li>
</ul>
</li>
</ul>
<ul class="fl mt5 ml20" >
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >教师评分 - 迟交扣分 - 缺评扣分</p>
</div>
<div class="popup_tip_box fontGrey2">
<em></em>
<span></span>
<p >助教评分 * 其百分比 + <br/>
学生匿评平均分 * 其百分比 - <br/>
( 迟交扣分 + 缺评扣分 )</p>
</div>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr80" onclick="set_score_rule_submit();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<% end %>
</div>
<script>
$(function(){
$("#ta_proportion").change(function(){
var ta_proportion = parseFloat($("#ta_proportion").val());
$("#student_proportion").val((100 - parseFloat(parseInt(ta_proportion * 100))) + "%");
});
<% if homework.teacher_priority == 1 %>
$("#teacher_score").attr("checked", "checked");
<% else %>
$("#other_score").attr("checked", "checked");
<% end %>
$("#teacher_score").change(function(){
if($("#teacher_score").attr("checked")){
$("#late_penalty_num").val("0");
$("#absence_penalty_num").val("0");
}
});
$("#other_score").change(function(){
if($("#other_score").attr("checked")){
$("#late_penalty_num").val("10");
<% if homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1 %>
$("#absence_penalty_num").val("0");
<% else %>
$("#absence_penalty_num").val("5");
<% end %>
}
});
});
</script>

View File

@ -0,0 +1,69 @@
<div id="muban_popup_box" style="width:500px;">
<div class="muban_popup_top">
<h3 class="fl">评分设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/>
<label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">&nbsp;&nbsp;</label>
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
<label for="other_score" class="fl ml5">助教评分</label>
</li>
</ul>
<ul class="fl mt5 ml20" >
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >教师评分 - 迟交扣分 </p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >助教评分 - 迟交扣分 </p>
</div>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr90" onclick="set_score_rule_submit();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<% end %>
</div>
<script>
$(function(){
<% if homework.teacher_priority == 1 %>
$("#teacher_score").attr("checked", "checked");
<% else %>
$("#other_score").attr("checked", "checked");
<% end %>
$("#teacher_score").change(function(){
if($("#teacher_score").attr("checked")){
$("#late_penalty_num").val("0");
}
});
$("#other_score").change(function(){
if($("#other_score").attr("checked")){
$("#late_penalty_num").val("10");
}
});
});
</script>

View File

@ -0,0 +1,111 @@
<div id="muban_popup_box" style="width:570px;">
<div class="muban_popup_top">
<h3 class="fl">评分设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">缺评扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/><label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">&nbsp;&nbsp;</label>
<ul class="fl">
<li class="clear">
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/>
<label for="other_score" class="fl ml5">系统评分+助教评分+学生匿评</label>
</li>
<li class="clear">
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "w61 fl ml15"} %>
<span class="fl ml5">系统评分</span>
</li>
<li class="clear">
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing.ta_proportion * 100).to_i),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
<span class="fl ml5">助教评分</span>
</li>
<li class="clear">
<input type="text" style="width: 49px; padding-left: 10px;" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion * 100).to_i - (homework.homework_detail_programing.ta_proportion * 100).to_i%>%" class="fl ml15" readonly>
<span class="fl ml5">学生匿评</span>
</li>
</ul>
</li>
</ul>
<ul class="fl ml20 mt5">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p id="late_penalty_notice" class="">请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p id="absence_penalty_notice" class="">请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p>教师评分-迟交扣分-缺评扣分</p>
</div>
<div class="popup_tip_box fontGrey2">
<em></em>
<span></span>
<p>系统评分*其百分比+ <br/>
助教评 *其百分比+ <br/>
学生匿评平均分*其百分比 - <br/>
( 迟交扣分+缺评扣分 )</p>
</div>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr70" onclick="set_score_rule_submit();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<% end%>
</div>
<script>
$(function(){
$("#sy_proportion").live('change', function(){
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100);
$("#ta_proportion").replaceWith(build_selector(ta_proportion));
$("#student_proportion").val("0%");
});
$("#ta_proportion").live("change",function(){
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100) - parseInt(parseFloat($("#ta_proportion").val()) * 100);
$("#student_proportion").val(ta_proportion + "%");
});
<% if homework.teacher_priority == 1 %>
$("#teacher_score").attr("checked", "checked");
<% else %>
$("#other_score").attr("checked", "checked");
<% end %>
$("#teacher_score").change(function(){
if($("#teacher_score").attr("checked")){
$("#late_penalty_num").val("0");
$("#absence_penalty_num").val("0");
}
});
$("#other_score").change(function(){
if($("#other_score").attr("checked")){
$("#late_penalty_num").val("10");
<% if homework.homework_detail_manual && homework.homework_detail_manual.evaluation_num == -1 %>
$("#absence_penalty_num").val("0");
<% else %>
$("#absence_penalty_num").val("5");
<% end %>
}
});
});
</script>

View File

@ -0,0 +1,91 @@
<div id="muban_popup_box" style="width:500px;">
<div class="muban_popup_top">
<h3 class="fl">评分设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
</div>
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl issues_calendar_input" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">最终得分&nbsp;&nbsp;:&nbsp;</label>
<input type="radio" class="fl" value="1" id="teacher_score" name="teacher_priority"/>
<label for="teacher_score" class=" fl ml5">教师评分</label>
</li>
<li class="mb10 clear">
<label class="pop_box_label fl">&nbsp;&nbsp;</label>
<ul class="fl">
<li class="clear">
<input type="radio" class="fl" id="other_score" value="0" name="teacher_priority"/><label for="other_score" class="fl ml5">系统评分+助教评分</label>
</li>
<li class="clear">
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "w61 fl ml15"} %>
<span class="fl ml5">系统评分</span>
</li>
<li class="clear">
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing.ta_proportion * 100).to_i),homework.homework_detail_manual.ta_proportion), {:class => "w61 fl ml15"} %>
<span class="fl ml5">助教评分</span>
</li>
</ul>
</li>
</ul>
<ul class="fl ml20 mt5">
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >请输入数值0-50</p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >教师评分 - 迟交扣分 </p>
</div>
<div class="popup_tip_box fontGrey2 mb10">
<em></em>
<span></span>
<p >系统评分 * 其百分比 + <br/>
助教评分 * 其百分比 - <br/>
迟交扣分 </p>
</div>
</ul>
<div class="cl"></div>
<a href="javascript:void(0);" class="fr sy_btn_blue mr75" onclick="set_score_rule_submit();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="hideModal();">取消</a>
</div>
</div>
<% end %>
</div>
<script>
$(function(){
$("#sy_proportion").live('change', function(){
var ta_proportion = 100 - parseInt(parseFloat($("#sy_proportion").val()) * 100);
$("#ta_proportion").replaceWith(build_selector(ta_proportion));
});
$("#ta_proportion").live('change', function(){
var sy_proportion = 100 - parseInt(parseFloat($("#ta_proportion").val()) * 100);
$("#sy_proportion").replaceWith(build_selector_sy(sy_proportion));
});
<% if homework.teacher_priority == 1 %>
$("#teacher_score").attr("checked", "checked");
<% else %>
$("#other_score").attr("checked", "checked");
<% end %>
$("#teacher_score").change(function(){
if($("#teacher_score").attr("checked")){
$("#late_penalty_num").val("0");
}
});
$("#other_score").change(function(){
if($("#other_score").attr("checked")){
$("#late_penalty_num").val("10");
}
});
});
</script>

View File

@ -1,6 +1,2 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms') %>'); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/alert_anonyoms') %>";
showModal('ajax-modal', '500px'); pop_box_new(htmlvalue, 550, 171);
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed").css("border","3px solid #269ac9");

View File

@ -1,6 +1,27 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>'); <% if @homework.homework_type == 2 %>
showModal('ajax-modal', '350px'); <% if @homework.anonymous_comment == 0 %>
$('#ajax-modal').siblings().remove(); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" + pop_box_new(htmlvalue, 570, 355);
"<a href='javascript:' onclick='hideModal();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>"); <% else %>
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9"); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 500, 285);
<% end %>
<% else %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 500, 325);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 500, 225);
<% end %>
<% end %>
function set_score_rule_submit() {
if($("#late_penalty_num").val() == ""){
$("#late_penalty_num").val("0");
}
if($("#absence_penalty_num").val() == ""){
$("#absence_penalty_num").val("0");
}
$('#muban_popup_box').find('form').submit();
hideModal();
}

View File

@ -1,4 +1,3 @@
clickCanel();
<% if @hw_status == 5 %> <% if @hw_status == 5 %>
$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>"); $("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
<% else %> <% else %>

View File

@ -1,10 +1,6 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>'); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_evalutation_att',:locals => {:user_activity_id => @user_activity_id,:hw_status => @hw_status,:remote=>true}) %>";
pop_box_new(htmlvalue, 550, 315);
var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true}; var datepickerOptions={dateFormat: 'yy-mm-dd', firstDay: 0, showOn: 'button', buttonImageOnly: true, buttonImage: '/images/public_icon.png', showButtonPanel: true, showWeek: true, showOtherMonths: true, selectOtherMonths: true};
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hideModal();'><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() { $('#evaluation_start_time').datepicker(datepickerOptions); $(function() { $('#evaluation_start_time').datepicker(datepickerOptions);
$('#evaluation_end_time').datepicker(datepickerOptions); $('#evaluation_end_time').datepicker(datepickerOptions);
}); });

View File

@ -1,10 +1,17 @@
<h3><%=h @issue.tracker %> #<%= @issue.id %></h3> <div class="myissues_con mb10">
<p>由<%= @journal.user %> 更新于 <%= format_time @journal.created_on %></p> <h3><%=h @issue.tracker %> #<%= @issue.id %></h3>
<p class="mb5">由<%= link_to @journal.user, user_path(@journal.user), :class => "c_blue" %> 更新于 <%= format_time @journal.created_on %></p>
<div class="text-diff" style="word-break:break-all; word-wrap:break-word;">
<div class="mb10 fl">之前版本:</div><div class="fl"><%= @detail.old_value.html_safe %></div>
<div class="cl"></div>
<div class="fl"> 当前版本:</div><div class="fl"><%= @detail.value.html_safe %></div>
<div class="cl"></div>
<%#= @diff.to_html.gsub("&lt;","<").gsub("&gt;",">").gsub("&quot;","\"").gsub("&amp;gt;", ">").gsub("&amp;lt;", "<").gsub("&amp;quot;", "\"").html_safe %>
</div>
<p><%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %></p>
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>
<div class="text-diff" style="word-break:break-all; word-wrap:break-word;">
<%= @diff.to_html.gsub("&lt;","<").gsub("&gt;",">").gsub("&quot;","\"").gsub("&amp;gt;", ">").gsub("&amp;lt;", "<").gsub("&amp;quot;", "\"").html_safe %>
</div> </div>
<p><%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %></p>
<% html_title "#{@issue.tracker.name} ##{@issue.id}: #{@issue.subject}" %>

View File

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

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" /> <meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %> <%= csrf_meta_tag %>
<%= favicon %> <%= favicon %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus',:media => 'all' %> <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common', 'css/structure','css/public', 'prettify','css/project','css/courses','css/popup','syllabus','css/moduel',:media => 'all' %>
<%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
<%= javascript_heads %> <%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%> <%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

View File

@ -2,9 +2,21 @@
<div class="testEditTitle"> <div class="testEditTitle">
第<%= poll_question.question_number%>题: 第<%= poll_question.question_number%>题:
<%= poll_question.question_title %> <%= poll_question.question_title %>
<span class="fontBlue">[多选题]</span>
<%if poll_question.is_necessary == 1%> <%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="必答">*</span>
<%end%> <%end%>
<% if poll_question.min_choices != 0 || poll_question.max_choices != 0 %>
<p class="fontGrey2">
<% if poll_question.min_choices != 0 && poll_question.max_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项、最多选<%=poll_question.max_choices %>项
<% elsif poll_question.min_choices != 0 %>
答题时最少选<%=poll_question.min_choices %>项
<% elsif poll_question.max_choices != 0 %>
答题时最多选<%=poll_question.max_choices %>项
<% end %>
</p>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="ur_inputs"> <div class="ur_inputs">

View File

@ -2,6 +2,7 @@
<div class="testEditTitle"> <div class="testEditTitle">
第<%= poll_question.question_number%>题: 第<%= poll_question.question_number%>题:
<%= poll_question.question_title %> <%= poll_question.question_title %>
<span class="fontBlue">[单选题]</span>
<%if poll_question.is_necessary == 1%> <%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="必答">*</span>
<%end%> <%end%>

View File

@ -2,6 +2,7 @@
<div class="testEditTitle"> <div class="testEditTitle">
第<%= poll_question.question_number%>题: 第<%= poll_question.question_number%>题:
<%= poll_question.question_title %> <%= poll_question.question_title %>
<span class="fontBlue">[多行主观题]</span>
<%if poll_question.is_necessary == 1%> <%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="必答">*</span>
<%end%> <%end%>

View File

@ -2,6 +2,7 @@
<div class="testEditTitle"> <div class="testEditTitle">
第<%= poll_question.question_number%>题: 第<%= poll_question.question_number%>题:
<%= poll_question.question_title %> <%= poll_question.question_title %>
<span class="fontBlue">[主观题]</span>
<%if poll_question.is_necessary == 1%> <%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span> <span class="ur_required" title="必答">*</span>
<%end%> <%end%>

View File

@ -7,50 +7,23 @@
</h1> </h1>
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div> <div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div>
</div> </div>
<% mc_question_list = @poll.poll_questions.where("question_type=1") %> <% @poll_questions.each do |poll_question|%>
<% mcq_question_list = @poll.poll_questions.where("question_type=2") %> <div class="testStatus">
<% single_question_list = @poll.poll_questions.where("question_type=3") %> <div id="poll_questions_<%= poll_question.id%>">
<% multi_question_list = @poll.poll_questions.where("question_type=4") %> <div id="show_poll_questions_<%= poll_question.id %>">
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>"> <% if poll_question.question_type == 1%>
<h3 class="fontGrey3">单选题</h3> <%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %>
<% mc_question_list.each do |poll_question| %> <% elsif poll_question.question_type == 2%>
<div id="poll_questions_<%= poll_question.id%>"> <%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %>
<div id="show_poll_questions_<%= poll_question.id %>"> <% elsif poll_question.question_type == 3%>
<%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %> <%= render :partial => 'show_single_result', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 4%>
<%= render :partial => 'show_mulit_result', :locals => {:poll_question => poll_question} %>
<% end%>
</div>
</div> </div>
</div> </div>
<% end %> <% end%>
</div>
<div class="testStatus" id="mcq_question_list" style="display: <%=mcq_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多选题</h3>
<% mcq_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="single_question_list" style="display: <%=single_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单行主观题</h3>
<% single_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_single_result', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
<div class="testStatus" id="multi_question_list" style="display: <%=multi_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">多行主观题</h3>
<% multi_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_mulit_result', :locals => {:poll_question => poll_question} %>
</div>
</div>
<% end %>
</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div><!--问卷内容end--> </div><!--问卷内容end-->

View File

@ -0,0 +1,119 @@
<% if homework.homework_detail_group %>
<div>
<div>
<div class="relateText fl">请从<%= homework.homework_detail_group.base_on_project == 1 ? '项目成员':'课程成员' %>中添加小组成员</div>
</div>
<div class="cl"></div>
<div>
<form class="resourcesSearchBox">
<input type="text" name="serach" placeholder="输入关键字搜索" class="searchResourcePopup" />
</form>
</div>
<div class="cl"></div>
<%=form_tag(add_group_member_student_work_index_path(:homework => homework.id), :method => :post, :id => 'add_group_member_form') do %>
<% str = User.current.id.to_s%>
<% student_work = StudentWork.where("homework_common_id = #{homework.id} and user_id = #{User.current.id}").first %>
<% if student_work %>
<% student_work.student_work_projects.where("is_leader = ?", 0).each do |pro| %>
<% str += ','+pro.user_id.to_s %>
<% end %>
<% end %>
<!--<span class="none" id="group_member_ids"><%#=str %></span>-->
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>str %>
<ul class="addMemberC fl" id="all_students_list"></ul>
<div class="rightArrow"><img src="/images/course/right-arrow.png" width="16" height="30" /></div>
<ul class="addMemberC fr" id="choose_students_list">
<li id="choose_student_<%=User.current.id %>"><%=User.current.show_name %>
<% unless User.current.user_extensions.student_id == "" %>
(<%=User.current.user_extensions.student_id %>)
<% end %>
<input name='member_id[]' value='<%=User.current.id %>' type='hidden'/>
</li>
</ul>
<div class="cl"></div>
<span class="c_red fl none" id="add_group_member_notice"></span>
<div class="courseSendCancel" style="float: right;"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a></div>
<div class="courseSendSubmit" style="float: right;"><a href="javascript:void(0);" class="sendSourceText" onclick="clickOK(<%=homework.homework_detail_group.min_num %>, <%=homework.homework_detail_group.max_num %>)">确定</a></div>
<div class="cl"></div>
<% end %>
</div>
<script type="text/javascript">
var lastSearchCondition = '';
var count = 0;
function search_stus(e){
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
{
return;
}
lastSearchCondition = $(e.target).val().trim();
$.ajax({
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?name='+ e.target.value+'&homework='+<%=homework.id %>,
type:'get'
});
}
function throttle(method,context,e){
clearTimeout(method.tId);
method.tId=setTimeout(function(){
method.call(context,e);
},500);
}
//查询
$("input[name='serach']").on('input', function (e) {
throttle(search_stus,window,e);
});
function clickOK(min, max) {
var lists = $("#choose_students_list li");
if(lists.length < parseInt(min) || lists.length > parseInt(max)) {
$("#add_group_member_notice").show();
$("#add_group_member_notice").html("合作成员人数应为:"+min+"-"+max+"人");
} else{
hideModal();
$("#add_group_member_form").submit();
}
}
function delete_student(id) {
$("#choose_student_"+id).remove();
$("#student_"+id).one("click",function choose_student() {
$("#choose_students_list").append("<li id='choose_student_"+id+"' onclick='delete_student("+id+");'>"+$("#student_"+id).html()+"<input name='member_id[]' value='"+id+"' type='hidden'/></li>");
});
}
$(document).ready(function(){
$.ajax({
url: '<%= url_for(:controller => 'student_work', :action => 'search_course_students') %>'+'?homework='+<%=homework.id %>,
type:'get'
});
var ids = $("#group_member_ids").val().split(',');
if (ids.length > 1){
for(var i=1; i<ids.length; i++) {
if($("#choose_student_"+ids[i]).length == 0) {
$.get(
'/student_work/get_user_infor',
{
user_id: ids[i]
},
function (data) {
if (data.valid) {
var link = "<li id='choose_student_"+data.id+"' onclick='delete_student("+data.id+");'>"+data.name;
if (data.student_id != "" ) {
link += "("+data.student_id+")";
}
link += "<input name='member_id[]' type='hidden' value='" + data.id + "'/></li>";
$("#choose_students_list").append(link);
}
else
{
}
}
);
}
}
}
});
</script>
<% end %>

View File

@ -11,6 +11,9 @@
<span class="ml5">分</span> <span class="ml5">分</span>
<span id="score_notice_span_<%= work.id%>" class="ml5 c_red" style="display: none;">未评分</span> <span id="score_notice_span_<%= work.id%>" class="ml5 c_red" style="display: none;">未评分</span>
<div class="cl"></div></li> <div class="cl"></div></li>
<% if @is_teacher && work.homework_common.homework_type == 3 && !is_member_work %>
<label class="ml30"><input type="checkbox" class="mb10" name="same_score" id="same_score_<%= work.id%>" value="1"/>&nbsp;&nbsp;组员同评(同时给每个组员相同的得分)</label>
<% end %>
<li > <li >
<% if @is_teacher%> <!-- 老师才可以上传批阅结果 --> <% if @is_teacher%> <!-- 老师才可以上传批阅结果 -->
<span class="tit_fb"> 批阅结果:</span> <span class="tit_fb"> 批阅结果:</span>

View File

@ -3,8 +3,6 @@
<div class="syllabus_courses_list" id="student_work_<%= student_work.id%>" style="cursor: default; background-color:#f6f6f6;"> <div class="syllabus_courses_list" id="student_work_<%= student_work.id%>" style="cursor: default; background-color:#f6f6f6;">
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %> <%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
</div> </div>
<div id="about_hwork_<%= student_work.id %>" class="about_hwork"></div>
<div id="group_member_work_<%= student_work.id%>"> <div id="group_member_work_<%= student_work.id%>">
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %> <%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
</div> </div>

View File

@ -1,30 +1,31 @@
<% is_expand = st.student_work_projects.empty? %> <% is_expand = st.student_work_projects.empty? %>
<ul id="syllabus_course_ul"> <ul id="syllabus_course_ul">
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;"> <li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
<div class="syllabus_class_w fontGrey3" style="<%=!is_expand ? '' : 'cursor: pointer;' %>" <%= !is_expand ? '' : "onclick = "+"show_student_work('"+"#{student_work_path(st)}"+"')" %>> <div class="syllabus_class_w fontGrey3" style="cursor: pointer;" 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") %> <%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
<% if !is_expand %> <% if !is_expand %>
<span class="fl student_work_<%= st.id%>" style="width:105px;"> <span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span> <span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
<span class="fl">(组长)</span> <span class="fl">(组长)</span>
</span> </span>
<span class="fl hidden student_work_<%= st.id%>" style="width:90px; margin-right:3px;"> <span class="fl hidden student_work_<%= st.id%>" style="width:105px; text-align: center">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%> <%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
</span> </span>
<% else %> <% else %>
<span class="fl student_work_<%= st.id%>" style="width:105px;"> <span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span> <span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
</span> </span>
<span class="fl student_work_<%= st.id%> hidden" style="width:90px; margin-right:3px;"> <span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%> <%= st.user.user_extensions.student_id.nil? ? "--" : st.user.user_extensions.student_id%>
</span> </span>
<% end %> <% end %>
<div class="flex-container fl" style="width:376px;"> <div class="flex-container fl" style="width:340px;">
<div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teacher_score%> ml35"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div> <div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teacher_score%>"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
<div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div> <div class="flex-cell student_work_<%= st.id%>"><span class="<%= score_color st.teaching_asistant_score%>"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %> <% if @homework.anonymous_comment == 0 %>
<div class="flex-cell student_work_<%= st.id%>"> <div class="flex-cell student_work_<%= st.id%>">
<div class="<%= score_color st.student_score%> student_score_info ml35 pr"> <div class="<%= score_color st.student_score%> student_score_info pr">
<% if st.student_score.nil? %> <% if st.student_score.nil? %>
<span title="该作品未被匿评">未参与</span> <span title="该作品未被匿评">未参与</span>
<% else %> <% else %>
@ -46,7 +47,7 @@
<% end %> <% end %>
<div class="flex-cell"> <div class="flex-cell">
<% score = st.work_score %> <% score = st.work_score %>
<div class="<%= score_color score%> student_final_scor_info ml35 pr" style="display: inline"> <div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%> <% unless score.nil?%>
<div class="score-tip none tl" style="line-height: 18px; top:-32px; right:-233px;"> <div class="score-tip none tl" style="line-height: 18px; top:-32px; right:-233px;">
@ -56,11 +57,11 @@
<span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分<br/> <span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分<br/>
迟交扣分 迟交扣分
<span class="c_red">&nbsp; <span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %> <%= st.late_penalty %>
&nbsp;</span>分<br/> &nbsp;</span>分<br/>
缺评扣分 缺评扣分
<span class="c_red">&nbsp; <span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%> <%= st.absence_penalty%>
&nbsp;</span>分<br/> &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>分
@ -69,11 +70,11 @@
</div> </div>
</div> </div>
</div> </div>
<% if is_expand %>
<div class="fr ml5" style="width:25px; color: #3b94d6; white-space:nowrap; text-align:right; margin-right:5px;" onclick = "show_student_work(<%= student_work_path(st)%>)">评分</div>
<% end %>
</div> </div>
<div class="hworkTip" style="display: none; left:710px; 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> <% if User.current.allowed_to?(:as_teacher, st.homework_common.course) %>
<div class="fr ml5" style="width:25px; color: #3b94d6; white-space:nowrap; text-align:right; margin-right:5px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>')">评分</div>
<% end %>
<div class="hworkTip" style="display: none; left:710px; top:20px; white-space:nowrap; right:auto;" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2">点击进行评分</font></div>
</li> </li>
</ul> </ul>

View File

@ -1,98 +1,65 @@
<div class="sy_courses_open f14 fontGrey3"> <div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span> <span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;"> <span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%=student_work.name %></span> <span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl"> <span class="fontGrey2 ml5 fl">
<% if student_work.work_status%> <% if student_work.work_status %>
<%=get_status student_work.work_status %> <%= get_status student_work.work_status %>
<% end %> <% end %>
</span> </span>
</span> </span>
<div class="cl"></div>
<% if @homework.homework_detail_group.base_on_project == 1 %> <% if @homework.homework_detail_group.base_on_project == 1 %>
<div class="pr fr projectName"> <span class="fl ml25 fontGrey2">关联项目:</span>
<div class="pr fl projectName">
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fr hidden', :style => "max-width:200px;", :title => "项目名称", :target => "_blank"%> <%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "max-width:200px;", :title => "项目名称", :target => "_blank" %>
<% elsif User.current.allowed_to?(:as_teacher, @homework.course) %> <% elsif User.current.allowed_to?(:as_teacher, @homework.course) %>
<%= link_to student_work.project.name, applied_join_project_path(:object_id => student_work.project.id, :is_teacher => 1), :remote => true, :method => "post", :class => 'link-blue fr hidden', :style => "max-width:200px;", :title => "项目名称" %> <%= link_to student_work.project.name, applied_join_project_path(:object_id => student_work.project.id, :is_teacher => 1), :remote => true, :method => "post", :class => 'link-blue fl hidden', :style => "max-width:200px;", :title => "项目名称" %>
<% else %> <% else %>
<span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span> <span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %> <% end %>
<% project = student_work.project %> <% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-362px;"> <div class="score-tip none tl f12" style="width:300px; top:-48px; right:-930px;">
<em style="bottom:45px;"></em> <em style="bottom:45px;"></em>
<font style="bottom:45px;"></font> <font style="bottom:45px;"></font>
<p class="fb"><%= project.name %></p> <p class="fb"><%= project.name %></p>
<p class="mb10"><span class="mr15">创建者:<%=project.creater %></span><span>成员数量:<%=project.members.count %></span></p>
<p class="mb10">
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
<% project_score = project.project_score %> <% project_score = project.project_score %>
<p>项目综合得分:<%=static_project_score(project_score).to_i %></p> <p>项目综合得分:<%= static_project_score(project_score).to_i %></p>
<p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p> <p>= 代码提交得分 + issue得分 + 资源得分 + 帖子得分</p>
<p>= <%=(project_score.changeset_num||0) * 4 %> + <%=project_score.issue_num * 4 + project_score.issue_journal_num %> + <%=project_score.attach_num * 5 %> + <%=project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
<p>= <%= (project_score.changeset_num||0) * 4 %>
+ <%= project_score.issue_num * 4 + project_score.issue_journal_num %> + <%= project_score.attach_num * 5 %>
+ <%= project_score.board_num * 2 + project_score.board_message_num + project_score.news_num %></p>
</div> </div>
</div> </div>
<span class="fr">关联项目:</span>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="fl sy_p_grey"> <div class="fl sy_p_grey">
<span class="fl" style="width:255px;">提交时间:<%=format_date(student_work.commit_time) %></span> <span class="fl" style="width:180px;">提交时间:<%= format_date(student_work.commit_time) %></span>
<div class="flex-container fl" style="width:376px;"> <span class="fl" style="width:105px; text-align: center">学号</span>
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div> <div class="flex-container fl" style="width:340px;">
<div class="flex-cell">教师</div>
<div class="flex-cell">助教</div>
<% if @homework.anonymous_comment == 0 %> <% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">匿评: <div class="flex-cell">匿评</div>
<div class="<%= score_color student_work.student_score%> student_score_info pr" style="display: inline">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%= format("%.1f", student_work.student_score) %>
<% end %>
<% unless student_work.student_score.nil? %>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", student_work.student_score) %>&nbsp;</span>分。
</div>
<% end %>
</div>
</div>
<% end %> <% end %>
<div class="flex-cell">成绩: <div class="flex-cell">成绩</div>
<% score = student_work.work_score %>
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="score-tip none tl" style="top:-48px; right:-229px;">
<em></em>
<font></font>
作品最终评分为
<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>分,<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>分,<br/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</div>
</div>
</div> </div>
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr ml5" style="width:28px; text-align:right;">评分</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<script> <script>
$(".projectName").mouseenter(function(){ $(".projectName").mouseenter(function () {
$(this).children().next().show(); $(this).children().next().show();
}).mouseleave(function(){ }).mouseleave(function () {
$(this).children().next().hide(); $(this).children().next().hide();
}); });
</script> </script>

View File

@ -104,11 +104,11 @@
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分<br/> <span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分<br/>
迟交扣分 迟交扣分
<span class="c_red">&nbsp; <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 %> <%= student_work.late_penalty %>
&nbsp;</span>分<br/> &nbsp;</span>分<br/>
缺评扣分 缺评扣分
<span class="c_red">&nbsp; <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%> <%= student_work.absence_penalty%>
&nbsp;</span>分<br/> &nbsp;</span>分<br/>
最终成绩为 最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分<br/> <span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分<br/>

View File

@ -5,7 +5,5 @@
<div class="syllabus_class_box" id="student_work_<%= st.id%>" style="background-color:#fff;"> <div class="syllabus_class_box" id="student_work_<%= st.id%>" style="background-color:#fff;">
<%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %> <%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
</div> </div>
<% if j != 0 %> <div id="about_hwork_<%= st.id %>" class="about_hwork"></div>
<div id="about_hwork_<%= st.id %>" class="about_hwork"></div>
<% end %>
<% end %> <% end %>

View File

@ -94,7 +94,7 @@
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%> <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && work.user != User.current )%>
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 --> <!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation"> <div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => false}%>
</div> </div>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
@ -106,12 +106,8 @@
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>"> <div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= student_work_scores.empty? ? 'padding:0px;' : ''%>">
<%student_work_scores.each do |student_score|%> <%= render :partial => 'student_work_score_records', :locals => {:student_work_scores => student_work_scores, :is_member_work => false} %>
<div id="work_score_<%= student_score.id%>">
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
</div>
<% end%>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!---ping_box end---> <!---ping_box end--->

View File

@ -84,7 +84,7 @@
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%> <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 --> <!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation"> <div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work}%>
</div> </div>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
@ -101,7 +101,7 @@
<% if @is_teacher %> <% if @is_teacher %>
<!-- 老师 --> <!-- 老师 -->
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation"> <div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> <%= render :partial => 'add_score',:locals => {:work => work,:score => score,:is_member_work => is_member_work}%>
</div> </div>
<% end%> <% end%>
<div class="cl"></div> <div class="cl"></div>
@ -109,15 +109,8 @@
</ul> </ul>
<% end %> <% end %>
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>"> <div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= student_work_scores.empty? ? 'padding:0px;' : ''%>">
<%student_work_scores.each do |student_score|%> <%= render :partial => 'student_work_score_records', :locals => {:student_work_scores => student_work_scores, :is_member_work => is_member_work} %>
<div id="work_score_<%= student_score.id%>">
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
</div>
<% end%>
<% if is_member_work && student_work_scores.empty? && !@is_teacher %>
<p class="c_red" style="text-align: center">暂无评分</p>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!---ping_box end---> <!---ping_box end--->

View File

@ -2,7 +2,12 @@
<span class="c_dark f14 fb fl mr15"> <span class="c_dark f14 fb fl mr15">
作品 作品
<font class="f12 c_red"> <font class="f12 c_red">
(<span id="student_work_count"><%= @student_work_count%></span><%=@homework.homework_type == 3 ? '组' : '人' %>已交) <% if @homework.homework_type == 3 %>
<% member_count = @homework.student_works.where("work_status != 0").count %>
(<%= @student_work_count%>组<%=member_count %>人已交)
<% else %>
(<%= @student_work_count%>人已交)
<% end %>
</font> </font>
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %> <%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %> <% my_work = cur_user_works_for_homework @homework %>
@ -31,17 +36,17 @@
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %> <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
<% end %> <% end %>
<% end%> <% end%>
<%# if @homework.homework_type == 3 && my_work && my_work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") %> <% if @homework.homework_type == 3 && my_work && my_work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") %>
<!--<div class="mt5 fr">--> <div class="mt5 fr">
<!--<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>--> <a href="javascript:void(0);" class="memberBtn fl mt3" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>
<!--</div>--> </div>
<%# end %> <% end %>
<% if @is_teacher && @homework.homework_type == 3 %> <% if @is_teacher && @homework.homework_type == 3 %>
<div class="group_work_tip_box fontGrey2"> <div class="group_work_tip_box fontGrey2">
<em></em> <em></em>
<span></span> <span></span>
<p class="mt5 mb5 break_word">大作品评分即组长的评分<br/> <p class="mt5 mb5 break_word">组长评分即小组作品评分<br/>
请先完成大作品评分,系统将把大作品<br/>评分做为每个组员的初始分值,您需<br/>要在此基础上对组员评分进行手动调整 组长评分时选择“组员同评”,本次评<br/>分结果将同时影响每个组员的评分。<br/>您可以继续对单个组员评分再调整或<br/>不调整
</p> </p>
</div> </div>
<% end %> <% end %>
@ -76,7 +81,7 @@
<% unless work.nil? %> <% unless work.nil? %>
location.hash = "<%=work.id %>"; location.hash = "<%=work.id %>";
<% if @homework.homework_type == 2 %> <% if @homework.homework_type == 2 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => student_work_score_record(work),:is_focus => @is_focus}) %>");
var program_name = "text/x-csrc"; var program_name = "text/x-csrc";
var language = <%= @homework.language %>; var language = <%= @homework.language %>;
@ -100,9 +105,9 @@
value: $("#work-src_<%= work.id%>").text() value: $("#work-src_<%= work.id%>").text()
}); });
<% elsif @homework.homework_type == 1 %> <% elsif @homework.homework_type == 1 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => student_work_score_record(work),:is_focus => @is_focus}) %>");
<% elsif @homework.homework_type == 3 %> <% elsif @homework.homework_type == 3 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc"),:is_focus => @is_focus}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'show',:locals => {:work => work, :score =>student_work_score(work,User.current),:student_work_scores => student_work_score_record(work),:is_focus => @is_focus}) %>");
<% end %> <% end %>
$('#score_<%= work.id%>').peSlider({range: 'min'}); $('#score_<%= work.id%>').peSlider({range: 'min'});
<% end %> <% end %>
@ -110,7 +115,7 @@
}); });
function add_or_delete_group_member() { function add_or_delete_group_member() {
var html_value = "<%#= escape_javascript(render :partial => 'student_work/add_or_delete_member',:locals => {:homework=>@homework,:edit_mode => true}) %>"; var html_value = "<%= escape_javascript(render :partial => 'student_work/add_or_delete_member',:locals => {:homework=>@homework,:edit_mode => true}) %>";
pop_up_box(html_value, 528); pop_up_box(html_value, 530);
} }
</script> </script>

View File

@ -0,0 +1,8 @@
<%student_work_scores.each do |student_score|%>
<div id="work_score_<%= student_score.id%>">
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
</div>
<% end%>
<% if is_member_work && student_work_scores.empty? && !@is_teacher %>
<p class="c_red" style="text-align: center">暂无评分</p>
<% end %>

View File

@ -1,12 +1,14 @@
$("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'add_score',:locals => {:work => @work,:score => @new_score}) %>"); <% is_member_work = @homework.homework_type == 3 && @work.student_work_projects.empty? %>
$("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'add_score',:locals => {:work => @work,:score => @new_score,:is_member_work => is_member_work}) %>");
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%> <%# if @is_new%>
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @new_score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last_a}) %></div>"); //$("#score_list_<%#= @work.id%>").prepend("<div id='work_score_<%#= @new_score.id%>'><%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last_a}) %></div>");
<% else %> <%# else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>"); //$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
<% end%> <%# end%>
$("#score_list_<%= @work.id%>").replaceWith("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => is_member_work}) %>");
var num = $("#work_num_<%= @work.id%>").html(); var num = $("#work_num_<%= @work.id%>").html();
$("#score_list_<%= @work.id%>").removeAttr("style"); $("#score_list_<%= @work.id%>").removeAttr("style");

View File

@ -48,14 +48,36 @@
// }); // });
<%# end%> <%# end%>
function set_score_rule_submit() {
if($("#late_penalty_num").val() == ""){
$("#late_penalty_num").val("0");
}
if($("#absence_penalty_num").val() == ""){
$("#absence_penalty_num").val("0");
}
$('#muban_popup_box').find('form').submit();
hideModal();
}
//设置评分规则 //设置评分规则
function set_score_rule(){ function set_score_rule(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>'); <% if @homework.homework_type == 2 %>
showModal('ajax-modal', '350px'); <% if @homework.anonymous_comment == 0 %>
$('#ajax-modal').siblings().remove(); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" + pop_box_new(htmlvalue, 570, 355);
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>"); <% else %>
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9"); var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 285);
<% end %>
<% else %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 325);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
pop_box_new(htmlvalue, 500, 225);
<% end %>
<% end %>
} }
</script> </script>

View File

@ -26,7 +26,7 @@ $("#all_students_list").empty();
<% if user.id.to_i != User.current.id.to_i %> <% if user.id.to_i != User.current.id.to_i %>
li += " onclick='delete_student(<%=user.id %>);'"; li += " onclick='delete_student(<%=user.id %>);'";
<% end %> <% end %>
li += ">" + $("#student_<%=user.id %>").html()+"</li>"; li += ">" + $("#student_<%=user.id %>").html()+"<input name='member_id[]' value='<%=user.id %>' type='hidden'/></li>";
$("#choose_students_list").append(li); $("#choose_students_list").append(li);
}); });
} }

View File

@ -1,4 +1,3 @@
clickCanel();
<% if @hw_status != 5 %> <% if @hw_status != 5 %>
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>"); $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework,:user_activity_id =>@user_activity_id,:hw_status=>@hw_status}) %>");
<% if @user_activity_id != @homework.id %> <% if @user_activity_id != @homework.id %>
@ -8,4 +7,4 @@ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(r
<% end %> <% end %>
<% else %> <% else %>
window.location.href = '<%=student_work_index_url(:homework => @homework.id) %>'; window.location.href = '<%=student_work_index_url(:homework => @homework.id) %>';
<% end %> <% end %>

View File

@ -79,7 +79,8 @@
<% if User.current.member_of_syl?(@syllabus) %> <% if User.current.member_of_syl?(@syllabus) %>
<p class="sy_tab_con_p">该课程还未创建班级,请 <p class="sy_tab_con_p">该课程还未创建班级,请
<%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "sy_corange", :target => '_blank'%> <%= link_to "新建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "sy_corange", :target => '_blank'%>
,谢谢啦!</p> ,谢谢啦!<br/>只有创建班级后才可以开展在线教学哦~
</p>
<% else %> <% else %>
<p class="sy_tab_con_p">该课程还未创建班级,敬请期待!</p> <p class="sy_tab_con_p">该课程还未创建班级,敬请期待!</p>
<% end %> <% end %>

View File

@ -28,6 +28,9 @@
</li> </li>
</ul> </ul>
<div id="sy_tab_con_1"> <div id="sy_tab_con_1">
<% if User.current == @syllabus.user && @syllabus.courses.empty? %>
<p class="nodata c_red">您还没有创建班级,只有<%= link_to "创建班级", new_course_path(:host=> Setting.host_course, :syllabus_id => @syllabus.id), :class => "linkBlue2", :target => '_blank'%>后才可以开展在线教学哦~</p>
<% end %>
<% if @syllabus.des_status == 0 && User.current == @syllabus.user %> <% if @syllabus.des_status == 0 && User.current == @syllabus.user %>
<div class="icons_tishi"><img src="../images/sy/icons_tan.png" width="110" height="110" alt="" ></div> <div class="icons_tishi"><img src="../images/sy/icons_tan.png" width="110" height="110" alt="" ></div>
<p class="sy_tab_con_p">您建立的课程尚未填写课程大纲,请完善您的 <%=link_to '课程大纲', edit_syllabus_path(@syllabus), :class => 'sy_corange' %>,谢谢啦!</p> <p class="sy_tab_con_p">您建立的课程尚未填写课程大纲,请完善您的 <%=link_to '课程大纲', edit_syllabus_path(@syllabus), :class => 'sy_corange' %>,谢谢啦!</p>

View File

@ -29,7 +29,7 @@
</div> </div>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
<% if activity.student_works.count != 0 %> <% if activity.student_works.has_committed.count != 0 %>
<% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %> <% sw_id = "("+activity.student_works.map{|sw| sw.id}.join(",")+")" %>
<%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %> <%# student_work_scores = StudentWorksScore.find_by_sql("select max(created_at) as created_at, student_work_id, user_id from student_works_scores where student_work_id in #{sw_id} group by student_work_id order by max(created_at) desc") %>
<% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %> <% student_work_scores = StudentWorksScore.where("student_work_id in #{sw_id} and score is not null").reorder("created_at desc") %>
@ -64,7 +64,7 @@
<% end %> <% end %>
</a> </a>
<% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %> <% score = sw.respond_to?("score") ? sw.score : (sw.final_score || 0) - sw.absence_penalty - sw.late_penalty %>
<p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_i<0 ? 0 : score.to_i) %>分</span></p> <p class="fontGrey2">分数:<span class="c_red"><%=format("%.1f",score.to_f < 0 ? 0 : score.to_f) %>分</span></p>
</div> </div>
<% if i == 4 %> <% if i == 4 %>
<% break %> <% break %>
@ -112,7 +112,7 @@
</li> </li>
<% if activity.anonymous_comment == 0 %> <% if activity.anonymous_comment == 0 %>
<li> <li>
<%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status == 1%> <%= link_to("匿评设置", start_evaluation_set_homework_common_path(activity,:user_activity_id => user_activity_id, :hw_status => hw_status),:class => "postOptionLink", :remote => true) if activity.homework_detail_manual.comment_status < 2%>
</li> </li>
<li> <li>
<%= homework_anonymous_comment activity,hw_status,user_activity_id %> <%= homework_anonymous_comment activity,hw_status,user_activity_id %>

View File

@ -202,8 +202,17 @@ zh:
label_issue_new: 新建问题 label_issue_new: 新建问题
label_query: 自定义查询 label_query: 自定义查询
label_issue_list_xls: Issue列表 label_issue_list_xls: Issue列表
label_per_week: 每周
label_per_month: 每月
label_per_all: 所有
label_rep_xls: 版本库代码统计 label_rep_xls: 版本库代码统计
label_user_rep_xls: 用户开发量统计
label_rep_branch: 分支 label_rep_branch: 分支
label_rep_user_id: 用户ID
label_rep_user_name: 用户名
label_rep_project_id: 项目ID
label_rep_project_name: 项目名
label_rep_admin_export_tip: 导出可能会持续很长一段时间,建议在平台空闲时间导出,你确定导出吗?
# Issue列表 excel导出参数 # Issue列表 excel导出参数
issue_xls_id: ID issue_xls_id: ID

View File

@ -346,6 +346,7 @@ RedmineApp::Application.routes.draw do
post 'set_score_rule' post 'set_score_rule'
get 'work_canrepeat' get 'work_canrepeat'
get 'get_user_infor' get 'get_user_infor'
post 'add_group_member'
end end
end end
@ -1107,6 +1108,7 @@ RedmineApp::Application.routes.draw do
match 'admin', :to => 'admin#index', :via => :get match 'admin', :to => 'admin#index', :via => :get
match 'admin/projects', :via => :get match 'admin/projects', :via => :get
match 'admin/export_rep_static_users', :via => :get
get 'admin/courses', as: :all_courses get 'admin/courses', as: :all_courses
get 'admin/syllabuses', as: :all_syllabuses get 'admin/syllabuses', as: :all_syllabuses
get 'admin/non_syllabus_courses', as: :non_syllabus_courses get 'admin/non_syllabus_courses', as: :non_syllabus_courses

View File

@ -132,6 +132,22 @@ class Gitlab::Client
end end
alias_method :repo_rep_stats, :rep_stats alias_method :repo_rep_stats, :rep_stats
# static all users
def admin_rep_stats_week(project, options={})
get("/projects/#{project}/repository/admin_rep_stats_week", :query => options)
end
alias_method :repo_rep_stats, :rep_stats
def admin_rep_stats_month(project, options={})
get("/projects/#{project}/repository/admin_rep_stats_month", :query => options)
end
alias_method :repo_rep_stats, :rep_stats
def admin_rep_stats_all(project, options={})
get("/projects/#{project}/repository/admin_rep_stats_all", :query => options)
end
alias_method :repo_rep_stats, :rep_stats
# Gets a tree activities of project repository. # Gets a tree activities of project repository.
# #
# @example # @example

View File

@ -16,35 +16,35 @@ namespace :homework_evaluation do
if homework_common.anonymous_comment == 0 && homework_detail_manual.comment_status == 1 #新建状态才可开启匿评 if homework_common.anonymous_comment == 0 && homework_detail_manual.comment_status == 1 #新建状态才可开启匿评
student_works = homework_common.student_works.has_committed student_works = homework_common.student_works.has_committed
if student_works && student_works.size >= 2 if student_works && student_works.size >= 2
# if homework_common.homework_type == 3 if homework_common.homework_type == 3
# student_work_projects = homework_common.student_work_projects.where("student_work_id is not null") student_work_projects = homework_common.student_work_projects.where("student_work_id is not null")
# student_work_projects.each_with_index do |pro_work, pro_index| student_work_projects.each_with_index do |pro_work, pro_index|
# n = homework_detail_manual.evaluation_num n = homework_detail_manual.evaluation_num
# n = n < student_works.size ? n : student_works.size - 1 n = (n < student_works.size && n != -1) ? n : student_works.size - 1
# work_index = -1 work_index = -1
# student_works.each_with_index do |stu_work, stu_index| student_works.each_with_index do |stu_work, stu_index|
# if stu_work.id.to_i == pro_work.student_work_id.to_i if stu_work.id.to_i == pro_work.student_work_id.to_i
# work_index = stu_index work_index = stu_index
# end end
# end end
# assigned_homeworks = get_assigned_homeworks(student_works, n, work_index) assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
# assigned_homeworks.each do |h| assigned_homeworks.each do |h|
# student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id) student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: pro_work.user_id, student_work_id: h.id)
# student_works_evaluation_distributions.save student_works_evaluation_distributions.save
# end end
# end end
# else else
student_works.each_with_index do |work, index| student_works.each_with_index do |work, index|
user = work.user user = work.user
n = homework_detail_manual.evaluation_num n = homework_detail_manual.evaluation_num
n = n < student_works.size ? n : student_works.size - 1 n = (n < student_works.size && n != -1) ? n : student_works.size - 1
assigned_homeworks = get_assigned_homeworks(student_works, n, index) assigned_homeworks = get_assigned_homeworks(student_works, n, index)
assigned_homeworks.each do |h| assigned_homeworks.each do |h|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id) student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
student_works_evaluation_distributions.save student_works_evaluation_distributions.save
end end
end end
#end end
homework_detail_manual.update_column('comment_status', 2) homework_detail_manual.update_column('comment_status', 2)
# 匿评开启消息邮件通知,# 所有人 # 匿评开启消息邮件通知,# 所有人
#send_message_anonymous_comment(homework_common, 2) #send_message_anonymous_comment(homework_common, 2)

View File

@ -423,6 +423,9 @@ function showModal(id, width) {
} }
function hideModal(el) { function hideModal(el) {
if($("#popupWrap").length > 0){
$("#popupWrap").hide();
}
var modal; var modal;
if (el) { if (el) {
modal = $(el).parents('.ui-dialog-content'); modal = $(el).parents('.ui-dialog-content');
@ -1554,13 +1557,24 @@ function pop_up_box(value,tWidth,tTop,tLeft){
function pop_box_new(value, Width, Height){ function pop_box_new(value, Width, Height){
w = ($(window).width() - Width)/2; w = ($(window).width() - Width)/2;
h = ($(window).height() - Height)/2; h = ($(window).height() - Height)/2;
$("#ajax-modal").html(value); var container =$('<div></div>');
showModal('ajax-modal', Width + 'px'); container.attr('id','popupWrap');
$('#ajax-modal').siblings().remove(); $(document.body).append(container);
$('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"}); $("#popupWrap").html(value);
$('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox"); $("#popupWrap").show();
$('#ajax-modal').css({"padding":"0","overflow":"hidden"}); $('#popupWrap').css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed","z-index":"99999","background-color":"#fff","box-shadow": "0px 2px 8px rgba(146, 153, 169, 0.5)"});
$('#ajax-modal').parent().attr("id","popupWrap"); $('#popupWrap').find("a[class*='close']").click(function(){
$("#popupWrap").hide();
});
// w = ($(window).width() - Width)/2;
// h = ($(window).height() - Height)/2;
// $("#ajax-modal").html(value);
// showModal('ajax-modal', Width + 'px');
// $('#ajax-modal').siblings().remove();
// $('#ajax-modal').parent().css({"top": h+"px","left": w+"px","padding":"0","border":"none","position":"fixed"});
// $('#ajax-modal').parent().removeClass("resourceUploadPopup popbox_polls popbox");
// $('#ajax-modal').css({"padding":"0","overflow":"hidden"});
// $('#ajax-modal').parent().attr("id","popupWrap");
//拖拽 //拖拽
function Drag(id) { function Drag(id) {
@ -1576,7 +1590,7 @@ function pop_box_new(value, Width, Height){
_this.getDistance(evt); _this.getDistance(evt);
document.onmousemove = function (evt) { document.onmousemove = function (evt) {
_this.setPosition(evt); _this.setPosition(evt);
} };
_this.div.onmouseup = function () { _this.div.onmouseup = function () {
_this.clearEvent(); _this.clearEvent();
} }
@ -1586,7 +1600,7 @@ function pop_box_new(value, Width, Height){
var oEvent = evt || event; var oEvent = evt || event;
this.disX = oEvent.clientX - this.div.offsetLeft; this.disX = oEvent.clientX - this.div.offsetLeft;
this.disY = oEvent.clientY - this.div.offsetTop; this.disY = oEvent.clientY - this.div.offsetTop;
} };
Drag.prototype.setPosition = function (evt) { Drag.prototype.setPosition = function (evt) {
var oEvent = evt || event; var oEvent = evt || event;
var l = oEvent.clientX - this.disX; var l = oEvent.clientX - this.disX;
@ -1605,18 +1619,24 @@ function pop_box_new(value, Width, Height){
} }
this.div.style.left = l + "px"; this.div.style.left = l + "px";
this.div.style.top = t + "px"; this.div.style.top = t + "px";
} };
Drag.prototype.clearEvent = function () { Drag.prototype.clearEvent = function () {
this.div.onmouseup = null; this.div.onmouseup = null;
document.onmousemove = null; document.onmousemove = null;
} };
$(".sy_popup_con").mousedown(function(event){ new Drag("popupWrap");
$("#popupWrap input, #popupWrap textarea").mousedown(function(event){
event.stopPropagation(); event.stopPropagation();
new Drag("popupWrap"); new Drag("popupWrap");
}); });
} }
function close_modal(){
$("#popupWrap").hide();
}
// 公共提示弹框样式 // 公共提示弹框样式
//function pop_box_tip_new(value, Width, Top, Left){ //function pop_box_tip_new(value, Width, Top, Left){
// $("#ajax-modal").html(value); // $("#ajax-modal").html(value);

View File

@ -626,7 +626,7 @@ $(function(){
//生成select //生成select
function build_selector(max_num){ function build_selector(max_num){
var html = "<select class='markPercentage' id='ta_proportion' name='ta_proportion'>"; var html = "<select class='w61 fl ml15' id='ta_proportion' name='ta_proportion'>";
for(var i = 0; i <= max_num; i += 10){ for(var i = 0; i <= max_num; i += 10){
if( i == max_num){ if( i == max_num){
html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>"; html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>";
@ -637,6 +637,18 @@ function build_selector(max_num){
html += "</select>"; html += "</select>";
return html; return html;
} }
function build_selector_sy(max_num){
var html = "<select class='w61 fl ml15' id='sy_proportion' name='sy_proportion'>";
for(var i = 0; i <= 100; i += 10){
if( i == max_num){
html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>";
}else{
html += "<option value='" + parseFloat(i)/100 + "'>" + i + "%</option>";
}
}
html += "</select>";
return html;
}
//提交匿评参数设置 //提交匿评参数设置
function submit_set_evaluation_attr(end_time){ function submit_set_evaluation_attr(end_time){
@ -650,7 +662,8 @@ function submit_set_evaluation_attr(end_time){
$("#evaluation_num").focus(); $("#evaluation_num").focus();
} }
else{ else{
$('#popbox02 form').submit(); $('#muban_popup_box form').submit();
hideModal();
} }
} }

View File

@ -268,7 +268,8 @@ function submit_set_evaluation_attr(end_time){
$("#evaluation_num").focus(); $("#evaluation_num").focus();
} }
else{ else{
$('#popbox02 form').submit(); $('#muban_popup_box form').submit();
hideModal();
} }
} }

View File

@ -50,7 +50,7 @@ function reset_topic(){
$("#evaluation_num").focus(); $("#evaluation_num").focus();
} }
else{ else{
$('#popbox02 form').submit(); $('#muban_popup_box form').submit();
hideModal(); hideModal();
} }
} }

View File

@ -165,6 +165,8 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.mr60 {margin-right:60px;} .mr60 {margin-right:60px;}
.mr65 {margin-right:65px;} .mr65 {margin-right:65px;}
.mr70{margin-right: 70px;} .mr70{margin-right: 70px;}
.mr75{margin-right: 75px;}
.mr80{margin-right: 80px;}
.mr95 {margin-right:95px !important;} .mr95 {margin-right:95px !important;}
.mr100 {margin-right:100px !important;} .mr100 {margin-right:100px !important;}
.mr118 {margin-right:118px !important;} .mr118 {margin-right:118px !important;}
@ -229,6 +231,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w50 {width:50px;} .w50 {width:50px;}
.w56 {width:56px;} .w56 {width:56px;}
.w60{ width:60px;} .w60{ width:60px;}
.w61{ width:61px;}
.w70{ width:70px;} .w70{ width:70px;}
.w80{ width:80px;} .w80{ width:80px;}
.w90{ width:90px;} .w90{ width:90px;}

View File

@ -3,7 +3,10 @@
.muban_popup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-moz-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;} .muban_popup_top{background:#3b94d6;height:40px;-webkit-border-radius: 5px 5px 0px 0px;-moz-border-radius: 5px 5px 0px 0px;-o-border-radius: 5px 5px 0px 0px;border-radius: 5px 5px 0px 0px;}
.muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; } .muban_popup_top h3{ font-size:16px; color:#fff; font-weight:normal; line-height:40px; padding-left:10px; }
a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;} a.muban_icons_close{width:20px; height:20px;display:block;background: url(/images/sy/sy_icons_close.png) 0 0px no-repeat; margin:8px 10px 0 0;}
a:hover.muban_icons_close{background: url(/images/sy/sy_icons_close.png) -40px 0px no-repeat;} a:hover.muban_icons_close{background: url(../images/sy/sy_icons_close.png) -40px 0px no-repeat;}
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label.pop_box_label{width: 100px; text-align: right; display: inline-block;}
input.radio-width90{ width: 90px; }
#muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;} #muban_popup_box input,#muban_popup_box select{ border:1px solid #c8c8c8; height: 28px; color: #888;}
#muban_popup_box label{width: 100px; text-align: right; display: inline-block;} #muban_popup_box label{width: 100px; text-align: right; display: inline-block;}
/*模板表格 20161013byLB*/ /*模板表格 20161013byLB*/
@ -59,3 +62,11 @@ a.sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; b
a:hover.sub_btn{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} a:hover.sub_btn{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;}
/*模板form 20161013byLB*/ /*模板form 20161013byLB*/
textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; color:#666; padding:5px;} textarea.muban_textarea{ width: 98.5%;border:1px solid #ddd; background:#fff; color:#666; padding:5px;}
/*模板图标20161020byLB*/
.muban-icons-clock{ background: url("../images/project/icons_issue.png") 0 -224px no-repeat; display: inline-block; width: 19px; height: 13px;}
/*提示条20161020byLB*/
.alert{ padding:10px;border: 1px solid transparent; text-align: center;}
.alert-blue{ background-color: #d9edf7;border-color: #bce8f1; color: #3a87ad;}
.alert-orange{ background-color: #fff9e9;border-color: #f6d0b1; color:#ee4a20;}
.close{padding: 0;cursor: pointer; background: transparent; border: 0; -webkit-appearance: none; font-size: 21px; font-weight: bold;line-height: 1; color: #000000; text-shadow: 0 1px 0 #ffffff; opacity: 0.3;}
.close:hover{opacity: 0.5;}

View File

@ -780,7 +780,7 @@ a:hover.issues_list_title{color:#3b94d6;}
/* 搜索 与课程相同 */ /* 搜索 与课程相同 */
.hw_search_box{ position:relative; } .hw_search_box{ position:relative; }
.hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;} .hw_search_box input.hw_search-input{ width:293px; height:28px; border:none; border:1px solid #e7e7e7; background:#fff; padding-left:5px;padding-right: 25px;}
.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; cursor:pointer;} .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; cursor:pointer;}
.hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;} .hw_search_box a:hover.hw_btn_search{background:url(../images/hw/icons_hw.png) -40px -57px no-repeat;}
.hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;} .hw_files_icon{display:block; width:17px; height:14px; background:url(../images/hw/icons_hw.png) 0 -135px no-repeat;}

View File

@ -1443,8 +1443,8 @@ a.syllabusbox_a_blue {
/*flex布局*/ /*flex布局*/
.flex-container {display:flex;} .flex-container {display:flex;}
.flex-cell {flex:1;} .flex-cell {flex:1; text-align: center}
.flex-cell:last-child {text-align:right;} /*.flex-cell:last-child {text-align:right;}*/
/*新课程、项目公用样式提取*/ /*新课程、项目公用样式提取*/
.sy_new_orange{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #ff4a1b;border: 1px solid #ff4a1b;} .sy_new_orange{font-size: 12px;padding: 0 5px;border-radius: 3px;line-height: 14px;color: #ff4a1b;border: 1px solid #ff4a1b;}
@ -1521,7 +1521,12 @@ a.syllabusbox_a_blue{
.homepagePostContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;} .homepagePostContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;}
.homepageMainContent {margin: 10px auto; width: 750px;} .homepageMainContent {margin: 10px auto; width: 750px;}
.pro_newsetting_con li{ line-height: 30px;}
.popup_tip_box { position: relative; padding: 5px 10px; white-space: nowrap; background-color: #FFFEF4; border:1px solid #F3DDB3;}
.popup_tip_box em { display: block; border-width: 9px; position: absolute; top: 5px; left: -18px; border-style: dashed solid dashed dashed; border-color: transparent #F3DDB3 transparent transparent; font-size: 0; line-height: 0;}
.popup_tip_box span { display: block; border-width: 9px;position: absolute; top: 5px; left: -17px; border-style: dashed solid dashed dashed;border-color: transparent #FFFEF4 transparent transparent; font-size: 0; line-height: 0; }
/*模拟title*/ /*模拟title*/
.simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;} .simulation-title {position:absolute; background-color:#fff; padding:5px 10px; z-index:99; white-space:nowrap; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); display:none; color:#666; border:1px solid #666; line-height:1;}
/*项目创建*/ /*项目创建*/
.project_new_input {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;} .project_new_input {border: 1px solid #ddd;height: 20px;width: 794px;background: #fff;padding: 5px;}