Merge branch 'develop' into dev_shcool

Conflicts:
	app/views/users/_course_newslist.html.erb
This commit is contained in:
daiao 2016-09-21 10:22:28 +08:00
commit ba57dbb284
71 changed files with 1159 additions and 719 deletions

2
.gitignore vendored
View File

@ -6,6 +6,8 @@
/config/database.yml /config/database.yml
/config/configuration.yml /config/configuration.yml
/config/additional_environment.rb /config/additional_environment.rb
/config/oneapm.yml
/config/environments/production.rb
/files/* /files/*

View File

@ -36,7 +36,7 @@ module Mobile
principal_types = "JournalsForMessage" principal_types = "JournalsForMessage"
watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(',')) watched_user_ids = User.watched_by(user.id).count == 0 ? " " : ("," + User.watched_by(user.id).map{|u| u.id.to_s }.join(','))
user_ids = "(" + user.id.to_s + watched_user_ids + ")" user_ids = "(" + user.id.to_s + watched_user_ids + ")"
watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? " " :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",") watched_user_blog_ids = Blog.select("id").where("author_id in #{user_ids}").count == 0 ? "-1" :Blog.select("id").where("author_id in #{user_ids}").map { |blog| blog.id}.join(",")
blog_ids = "(" + watched_user_blog_ids + ")" blog_ids = "(" + watched_user_blog_ids + ")"
if container_type == "Course" if container_type == "Course"

View File

@ -35,6 +35,8 @@ module Mobile
present :is_public, is_public present :is_public, is_public
present :status, 0 present :status, 0
rescue Exception=>e rescue Exception=>e
Rails.logger.info "course_notice is not find!"
Rails.logger.info e
present :status, -1 present :status, -1
present :message, e.message present :message, e.message
end end

View File

@ -73,6 +73,12 @@ module Mobile
elsif ac.container_type == "Blog" elsif ac.container_type == "Blog"
"发表博客" "发表博客"
end end
when :syllabus_title
if ac.container_type == "Course"
course = get_course(ac.container_id)
name = course.syllabus.nil? ? "":course.syllabus.title
name
end
when :course_project_id when :course_project_id
if ac.container_type == "Course" if ac.container_type == "Course"
ac.container_id ac.container_id
@ -145,6 +151,7 @@ module Mobile
act_expose :latest_update #最新更新时间 act_expose :latest_update #最新更新时间
act_expose :course_project_id #课程/项目ID act_expose :course_project_id #课程/项目ID
act_expose :course_project_name #课程/项目名字 act_expose :course_project_name #课程/项目名字
act_expose :syllabus_title #课程名字
act_expose :activity_type_name #课程问答区/项目缺陷等 act_expose :activity_type_name #课程问答区/项目缺陷等
expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options| expose :has_praise , if: lambda { |instance, options| options[:user] } do |instance, options|
if instance.act_type == "HomeworkCommon" || instance.act_type == "News" || instance.act_type == "Message" || instance.act_type == "BlogComment" || instance.act_type == "JournalsForMessage" || instance.act_type == "Issue" if instance.act_type == "HomeworkCommon" || instance.act_type == "News" || instance.act_type == "Message" || instance.act_type == "BlogComment" || instance.act_type == "JournalsForMessage" || instance.act_type == "Issue"

View File

@ -107,6 +107,7 @@ module Mobile
course_expose :current_user_is_member course_expose :current_user_is_member
course_expose :current_user_is_teacher course_expose :current_user_is_teacher
course_expose :work_unit course_expose :work_unit
course_expose :syllabus_title
end end
end end
end end

View File

@ -894,12 +894,15 @@ class CoursesController < ApplicationController
# return # return
# end # end
#更新创建课程消息状态 #更新创建课程消息状态
create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0) course_request_messages = CourseMessage.where(:user_id => User.current.id, :course_id => @course.id, :course_message_type => ["CourseRequestDealResult", "Course"], :viewed => false)
create_course_messages.update_all(:viewed => true) course_request_messages.update_all(:viewed => true)
# create_course_messages = @course.course_messages.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Course', @course.id, 0)
# create_course_messages.update_all(:viewed => true)
#更新申请结果反馈消息的状态 #更新申请结果反馈消息的状态
course_request_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @course.id, 'CourseRequestDealResult', false) # course_request_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @course.id, 'CourseRequestDealResult', false)
course_request_messages.update_all(:viewed => true) # course_request_messages.update_all(:viewed => true)
course_activities = @course.course_activities course_activities = @course.course_activities
@canShowRealName = User.current.member_of_course? @course @canShowRealName = User.current.member_of_course? @course

View File

@ -85,7 +85,16 @@ class HomeworkCommonController < ApplicationController
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
@homework.end_time = params[:homework_common][:end_time] || Time.now @homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id] @homework.course_id = params[:course_id]
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0 if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type
if @homework.homework_type == 2
@homework.homework_detail_programing.destroy if @homework.homework_detail_programing
@homework.homework_tests.destroy_all
elsif @homework.homework_type == 3
@homework.homework_detail_group.destroy if @homework.homework_detail_group
end
end
@homework.homework_type = params[:homework_type].to_i || @homework.homework_type
anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
if anonymous != @homework.anonymous_comment if anonymous != @homework.anonymous_comment
if anonymous == 1 if anonymous == 1
homework_detail_manual.ta_proportion = @homework.homework_type == 1 ? 1.0 : 0.4 homework_detail_manual.ta_proportion = @homework.homework_type == 1 ? 1.0 : 0.4
@ -111,7 +120,7 @@ class HomeworkCommonController < ApplicationController
if @homework.homework_type == 2 if @homework.homework_type == 2
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new @homework.homework_detail_programing ||= HomeworkDetailPrograming.new
@homework_detail_programing = @homework.homework_detail_programing @homework_detail_programing = @homework.homework_detail_programing
@homework_detail_programing.language = params[:language_type].to_i @homework_detail_programing.language = params[:language_type].to_i if params[:language_type]
if anonymous != @homework.anonymous_comment if anonymous != @homework.anonymous_comment
if anonymous == 1 if anonymous == 1
@homework_detail_programing.ta_proportion = 0.6 @homework_detail_programing.ta_proportion = 0.6
@ -120,8 +129,8 @@ class HomeworkCommonController < ApplicationController
end end
end end
@homework.homework_tests.delete_all @homework.homework_tests.delete_all if params[:program]
inputs = params[:program][:input] inputs = params[:program][:input] if params[:program]
if Array === inputs if Array === inputs
inputs.each_with_index do |val, i| inputs.each_with_index do |val, i|
@homework.homework_tests << HomeworkTest.new( @homework.homework_tests << HomeworkTest.new(
@ -136,12 +145,12 @@ class HomeworkCommonController < ApplicationController
if @homework.homework_type == 3 if @homework.homework_type == 3
@homework.homework_detail_group ||= HomeworkDetailGroup.new @homework.homework_detail_group ||= HomeworkDetailGroup.new
@homework_detail_group = @homework.homework_detail_group @homework_detail_group = @homework.homework_detail_group
@homework_detail_group.min_num = params[:min_num].to_i @homework_detail_group.min_num = params[:min_num].to_i if params[:min_num]
@homework_detail_group.max_num = params[:max_num].to_i @homework_detail_group.max_num = params[:max_num].to_i if params[:max_num]
@homework_detail_group.base_on_project = params[:base_on_project].to_i @homework_detail_group.base_on_project = params[:base_on_project].to_i if params[:base_on_project]
end end
@homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 0 @homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1
if @homework.save if @homework.save
homework_detail_manual.save if homework_detail_manual homework_detail_manual.save if homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing @homework_detail_programing.save if @homework_detail_programing

View File

@ -92,7 +92,13 @@ class MessagesController < ApplicationController
@message.board = @board @message.board = @board
@message.safe_attributes = params[:message] @message.safe_attributes = params[:message]
if request.post? if request.post?
@message.save_attachments(params[:attachments]) if @project
is_public = @project.is_public
elsif @course
is_public = @course.is_public
end
# 公开项目/课程上传的资源是公开的,私有项目上传的是私有的
@message.save_attachments_containers(params[:attachments], User.current, is_public)
if @message.save if @message.save
# 更新kindeditor上传的图片资源所有者 # 更新kindeditor上传的图片资源所有者
if params[:asset_id] if params[:asset_id]

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang # Copyright (C) 2006-2013 Jean-Philippe Lang
# #
@ -212,6 +213,19 @@ class NewsController < ApplicationController
@news.safe_attributes = params[:news] @news.safe_attributes = params[:news]
@news.save_attachments(params[:attachments]) @news.save_attachments(params[:attachments])
if @news.save if @news.save
@course.members.each do |m|
if m.user_id != User.current.id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{@news.course_id}").count
if count == 0
ws = WechatService.new
content = @news.title
name = @news.course.syllabus.nil? ? @news.course.name : @news.course.syllabus.title+""+@news.course.name
ws.class_notice m.user_id, "course_notice", @news.id, "#{l(:label_new_notice_template)}", name, @news.author.show_name, format_time(@news.created_on), content, "点击查看通知详情"
end
end
end
if params[:asset_id] if params[:asset_id]
ids = params[:asset_id].split(',') ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS

View File

@ -325,27 +325,27 @@ class ProjectsController < ApplicationController
end end
# 版本库统计图 # 版本库统计图
unless @project.gpid.nil? || @project.project_score.changeset_num == 0 # unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# rep_statics_commit = @project.rep_statics.order("commits_num desc") # # rep_statics_commit = @project.rep_statics.order("commits_num desc")
rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10") # rep_statics_commit = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by commits_num desc limit 10")
rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10") # rep_statics_code = RepStatics.find_by_sql("SELECT * FROM `rep_statics` where project_id = #{@project.id} order by changeset desc limit 10")
# rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse # # rep_statics_code = @project.rep_statics.sort_by {|u| u.changeset}.reverse
@a_uname = rep_statics_commit.map {|s| s.uname } # @a_uname = rep_statics_commit.map {|s| s.uname }
@a_uname_code = rep_statics_code.map {|s| s.uname } # @a_uname_code = rep_statics_code.map {|s| s.uname }
@a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i } # @a_commits_num = rep_statics_commit.map {|s| s.commits_num.to_i }
@a_commits_add = rep_statics_code.map {|s| s.add.to_i } # @a_commits_add = rep_statics_code.map {|s| s.add.to_i }
@a_commits_del = rep_statics_code.map {|s| s.del.to_i } # @a_commits_del = rep_statics_code.map {|s| s.del.to_i }
@a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i } # @a_commits_changeset = rep_statics_code.map {|s| s.changeset.to_i }
g = Gitlab.client # g = Gitlab.client
begin # begin
gid = @project.gpid # gid = @project.gpid
g_project = g.project(gid) # g_project = g.project(gid)
g_branch = g_project.default_branch.to_s # g_branch = g_project.default_branch.to_s
rescue =>e # rescue =>e
logger.error("get default branch failed: " + e) # logger.error("get default branch failed: " + e)
end # end
@rev = g_branch.nil? ? "master" : g_branch # @rev = g_branch.nil? ? "master" : g_branch
end # end
# 根据对应的请求,返回对应的数据 # 根据对应的请求,返回对应的数据
respond_to do |format| respond_to do |format|
format.html format.html

View File

@ -338,41 +338,17 @@ class StudentWorkController < ApplicationController
end end
def index def index
# 作业消息状态更新 # 作业消息状态更新?
@homework.course_messages.each do |homework_message| homeworkcommon_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_message_id => @homework.id, :course_message_type => "HomeWorkCommon")
if User.current.id == homework_message.user_id && homework_message.viewed == 0 homeworkcommon_messages.update_all(:viewed => true)
homework_message.update_attributes(:viewed => true) if homework_message.viewed == 0 studentwork_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_id => @homework.course, :course_message_type => "StudentWork")
end studentwork_messages.update_all(:viewed => true)
end
#修改作品提示消息更新
student_work_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, StudentWork.name, 0)
student_work_messages.each do |message|
message.update_attribute(:viewed, true)
end
# 作品打分消息状态更新 # 作品打分消息状态更新
studentworks_scores = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScore", 0) studentworks_scores = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "StudentWorksScore", 0)
studentworks_scores.each do |studentworks_score| studentworks_scores.update_all(:viewed => true)
studentworks_score.update_attributes(:viewed => true) if studentworks_score.viewed == 0
end
# 作品评论消息状态更新 # 作品评论消息状态更新
journals_for_teacher = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "JournalsForMessage", 0) journals_for_teacher = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @homework.course, "JournalsForMessage", 0)
journals_for_teacher.each do |journal_for_teacher| journals_for_teacher.update_all(:viewed => true)
journal_for_teacher.update_attributes(:viewed => true)
end
#不能参与作业匿评消息状态更新
no_evaluation = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =? and status =?", User.current.id, @homework.course, "StudentWork", 0, 0)
no_evaluation.update_all(:viewed => true)
# 作品留言
# 消息end
#设置作业对应的forge_messages表的viewed字段
query_student_work = @homework.course_messages
query_student_work.each do |query|
if User.current.id == query.user_id
query.update_attributes(:viewed => true)
end
end
################################################################################################################## ##################################################################################################################
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group] @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group]
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc") @homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
@ -480,7 +456,7 @@ class StudentWorkController < ApplicationController
elsif @order == 'student_id' elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else else
@stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").order("#{@order} #{@b_sort}"),@name @stundet_works = search_homework_member @homework.student_works.no_copy.select("student_works.*,student_works.work_score as score").includes(:user => {:user_extensions => []}, :project => {}, :student_works_scores => {}).order("#{@order} #{@b_sort}"),@name
end end
@show_all = true @show_all = true
elsif User.current.member_of_course?(@course) elsif User.current.member_of_course?(@course)
@ -571,7 +547,7 @@ class StudentWorkController < ApplicationController
@student_work = StudentWork.new @student_work = StudentWork.new
#end #end
respond_to do |format| respond_to do |format|
format.html{ render :layout => "new_base_user"} format.html{ render :layout => "base_courses"}
end end
end end
@ -657,7 +633,7 @@ class StudentWorkController < ApplicationController
render_403 render_403
else else
respond_to do |format| respond_to do |format|
format.html{ render :layout => "new_base_user"} format.html{ render :layout => "base_courses"}
end end
end end
end end
@ -844,17 +820,29 @@ class StudentWorkController < ApplicationController
render_attachment_warning_if_needed(@new_score) render_attachment_warning_if_needed(@new_score)
if @new_score.save if @new_score.save
if @homework.homework_type == 3
@is_group_leader = !@work.student_work_projects.empty?
end
case @new_score.reviewer_role case @new_score.reviewer_role
when 1 #教师评分:最后一个教师评分为最终评分 when 1 #教师评分:最后一个教师评分为最终评分
@work.teacher_score = @new_score.score @work.teacher_score = @new_score.score
if @is_group_leader
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score
end
when 2 #教辅评分 教辅评分显示平均分 when 2 #教辅评分 教辅评分显示平均分
#@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f #@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f @work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
if @is_group_leader
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score
end
when 3 #学生评分 学生评分显示平均分 when 3 #学生评分 学生评分显示平均分
#@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f #@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a") stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.student_score = stu_score.first.score.try(:round, 2).to_f @work.student_score = stu_score.first.score.try(:round, 2).to_f
if @is_group_leader
add_score_to_member @work, @homework, 3, 'student_score', @work.student_score
end
end end
@homework.update_column('updated_at', Time.now) @homework.update_column('updated_at', Time.now)
update_course_activity(@homework.class,@homework.id) update_course_activity(@homework.class,@homework.id)
@ -1577,10 +1565,6 @@ class StudentWorkController < ApplicationController
end end
end end
end end
if homework.homework_type == 3
student_works = group_student_works student_work, homework
student_works.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
end
end end
end end
end end

View File

@ -1052,7 +1052,7 @@ class UsersController < ApplicationController
else else
homework.publish_time = params[:homework_common][:publish_time] homework.publish_time = params[:homework_common][:publish_time]
end end
homework.anonymous_comment = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment] : 0 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.homework_type = params[:homework_type].to_i || 1
homework.late_penalty = 10 homework.late_penalty = 10
homework.teacher_priority = 1 homework.teacher_priority = 1
@ -1683,7 +1683,7 @@ class UsersController < ApplicationController
container_type = 'Project' container_type = 'Project'
act_type = 'Issue' act_type = 'Issue'
when "project_message" when "project_message"
container_type = 'Course' container_type = 'Project'
act_type = 'Message' act_type = 'Message'
when "user_journals" when "user_journals"
container_type = 'Principal' container_type = 'Principal'
@ -2156,11 +2156,9 @@ class UsersController < ApplicationController
@user = User.current @user = User.current
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" search = "%#{params[:search].to_s.strip.downcase}%"
@course = @user.courses.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search) @course = @user.courses.not_deleted.where(" #{Course.table_name}.id = #{params[:search].to_i } or #{Course.table_name}.name like :p",:p=>search)
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
else else
@course = @user.courses @course = @user.courses.not_deleted
.select { |course| @user.allowed_to?(:as_teacher,course) and course.is_delete == 0 }
end end
@search = params[:search] @search = params[:search]
@type = params[:type] @type = params[:type]
@ -2178,7 +2176,7 @@ class UsersController < ApplicationController
@user = User.current @user = User.current
if !params[:search].nil? if !params[:search].nil?
search = "%#{params[:search].to_s.strip.downcase}%" search = "%#{params[:search].to_s.strip.downcase}%"
@projects = @user.projects.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search) @projects = @user.projects.visible.where(" #{Project.table_name}.id = #{params[:search].to_i } or #{Project.table_name}.name like :p",:p=>search)
else else
@projects = @user.projects.visible @projects = @user.projects.visible
end end

View File

@ -8,13 +8,13 @@ class WechatsController < ActionController::Base
# default text responder when no other match # default text responder when no other match
on :text do |request, content| on :text do |request, content|
#邀请码 #邀请码
if join_class_request(request) # if join_class_request(request)
sendBindClass(request, {invite_code: content}) # sendBindClass(request, {invite_code: content})
elsif join_project_request(request) # elsif join_project_request(request)
sendBindProject(request, {invite_code: content}) # sendBindProject(request, {invite_code: content})
else # else
request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群173184401\n我们会认真聆听您的意见和建议。" request.reply.text "您的意见已收到,非常感谢~ \n更多问题可以通过以下方式联系我们:\n官方QQ群173184401\n我们会认真聆听您的意见和建议。"
end # end
end end
# When receive 'help', will trigger this responder # When receive 'help', will trigger this responder
@ -456,10 +456,20 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id session[:wechat_openid] = open_id
if params[:code] if params[:code]
# if params[:state].match("review_class_member") || params[:state].match("review_project_member") if !(params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
uw = user_binded?(open_id)
if uw
user = uw.user
lastname = user.lastname
end
end
if lastname && lastname == ""
@path = '/edit_userinfo'
else
@path = params[:state].split('/')[0] @path = params[:state].split('/')[0]
useridstr = params[:state].split('/')[1] useridstr = params[:state].split('/')[1]
# end
if useridstr if useridstr
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&#{useridstr}" and return
elsif params[:id] elsif params[:id]
@ -470,6 +480,7 @@ class WechatsController < ActionController::Base
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
end end
end end
end
render 'wechats/user_activities', layout: nil render 'wechats/user_activities', layout: nil
end end

View File

@ -3531,3 +3531,21 @@ def get_forge_act_message(act, type)
format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at)) format_time(forge_act.nil? ? act.created_on : forge_act.try(:updated_at))
end end
#作业类型
def homework_type_option
type = []
option1 = []
option1 << "普通作业"
option1 << 1
option2 = []
option2 << "编程作业"
option2 << 2
option3 = []
option3 << "分组作业"
option3 << 3
type << option1
type << option2
type << option3
type
end

View File

@ -193,18 +193,6 @@ module CoursesHelper
# garble count # garble count
# end # end
def homework_type_option
type = []
option1 = []
option2 = []
option1 << l(:label_task_submit_form_accessory)
option1 << 1
option2 << l(:label_task_submit_form_project)
option2 << 2
type << option1
type << option2
end
def proportion_option def proportion_option
type = [] type = []
i = 0 i = 0

View File

@ -225,19 +225,6 @@ module ProjectsHelper
Project.tagged_with(tag_name).order('updated_on desc') Project.tagged_with(tag_name).order('updated_on desc')
end end
# added by fq
def homework_type_option
type = []
option1 = []
option2 = []
option1 << l(:label_task_submit_form_accessory)
option1 << 1
option2 << l(:label_task_submit_form_project)
option2 << 2
type << option1
type << option2
end
#是否启动互评下拉框 #是否启动互评下拉框
def is_evaluation_option def is_evaluation_option
type = [] type = []

View File

@ -165,4 +165,13 @@ module StudentWorkHelper
student_works = homework.student_works.where("user_id in #{user_ids}") student_works = homework.student_works.where("user_id in #{user_ids}")
return student_works return student_works
end end
def add_score_to_member student_work, homework, role, score_type, 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)
end
end
end
end end

View File

@ -89,7 +89,7 @@ class AtMessage < ActiveRecord::Base
status = -1 status = -1
end end
when 'JournalsForMessage' when 'JournalsForMessage'
if at_message.jour && at_message.jour.course if at_message.jour && defined? at_message.jour.course
#作业回复 #作业回复
shield_type = "Course" shield_type = "Course"
container_id = at_message.jour.course.id container_id = at_message.jour.course.id
@ -99,7 +99,7 @@ class AtMessage < ActiveRecord::Base
else else
type = "journal_for_message" type = "journal_for_message"
detail_id = topic.id detail_id = topic.id
detail_title = at_message.subject detail_title = topic.notes.nil? ? "" : topic.notes
end end
else else
status = -1 status = -1

View File

@ -77,7 +77,8 @@ class HomeworkCommon < ActiveRecord::Base
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0 if count == 0
ws = WechatService.new ws = WechatService.new
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", self.course.name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。") name = self.course.syllabus.nil? ? self.course.name : self.course.syllabus.title+""+self.course.name
ws.homework_message_notice(m.user_id, "homework", self.id, "#{m.user.show_name}#{l(:label_new_homework_template)}", name, "新作业:"+ self.name.html_safe, "作业内容请点击“详情”查看。")
end end
# end # end
end end

View File

@ -62,7 +62,7 @@ class News < ActiveRecord::Base
:author_key => :author_id :author_key => :author_id
acts_as_watchable acts_as_watchable
after_create :act_as_activity,:act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message, :delay_news_send after_create :act_as_forge_activity, :act_as_course_activity, :add_author_as_watcher, :send_mail, :add_news_count, :act_as_student_score, :act_as_system_message, :delay_news_send
after_update :update_activity after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
@ -140,19 +140,13 @@ class News < ActiveRecord::Base
Watcher.create(:watchable => self, :user => author) Watcher.create(:watchable => self, :user => author)
end end
## fq
def act_as_activity
self.acts << Activity.new(:user_id => self.author_id)
end
# Time 2015-02-27 15:48:17 # Time 2015-02-27 15:48:17
# Author lizanle # Author lizanle
# Description 公用表中也要记录 # Description 公用表中也要记录
def act_as_forge_activity def act_as_forge_activity
# 如果是project为空那么是课程相关的不需要保存 # 如果是project为空那么是课程相关的不需要保存
if self.project if self.project
self.forge_acts << ForgeActivity.new(:user_id => self.author_id, self.forge_acts << ForgeActivity.new(:user_id => self.author_id, :project_id => self.project.id)
:project_id => self.project.id)
end end
end end
@ -167,17 +161,17 @@ class News < ActiveRecord::Base
# 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒 # 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
def act_as_system_message def act_as_system_message
if self.course if self.course
self.course.members.each do |m| # self.course.members.each do |m|
if m.user_id != self.author_id # if m.user_id != self.author_id
#self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false) # #self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count # count = ShieldWechatMessage.where("container_type='User' and container_id=#{m.user_id} and shield_type='Course' and shield_id=#{self.course_id}").count
if count == 0 # if count == 0
ws = WechatService.new # ws = WechatService.new
content = self.title # content = self.title
ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情" # ws.class_notice m.user_id, "course_notice", self.id, "#{l(:label_new_notice_template)}", self.course.name, self.author.show_name, format_time(self.created_on), content, "点击查看通知详情"
end # end
end # end
end # end
else else
if !self.project.nil? if !self.project.nil?
self.project.members.each do |m| self.project.members.each do |m|
@ -198,7 +192,7 @@ class News < ActiveRecord::Base
def contain_news_message def contain_news_message
self.course.members.each do |m| self.course.members.each do |m|
if m.user_id != self.author_id if m.user_id != self.author_id
self.course_messages << CourseMessage.new(:user_id => user_id, :course_id => container_id, :viewed => false) self.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => self.course_id, :viewed => false)
end end
end end
end end

View File

@ -170,12 +170,6 @@ class StudentWork < ActiveRecord::Base
end end
end end
end end
if homework.homework_type == 3
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.update_all(:final_score => student_work.final_score,:teacher_score => student_work.teacher_score,:student_score => student_work.student_score,:teaching_asistant_score => student_work.teaching_asistant_score,:work_score => student_work.work_score)
end
end end
end end

View File

@ -332,7 +332,7 @@ class CoursesService
# unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?) # unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
# raise '403' # raise '403'
# end # end
{:course => course,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0} {:course => course,:syllabus_title => course.syllabus.nil? ? "":course.syllabus.title ,:work_unit => work_unit, :img_url => url_to_avatar(course),:current_user_is_member => current_user.nil? ? false : current_user.member_of_course?(course),:current_user_is_teacher => current_user.nil? ? false : is_course_teacher(current_user,course),:course_student_num => course ? course.student.count.to_s : 0}
end end
#创建课程 #创建课程
@ -554,8 +554,10 @@ class CoursesService
uid = user.id uid = user.id
type = "review_class_member" type = "review_class_member"
end end
name = course.syllabus.nil? ? course.name : course.syllabus.title+""+course.name
ws = WechatService.new ws = WechatService.new
ws.class_notice user.id, type, course.id, title, course.name, user.show_name, format_time(Time.now), content, remark,uid ws.class_notice user.id, type, course.id, title,name, user.show_name, format_time(Time.now), content, remark,uid
end end
end end
@ -650,8 +652,9 @@ class CoursesService
rolename = role_ids.include?("7") ? "助教" : "教师" rolename = role_ids.include?("7") ? "助教" : "教师"
content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。" content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。"
name = course.syllabus.nil? ? course.name : course.syllabus.title+""+course.name
ws = WechatService.new ws = WechatService.new
ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", course.name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id ws.class_notice tea_user.id, "review_class_member", course.id, "班级成员审批通知。", name, tea_user.show_name, format_time(Time.now), content, "点击查看申请详情。",current_user.id
end end
end end
#-------------------------------------------- #--------------------------------------------

View File

@ -69,7 +69,8 @@ class SyllabusesService
if count == 0 if count == 0
ws = WechatService.new ws = WechatService.new
title = "恭喜您创建班级成功。" title = "恭喜您创建班级成功。"
ws.create_class_notice user.id, "create_course_notice", course.id,title, course.name, user.show_name, 1, "点击查看班级详情。" name = course.syllabus.nil? ? course.name : course.syllabus.title+""+course.name
ws.create_class_notice user.id, "create_course_notice", course.id,title, name, user.show_name, 1, "点击查看班级详情。"
end end
end end

View File

@ -17,12 +17,13 @@
<div class="cl"></div> <div class="cl"></div>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_tags_course_name)%>&nbsp;&nbsp;</label>
<input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:软件工程计算机系A班" onkeyup="regex_course_name('new');"> <input type="text" name="course[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:计算机系2016秋季A班" onkeyup="regex_course_name('new');">
<span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span> <span class="c_red" id="new_course_name_notice" style="display: none;">班级名称不能为空且至少有两个字符</span>
</li> </li>
<div class="cl"></div> <div class="cl"></div>
<li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li> <li class="ml125 mb5 fontGrey3"><span class="success-icon mr25">正确示例计算机系2016秋季A班</span></li>
<li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li> <li class="ml125 mb10 fontGrey3"><span class="error-icon">错误示例:软件工程 - 计算机系2016秋季A班</span></li>
<li class="ml125 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>
<li class="ml45"> <li class="ml45">
<label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label> <label><span class="c_red">*</span>&nbsp;<%= l(:label_class_period)%>&nbsp;&nbsp;</label>
<input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6"> <input type="text" name="class_period" id="new_class_period" class="hwork_input02" onkeyup="regex_course_class_period('new');" placeholder="例如54" maxlength="6">

View File

@ -41,6 +41,20 @@
<!-- 老师身份才可以发布作业 --> <!-- 老师身份才可以发布作业 -->
<div class="HomeWork mb10 ml10" nhname='homework_common_form'> <div class="HomeWork mb10 ml10" nhname='homework_common_form'>
<% committed_work_count = @homework.student_works.has_committed.count %>
<% stu_pro_count = @homework.student_work_projects.count %>
<% if committed_work_count != 0 %>
<% if @homework.homework_type == 1 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型。</p>
<% elsif @homework.homework_type == 2 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和测试集。</p>
<% elsif @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=committed_work_count %>个学生提交作品,不允许再修改作业类型和分组设置。</p>
<% end %>
<% elsif stu_pro_count != 0 && @homework.homework_type == 3 %>
<p class="c_red mb5">已有<%=stu_pro_count %>个学生关联项目,不允许再修改作业类型。</p>
<% end %>
<%= form_for @homework do |f| %> <%= form_for @homework do |f| %>
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/> <input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/> <input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>

View File

@ -3,13 +3,13 @@
$("#homework_name").val(""); $("#homework_name").val("");
$("#homework_publish_time").val(""); $("#homework_publish_time").val("");
$("#homework_end_time").val(""); $("#homework_end_time").val("");
document.getElementById("anonymous_comment").checked = true;
$("#course_id").val($("#option_select").val()); $("#course_id").val($("#option_select").val());
$("#homeworkSetting").addClass("undis");
$("#homeworkSetting").html("");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>"); $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true,:has_group => true})%>");
//homework_description_editor.html(""); //homework_description_editor.html("");
$("#homework_name_span").text(""); $("#homework_name_span").text("");
$("#homework_end_time_span").text(""); $("#homework_end_time_span").text("");
$("#homework_end_time_span").text("");
$("#homework_course_id_span").text(""); $("#homework_course_id_span").text("");
$("#homework_editor").toggle(); $("#homework_editor").toggle();
} }

View File

@ -1,41 +1,51 @@
<%= javascript_include_tag "feedback" %> <%= javascript_include_tag "feedback" %>
<div class="scrollsidebar" id="scrollsidebar"> <div class="scrollsidebar pr" id="scrollsidebar">
<div class="side_content"> <div class="side_content">
<div class="side_list"> <div class="side_list">
<div class="qr-code-border borderBottomNone"><img src="/images/wechat/trustie_QR.jpg" width="150" style="display:block;" /> </div> <div style="background-color:#fff; padding:10px 0; border:1px solid #aaa; border-bottom:none;">
<div class="side_title"> <span class="fontGrey3 f14 ml40" style="vertical-align:top;">问题和建议</span>
<a title="<%= l(:button_hide) %>" class="close_btn"> <span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content">×</span></span>
<span> <span class="close_btn side-bar-circle fr mt3 mr10" title="隐藏"><span class="side-bar-content" style="left:4px;"></span></span>
</span>
</a>
</div> </div>
<div class="side_center"> <div style="background-color:#fff; border-left:1px solid #aaa; border-right:1px solid #aaa;">
<div class="custom_service"> <div class="custom_service tac">
<% get_memo %> <% get_memo %>
<%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %> <%= form_for(@new_memo, :url => create_feedback_forum_path(@public_forum)) do |f| %>
<%= f.text_area :subject, :id=>"subject", :class => "opnionText", :placeholder => l(:label_feedback_tips) %> <%= f.text_area :subject, :id=>"subject", :class => "opnionText mb5", :placeholder => l(:label_feedback_tips) %>
<%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %> <%= f.hidden_field :content,:id => 'hidden', :required => true , :value => l(:label_feedback_value) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label> <span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick="f_submit();"> <a href="javascript:void(0);" class="linkBlue f14 fr mr10" style="height:21px;" id="" onclick="f_submit();">
<%= l(:label_submit)%> <%= l(:label_submit)%>
</a> </a>
<div class="cl"></div>
<% end %> <% end %>
</div> </div>
<div class="mt5" style="color: #269ac9;cursor: default"> </div>
<div style="background-color:#fff; border:1px solid #aaa; border-top:none; padding-top:5px;">
<div class="fl mt5 ml10 tac">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">--> <!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %> <%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad--> <!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>--> <!--<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 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 border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></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>
<p class="fontGrey3" style="padding-bottom:10px; padding-top:3px;">加入QQ群</p>
</div>
<div class="fr mr10 tac">
<img src="/images/wechat/trustie_QR.jpg" width="80" style="display:inline-block; margin-right:-5px;" /><p class="fontGrey3" style="padding-bottom:10px;">关注官方微信</p>
</div>
<div class="cl"></div>
</div> </div>
</div> </div>
<div class="side_bottom"></div> </div>
<div class="show_btn tac">
<div style=" border:1px solid #aaa;">
<div style="height:79px;">
<img src="/images/dialog.png" width="18" class="mt10 mb5" />
<span class="f14 fontBlue">提<br />问</span>
</div>
<span class="closeSidebar f16">×</span>
</div> </div>
</div> </div>
<div class="show_btn">
<span><%= l(:label_submit)%></span>
<a href="javascript:void(0)" class="closeSidebar"></a>
</div>
</div> </div>

View File

@ -2,10 +2,17 @@
<li> <li>
<span class="user_icons_class"></span> <span class="user_icons_class"></span>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %> <% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu" title="<%= course.syllabus.title+' · '+(course.is_public? ? '公开班级:' : '私有班级:')+course.name+''+current_time_and_term(course)+'' %>"> <p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu pr" >
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%> <% title = "<span class='course-name'>#{course.syllabus.title}</span>".html_safe %>
<%= link_to title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
<font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font> <font class="fb c_grey" style="height:39px; line-height:39px; vertical-align:top;">·</font>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%> <% classes = "<span class='course-name'>#{course.name}</span>".html_safe %>
<%= link_to classes, course_path(course.id,:host=>Setting.host_course), :target => '_blank', :class => 'hidden', :style => "max-width:91px; display:inline-block;"%>
<span class="sub-menu-title c_dark">
课程名称:<%= course.syllabus.title %><br />
班级名称:<%= course.name+''+current_time_and_term(course)+'' %><br />
班级属性:<%= course.is_public? ? '公开' : '私有' %>
</span>
</p> </p>
<%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course), <%#= link_to course.name+"("+current_time_and_term_short(course)+")", course_path(course.id,:host=>Setting.host_course),
:id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%> :id => "show_course_#{course.id}", :class => 'course_list_menu hidden', :target => '_blank', :title => (course.is_public? ? "公开班级:":"私有班级:")+course.name+""+current_time_and_term(course)+""%>
@ -106,11 +113,25 @@
} }
$(".course_list_menu").each(function(){ $(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).width(); var courseWidth = $(this).children().eq(0).children().width();
var classWidth = 170 -courseWidth; var classWidth = $(this).children().eq(2).children().width();
var newClassWidth = 182 - courseWidth;
var newCourseWidth = 182 - classWidth;
console.log(courseWidth, classWidth); console.log(courseWidth, classWidth);
if(courseWidth < 80){ if(courseWidth < 91 && classWidth > 91){
$(this).children().eq(2).css("max-width",classWidth + "px"); $(this).children().eq(2).css("max-width",newClassWidth + "px");
}
if(classWidth < 91 && courseWidth > 91){
$(this).children().eq(0).css("max-width",newCourseWidth + "px");
} }
}) })
$(".course-name").each(function(){
$(this).mouseenter(function(){
$(this).parent().parent().children().eq(3).show();
});
$(this).mouseleave(function(){
$(this).parent().parent().children().eq(3).hide();
});
})
</script> </script>

View File

@ -90,7 +90,7 @@
</div> </div>
<div class="homepagePostReplyDes"> <div class="homepagePostReplyDes">
<div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div> <div class="homepagePostReplyPublisher"><a href="<%=user_path(reply.author)%>" class="newsBlue mr10 f14"><%= reply.author.name%></a><%= format_date(reply.created_at) %></div>
<div class="homepagePostReplyContent break_word" id="activity_description_<%= reply.id %>"><%= h reply.content.html_safe.gsub(/\<script\>/, "<script>") %></div> <div class="homepagePostReplyContent break_word" id="activity_description_<%= reply.id %>"><%= reply.content.gsub(/script/, "script&nbsp").html_safe %></div>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){

View File

@ -29,17 +29,6 @@
<!--CONTENT LIST--> <!--CONTENT LIST-->
</div> </div>
<%# 时间紧,权限待优化 %>
<% unless @project.hidden_repo && !User.current.member_of?(@project) && !User.current.admin? %>
<% unless @project.gpid.nil? || @project.project_score.changeset_num == 0 || @project.rep_statics.blank? %>
<div class="resources mt10">
<div class="homepagePostBrief">
<%= render :partial => "rep_static" %>
<div class="cl"></div>
</div>
</div>
<% end %>
<% end %>
<%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %> <%= render :partial => "project_activities", :locals => {:forge_acts => @events_pages, :page => 0, :type => @type} %>
</div> </div>

View File

@ -0,0 +1,26 @@
<div class="syllabus_courses_box">
<% @stundet_works.each_with_index do |student_work, i| %>
<div class="syllabus_courses_list" id="student_work_<%= student_work.id%>" style="cursor: default;">
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
</div>
<div id="about_hwork_<%= student_work.id %>"></div>
<div id="group_member_work_<%= student_work.id%>" class="undis">
<%= render :partial => 'group_member_work', :locals => {:student_work => student_work} %>
</div>
<% end %>
</div>
<div class="cl"></div>
<script>
$(".icons_sy_close").live('click',function(){
$(this).parent().parent().next().next().show();
$(this).removeClass("icons_sy_close");
$(this).addClass("icons_sy_open");
});
$(".icons_sy_open").live('click',function(){
$(this).parent().parent().next().next().hide();
$(this).addClass("icons_sy_close");
$(this).removeClass("icons_sy_open");
});
</script>

View File

@ -0,0 +1,82 @@
<ul id="syllabus_course_ul">
<li class="syllabus_class_list" style="line-height:44px; vertical-align:middle;">
<div class="syllabus_class_w fontGrey3">
<%= link_to(image_tag(url_to_avatar(st.user),:width =>"40",:height => "40", :style => "display:block;"),user_activities_path(st.user), :class => "fl") %>
<% if !st.student_work_projects.empty? %>
<span class="fl student_work_<%= st.id%>" style="width:135px;">
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
<span class="fl">(组长)</span>
</span>
<span class="fl mr15 hidden student_work_<%= st.id%>" style="width:90px;">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
</span>
<% else %>
<span class="fl student_work_<%= st.id%>" style="width:135px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
<span class="fl hidden ml5" style="max-width:90px;"><%= st.user.show_name %></span>
</span>
<span class="fl student_work_<%= st.id%> mr15 hidden" style="width:90px; cursor: pointer;" onclick="show_student_work('<%= student_work_path(st)%>');">
<span class="fontGrey2">学号</span><%= st.user.user_extensions.nil? ? "--" : st.user.user_extensions.student_id%>
</span>
<% end %>
<div class="flex-container fl" style="width:365px;">
<div class="flex-cell"><span class="<%= score_color st.teacher_score%> ml35"><%= st.teacher_score.nil? ? "--" : format("%.1f",st.teacher_score)%></span></div>
<div class="flex-cell"><span class="<%= score_color st.teaching_asistant_score%> ml35"><%= st.teaching_asistant_score.nil? ? "--" : format("%.1f",st.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">
<div class="<%= score_color st.student_score%> student_score_info ml35 pr">
<% if st.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%= format("%.1f", st.student_score) %>
<% end %>
<% unless st.student_score.nil? %>
<span class="linkBlue">
(<%= anon_count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= anon_count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", st.student_score) %>&nbsp;</span>分。
</div>
<% end %>
</div>
</div>
<% end %>
<div class="flex-cell">
<% score = st.work_score %>
<div class="<%= score_color score%> student_final_scor_info ml35 pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="g_infoNi none width180">
作品最终评分为
<span class="c_red">&nbsp;<%= st.final_score%>&nbsp;</span>分。
迟交扣分
<span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.late_penalty %>
&nbsp;</span>分,
缺评扣分
<span class="c_red">&nbsp;
<%= st.homework_common && st.homework_common.teacher_priority == 1 && st.teacher_score ? 0 : st.absence_penalty%>
&nbsp;</span>分,
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</div>
</div>
</div>
</div>
<div class="hworkTip" style="display: none; left:700px; top:20px; white-space:nowrap; right:auto;" id="work_click_<%= st.id%>"><em></em><span></span><font class="fontGrey2"><%= !st.student_work_projects.empty? ? '大作品评分即组长的评分' : '点击查看详情' %></font></div>
</li>
</ul>
<script type="text/javascript">
$(".student_work_<%= st.id%>").mouseenter(function(){
if($("#about_hwork_<%= st.id%>").html().trim() == "") {
$("#work_click_<%= st.id%>").show();
}
}).mouseleave(function(){
$("#work_click_<%= st.id%>").hide();
}).mouse;
</script>

View File

@ -1,47 +1,32 @@
<tr class="hworkListRow" id="student_work_<%= student_work.id%>"> <div class="sy_courses_open f14 fontGrey3">
<td class="none"><a name="<%= student_work.id%>"></a></td> <span class="icons_sy_close fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td> <span class="fl" style="width:280px;">
<td class="hworkPortrait pr10 float-none"> <span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span>
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %> <span class="fontGrey2 ml5 fl">
</td> <% if student_work.work_status%>
<%=get_status student_work.work_status %>
<% end %>
</span>
</span>
<% if @homework.homework_detail_group.base_on_project == 1 %> <% if @homework.homework_detail_group.base_on_project == 1 %>
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> width130" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');"> <span class="ml15 fl">关联项目:</span>
<div>
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div>
</td>
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %> <% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="项目名称"> <%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "width:200px;", :title => "项目名称"%>
<%= link_to( student_work.project.name, project_path(student_work.project.id))%>
</td>
<% else %> <% else %>
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的"> <span class="fontBlue fl hidden" style="width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<%= student_work.project.name %>
</td>
<% end %> <% end %>
<% elsif @homework.homework_detail_group.base_on_project == 0 %> <% end %>
<td class="hworkName float-none pr10 student_work_<%= student_work.id%> <%=@homework.anonymous_comment == 1 ? 'width280' : 'width210' %>" style="cursor: pointer;" onclick="show_student_work('<%= student_work_path(student_work)%>');"> <a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr">评分</a>
<div> <div class="cl"></div>
<%= link_to student_work.user.show_name,"javascript:void(0)" ,:title => student_work.user.show_name, :class => "linkGrey f14 StudentName break_word #{@homework.homework_type == 2 ? '' : 'width165'}"%>
</div> </div>
</td> <div class="fl sy_p_grey">
<% end %> <span class="fl" style="width:296px;">提交时间:<%=format_date(student_work.commit_time) %></span>
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <div class="flex-container fl" style="width:368px;">
<% if student_work.created_at && @homework.end_time%> <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>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <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>
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(format_time(student_work.created_at)).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span>
<% end %>
<% end %>
</td>
<td class="hworkList70 <%= score_color student_work.teacher_score%>">
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
</td>
<td class="hworkList70 <%= score_color student_work.teaching_asistant_score%>">
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
</td>
<% if @homework.anonymous_comment == 0 %> <% if @homework.anonymous_comment == 0 %>
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info"> <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? %> <% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span> <span title="该作品未被匿评">未参与</span>
<% else %> <% else %>
@ -51,25 +36,22 @@
<span class="linkBlue"> <span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>) (<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
</span> </span>
<div class="infoNi none"> <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;<%= 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>分。 <span class="c_red">&nbsp;<%= format("%.1f", student_work.student_score) %>&nbsp;</span>分。
</div> </div>
<% end %> <% end %>
</td> </div>
</div>
<% end %> <% end %>
<!-- 成绩 --> <div class="flex-cell">成绩:
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %> <% score = student_work.work_score %>
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %> <div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<% else %>
<% score = student_work.respond_to?("score") ? student_work.score : (student_work.final_score || 0) - student_work.absence_penalty - student_work.late_penalty%>
<% end %>
<td class="hworkList70 <%= score_color score%> student_final_scor_info">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%> <% unless score.nil?%>
<div class="infoNi none width180"> <div class="g_infoNi none width180">
作品最终评分为 作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
迟交扣分 迟交扣分
@ -84,6 +66,8 @@
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。 <span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div> </div>
<% end%> <% end%>
</td> </div>
<td><div style="position:relative;"><div class="hworkTip" style="display: none" id="work_click_<%= student_work.id%>"><em></em><span></span><font class="fontGrey2">点击查看详情</font></div></div></td> </div>
</tr> </div>
</div>
<div class="cl"></div>

View File

@ -0,0 +1,11 @@
<% user_ids = student_work.student_work_projects.empty? ? "(-1)" : "(" + student_work.student_work_projects.map{|st| st.user_id}.join(",") + ")" %>
<% student_work_groups = @homework.student_works.where("user_id in #{user_ids}").order("created_at asc") %>
<% anon_count = student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
<% student_work_groups.each_with_index do |st, j| %>
<div class="syllabus_class_box" id="student_work_<%= st.id%>">
<%= render :partial => 'evaluation_un_group_member_work', :locals => {:st => st, :anon_count => anon_count} %>
</div>
<% if j != 0 %>
<div id="about_hwork_<%= st.id %>"></div>
<% end %>
<% end %>

View File

@ -7,6 +7,8 @@
<% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %> <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %>
<% is_my_work = pro && pro.student_work_id == work.id%> <% is_my_work = pro && pro.student_work_id == work.id%>
<% end %> <% end %>
<% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %>
<% if !is_member_work %>
<ul> <ul>
<li class="fl" > <li class="fl" >
<span class="tit_fb">上交时间:</span> <span class="tit_fb">上交时间:</span>
@ -31,7 +33,6 @@
<div class="cl"></div> <div class="cl"></div>
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯&nbsp;&nbsp;王强</li>--> <!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯&nbsp;&nbsp;王强</li>-->
<% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %> <% if @homework.homework_type == 3 && work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %>
<div class="cl"></div> <div class="cl"></div>
<li> <li>
@ -94,6 +95,19 @@
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<% else %>
<ul>
<li >
<% if @is_teacher %>
<!-- 老师 -->
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
</div>
<% end%>
<div class="cl"></div>
</li>
</ul>
<% end %>
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>"> <div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
<%student_work_scores.each do |student_score|%> <%student_work_scores.each do |student_score|%>
@ -101,6 +115,9 @@
<%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%> <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
</div> </div>
<% end%> <% end%>
<% if is_member_work && student_work_scores.empty? && !@is_teacher %>
<p class="c_red" style="text-align: center">暂无评分</p>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<!---ping_box end---> <!---ping_box end--->

View File

@ -36,11 +36,19 @@
<div class="cl"></div> <div class="cl"></div>
<div class="fl"> <div class="fl">
<% if @homework.homework_type != 3%>
<% if @is_evaluation && !@stundet_works.empty? %> <% if @is_evaluation && !@stundet_works.empty? %>
<%= render :partial => "evaluation_title"%> <%= render :partial => "evaluation_title"%>
<% else%> <% else%>
<%= render :partial => "evaluation_un_title"%> <%= render :partial => "evaluation_un_title"%>
<% end%> <% end%>
<% else %>
<% if !@is_teacher && @is_evaluation && !@stundet_works.empty? %>
<%= render :partial => "evaluation_title"%>
<% else %>
<%= render :partial => "evaluation_un_group"%>
<% end%>
<% end %>
</div> </div>
<div class="cl"></div> <div class="cl"></div>

View File

@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html();
$("#score_list_<%= @work.id%>").removeAttr("style"); $("#score_list_<%= @work.id%>").removeAttr("style");
<% if @is_teacher %> <% if @is_teacher %>
<% if @homework.homework_type == 3 %>
<% if @is_group_leader %>
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_work', :locals => {:student_work => @work}) %>");
$("#group_member_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'group_member_work', :locals => {:student_work => @work}) %>");
<% else %>
<% anon_count = @work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>
$("#student_work_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'evaluation_un_group_member_work', :locals => {:st => @work, :anon_count => anon_count}) %>");
<% end %>
<% else %>
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>"); $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work, :index => 1}) %>");
$("#work_num_<%= @work.id%>").html(num); $("#work_num_<%= @work.id%>").html(num);
<% end %>
<% else %> <% else %>
$("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>"); $("tr[id='student_work_<%= @work.id%>']").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work, :index => 1}) %>");
$("#work_num_<%= @work.id%>").html(num); $("#work_num_<%= @work.id%>").html(num);

View File

@ -2,6 +2,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'homework','baiduTemplate' %> <%= javascript_include_tag 'homework','baiduTemplate' %>
<% end %> <% end %>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
<div class="NewsBannerName">编辑作品</div> <div class="NewsBannerName">编辑作品</div>
</div> </div>
@ -83,6 +84,7 @@
<% end%> <% end%>
</div><!----HomeWorkCon end--> </div><!----HomeWorkCon end-->
</div> </div>
</div>
<script type="text/javascript"> <script type="text/javascript">
<% if @homework.homework_detail_group %> <% if @homework.homework_detail_group %>
$(function(){ $(function(){

View File

@ -197,7 +197,8 @@
}); });
</script> </script>
<div class="homepageRightBanner mb10"> <div class="homepageRight mt0 ml10">
<div class="homepageRightBanner mb10 ml10">
<div class="NewsBannerName">提交作品</div> <div class="NewsBannerName">提交作品</div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
@ -298,3 +299,4 @@
<% end%> <% end%>
</div><!----HomeWorkCon end--> </div><!----HomeWorkCon end-->
</div> </div>
</div>

View File

@ -31,9 +31,9 @@
</div> </div>
<div class="ml15 mt10"> <div class="ml15 mt10">
<span class="grayTxt"> <span class="grayTxt">
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> 发布者: <%= activity.author.show_name %>
</span> </span>
<span class="grayTxt">更新:<%= format_time(CourseActivity.where("course_act_type='#{activity.class}' and course_act_id =#{activity.id}").first.updated_at) %></span> <span class="grayTxt">更新:<%= format_time(activity.course_acts.first.try(:updated_at)) %></span>
<% count=0 %> <% count=0 %>
<% count=activity.comments.count %> <% count=activity.comments.count %>
<p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p> <p class="list-info fr grayTxt"><span><%= count>0 ? "#{count}" : "0" %></span><span>回复</span><span>|</span><span><%= get_praise_num(activity) > 0 ? "#{get_praise_num(activity)}" : "0" %></span><span>赞</span></p>

View File

@ -24,6 +24,8 @@
<%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> <%=render :partial=> "praise_tread/praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span> </span>
<% if type == 'Message' %> <% if type == 'Message' %>
<% topic = comment.root %>
<% if !topic.locked? && authorize_for('messages', 'reply') %>
<span style="position: relative" class="fr mr20"> <span style="position: relative" class="fr mr20">
<%= link_to( <%= link_to(
l(:button_reply), l(:button_reply),
@ -33,6 +35,7 @@
:title => l(:button_reply)) %> :title => l(:button_reply)) %>
<span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span> <span id="reply_iconup_<%=comment.id %>" class="reply_iconup02" style="display: none"> ︿</span>
</span> </span>
<% end %>
<% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %> <% if comment.course_destroyable_by?(User.current) || comment.destroyable_by?(User.current) %>
<%= link_to( <%= link_to(
l(:button_delete), l(:button_delete),

View File

@ -43,7 +43,7 @@
</div> </div>
<div class="ml15 mt10 f12"> <div class="ml15 mt10 f12">
<span class="grayTxt"> <span class="grayTxt">
发帖人:<%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %> 发帖人:<%=(u.try(:realname) != " " ? u.try(:lastname) + u.try(:firstname) : u.try(:login)) unless u.nil? %>
</span> </span>
<span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span> <span class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% all_comments = []%> <% all_comments = []%>

View File

@ -1,3 +1,4 @@
<% unless activity.author.nil? %>
<div class="resources mt10" id="user_activity_<%= user_activity_id%>"> <div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief"> <div class="homepagePostBrief">
<div class="homepagePostPortrait"> <div class="homepagePostPortrait">
@ -103,3 +104,5 @@
user_card_show_hide(); user_card_show_hide();
}); });
</script> </script>
<% end %>

View File

@ -1,27 +1,27 @@
<span class="f16 fontBlue">分组设置</span> <div id="groupHomework">
<a href="javascript:void(0);" class="popClose" title="关闭弹框"></a> <div> <span class="f14 mt5 fl fontGrey3 mr10">分组设置:</span>
<div class="mt10"> <div class="mr50 fl"> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
<span class="f14 fontGrey3 mr5">每组最小人数:</span> <input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
<input id="min_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" />人
<span class="c_red undis" id="min_num_notice"></span>
</div> </div>
<div class="mt10"> <div class="fl"> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
<span class="f14 fontGrey3 mr5">每组最大人数:</span> <input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
<input id="max_num" type="text" name="" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" />人
<span class="c_red undis" id="max_num_notice"></span>
</div> </div>
<p class="c_red undis" id="min_max_num_notice"></p> <span class="c_red undis ml20 mt7 fl" id="min_max_num_notice"></span>
<div class="mb10 mt10"> <div class="cl"></div>
<div class="ml80">
<label> <label>
<input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project"/> <input type="checkbox" class="mr5" name="base_on_project" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.base_on_project : 1 %>" id="base_on_project" <%=not_allow_select ? 'disabled' : '' %>/>
<span class="f14 fontGrey3 mr10">基于项目实施</span> <span class="f14 fontGrey3 mr10">基于项目实施</span>
</label> </label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p> <p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
</div> </div>
<div class="courseSendSubmit"> <div class="cl"></div>
<a href="javascript:void(0);" class="group_save_btn sendSourceText">确定</a>
</div> </div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" id="cancel_group">取消</a>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<script>
if($.trim($("#base_on_project").val()) == 1) {
$("#base_on_project").attr('checked','checked');
}
</script>

View File

@ -71,17 +71,6 @@
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) --> <!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a> <a href="javascript:void(0);" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
<%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %> <%= link_to "资源库", user_ref_resource_search_user_path(User.current.id, :homework_id => container.id), :class => "FilesBtn fl mt3 mr15", :title => "请从资源库中选择文件作为作业的附件", :remote => true %>
<% if defined?(has_program) && has_program %>
<div id="program_setting" class="fl">
<a href="javascript:void(0);" class="ProBtn fl mt3"title="请设置编程语言和输入测试集">编程</a>
<span class="fl C_lgrey mt3 program_detail_info mr15"></span>
</div>
<% end %>
<% if defined?(has_group) && has_group %>
<div id="group_setting" class="fl">
<a href="javascript:void(0);" class="groupBtn fl mt3" title="请设置分组作业的相关参数">分组</a>
</div>
<% end %>
</div> </div>
<% content_for :header_tags do %> <% content_for :header_tags do %>

View File

@ -1,3 +1,4 @@
<% not_allow_select = edit_mode && homework.student_works.has_committed.count != 0 %>
<% content_for :header_tags do %> <% content_for :header_tags do %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
@ -5,14 +6,31 @@
<script type="text/javascript"> <script type="text/javascript">
var first_click = true; var first_click = true;
$(function(){ $(function(){
if($.trim($("#anonymous_comment").val()) == 1) { $("#homework_type_option").on("change",function(){
$("#anonymous_comment").attr('checked',true); var type = $(this).children('option:selected').val()
if(type == "1"){
$("#homeworkSetting").addClass("undis");
$("#homeworkSetting").html("");
}else if(type == "2"){
$("#homeworkSetting").removeClass("undis");
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
}else{ }else{
$("#homeworkSetting").removeClass("undis");
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
}
});
if($.trim($("#anonymous_comment").val()) == 1) {
$("#anonymous_comment").attr('checked',false); $("#anonymous_comment").attr('checked',false);
} else {
$("#anonymous_comment").attr('checked',true);
} }
if($.trim($("#base_on_project").val()) == 1) { <% if edit_mode && homework.homework_type == 2 %>
$("#base_on_project").attr('checked','checked'); $("#homeworkSetting").removeClass("undis");
} $("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
<% elsif edit_mode && homework.homework_type == 3 %>
$("#homeworkSetting").removeClass("undis");
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework, :not_allow_select => not_allow_select}) %>");
<% end %>
<% if edit_mode && homework.is_program_homework? %> <% if edit_mode && homework.is_program_homework? %>
$("#BluePopupBox a.BlueCirBtn").click(); $("#BluePopupBox a.BlueCirBtn").click();
<% end %> <% end %>
@ -21,15 +39,15 @@
<% end %> <% end %>
<% if edit_mode %> <% if edit_mode %>
$("#anonymous_comment").on('click',function(){ $("#anonymous_comment").on('click',function(){
$("#anonymous_hint").show(); $("#homework_end_time_span").html("更改后评分比例将恢复默认值");
}); });
<% end %> <% end %>
}); });
function checked_val() { function checked_val() {
if ($("#anonymous_comment").is(":checked")) { if ($("#anonymous_comment").is(":checked")) {
$("#anonymous_comment").val(1);
} else {
$("#anonymous_comment").val(0); $("#anonymous_comment").val(0);
} else {
$("#anonymous_comment").val(1);
} }
} }
function nh_reset_homework_form(params){ function nh_reset_homework_form(params){
@ -63,6 +81,10 @@
else if(!regex_course_id()){ else if(!regex_course_id()){
$("#course_id").focus(); $("#course_id").focus();
} }
else if($("#homework_type_option").val() == 2 && !regex_program_attr()) {
}
else if($("#homework_type_option").val() == 3 && !regex_group_attr()) {
}
else{ else{
params.textarea.html(params.editor.html()); params.textarea.html(params.editor.html());
params.editor.sync(); params.editor.sync();
@ -154,28 +176,32 @@
<div class="HomeWorkCon"> <div class="HomeWorkCon">
<a id="submit_homework"></a> <a id="submit_homework"></a>
<div> <div>
<input type="text" name="homework_common[name]" id="homework_name" class="InputBox w701" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" > <input type="text" name="homework_common[name]" id="homework_name" class="InputBox fl <%= edit_mode ? 'w701' : 'w603' %>" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fr",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%>
<% unless edit_mode %>
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
<% end %>
<div class="cl"></div>
<p id="homework_name_span" class="c_red mt5"></p> <p id="homework_name_span" class="c_red mt5"></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10"> <div class="mt10">
<%= link_to("从题库选用", user_import_homeworks_user_path(User.current.id,:select_course => defined?(select_course)),:class => "BlueCirBtn fl mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") unless edit_mode%> <% group_pro = homework.homework_type == 3 && homework.student_work_projects.count != 0 %>
<% unless edit_mode %> <select class="homework-type-option fl mr10" name="homework_type" <%=(not_allow_select || group_pro) ? 'disabled' : '' %> id="homework_type_option">
<input type="hidden" name="quotes" id="ref_homework_id" value=""/> <%= options_for_select(homework_type_option,homework.homework_type) %>
</select>
<% if not_allow_select || group_pro %>
<input type="text" style="display: none" name="homework_type" value="<%=homework.homework_type %>"/>
<% end %> <% end %>
<%# if edit_mode %> <label class="fl c_grey f14 mt5">截止日期:</label>
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
<%# end %>
<div class="calendar_div fl mr10"> <div class="calendar_div fl mr10">
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" > <input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.end_time%>" >
<% if homework.homework_detail_manual.comment_status.to_i < 2 %> <% if homework.homework_detail_manual.comment_status.to_i < 2 %>
<%= calendar_for('homework_end_time')%> <%= calendar_for('homework_end_time')%>
<% end %> <% end %>
</div> </div>
<%# if edit_mode %> <label class="fl c_grey f14 mt5" style="margin-top: 4px;">发布日期(可选):</label>
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选)</label>
<%# end %>
<div class="calendar_div fl"> <div class="calendar_div fl">
<% allow_edit = homework.student_works.has_committed.count == 0 && homework.student_work_projects.count ==0 %> <% allow_edit = homework.student_works.has_committed.count == 0 && homework.student_work_projects.count ==0 %>
<input title="<%=allow_edit ? '' : '已有学生提交作品或关联项目,发布日期不可再编辑' %>" type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" > <input title="<%=allow_edit ? '' : '已有学生提交作品或关联项目,发布日期不可再编辑' %>" type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 calendar_input" readonly="readonly" value="<%= homework.publish_time%>" >
@ -184,10 +210,10 @@
<% end %> <% end %>
</div> </div>
<% if !edit_mode || edit_mode && homework.homework_detail_manual.comment_status < 2 %> <% if !edit_mode || edit_mode && homework.homework_detail_manual.comment_status < 2 %>
<div class="fl f14 ml10" style="margin-top: 4px;"> <div class="fr f14 ml10" style="margin-top: 4px;">
<input type="checkbox" name="homework_common[anonymous_comment]" value="<%=edit_mode ? homework.anonymous_comment : 1 %>" id="anonymous_comment"/> <input type="checkbox" name="homework_common[anonymous_comment]" value="<%=edit_mode ? homework.anonymous_comment : 1 %>" id="anonymous_comment"/>
<span class="f14 c_grey">用匿评</span> <span class="f14 c_grey">用匿评</span>
<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span> <!--<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span>-->
</div> </div>
<% end %> <% end %>
</div> </div>
@ -216,9 +242,13 @@
<p id="e_tips" class="c_grey"></p> <p id="e_tips" class="c_grey"></p>
<div class="cl"></div> <div class="cl"></div>
<div class="mt10 b_grey undis" style="padding:10px;" id="homeworkSetting">
</div>
<div id="homework_attachments"> <div id="homework_attachments">
<!-- 编辑作业 && 作业类型为匿评作业时没有编程选项--> <!-- 编辑作业 && 作业类型为匿评作业时没有编程选项-->
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => homework, :has_program=>!(edit_mode && homework.homework_type != 2), :has_group=>(!(edit_mode && homework.homework_type != 3))&& homework.student_works.empty?,:show_member => true} %> <%= render :partial => 'users/user_homework_attachment', :locals => {:container => homework, :show_member => true} %>
</div> </div>
<div class="mt5"> <div class="mt5">
@ -234,50 +264,21 @@
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<input type="hidden" name="homework_type" value="<%= edit_mode ? homework.homework_type : 1 %>">
</div> </div>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
<script id="t:test-answer-list" type="text/html"> <script id="t:test-answer-list" type="text/html">
<div class="mt10"> <div class="mt10" style="margin-left:63px;">
<label class="fl mt5" name="inputs_label">&nbsp;&nbsp;&nbsp;</label> <label class="fl fontGrey2 mr10 mt5" name="inputs_label">&nbsp;&nbsp;&nbsp;</label>
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"></textarea> <textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]"></textarea>
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"></textarea> <textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a> <a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a> <a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</script> </script>
<script type="text/html" id="t:program-input-list">
<div class="program-input">
<input type="hidden" name="language_type" value="<!= language_type !>" />
<! for(var i=0; i< input_groups.length; ++i) { !>
<input name="program[input][]" type="hidden" value="<!= input_groups[i].input !>" />
<input name="program[output][]" type="hidden" value="<!= input_groups[i].output !>" />
<! } !>
</div>
</script>
<script id="t:group-input-list" type="text/html">
<div class="group-input">
<input type="hidden" name="min_num" value="<!= min_num !>" />
<input type="hidden" name="max_num" value="<!= max_num !>" />
<input type="hidden" name="base_on_project" value="<!= base_on_project !>" />
</div>
</script>
<div class="BluePopupBox" id="BluePopupBox" style="display:none;">
<%= render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework} %>
</div><!----BluePopupBox end-->
<div class="BluePopupBox" style="display:none;" id="GroupPopupBox">
<%= render :partial => 'users/user_group_attr', :locals => {:edit_mode => edit_mode, :homework=>homework}%>
</div>
<% unless edit_mode %> <% unless edit_mode %>
<div class="BluePopupBox" style="display:none;" id="NoticePopupBox"> <div class="BluePopupBox" style="display:none;" id="NoticePopupBox">
<%= render :partial => 'users/homework_type_notice', :locals => {:edit_mode => edit_mode, :homework=>homework}%> <%= render :partial => 'users/homework_type_notice', :locals => {:edit_mode => edit_mode, :homework=>homework}%>

View File

@ -1,46 +1,63 @@
<a href="javascript:void(0);" class="CloseBtn" title="关闭弹框"></a> <div id="programHomework">
<h2 class="BluePopuph2 fl">编程作业的测试集设置</h2> <span class="f14 mt5 fl fontGrey3 mr10">测试集设置:</span>
<div class="cl"></div> <select class="InputBox W120 language_type" name="language_type" <%=not_allow_select ? 'disabled' : '' %>>
<div class="HomeWorkCon">
<div class="mt15">
<select class="InputBox W120 language_type" >
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %> <%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
</select> </select>
</div> <span class="f12 c_red mt5 fr">温馨提示:您可以在发布作业后,在作业"模拟答题"中进行标准代码的检测。</span>
<div style="height: 320px; overflow-y:auto; width:756px;"> <div class="cl"></div>
<% if edit_mode && homework.is_program_homework? %> <% if edit_mode && homework.is_program_homework? %>
<% homework.homework_tests.each_with_index do |test, index| %> <% homework.homework_tests.each_with_index do |test, index| %>
<div class="mt10"> <div class="mt10" style="margin-left:63px;">
<label class="fl mt5" name="inputs_label"><%=index+1 %>&nbsp;&nbsp;</label> <label class="fl fontGrey2 mr10 mt5" name="inputs_label"><%=index+1 %>&nbsp;&nbsp;</label>
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"><%= test.input %></textarea> <textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" <%=not_allow_select ? 'disabled' : '' %>><%= test.input %></textarea>
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"><%= test.output %></textarea> <textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]" <%=not_allow_select ? 'disabled' : '' %>><%= test.output %></textarea>
<% unless not_allow_select %>
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a> <a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
<% if index != 0 %> <% if index != 0 %>
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a> <a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
<% end %> <% end %>
<% end %>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
<% else %> <% else %>
<div class="mt10"> <div class="mt10" style="margin-left:63px;">
<label class="fl mt5" name="inputs_label">1&nbsp;&nbsp;</label> <label class="fl fontGrey2 mr10 mt5" name="inputs_label">1&nbsp;&nbsp;</label>
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]" id="textarea_input_test"></textarea> <textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" id="textarea_input_test"></textarea>
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]" id="textarea_output_test"></textarea> <textarea class="InputBox w265 fl mr5" placeholder="测试输出" name="program[output][]" id="textarea_output_test"></textarea>
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a> <a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% end %> <% end %>
</div> </div>
<div class="mt10">
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测。</span>
<a href="#submit_homework" class="BlueCirBtn fr">确&nbsp;&nbsp;定</a>
<div class="cl"></div>
</div>
</div><!----HomeWorkCon end-->
<script> <script>
$(function(){
var bt=baidu.template;
bt.LEFT_DELIMITER='<!';
bt.RIGHT_DELIMITER='!>';
$("#programHomework").on('click', 'a.icon_add', function(){
var html = bt('t:test-answer-list', null);
$(this).parent('.mt10').after(html);
var inputs = document.getElementsByName("program[input][]");
var outputs = document.getElementsByName("program[output][]");
var inputs_labels = document.getElementsByName("inputs_label");
for(var j= 0; j<inputs_labels.length; j++){
$(inputs_labels[j]).html(j + 1 + "&nbsp;&nbsp;" );
}
if (inputs.length == outputs.length) {
for (var i=0; i<inputs.length; i++) {
autoTextarea2(inputs[i], outputs[i]);
autoTextarea2(outputs[i], inputs[i]);
}
}
$(inputs[inputs.length - 1]).focus();
});
$("#programHomework").on('click', 'a.icon_remove', function(){
$(this).parent('.mt10').remove();
});
});
<% if !edit_mode %> <% if !edit_mode %>
var text = document.getElementById("textarea_input_test"); var text = document.getElementById("textarea_input_test");
var text2 = document.getElementById("textarea_output_test"); var text2 = document.getElementById("textarea_output_test");

View File

@ -10,11 +10,11 @@ $("#homework_attachments").html("<%= escape_javascript(render :partial => 'users
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>"); homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
//$("input[name='homework_type']").val("<%#= @homework.homework_type%>"); //$("input[name='homework_type']").val("<%#= @homework.homework_type%>");
<% if @homework_detail_programing %> <% if @homework_detail_programing %>
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); $("#homeworkSetting").removeClass("undis");
$("#BluePopupBox a.BlueCirBtn").click(); $("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
<% elsif @homework_detail_group %> <% elsif @homework_detail_group %>
$('span.group_detail_info').text('分组人数:<%=@homework_detail_group.min_num %>-<%=@homework_detail_group.max_num %> 人'); $("#homeworkSetting").removeClass("undis");
$("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>"); $("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
$("#GroupPopupBox a.group_save_btn").click();
<% end %> <% end %>
$("#homework_type_option option[value='<%=@homework.homework_type %>']").attr("selected",true);
$("#homework_editor").show(); $("#homework_editor").show();

View File

@ -358,7 +358,7 @@ zh:
# 意见反馈 # 意见反馈
# #
label_feedback: 意见反馈 label_feedback: 意见反馈
label_feedback_tips: "请在此发布平台问题和建议,或直接加入答疑群,谢谢!" label_feedback_tips: "在此输入对平台问题和建议您也可以通过QQ、微信留言,谢谢!"
label_technical_support: "QQ 在线支持:" label_technical_support: "QQ 在线支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!" label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "该帖来自用户反馈:)" label_feedback_value: "该帖来自用户反馈:)"

View File

@ -0,0 +1,6 @@
class AddIndexToStudentWorksScores < ActiveRecord::Migration
def change
add_index :student_works_scores, :user_id, name: 'user_id'
add_index :student_works_scores, :student_work_id, name: 'student_work_id'
end
end

View File

@ -0,0 +1,9 @@
class UpdateUserExtensions < ActiveRecord::Migration
def up
ues = UserExtensions.where(:school_id => 0)
ues.update_all(:school_id => nil)
end
def down
end
end

View File

@ -0,0 +1,13 @@
class UpdateIssueAuthor < ActiveRecord::Migration
def up
begin
issue = Issue.find(9377)
issue.update_column(:author_id, 15341)
rescue Exception => e
puts e
end
end
def down
end
end

View File

@ -0,0 +1,13 @@
class UpdateAttachPublicForMessage < ActiveRecord::Migration
def up
begin
attachments = Attachment.where(:container_type => "Message", :is_public => 0)
attachments.update_all(:is_public => 1)
rescue Exception => e
puts e
end
end
def down
end
end

View File

@ -172,6 +172,72 @@ module Redmine
{:files => saved_attachments, :unsaved => unsaved_attachments} {:files => saved_attachments, :unsaved => unsaved_attachments}
end end
# 扩展方法,因为类型太多,为了不影响其它的
# 最终需要形成一个方法
def save_attachments_containers(attachments, author, is_public)
# 清除临时文件
if attachments
tempAttach = attachments[:dummy]
if tempAttach && tempAttach[:file]
attachments.delete(:dummy)
end
end
if attachments.is_a?(Hash)
attachments = attachments.stringify_keys
attachments = attachments.to_a.sort {|a, b|
if a.first.to_i > 0 && b.first.to_i > 0
a.first.to_i <=> b.first.to_i
elsif a.first.to_i > 0
1
elsif b.first.to_i > 0
-1
else
a.first <=> b.first
end
}
attachments = attachments.map(&:last)
end
if attachments.is_a?(Array)
attachments.each do |attachment|
if attachment.is_a?(Hash)
a = nil
file = attachment['file']
token = attachment['token']
t = file && file.size > 0
if file && file.size > 0
a = Attachment.create(:file => file, :author => author)
elsif token
# 通过token值找到对应的attachment
a = Attachment.find_by_token_only(token)
if a
a.filename = attachment['filename'] unless attachment['filename'].blank?
a.content_type = attachment['content_type']
end
end
end
if a && !attachment['is_public_checkbox']
# 考虑到更新操作,所以全部设置为公开,私有项目、课程是不能访问的
a.is_public = true
elsif a && attachment['is_public_checkbox']
a.is_public = true
end
set_attachment_public(a) if a
next unless a
a.description = attachment['description'].to_s.strip
a.attachtype = @curattachment_type
if a.new_record?
unsaved_attachments << a
else
saved_attachments << a
end
end
end
{:files => saved_attachments, :unsaved => unsaved_attachments}
end
def attach_saved_attachments def attach_saved_attachments
saved_attachments.each do |attachment| saved_attachments.each do |attachment|
self.attachments << attachment self.attachments << attachment

View File

@ -11,7 +11,7 @@
<form name="regFrm" novalidate> <form name="regFrm" novalidate>
<div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的姓名全称" maxlength="30" /></div> <div class="course-list-row f13 c-grey3 mt10"><span class="fl ml15 c-grey3">姓名</span><input class="new-class-input ml25" ng-model="lastname" placeholder="请输入您的真实姓名" maxlength="30" /></div>
<div class="course-list-row f13 c-grey3 mt10" style="height:auto;"> <div class="course-list-row f13 c-grey3 mt10" style="height:auto;">
<div class="mt5" style="line-height:20px"> <div class="mt5" style="line-height:20px">
<span class="ml15 c-grey3">性别</span> <span class="ml15 c-grey3">性别</span>
@ -33,6 +33,12 @@
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span> <span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
</div> </div>
</div> </div>
<div ng-show="lastname == '' " class="f12 c-grey6 mt10 ml15">
<span class="f13 c-grey3">提示</span>
<ul class="mb15 mt5 ml10 new-tip">
<li><span class="project-intro-dot"></span>您尚未完善您的基本资料,完善后可使用更多功能</li>
</ul>
</div>
<div class="bottom-tab-wrap mt10"> <div class="bottom-tab-wrap mt10">
<a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a> <a ng-click="cancel()" class="weixin-tab c-grey border-top">取消</a>
<a ng-click="confirm(regFrm)" ng-class="[{'btn-disabled':!regFrm.$valid} ]" class="weixin-tab link-blue2 border-top">确定</a> <a ng-click="confirm(regFrm)" ng-class="[{'btn-disabled':!regFrm.$valid} ]" class="weixin-tab link-blue2 border-top">确定</a>

View File

@ -4,13 +4,13 @@
<form name="loginFrm" novalidate> <form name="loginFrm" novalidate>
<div class="blue-title">绑定<span class="f13 blue-title-sub" ng-click="goReg()">注册</span></div> <div class="blue-title">绑定<span class="f13 blue-title-sub" ng-click="goReg()">注册</span></div>
<div class="input-box-wrap login-wrap mt30"> <div class="input-box-wrap login-wrap mt30">
<input name="login" ng-model="user.login" required class="input-box" placeholder="请输入电子邮箱地址或登录名" /> <input name="login" ng-model="user.login" required class="input-box" placeholder="请输入平台上的注册邮箱或登录名" />
<div ng-show="loginFrm.$submitted || loginFrm.login.$touched"> <div ng-show="loginFrm.$submitted || loginFrm.login.$touched">
<span ng-show="loginFrm.login.$error.required" class="c-red fl f12">电子邮箱地址或登录名不能为空</span> <span ng-show="loginFrm.login.$error.required" class="c-red fl f12">电子邮箱地址或登录名不能为空</span>
</div> </div>
</div> </div>
<div class="input-box-wrap login-wrap mt10 mb20"> <div class="input-box-wrap login-wrap mt10 mb20">
<input class="input-box" placeholder="请输入密码" name="password" type="password" ng-model="user.password" required /> <input class="input-box" placeholder="请输入帐号的登录密码" name="password" type="password" ng-model="user.password" required />
<div ng-show="loginFrm.$submitted || loginFrm.password.$touched"> <div ng-show="loginFrm.$submitted || loginFrm.password.$touched">
<span ng-show="loginFrm.password.$error.required" class="c-red fl f12">密码不能为空</span> <span ng-show="loginFrm.password.$error.required" class="c-red fl f12">密码不能为空</span>
</div> </div>

BIN
public/images/QQ_Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
public/images/dialog.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -815,6 +815,58 @@ function regex_course_id(){
} }
} }
//验证分组作业的参数
function regex_group_attr(){
var min = $.trim($("#min_num").val());
var max = $.trim($("#max_num").val());
var regex = /^\d+$/;
if(!regex.test(min) || parseInt(min) <= 0) {
$("#min_max_num_notice").html("人数为正整数");
$("#min_max_num_notice").show();
$("#min_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if(!regex.test(max) || parseInt(max) <= 0) {
$("#min_max_num_notice").html("人数为正整数");
$("#min_max_num_notice").show();
$("#max_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if(parseInt(min) > parseInt(max)) {
$("#min_max_num_notice").html("最小人数不得大于最大人数");
$("#min_max_num_notice").show();
$("#max_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if ($("#base_on_project").is(":checked")) {
$("#base_on_project").val(1);
} else {
$("#base_on_project").val(0);
}
return true;
}
//验证编程作业的参数
function regex_program_attr() {
var result = true;
$.each($('#programHomework textarea.InputBox'), function(i, val){
if (result && $(val).val().length<=0) {
$(val)[0].focus();
result = false;
}
});
return result;
}
function regexHomeworkCommonName() function regexHomeworkCommonName()
{ {
var name = $.trim($("#homework_attach_name").val()); var name = $.trim($("#homework_attach_name").val());

View File

@ -35,7 +35,7 @@
//show //show
show_btn.bind("click",function() { show_btn.bind("click",function() {
$(this).animate({width: '0px'},"fast"); $(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast"); sideContent.stop(true, true).delay(200).animate({ width: '180px'},"fast");
cookiesave('minStatue','false','','',''); cookiesave('minStatue','false','','','');
}); });
}); //end this.each }); //end this.each
@ -83,7 +83,7 @@ $(function(){
$("#scrollsidebar").css("display","none"); $("#scrollsidebar").css("display","none");
return; return;
} }
$(".closeSidebar").click(function(){ $(".closeSidebar, .hide-side-bar").click(function(){
$(".show_btn").css("display","none"); $(".show_btn").css("display","none");
$("#scrollsidebar").css("display","none"); $("#scrollsidebar").css("display","none");
return false; return false;

View File

@ -194,6 +194,58 @@ function regex_course_id(){
} }
} }
//验证分组作业的参数
function regex_group_attr(){
var min = $.trim($("#min_num").val());
var max = $.trim($("#max_num").val());
var regex = /^\d+$/;
if(!regex.test(min) || parseInt(min) <= 0) {
$("#min_max_num_notice").html("人数为正整数");
$("#min_max_num_notice").show();
$("#min_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if(!regex.test(max) || parseInt(max) <= 0) {
$("#min_max_num_notice").html("人数为正整数");
$("#min_max_num_notice").show();
$("#max_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if(parseInt(min) > parseInt(max)) {
$("#min_max_num_notice").html("最小人数不得大于最大人数");
$("#min_max_num_notice").show();
$("#max_num").focus();
return false;
} else {
$("#min_max_num_notice").html("");
$("#min_max_num_notice").hide();
}
if ($("#base_on_project").is(":checked")) {
$("#base_on_project").val(1);
} else {
$("#base_on_project").val(0);
}
return true;
}
//验证编程作业的参数
function regex_program_attr() {
var result = true;
$.each($('#programHomework textarea.InputBox'), function(i, val){
if (result && $(val).val().length<=0) {
$(val)[0].focus();
result = false;
}
});
return result;
}
//老师导入作业时查询作业 //老师导入作业时查询作业
function search_homework_by_name(url){ function search_homework_by_name(url){
$.get( $.get(

View File

@ -155,7 +155,7 @@ app.controller('ProjectController', ['$scope', 'config','$http','$timeout', 'aut
vm.currentTab = rms.get('tab_num'); vm.currentTab = rms.get('tab_num');
// //
if(!vm.currentTab){ if(!vm.currentTab || !vm.project){
$http.get(config.apiUrl+ 'projects/'+projectid+"?token="+auth.token()).then( $http.get(config.apiUrl+ 'projects/'+projectid+"?token="+auth.token()).then(
function(response) { function(response) {
console.log(response.data); console.log(response.data);

View File

@ -36,7 +36,8 @@ app.controller('RegController', ['$scope', '$http', '$location', 'alertService',
vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){ vm.successDialog.showMessage("提示","注册且绑定微信成功", function(){
// $location.path("/activities"); // $location.path("/activities");
// window.WeixinJSBridge.call('closeWindow'); // window.WeixinJSBridge.call('closeWindow');
wx.closeWindow(); // wx.closeWindow();
$location.path("/edit_userinfo");
}); });
} }
}, function (response) { }, function (response) {

View File

@ -270,6 +270,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w350{ width:350px;} .w350{ width:350px;}
.w610{ width:610px;} .w610{ width:610px;}
.w600{ width:600px !important;} .w600{ width:600px !important;}
.w603{ width:603px !important;}
.w606{ width:606px; } .w606{ width:606px; }
.w620{ width:620px;} .w620{ width:620px;}
.w680{ width: 680px;} .w680{ width: 680px;}
@ -607,7 +608,6 @@ a:hover.sy_btn_blue{ background: #2788d0;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;} .is_public_checkbox{margin-left: 15px;margin-right: 10px;}
.author_name{color: #3ca5c6 !important;} .author_name{color: #3ca5c6 !important;}
.ke-container-default{max-width: 100%;} .ke-container-default{max-width: 100%;}
.borderRadius {border-radius:5px;}
/*状态提示图标*/ /*状态提示图标*/
.success-icon {background:url("/images/icons_ziliao.png") 0 -28px no-repeat; padding-left:25px;} .success-icon {background:url("/images/icons_ziliao.png") 0 -28px no-repeat; padding-left:25px;}

View File

@ -234,6 +234,7 @@ a.hworkExport {background:url(/images/homepage_icon2.png) -10px -401px no-repeat
a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;} a.hworkSetting {background:url(/images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;} .hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;} .infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
.g_infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; left:0; z-index:99;}
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;} .problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;} .rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;} .hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
@ -515,9 +516,6 @@ a.blueCir{ display:inline-block; padding:2px 5px; background-color:#ffffff;borde
a:hover.blueCir{ background:#3598db; color:#fff;} a:hover.blueCir{ background:#3598db; color:#fff;}
.proList {background-color:#eaeaea; padding:5px 10px; display:block; max-width:655px; float:left;} .proList {background-color:#eaeaea; padding:5px 10px; display:block; max-width:655px; float:left;}
.borderRadius {border-radius:5px;}
.tac {text-align:center;}
.reCon{ margin:5px; width:710px;} .reCon{ margin:5px; width:710px;}
.reTop{width:710px; height:40px; background:#eaeaea; padding:5px;} .reTop{width:710px; height:40px; background:#eaeaea; padding:5px;}
.filesTag{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;cursor: pointer } .filesTag{ width:auto;background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 5px; float:left; margin-right:10px;cursor: pointer }

View File

@ -116,36 +116,32 @@ a.resourcesTypeUser {background:url(../images/homepage_icon.png) -178px -453px n
.softwareIcon {background:url(/images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;} .softwareIcon {background:url(/images/hwork_icon.png) -5px -254px no-repeat; padding-left:23px;}
/*意见反馈*/ /*意见反馈*/
.qr-code-border {border:2px solid #269ac9;}
html{ overflow-x:hidden;} html{ overflow-x:hidden;}
.scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; } .scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; }
.side_content{width:154px; height:auto; overflow:hidden; float:left; } .side_content{width:180px; height:auto; overflow:hidden; float:left;}
.side_content .side_list {width:154px;overflow:hidden;} .side_content .side_list {width:180px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:200px; cursor:pointer;} .show_btn{ width:0; height:100px; overflow:hidden; float:left; margin-top:200px; cursor:pointer; background-color:#fff;}
.show_btn span { display:none;} .close_btn{cursor:pointer;}
.close_btn{width:24px;height:24px;cursor:pointer;} .side_title,.side_bottom {background:url(/images/sidebar_bg.png) no-repeat; }
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; }
.side_title {height:35px;} .side_title {height:35px;}
.side_bottom { height:8px;} .side_bottom { height:8px;}
.side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;} .side_center {font-family:Verdana, Geneva, sans-serif; padding:0px 12px; font-size:12px;}
.close_btn { float:right; display:block; width:21px; height:16px; margin:9px 10px 0 0; _margin:16px 5px 0 0;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;} .side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;}
.msgserver { margin:10px 0 0px 5px;} .msgserver { margin:10px 0 0px 5px;}
.msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; } .msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -110px; padding-left:22px; display:block; height:24px; }
.opnionText{box-shadow:none; width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;} .opnionText{box-shadow:none; width:150px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;overflow:auto; background-attachment:fixed;border-style:solid;}
a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;} a.opnionButton{ display:block; background:#269ac9; width:130px; height:26px; margin-top:5px; text-align:center; padding-top:0px; color:#fff;}
a.opnionButton:hover{background: #297fb8; } a.opnionButton:hover{background: #297fb8; }
/* blue skin as the default skin */ /* blue skin as the default skin */
.side_title {background-position:-195px 0;} .side_title {background-position:-195px 0;}
.side_center {background:url(/images/blue_line.png) repeat-y center; } .side_center {background:url(/images/blue_line.png) repeat-y center; }
.side_bottom {background-position:-195px -50px;} .side_bottom {background-position:-195px -50px;}
.close_btn {background-position:-44px 0;}
.close_btn:hover {background-position:-66px 0;}
.show_btn {background-position:-119px 0;}
.msgserver a {color:#269ac9; } .msgserver a {color:#269ac9; }
.msgserver a:hover { text-decoration:underline; } .msgserver a:hover { text-decoration:underline; }
.closeSidebar {background:url(/images/sidebar_bg.png) 0px -112px no-repeat; width:28px; height:18px; margin-top:65px; position:absolute;} .closeSidebar {width:26px; height:18px; line-height:18px; vertical-align:middle; border-top:1px solid #aaa; color:#aaa; display:block;}
.side-bar-circle {width:13px; height:13px; font-size:14px; color:#aaa; border:1px solid #aaa; border-radius:50%; display:block; font-weight:bold; position:relative; cursor:pointer;}
.side-bar-content {position:absolute; top:-5px; left:1px;}
.hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .hiddent{ overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
@ -1459,3 +1455,7 @@ a:hover.sy_btn_green{ background: #51a74f;}
.invite_code_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;} .invite_code_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;}
.invite_code_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;} .invite_code_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;}
/*flex布局*/
.flex-container {display:flex;}
.flex-cell {flex:1;}
.flex-cell:last-child {text-align:right;}

View File

@ -596,7 +596,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
.user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;} .user_sub_menu li a:hover,.user_sub_menu li a:target { color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
.user_sub_menu li a:hover,.user_sub_menu li a:target{} .user_sub_menu li a:hover,.user_sub_menu li a:target{}
.user_sub_menu li:last-child a { } .user_sub_menu li:last-child a { }
.user_sub_menu li p {padding:0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;} .user_sub_menu li p {padding:0 15px 0 25px; border:1px solid #e5e5e5; border-bottom:none; background:#f8f8f8;}
.user_sub_menu li p:hover {background:#fff;} .user_sub_menu li p:hover {background:#fff;}
.user_sub_menu li p:hover a {background:#fff;} .user_sub_menu li p:hover a {background:#fff;}
.user_sub_menu li p:hover,.user_sub_menu li p:target {color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;} .user_sub_menu li p:hover,.user_sub_menu li p:target {color:#3b94d6; background:#fff url(/images/user/user_navmore_icons.png) 0px 0px no-repeat;}
@ -617,6 +617,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
width:20px; width:20px;
height:20px; height:20px;
background:url(/images/user/icons_user_leftnav.png) 0px -34px no-repeat; background:url(/images/user/icons_user_leftnav.png) 0px -34px no-repeat;
z-index:99;
} }
a.user_navmorebox{ display:block; width:238px; height:20px; position:relative; background:#f8f8f8;border:1px solid #e5e5e5; border-bottom:none;} a.user_navmorebox{ display:block; width:238px; height:20px; position:relative; background:#f8f8f8;border:1px solid #e5e5e5; border-bottom:none;}
a:hover.user_navmorebox{ background:#fff;} a:hover.user_navmorebox{ background:#fff;}
@ -639,6 +640,7 @@ a.user_navmorebox .user_icons_closeclass{
background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat; background:url(/images/user/icons_user_leftnav.png) -25px -347px no-repeat;
} }
.show-all-sub {position:absolute; top:18px; right:15px;} .show-all-sub {position:absolute; top:18px; right:15px;}
.sub-menu-title {position:absolute; border:1px solid #ddd; background-color:#fff; padding:2px 5px; z-index:99; white-space:nowrap; left:25px; top:35px; display:none;}
/* 个人主页左侧导航更多功能 */ /* 个人主页左侧导航更多功能 */
.user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;} .user_navmore_box {position:absolute; width:15px; height:15px; right:13px; top:17px; cursor:pointer;}
.user_navmore_box ul li:hover ul {display:block; } .user_navmore_box ul li:hover ul {display:block; }