Merge branch 'develop' into dev_newproject

This commit is contained in:
huang 2016-11-07 17:19:47 +08:00
commit cceadb02ce
71 changed files with 1110 additions and 455 deletions

View File

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

View File

@ -206,35 +206,35 @@ class HomeworkCommonController < ApplicationController
if @homework_detail_manual.comment_status == 1
student_works = @homework.student_works.has_committed
if student_works && student_works.size >= 2
# if @homework.homework_type == 3
# 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|
# n = @homework_detail_manual.evaluation_num
# n = n < student_works.size ? n : student_works.size - 1
# work_index = -1
# student_works.each_with_index do |stu_work, stu_index|
# if stu_work.id.to_i == pro_work.student_work_id.to_i
# work_index = stu_index
# end
# end
# assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
# 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.save
# end
# end
# else
if @homework.homework_type == 3
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|
n = @homework_detail_manual.evaluation_num
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
work_index = -1
student_works.each_with_index do |stu_work, stu_index|
if stu_work.id.to_i == pro_work.student_work_id.to_i
work_index = stu_index
end
end
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
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.save
end
end
else
student_works.each_with_index do |work, index|
user = work.user
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.each do |h|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
student_works_evaluation_distributions.save
end
end
#end
end
@homework_detail_manual.update_column('comment_status', 2)
@homework_detail_manual.update_column('evaluation_start', Date.today)
@statue = 1
@ -270,13 +270,13 @@ class HomeworkCommonController < ApplicationController
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
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
student_work.save
if student_work.absence_penalty != 0
pros = student_work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
st_work.update_attribute("absence_penalty", student_work.absence_penalty)
end
pros = student_work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
st_work.save
end
end
end
@ -304,9 +304,11 @@ class HomeworkCommonController < ApplicationController
def alert_anonymous_comment
@cur_size = 0
@totle_size = 0
@work_size = 0
if @homework_detail_manual.comment_status == 1
@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
@homework.student_works.has_committed.map { |work| @totle_size += work.student_works_evaluation_distributions.count}
@cur_size = 0
@ -394,7 +396,14 @@ class HomeworkCommonController < ApplicationController
@homework_detail_manual.evaluation_end = params[:evaluation_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
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i

View File

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

View File

@ -5,7 +5,9 @@ class StudentWorkController < ApplicationController
include ApplicationHelper
require 'bigdecimal'
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 :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
before_filter :author_of_work, :only => [:edit, :update, :destroy]
@ -689,7 +691,7 @@ class StudentWorkController < ApplicationController
def show
@score = student_work_score @work,User.current
@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|
format.js
end
@ -827,22 +829,22 @@ class StudentWorkController < ApplicationController
case @new_score.reviewer_role
when 1 #教师评分:最后一个教师评分为最终评分
@work.teacher_score = @new_score.score
if @is_group_leader
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score
if @is_group_leader && params[:same_score]
add_score_to_member @work, @homework, @new_score
end
when 2 #教辅评分 教辅评分显示平均分
#@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")
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
if @is_group_leader
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score
if @is_group_leader && params[:same_score]
add_score_to_member @work, @homework, @new_score
end
when 3 #学生评分 学生评分显示平均分
#@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")
@work.student_score = stu_score.first.score.try(:round, 2).to_f
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
@homework.update_column('updated_at', Time.now)
@ -852,6 +854,7 @@ class StudentWorkController < ApplicationController
if @work.save
@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
@student_work_scores = student_work_score_record @work
respond_to do |format|
format.js
end
@ -972,9 +975,9 @@ class StudentWorkController < ApplicationController
homework_detail_programing = @homework.homework_detail_programing
unless @homework.late_penalty.to_s == params[:late_penalty].to_s
@homework.late_penalty = params[:late_penalty]
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = @homework.late_penalty
@homework.late_penalty = params[:late_penalty].to_s
@homework.student_works.where("commit_time > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = params[:late_penalty].to_i
student_work.save
end
end
@ -982,18 +985,34 @@ class StudentWorkController < ApplicationController
if params[:absence_penalty] && homework_detail_manual.absence_penalty.to_s != params[:absence_penalty].to_s
homework_detail_manual.absence_penalty = params[:absence_penalty]
if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
@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
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save
work_ids = "(" + @homework.student_works.has_committed.map(&:id).join(",") + ")"
if @homework.homework_type != 3
@homework.student_works.has_committed.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
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save
end
else
@homework.student_works.has_committed.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
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
student_work.save
pros = student_work.student_work_projects.where("is_leader = 0")
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = @homework.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
st_work.save
end
end
end
end
homework_detail_manual.save if homework_detail_manual
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)
homework_detail_manual.ta_proportion = params[:ta_proportion]
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
@ -1002,6 +1021,8 @@ class StudentWorkController < ApplicationController
homework_detail_manual.save if homework_detail_manual
homework_detail_programing.save if homework_detail_programing
@homework.save
@homework = HomeworkCommon.find @homework.id
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save
@ -1009,7 +1030,7 @@ class StudentWorkController < ApplicationController
end
@homework.save
if params[:student_path]
if params[:student_path] && params[:student_path] == "true"
redirect_to student_work_index_url(:homework => @homework.id)
else
@user_activity_id = params[:user_activity_id].to_i
@ -1149,6 +1170,41 @@ class StudentWorkController < ApplicationController
render :json => req
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
def searchstudent_by_name users, name
mems = []
@ -1444,11 +1500,11 @@ class StudentWorkController < ApplicationController
#成绩计算
def set_final_score homework,student_work
if homework && homework.homework_detail_manual
if homework.homework_type != 2 #匿评作业
if homework.homework_type != 2 #非编程作业
if homework.teacher_priority == 1 #教师优先
if 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
if student_work.teaching_asistant_score.nil?
student_work.final_score = student_work.student_score
@ -1491,7 +1547,7 @@ class StudentWorkController < ApplicationController
if homework.teacher_priority == 1 #教师优先
if 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
if student_work.teaching_asistant_score.nil? #教辅未评分
if student_work.student_score.nil?

View File

@ -1055,7 +1055,7 @@ class UsersController < ApplicationController
end
homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
homework.homework_type = params[:homework_type].to_i || 1
homework.late_penalty = 10
homework.late_penalty = 0
homework.teacher_priority = 1
homework.user_id = User.current.id
homework.course_id = params[:course_id]
@ -1077,7 +1077,7 @@ class UsersController < ApplicationController
homework_detail_manual.evaluation_start = params[:evaluation_start].blank? ? homework.end_time + 7 : params[:evaluation_start]
homework_detail_manual.evaluation_end = params[:evaluation_end].blank? ? homework_detail_manual.evaluation_start + 7 : params[:evaluation_end]
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
homework_detail_manual.absence_penalty = 5
homework_detail_manual.absence_penalty = 0
homework.homework_detail_manual = homework_detail_manual
#编程作业相关属性

View File

@ -2905,8 +2905,17 @@ module ApplicationHelper
link_to "补交作品(#{count})", new_student_work_url_without_domain(homework.id),:class => 'c_red'
end
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 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 && StudentWorksEvaluationDistribution.where("student_work_id = #{work.id}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
if homework.homework_type != 3
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
else
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
if User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "开启匿评后不可修改作品"
else
link_to "查看作品(#{count})",student_work_index_url_in_org(homework.id, 2), :class => 'c_blue', :title => "匿评开启后提交的作品不参与匿评"
end
end
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 => "匿评已结束"
elsif homework.homework_type == 2 && Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")#编程作业不能修改作品

View File

@ -69,6 +69,15 @@ module StudentWorkHelper
str
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
PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'StudentWork'").count
@ -166,12 +175,19 @@ module StudentWorkHelper
return student_works
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.each do |st_work|
if st_work.student_works_scores.where("reviewer_role = #{role} and score is not null").empty?
st_work.update_attribute("#{score_type}", score)
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)
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
st_work.save
end
end
end

View File

@ -162,7 +162,7 @@ class JournalsForMessage < ActiveRecord::Base
end
def reset_counters!
self.class.reset_counters!(self)
# self.class.reset_counters!(self)
end
def self.reset_counters! journals_for_messages
# jfm_id = journals_for_messages.id.to_i

View File

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

View File

@ -1205,6 +1205,12 @@ class User < Principal
#为新注册用户发送留言
def add_new_jour
self.delay.add_new_jour_delay
end
#为新注册用户发送留言
def add_new_jour_delay
Rails.logger.info "add_new_jour_delay!!!!!!!!!"
if Setting.find_by_name("hidden_non_project") && Setting.find_by_name("hidden_non_project").value != "0"
if Message.where("id=19504").any? and Message.where("id=19291").any? and Message.where("id=19292").any?
lead_message1 = Message.find(19292)

View File

@ -68,20 +68,13 @@
<% end %>
</td>
<td class="center">
<% if(journal.m_reply_count) %>
<%case journal.jour_type %>
<% when 'Principal' %>
<%= link_to(journal.m_reply_count, feedback_path(journal.jour_id)) %>
<% when 'Course' %>
<%= link_to(journal.m_reply_count, course_feedback_path(journal.jour_id)) %>
<% end %>
<% else %>
<%case journal.jour_type %>
<% when 'Principal' %>
<%= link_to(0, feedback_path(journal.jour_id)) %>
<% when 'Course' %>
<%= link_to(0, course_feedback_path(journal.jour_id)) %>
<% end %>
<% replys = JournalsForMessage.where(:m_parent_id=>journal.id) %>
<% reply_count = replys.nil? ? 0:replys.count %>
<%case journal.jour_type %>
<% when 'Principal' %>
<%= link_to(reply_count, feedback_path(journal.jour_id)) %>
<% when 'Course' %>
<%= link_to(reply_count, course_feedback_path(journal.jour_id)) %>
<% end %>
</td>
</tr>

View File

@ -1,3 +1,4 @@
<div style="width:460px;">
<div class="sy_popup_top">
<h3 class="fl">欢迎加入项目</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -35,3 +36,4 @@
</ul>
<% end %>
</div>
</div>

View File

@ -1,11 +1,12 @@
<div style="width:820px;">
<div class="muban_popup_top">
<h3 class="fl">更新资源版本</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal();"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con" >
<div class=" clear ml15 mr15 mt15" id="attachment_history_popub">
<%= render :partial => "files/attachment_history_popub" %>
</div>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width:820px;">
<div class="muban_popup_top">
<h3 class="fl">删除资源</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="attachment_fresh_for_destroy();"></a>
@ -9,7 +10,7 @@
<%= render :partial => "files/attachment_history_popub_delete" %>
</div>
</div>
</div>
<script>
function attachment_fresh_for_destroy(){
hideModal();

View File

@ -1,7 +1,7 @@
<% if @flag %>
hideModal();
alert('更新成功')
alert('更新成功');
$(".re_search").submit(); // 为了刷新
<%else%>
$("#upload_file_count").html('(更新失败)')
$("#upload_file_count").html('(更新失败)');
<%end %>

View File

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

View File

@ -6,9 +6,7 @@
<% members.each do |member| %>
<div class="st_boxlist">
<a href="javascript:" class="st_img">
<%= member.user.nil? ? '' : (image_tag(url_to_avatar(member.user), :width => 32, :height => 32)) %>
</a>
<%= 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 => "用户头像" %>
<span class="fl ml10 c_grey"><%= l(:label_username)%></span>
<%= 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>

View File

@ -1,4 +1,4 @@
<div id="sy_popup_box">
<div id="sy_popup_box" style="width:460px;">
<div class="sy_popup_top">
<h3 class="fl">欢迎加入班级</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>

View File

@ -57,7 +57,8 @@
<li class="pollsbtn_tip fl ml5">已答</li-->
<%#else%>
<%= 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>
<% end %>
<%#end%>

View File

@ -1,44 +1,24 @@
<div id="popbox02">
<div class="ni_con">
<div id="muban_popup_box" style="width:550px;">
<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%>
<h2>开启匿评功能</h2>
<p>
开启匿评后提交的作品将
<span class="c_blue">不能参与匿评</span>
匿评评分将被记为
<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>
<p class="mb10">开启匿评之后提交作品的学生及其作品,不能参与匿评,匿评评分将被记为 <span class="c_red">0</span> 分。</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 %>
<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>
<% end %>
<div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="clickOK('<%= alert_anonyoms_path @homework,@homework_detail_manual,@user_activity_id,@hw_status%>');" style="margin-bottom: 20px;" >
确&nbsp;&nbsp;定
</a>
<a href="javascript:" class="tijiao" onclick="clickCanel();" style="margin-bottom: 20px;">
取&nbsp;&nbsp;消
</a>
</div>
<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:void(0);" class="fl sy_btn_grey" onclick="hideModal();">取消</a>
</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|%>
<span class="uploadText">匿评设置</span>
<div class="cl"></div>
<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="muban_popup_top">
<h3 class="fl">匿评设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
<div class="cl"></div>
<p id="homework_evaluation_start_time" class="c_red"></p>
</div>
<div class="cl"></div>
<div class="mt15">
<span class="f14 fontGrey3 fl mt5">关闭匿评</span>
<div class="calendar_div fl ml10">
<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="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<li class="mb10 clear">
<label class="fl pop_box_label">开启匿评&nbsp;&nbsp;:&nbsp;</label>
<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>
<p id="homework_evaluation_end_time" class="c_red"></p>
</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 class="alert alert-orange mb15 ml30 mr80 mt10">
注意:开启匿评时尚未提交作品的同学,将不参与匿评
</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 class="cl"></div>
<% end%>
</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') %>');
showModal('ajax-modal', '500px');
$('#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");
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/alert_anonyoms') %>";
pop_box_new(htmlvalue, 550, 171);

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}) %>');
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");
<% if @homework.homework_type == 2 %>
<% if @homework.anonymous_comment == 0 %>
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}) %>";
pop_box_new(htmlvalue, 570, 355);
<% else %>
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 %>
$("#homework_post_brief").html("<%= escape_javascript(render :partial => 'student_work/homework_post_brief', :locals => {:homework => @homework, :is_teacher => @is_teacher}) %>");
<% 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};
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);
$('#evaluation_end_time').datepicker(datepickerOptions);
});

View File

@ -31,7 +31,7 @@
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=b16ba20827767a9fc40bd120191a02a6e3d6356c137e523ac2ccccd1c63e10b1"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<p class="fontGrey3" style="padding-bottom:10px; padding-top:3px;">加入QQ群</p>
</div>
<div class="fr mr10 tac">

View File

@ -30,7 +30,7 @@
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=b16ba20827767a9fc40bd120191a02a6e3d6356c137e523ac2ccccd1c63e10b1"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<p class="fontGrey3" style="padding-bottom:10px; padding-top:3px;">加入QQ群</p>
</div>
<div class="fr mr10 tac">

View File

@ -7,7 +7,7 @@
<meta name="keywords" content="issue,bug,tracker" />
<%= csrf_meta_tag %>
<%= 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' %>
<%= javascript_heads %>
<%= javascript_include_tag "bootstrap","avatars","new_user",'attachments','prettify'%>

View File

@ -103,8 +103,8 @@
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<% end %>
<% else %>
<!-- link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" -->
<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%= field.id %>').slideToggle();"><%= field.name %></a>
<%= link_to "#{field.name}", organization_path(organization, :org_subfield_id => field.id), :class => "homepageMenuText homepageMenuControl hidden", :onclick => "$('#homepageLeftMenuPost').slideToggle();" %>
<!--<a href = "javascript:void(0);" class = "homepageMenuText" onclick = "$('#PostDomain_<%#= field.id %>').slideToggle();"><%#= field.name %></a>-->
<% end %>
<% if User.current.logged? and User.current.admin_of_org?(organization) %>
<%=link_to "", new_organization_org_document_comment_path(organization, :field_id => field.id), :method => "get", :class => "homepageMenuSetting fr", :title => "发布帖子" %>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -16,3 +17,4 @@
</li>
</ul>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -17,5 +18,5 @@
</li>
</ul>
</div>
</div>

View File

@ -1,3 +1,4 @@
<div style="width: 460px;">
<div class="sy_popup_top">
<h3 class="fl">提示</h3>
<a href="javascript:void(0);" class="sy_icons_close fr" onclick="hideModal()"></a>
@ -19,5 +20,5 @@
</li>
</ul>
</div>
</div>

View File

@ -2,9 +2,21 @@
<div class="testEditTitle">
第<%= poll_question.question_number%>题:
<%= poll_question.question_title %>
<span class="fontBlue">[多选题]</span>
<%if poll_question.is_necessary == 1%>
<span class="ur_required" title="必答">*</span>
<%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 class="cl"></div>
<div class="ur_inputs">

View File

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

View File

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

View File

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

View File

@ -7,50 +7,23 @@
</h1>
<div class="testDesEdit mt5"><%= @poll.polls_description.nil? ? "" : @poll.polls_description.html_safe%></div>
</div>
<% mc_question_list = @poll.poll_questions.where("question_type=1") %>
<% mcq_question_list = @poll.poll_questions.where("question_type=2") %>
<% single_question_list = @poll.poll_questions.where("question_type=3") %>
<% multi_question_list = @poll.poll_questions.where("question_type=4") %>
<div class="testStatus" id="mc_question_list" style="display: <%=mc_question_list.count > 0 ? "" : "none" %>">
<h3 class="fontGrey3">单选题</h3>
<% mc_question_list.each do |poll_question| %>
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %>
<% @poll_questions.each do |poll_question|%>
<div class="testStatus">
<div id="poll_questions_<%= poll_question.id%>">
<div id="show_poll_questions_<%= poll_question.id %>">
<% if poll_question.question_type == 1%>
<%= render :partial => 'show_MC_result', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 2%>
<%= render :partial => 'show_MCQ_result', :locals => {:poll_question => poll_question} %>
<% elsif poll_question.question_type == 3%>
<%= 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>
<% 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>
<% end%>
<div class="cl"></div>
</div>
</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 id="score_notice_span_<%= work.id%>" class="ml5 c_red" style="display: none;">未评分</span>
<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" checked id="same_score_<%= work.id%>" value="1"/>&nbsp;&nbsp;组员同评(同时给每个组员相同的得分)</label>
<% end %>
<li >
<% if @is_teacher%> <!-- 老师才可以上传批阅结果 -->
<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;">
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
</div>
<div id="about_hwork_<%= student_work.id %>" class="about_hwork"></div>
<div id="group_member_work_<%= student_work.id%>">
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
</div>

View File

@ -1,30 +1,31 @@
<% is_expand = st.student_work_projects.empty? %>
<ul id="syllabus_course_ul">
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
<div class="syllabus_class_w fontGrey3" 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") %>
<% if !is_expand %>
<span class="fl student_work_<%= st.id%>" style="width:105px;">
<span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span>
<span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
<span class="fl">(组长)</span>
</span>
<span class="fl hidden student_work_<%= st.id%>" style="width:90px; margin-right:3px;">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
<span class="fl hidden student_work_<%= st.id%>" style="width:105px; text-align: center">
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
</span>
<% else %>
<span class="fl student_work_<%= st.id%>" style="width:105px;">
<span class="fl hidden ml5" style="max-width:60px;"><%= st.user.show_name %></span>
<span class="fl student_work_<%= st.id%>" style="width:120px;">
<span class="fl hidden ml5" style="max-width:75px;"><%= st.user.show_name %></span>
</span>
<span class="fl student_work_<%= st.id%> hidden" style="width:90px; margin-right:3px;">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
<span class="fl student_work_<%= st.id%> hidden" style="width:105px; text-align: center">
<%= st.user.user_extensions.student_id.nil? || st.user.user_extensions.student_id == "" ? "--" : st.user.user_extensions.student_id%>
</span>
<% end %>
<div class="flex-container fl" style="width:376px;">
<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.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
<div class="flex-container fl" style="width:340px;">
<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%>"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %>
<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? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
@ -46,21 +47,21 @@
<% end %>
<div class="flex-cell">
<% 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)%>
<% 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:-273px;">
<em></em>
<font></font>
作品最终评分为
<span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分<br/>
迟交扣分
<span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
<%= st.late_penalty %>
&nbsp;</span>分<br/>
缺评扣分
<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/>
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分
@ -69,11 +70,11 @@
</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 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>
</ul>

View File

@ -1,98 +1,67 @@
<div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_open fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%=student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<% end %>
</span>
</span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<% end %>
</span>
</span>
<div class="cl"></div>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<div class="pr fr projectName">
<% 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"%>
<% 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 => "项目名称" %>
<% else %>
<span class="fontBlue fr hidden" style="max-width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-362px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<p class="fb"><%= project.name %></p>
<p class="mb10"><span class="mr15">创建者:<%=project.creater %></span><span>成员数量:<%=project.members.count %></span></p>
<% project_score = project.project_score %>
<p>项目综合得分:<%=static_project_score(project_score).to_i %></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>
</div>
<div class="pr">
<span class="fl ml25 fontGrey2">关联项目:</span>
<div class="fl projectName">
<% 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 fl hidden', :style => "max-width:550px;", :title => "项目名称", :target => "_blank" %>
<% 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 fl hidden', :style => "max-width:550px;", :title => "项目名称" %>
<% else %>
<span class="fontBlue fr hidden" style="max-width:550px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% project = student_work.project %>
<div class="score-tip none tl f12" style="width:300px; top:-48px; right:-372px;">
<em style="bottom:45px;"></em>
<font style="bottom:45px;"></font>
<p class="fb break_word mw280"><%= project.name %></p>
<p class="mb10">
<span class="mr15">创建者:<%= project.creater %></span><span>成员数量:<%= project.members.count %></span></p>
<% project_score = project.project_score %>
<p>项目综合得分:<%= static_project_score(project_score).to_i %></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>
</div>
</div>
</div>
<span class="fr">关联项目:</span>
<% end %>
<div class="cl"></div>
</div>
<div class="fl sy_p_grey">
<span class="fl" style="width:255px;">提交时间:<%=format_date(student_work.commit_time) %></span>
<div class="flex-container fl" style="width:376px;">
<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>
<span class="fl" style="width:180px;">提交时间:<%= format_date(student_work.commit_time) %></span>
<span class="fl" style="width:105px; text-align: center">学号</span>
<div class="flex-container fl" style="width:340px;">
<div class="flex-cell">教师</div>
<div class="flex-cell">助教</div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">匿评:
<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>
<div class="flex-cell">匿评</div>
<% end %>
<div class="flex-cell">成绩:
<% 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 class="flex-cell">成绩</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 class="cl"></div>
<script>
$(".projectName").mouseenter(function(){
$(this).children().next().show();
}).mouseleave(function(){
$(this).children().next().hide();
});
$(".projectName").mouseenter(function () {
$(this).children().next().show();
}).mouseleave(function () {
$(this).children().next().hide();
});
</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.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/>
缺评扣分
<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/>
最终成绩为
<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;">
<%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
</div>
<% if j != 0 %>
<div id="about_hwork_<%= st.id %>" class="about_hwork"></div>
<% end %>
<div id="about_hwork_<%= st.id %>" class="about_hwork"></div>
<% end %>

View File

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

View File

@ -84,7 +84,7 @@
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
<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>
<% end%>
<div class="cl"></div>
@ -101,7 +101,7 @@
<% if @is_teacher %>
<!-- 老师 -->
<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>
<% end%>
<div class="cl"></div>
@ -109,15 +109,8 @@
</ul>
<% end %>
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
<%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 %>
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= student_work_scores.empty? ? 'padding:0px;' : ''%>">
<%= render :partial => 'student_work_score_records', :locals => {:student_work_scores => student_work_scores, :is_member_work => is_member_work} %>
</div>
<div class="cl"></div>
<!---ping_box end--->

View File

@ -1,8 +1,13 @@
<div class="fl pr" style="padding-bottom:10px; width:720px;">
<span class="c_dark f14 fb fl mr15">
<span class="c_dark f14 fb fl mr10">
作品
<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>
<%# my_work = @homework.student_works.where("user_id = #{User.current.id}").first %>
<% my_work = cur_user_works_for_homework @homework %>
@ -22,26 +27,26 @@
<% end %>
</span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%>
<div class="hworkSearchBox mr15">
<div class="hworkSearchBox mr10">
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
</div>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit fl mr20"}) unless course_group_list(@course).empty? %>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit fl mr10"}) unless course_group_list(@course).empty? %>
<%if @homework.homework_type == 2 && @is_teacher %>
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
<% 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") %>
<!--<div class="mt5 fr">-->
<!--<a href="javascript:void(0);" class="memberBtn fl mt3 mr15" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>-->
<!--</div>-->
<%# end %>
<% if !@is_teacher && @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">
<a href="javascript:void(0);" class="memberBtn fl mt3" title="添加小组成员" onclick="add_or_delete_group_member();">合作成员</a>
</div>
<% end %>
<% if @is_teacher && @homework.homework_type == 3 %>
<div class="group_work_tip_box fontGrey2">
<em></em>
<span></span>
<p class="mt5 mb5 break_word">大作品评分即组长的评分<br/>
请先完成大作品评分,系统将把大作品<br/>评分做为每个组员的初始分值,您需<br/>要在此基础上对组员评分进行手动调整
<p class="mt5 mb5 break_word">组长评分即小组作品评分<br/>
组长评分时选择“组员同评”,本次评<br/>分结果将同时影响每个组员的评分。<br/>您可以继续对单个组员评分再调整或<br/>不调整
</p>
</div>
<% end %>
@ -76,7 +81,7 @@
<% unless work.nil? %>
location.hash = "<%=work.id %>";
<% 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 language = <%= @homework.language %>;
@ -100,9 +105,9 @@
value: $("#work-src_<%= work.id%>").text()
});
<% 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 %>
$("#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 %>
$('#score_<%= work.id%>').peSlider({range: 'min'});
<% end %>
@ -110,7 +115,7 @@
});
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}) %>";
pop_up_box(html_value, 528);
var html_value = "<%= escape_javascript(render :partial => 'student_work/add_or_delete_member',:locals => {:homework=>@homework,:edit_mode => true}) %>";
pop_up_box(html_value, 530);
}
</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'});
<% 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>");
<% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
<% end%>
<%# 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>");
<%# else %>
//$("#work_score_<%#= @score.id%>").html("<%#= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @new_score,:is_last => @is_last}) %>");
<%# end%>
$("#score_list_<%= @work.id%>").html("<%=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();
$("#score_list_<%= @work.id%>").removeAttr("style");

View File

@ -48,14 +48,36 @@
// });
<%# 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(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
showModal('ajax-modal', '350px');
$('#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","25%").css("left","35%").css("position","fixed").css("border","3px solid #269ac9");
<% if @homework.homework_type == 2 %>
<% if @homework.anonymous_comment == 0 %>
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}) %>";
pop_box_new(htmlvalue, 570, 355);
<% else %>
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>

View File

@ -26,7 +26,7 @@ $("#all_students_list").empty();
<% if user.id.to_i != User.current.id.to_i %>
li += " onclick='delete_student(<%=user.id %>);'";
<% 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);
});
}

View File

@ -1,4 +1,3 @@
clickCanel();
<% 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}) %>");
<% if @user_activity_id != @homework.id %>

View File

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

View File

@ -28,6 +28,9 @@
</li>
</ul>
<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 %>
<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>

View File

@ -29,7 +29,7 @@
</div>
<% end %>
<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(",")+")" %>
<%# 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") %>
@ -64,7 +64,7 @@
<% end %>
</a>
<% 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>
<% if i == 4 %>
<% break %>
@ -112,7 +112,7 @@
</li>
<% if activity.anonymous_comment == 0 %>
<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>
<%= homework_anonymous_comment activity,hw_status,user_activity_id %>

View File

@ -1,4 +1,4 @@
<div class="hw_popup_box" style="padding-bottom:30px;">
<div class="hw_popup_box" style="width: 820px; padding-bottom:30px;">
<div class="hw_popup_top clear">
<a href="javascript:void(0);" class="hw_icons_close fr" style="outline: none;" onclick="hideModal()"></a>
</div>

View File

@ -1,4 +1,4 @@
<div class="hw_sendpopup_box">
<div class="hw_sendpopup_box" style="width: 460px;">
<div class="hw_sendpopup_top">
<h3 class="fl">发送</h3>
<a href="javascript:void(0);" class="hw_sendpopup_close fr" onclick="hideModal()"></a>

View File

@ -346,6 +346,7 @@ RedmineApp::Application.routes.draw do
post 'set_score_rule'
get 'work_canrepeat'
get 'get_user_infor'
post 'add_group_member'
end
end

View File

@ -16,35 +16,35 @@ namespace :homework_evaluation do
if homework_common.anonymous_comment == 0 && homework_detail_manual.comment_status == 1 #新建状态才可开启匿评
student_works = homework_common.student_works.has_committed
if student_works && student_works.size >= 2
# if homework_common.homework_type == 3
# 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|
# n = homework_detail_manual.evaluation_num
# n = n < student_works.size ? n : student_works.size - 1
# work_index = -1
# student_works.each_with_index do |stu_work, stu_index|
# if stu_work.id.to_i == pro_work.student_work_id.to_i
# work_index = stu_index
# end
# end
# assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
# 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.save
# end
# end
# else
if homework_common.homework_type == 3
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|
n = homework_detail_manual.evaluation_num
n = (n < student_works.size && n != -1) ? n : student_works.size - 1
work_index = -1
student_works.each_with_index do |stu_work, stu_index|
if stu_work.id.to_i == pro_work.student_work_id.to_i
work_index = stu_index
end
end
assigned_homeworks = get_assigned_homeworks(student_works, n, work_index)
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.save
end
end
else
student_works.each_with_index do |work, index|
user = work.user
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.each do |h|
student_works_evaluation_distributions = StudentWorksEvaluationDistribution.new(user_id: user.id, student_work_id: h.id)
student_works_evaluation_distributions.save
end
end
#end
end
homework_detail_manual.update_column('comment_status', 2)
# 匿评开启消息邮件通知,# 所有人
#send_message_anonymous_comment(homework_common, 2)
@ -98,7 +98,9 @@ namespace :homework_evaluation do
user_ids = pros.empty? ? "(-1)" : "(" + pros.map{|stu|stu.user_id}.join(",") + ")"
student_works = homework_common.student_works.where("user_id in #{user_ids}")
student_works.each do |st_work|
st_work.update_attribute("absence_penalty", student_work.absence_penalty)
absence_penalty_count = st_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - st_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
st_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0
st_work.save
end
end
end

View File

@ -423,13 +423,20 @@ function showModal(id, width) {
}
function hideModal(el) {
var modal;
if (el) {
modal = $(el).parents('.ui-dialog-content');
} else {
modal = $('#ajax-modal');
if($("#popupWrap").length > 0){
$("#popupWrap").remove();
}
modal.dialog("close");
else{
var modal;
if (el) {
modal = $(el).parents('.ui-dialog-content');
} else {
modal = $('#ajax-modal');
}
modal.dialog("close");
}
}
function submitPreview(url, form, target) {
@ -1554,13 +1561,24 @@ function pop_up_box(value,tWidth,tTop,tLeft){
function pop_box_new(value, Width, Height){
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");
var container =$('<div></div>');
container.attr('id','popupWrap');
$(document.body).append(container);
$("#popupWrap").html(value);
$("#popupWrap").show();
$('#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)"});
$('#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) {
@ -1576,7 +1594,7 @@ function pop_box_new(value, Width, Height){
_this.getDistance(evt);
document.onmousemove = function (evt) {
_this.setPosition(evt);
}
};
_this.div.onmouseup = function () {
_this.clearEvent();
}
@ -1586,7 +1604,7 @@ function pop_box_new(value, Width, Height){
var oEvent = evt || event;
this.disX = oEvent.clientX - this.div.offsetLeft;
this.disY = oEvent.clientY - this.div.offsetTop;
}
};
Drag.prototype.setPosition = function (evt) {
var oEvent = evt || event;
var l = oEvent.clientX - this.disX;
@ -1605,18 +1623,24 @@ function pop_box_new(value, Width, Height){
}
this.div.style.left = l + "px";
this.div.style.top = t + "px";
}
};
Drag.prototype.clearEvent = function () {
this.div.onmouseup = null;
document.onmousemove = null;
}
};
$(".sy_popup_con").mousedown(function(event){
new Drag("popupWrap");
$("#popupWrap input, #popupWrap textarea").mousedown(function(event){
event.stopPropagation();
new Drag("popupWrap");
});
}
function close_modal(){
$("#popupWrap").hide();
}
// 公共提示弹框样式
//function pop_box_tip_new(value, Width, Top, Left){
// $("#ajax-modal").html(value);

View File

@ -626,7 +626,7 @@ $(function(){
//生成select
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){
if( i == max_num){
html += "<option value='" + parseFloat(i)/100 + "' selected='selected'>" + i + "%</option>";
@ -637,6 +637,18 @@ function build_selector(max_num){
html += "</select>";
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){
@ -650,7 +662,8 @@ function submit_set_evaluation_attr(end_time){
$("#evaluation_num").focus();
}
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();
}
else{
$('#popbox02 form').submit();
$('#muban_popup_box form').submit();
hideModal();
}
}

View File

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

View File

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

View File

@ -583,6 +583,6 @@ a:hover.blueCir{ background:#3598db; color:#fff;}
.ye_tips_box_inner em { display: block; border-width: 10px;position: absolute;top: 42px; left: -20px; border-style: dashed solid dashed dashed;border-color: transparent #F3DDB3 transparent transparent;font-size: 0;line-height: 0;}
/*分组作业评分提示框*/
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-10px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
.group_work_tip_box {width:200px; position:absolute; padding:5px 10px; white-space:nowrap; background-color:#fff; right:-255px; top:-90px; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5);}
.group_work_tip_box em {display:block; border-width:10px; position:absolute;top:26px; left:-20px; border-style:dashed solid dashed dashed; border-color:transparent #eaeaea transparent transparent; font-size:0; line-height:0;}
.group_work_tip_box span {display:block; border-width:10px; position:absolute;top:26px; left:-18px; border-style:dashed solid dashed dashed; border-color:transparent #fff transparent transparent; font-size:0; line-height:0;}

View File

@ -5,7 +5,10 @@
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;}
#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.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 label.pop_box_label {width: 100px; text-align: right; display: inline-block;}
/*模板表格 20161013byLB*/
.muban_table{ width:100%; background:#fff; border:1px solid #e5e5e5; border-bottom: none; }
.muban_table thead tr{ height:40px; line-height:40px;}
@ -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;}
/*模板form 20161013byLB*/
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

@ -1443,8 +1443,8 @@ a.syllabusbox_a_blue {
/*flex布局*/
.flex-container {display:flex;}
.flex-cell {flex:1;}
.flex-cell:last-child {text-align:right;}
.flex-cell {flex:1; text-align: center}
/*.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;}
@ -1521,6 +1521,11 @@ a.syllabusbox_a_blue{
.homepagePostContainer {width:718px; border:1px solid #dddddd; padding:15px; background-color:#ffffff;}
.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*/
.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;}
/*项目创建*/