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/configuration.yml
/config/additional_environment.rb
/config/oneapm.yml
/config/environments/production.rb
/files/*

View File

@ -36,7 +36,7 @@ module Mobile
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(','))
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 + ")"
if container_type == "Course"

View File

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

View File

@ -73,6 +73,12 @@ module Mobile
elsif ac.container_type == "Blog"
"发表博客"
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
if ac.container_type == "Course"
ac.container_id
@ -145,6 +151,7 @@ module Mobile
act_expose :latest_update #最新更新时间
act_expose :course_project_id #课程/项目ID
act_expose :course_project_name #课程/项目名字
act_expose :syllabus_title #课程名字
act_expose :activity_type_name #课程问答区/项目缺陷等
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"

View File

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

View File

@ -894,12 +894,15 @@ class CoursesController < ApplicationController
# return
# 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)
create_course_messages.update_all(:viewed => true)
course_request_messages = CourseMessage.where(:user_id => User.current.id, :course_id => @course.id, :course_message_type => ["CourseRequestDealResult", "Course"], :viewed => false)
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.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.update_all(:viewed => true)
course_activities = @course.course_activities
@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.end_time = params[:homework_common][:end_time] || Time.now
@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 == 1
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
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new
@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 == 1
@homework_detail_programing.ta_proportion = 0.6
@ -120,8 +129,8 @@ class HomeworkCommonController < ApplicationController
end
end
@homework.homework_tests.delete_all
inputs = params[:program][:input]
@homework.homework_tests.delete_all if params[:program]
inputs = params[:program][:input] if params[:program]
if Array === inputs
inputs.each_with_index do |val, i|
@homework.homework_tests << HomeworkTest.new(
@ -136,12 +145,12 @@ class HomeworkCommonController < ApplicationController
if @homework.homework_type == 3
@homework.homework_detail_group ||= HomeworkDetailGroup.new
@homework_detail_group = @homework.homework_detail_group
@homework_detail_group.min_num = params[:min_num].to_i
@homework_detail_group.max_num = params[:max_num].to_i
@homework_detail_group.base_on_project = params[:base_on_project].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 if params[:max_num]
@homework_detail_group.base_on_project = params[:base_on_project].to_i if params[:base_on_project]
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
homework_detail_manual.save if homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing

View File

@ -92,7 +92,13 @@ class MessagesController < ApplicationController
@message.board = @board
@message.safe_attributes = params[:message]
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
# 更新kindeditor上传的图片资源所有者
if params[:asset_id]

View File

@ -1,3 +1,4 @@
#encoding: utf-8
# Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
@ -212,6 +213,19 @@ class NewsController < ApplicationController
@news.safe_attributes = params[:news]
@news.save_attachments(params[:attachments])
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]
ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids,@news.id,OwnerTypeHelper::NEWS

View File

@ -325,27 +325,27 @@ class ProjectsController < ApplicationController
end
# 版本库统计图
unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# 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_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
@a_uname = rep_statics_commit.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_add = rep_statics_code.map {|s| s.add.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 }
g = Gitlab.client
begin
gid = @project.gpid
g_project = g.project(gid)
g_branch = g_project.default_branch.to_s
rescue =>e
logger.error("get default branch failed: " + e)
end
@rev = g_branch.nil? ? "master" : g_branch
end
# unless @project.gpid.nil? || @project.project_score.changeset_num == 0
# # 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_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
# @a_uname = rep_statics_commit.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_add = rep_statics_code.map {|s| s.add.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 }
# g = Gitlab.client
# begin
# gid = @project.gpid
# g_project = g.project(gid)
# g_branch = g_project.default_branch.to_s
# rescue =>e
# logger.error("get default branch failed: " + e)
# end
# @rev = g_branch.nil? ? "master" : g_branch
# end
# 根据对应的请求,返回对应的数据
respond_to do |format|
format.html

View File

@ -338,41 +338,17 @@ class StudentWorkController < ApplicationController
end
def index
# 作业消息状态更新
@homework.course_messages.each do |homework_message|
if User.current.id == homework_message.user_id && homework_message.viewed == 0
homework_message.update_attributes(:viewed => true) if homework_message.viewed == 0
end
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
# 作业消息状态更新?
homeworkcommon_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_message_id => @homework.id, :course_message_type => "HomeWorkCommon")
homeworkcommon_messages.update_all(:viewed => true)
studentwork_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_id => @homework.course, :course_message_type => "StudentWork")
studentwork_messages.update_all(:viewed => true)
# 作品打分消息状态更新
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_score.update_attributes(:viewed => true) if studentworks_score.viewed == 0
end
studentworks_scores.update_all(:viewed => true)
# 作品评论消息状态更新
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|
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
journals_for_teacher.update_all(:viewed => true)
##################################################################################################################
@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")
@ -480,7 +456,7 @@ class StudentWorkController < ApplicationController
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
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
@show_all = true
elsif User.current.member_of_course?(@course)
@ -571,7 +547,7 @@ class StudentWorkController < ApplicationController
@student_work = StudentWork.new
#end
respond_to do |format|
format.html{ render :layout => "new_base_user"}
format.html{ render :layout => "base_courses"}
end
end
@ -657,7 +633,7 @@ class StudentWorkController < ApplicationController
render_403
else
respond_to do |format|
format.html{ render :layout => "new_base_user"}
format.html{ render :layout => "base_courses"}
end
end
end
@ -844,17 +820,29 @@ class StudentWorkController < ApplicationController
render_attachment_warning_if_needed(@new_score)
if @new_score.save
if @homework.homework_type == 3
@is_group_leader = !@work.student_work_projects.empty?
end
case @new_score.reviewer_role
when 1 #教师评分:最后一个教师评分为最终评分
@work.teacher_score = @new_score.score
if @is_group_leader
add_score_to_member @work, @homework, 1, 'teacher_score', @new_score.score
end
when 2 #教辅评分 教辅评分显示平均分
#@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
ts_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 2 AND score IS NOT NULL ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.teaching_asistant_score = ts_score.first.score.nil? ? nil : ts_score.first.score.try(:round, 2).to_f
if @is_group_leader
add_score_to_member @work, @homework, 2, 'teaching_asistant_score', @work.teaching_asistant_score
end
when 3 #学生评分 学生评分显示平均分
#@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
stu_score = StudentWorksScore.find_by_sql("SELECT AVG(score) AS score FROM (SELECT * FROM (SELECT * FROM student_works_scores WHERE student_work_id = #{@work.id} AND reviewer_role = 3 ORDER BY created_at DESC) AS t GROUP BY user_id) AS a")
@work.student_score = stu_score.first.score.try(:round, 2).to_f
if @is_group_leader
add_score_to_member @work, @homework, 3, 'student_score', @work.student_score
end
end
@homework.update_column('updated_at', Time.now)
update_course_activity(@homework.class,@homework.id)
@ -1577,10 +1565,6 @@ class StudentWorkController < ApplicationController
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

View File

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

View File

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

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))
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
# 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
type = []
i = 0

View File

@ -224,19 +224,6 @@ module ProjectsHelper
def get_projects_by_tag(tag_name)
Project.tagged_with(tag_name).order('updated_on desc')
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

View File

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

View File

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

View File

@ -62,7 +62,7 @@ class News < ActiveRecord::Base
:author_key => :author_id
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_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)
end
## fq
def act_as_activity
self.acts << Activity.new(:user_id => self.author_id)
end
# Time 2015-02-27 15:48:17
# Author lizanle
# Description 公用表中也要记录
def act_as_forge_activity
# 如果是project为空那么是课程相关的不需要保存
if self.project
self.forge_acts << ForgeActivity.new(:user_id => self.author_id,
:project_id => self.project.id)
self.forge_acts << ForgeActivity.new(:user_id => self.author_id, :project_id => self.project.id)
end
end
@ -167,17 +161,17 @@ class News < ActiveRecord::Base
# 消息发送原则:除了消息的发布者,课程的其它成员都能收到消息提醒
def act_as_system_message
if self.course
self.course.members.each do |m|
if m.user_id != self.author_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=#{self.course_id}").count
if count == 0
ws = WechatService.new
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, "点击查看通知详情"
end
end
end
# self.course.members.each do |m|
# if m.user_id != self.author_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=#{self.course_id}").count
# if count == 0
# ws = WechatService.new
# 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, "点击查看通知详情"
# end
# end
# end
else
if !self.project.nil?
self.project.members.each do |m|
@ -198,7 +192,7 @@ class News < ActiveRecord::Base
def contain_news_message
self.course.members.each do |m|
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

View File

@ -170,12 +170,6 @@ class StudentWork < ActiveRecord::Base
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

View File

@ -332,7 +332,7 @@ class CoursesService
# unless (course.is_public == 1 || current_user.member_of_course?(course) || current_user.admin?)
# raise '403'
# 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
#创建课程
@ -554,8 +554,10 @@ class CoursesService
uid = user.id
type = "review_class_member"
end
name = course.syllabus.nil? ? course.name : course.syllabus.title+""+course.name
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
@ -650,8 +652,9 @@ class CoursesService
rolename = role_ids.include?("7") ? "助教" : "教师"
content = current_user.show_name + "申请以"+rolename+"身份加入班级,等待您的审批。"
name = course.syllabus.nil? ? course.name : course.syllabus.title+""+course.name
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
#--------------------------------------------

View File

@ -69,7 +69,8 @@ class SyllabusesService
if count == 0
ws = WechatService.new
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

View File

@ -17,12 +17,13 @@
<div class="cl"></div>
<li class="ml45">
<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>
</li>
<div class="cl"></div>
<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 mt10 mb10 fontGrey2" style="max-width: 544px;">班级是一个由教师、助教(教辅)和学生组成的临时的教学群体,在规定的时间内(如一个学期)完成一门课程规定的教学任务。本质上,一门课程就是一个教学计划。</li>
<li class="ml45">
<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">

View File

@ -41,6 +41,20 @@
<!-- 老师身份才可以发布作业 -->
<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| %>
<input type="text" name="is_in_course" class="none" value="<%= @is_in_course%>"/>
<input type="text" name="course_activity" class="none" value="<%= @course_activity%>"/>

View File

@ -3,13 +3,13 @@
$("#homework_name").val("");
$("#homework_publish_time").val("");
$("#homework_end_time").val("");
document.getElementById("anonymous_comment").checked = true;
$("#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_description_editor.html("");
$("#homework_name_span").text("");
$("#homework_end_time_span").text("");
$("#homework_end_time_span").text("");
$("#homework_course_id_span").text("");
$("#homework_editor").toggle();
}

View File

@ -1,41 +1,51 @@
<%= javascript_include_tag "feedback" %>
<div class="scrollsidebar" id="scrollsidebar">
<div class="scrollsidebar pr" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
<div class="qr-code-border borderBottomNone"><img src="/images/wechat/trustie_QR.jpg" width="150" style="display:block;" /> </div>
<div class="side_title">
<a title="<%= l(:button_hide) %>" class="close_btn">
<span>
</span>
</a>
<div style="background-color:#fff; padding:10px 0; border:1px solid #aaa; border-bottom:none;">
<span class="fontGrey3 f14 ml40" style="vertical-align:top;">问题和建议</span>
<span class="hide-side-bar side-bar-circle fr mt3 mr10" title="关闭"><span class="side-bar-content">×</span></span>
<span class="close_btn side-bar-circle fr mt3 mr10" title="隐藏"><span class="side-bar-content" style="left:4px;"></span></span>
</div>
<div class="side_center">
<div class="custom_service">
<div style="background-color:#fff; border-left:1px solid #aaa; border-right:1px solid #aaa;">
<div class="custom_service tac">
<% get_memo %>
<%= 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) %>
<label class="c_grey">您还能输入<span id="textCount" class="c_orange">50</span>个字符</label>
<a href="javascript:void(0);" class="opnionButton" style=" color:#fff;height:21px" id="" onclick="f_submit();">
<span class="c_grey fl ml10">还能输入<span id="textCount" class="c_orange">50</span>个字符</span>
<a href="javascript:void(0);" class="linkBlue f14 fr mr10" style="height:21px;" id="" onclick="f_submit();">
<%= l(:label_submit)%>
</a>
<div class="cl"></div>
<% end %>
</div>
<div class="mt5" style="color: #269ac9;cursor: default">
<!--<a target="hiddentab" href="http://wpa.qq.com/msgrd?v=1&uin=1554253403&site=qq&menu=yes" style="color: #269ac9;">-->
<%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="Trustie师姐师兄答疑群" title="Trustie师姐师兄答疑群"></a>
</div>
</div>
<div class="side_bottom"></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;">-->
<%#= l(:label_technical_support) %>
<!--白&nbsp;&nbsp;&nbsp;羽</a> http://shang.qq.com/wpa/qunwpa?idkey=4fe2d63a4527cddce038f04f0b1d728a62082074fb4a74870a5444ee1a6910ad-->
<!--<p style="text-align: center"> 请加入师姐师兄答疑群</p> <p style="text-align: center"></p>-->
<!--<a href="mqqapi://card/show_pslcard?src_type=internal&version=1&uin=173184401&card_type=group&source=qrcode">QQ群号173184401</a>-->
<a target="_blank" href="http://shang.qq.com/wpa/qunwpa?idkey=fb938b1f6f991fc100f3d32b6ef38b7888dd4097c71d0eb8b239eaa8749a6afd"><img src="/images/QQ_Logo.png" width="30" style="cursor:default; border:1px solid #ddd; padding:20px; cursor:pointer;" /></a>
<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 class="show_btn">
<span><%= l(:label_submit)%></span>
<a href="javascript:void(0)" class="closeSidebar"></a>
<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>

View File

@ -2,10 +2,17 @@
<li>
<span class="user_icons_class"></span>
<% 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)+'' %>">
<%= link_to course.syllabus.title, syllabus_path(course.syllabus_id), :target => '_blank', :class => 'hidden', :style => "max-width:85px; display:inline-block;"%>
<p href="javascript:void(0);" id="show_course_<%= course.id %>" class="course_list_menu pr" >
<% 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>
<%= 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>
<%#= 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)+""%>
@ -106,11 +113,25 @@
}
$(".course_list_menu").each(function(){
var courseWidth = $(this).children().eq(0).width();
var classWidth = 170 -courseWidth;
var courseWidth = $(this).children().eq(0).children().width();
var classWidth = $(this).children().eq(2).children().width();
var newClassWidth = 182 - courseWidth;
var newCourseWidth = 182 - classWidth;
console.log(courseWidth, classWidth);
if(courseWidth < 80){
$(this).children().eq(2).css("max-width",classWidth + "px");
if(courseWidth < 91 && classWidth > 91){
$(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>

View File

@ -90,7 +90,7 @@
</div>
<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="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>
<script type="text/javascript">
$(function(){

View File

@ -29,17 +29,6 @@
<!--CONTENT LIST-->
</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} %>
</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,89 +1,73 @@
<tr class="hworkListRow" id="student_work_<%= student_work.id%>">
<td class="none"><a name="<%= student_work.id%>"></a></td>
<td class="hworkList40 pl5 pr5" id="work_num_<%=student_work.id %>"><%=index + 1 %></td>
<td class="hworkPortrait pr10 float-none">
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40",:style => "display:block;"),user_activities_path(student_work.user)) %>
</td>
<% 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)%>');">
<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? %>
<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))%>
</td>
<% else %>
<td class="<%=@homework.anonymous_comment == 1 ? 'hworkPrName2' : 'hworkPrName'%> student_work_<%= student_work.id%>" title="该项目是私有的">
<%= student_work.project.name %>
</td>
<% end %>
<% elsif @homework.homework_detail_group.base_on_project == 0 %>
<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)%>');">
<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>
<% end %>
<td class="hworkList130 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.created_at && @homework.end_time%>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% 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%>
<td class="hworkList70 <%= score_color student_work.student_score%> student_score_info">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%=format("%.1f",student_work.student_score) %>
<% end %>
<% unless student_work.student_score.nil?%>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>)
<div class="sy_courses_open f14 fontGrey3">
<span class="icons_sy_close fl mr5" title="点击展开/收起详情" style="cursor: pointer;"></span>
<span class="fl" style="width:280px;">
<span class="hidden fl" style="max-width:240px;"><%=student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<% end %>
</span>
<div class="infoNi none">
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count%>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f",student_work.student_score)%>&nbsp;</span>分。
</span>
<% if @homework.homework_detail_group.base_on_project == 1 %>
<span class="ml15 fl">关联项目:</span>
<% if student_work.project.is_public || User.current.member_of?(student_work.project) || User.current.admin? %>
<%= link_to student_work.project.name, project_path(student_work.project.id), :class => 'link-blue fl hidden', :style => "width:200px;", :title => "项目名称"%>
<% else %>
<span class="fontBlue fl hidden" style="width:200px;" title="该项目是私有的"><%= student_work.project.name %></span>
<% end %>
<% end %>
<a href="javascript:void(0)" onclick="show_student_work('<%= student_work_path(student_work)%>');" class="link-blue fr">评分</a>
<div class="cl"></div>
</div>
<div class="fl sy_p_grey">
<span class="fl" style="width:296px;">提交时间:<%=format_date(student_work.commit_time) %></span>
<div class="flex-container fl" style="width:368px;">
<div class="flex-cell">教师:<span class="<%= score_color student_work.teacher_score%>"><%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%></span></div>
<div class="flex-cell">助教:<span class="<%= score_color student_work.teaching_asistant_score%>"><%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%></span></div>
<% if @homework.anonymous_comment == 0 %>
<div class="flex-cell">匿评:
<div class="<%= score_color student_work.student_score%> student_score_info pr" style="display: inline">
<% if student_work.student_score.nil? %>
<span title="该作品未被匿评">未参与</span>
<% else %>
<%= format("%.1f", student_work.student_score) %>
<% end %>
<% unless student_work.student_score.nil? %>
<span class="linkBlue">
(<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>)
</span>
<div class="g_infoNi none">
现共有
<span class="c_red">&nbsp;<%= student_work.student_works_scores.where(:reviewer_role => 3).group_by(&:user_id).count %>&nbsp;</span>
名学生进行了匿评,平均分为
<span class="c_red">&nbsp;<%= format("%.1f", student_work.student_score) %>&nbsp;</span>分。
</div>
<% end %>
</div>
</div>
<% end %>
<div class="flex-cell">成绩:
<% score = student_work.work_score %>
<div class="<%= score_color score%> student_final_scor_info pr" style="display: inline">
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%>
<% unless score.nil?%>
<div class="g_infoNi none width180">
作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
迟交扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
&nbsp;</span>分,
缺评扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
&nbsp;</span>分,
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</td>
<% end %>
<!-- 成绩 -->
<% if student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score %>
<% score = student_work.respond_to?("score") ? student_work.score : student_work.teacher_score %>
<% 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)%>
<% unless score.nil?%>
<div class="infoNi none width180">
作品最终评分为
<span class="c_red">&nbsp;<%= student_work.final_score%>&nbsp;</span>分。
迟交扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.late_penalty %>
&nbsp;</span>分,
缺评扣分
<span class="c_red">&nbsp;
<%= student_work.homework_common && student_work.homework_common.teacher_priority == 1 && student_work.teacher_score ? 0 : student_work.absence_penalty%>
&nbsp;</span>分,
最终成绩为
<span class="c_red">&nbsp;<%= format("%.1f",score<0 ? 0 : score)%>&nbsp;</span>分。
</div>
<% end%>
</td>
<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>
</tr>
</div>
</div>
</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 %>
<% is_my_work = pro && pro.student_work_id == work.id%>
<% end %>
<% is_member_work = @homework.homework_type == 3 && work.student_work_projects.empty? %>
<% if !is_member_work %>
<ul>
<li class="fl" >
<span class="tit_fb">上交时间:</span>
@ -31,8 +33,7 @@
<div class="cl"></div>
<!--<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>
<li>
<span class="tit_fb"> 参与人员:</span>
@ -58,42 +59,55 @@
<%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%>
</li>
<% end %>
<% end%>
<% end%>
<li >
<span class="tit_fb ">内容:</span>
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= work.description.html_safe if work.description%>
</div>
<div class="cl"></div>
</li>
<li >
<span class="tit_fb"> 附件:</span>
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
<% if com_attachments.empty?%>
<li>
<span class="tit_fb ">内容:</span>
<div class="showHworkP break_word upload_img" id="student_work_img_<%=work.id %>">
<%= work.description.html_safe if work.description%>
</div>
<div class="cl"></div>
</li>
<li>
<span class="tit_fb"> 附件:</span>
<% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %>
<% if com_attachments.empty?%>
<span style="color: #999999">尚未提交附件</span>
<% else%>
<% else%>
<div class="fl" style="width: 90%;">
<%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %>
</div>
<% end%>
<div class="cl"></div>
</li>
<li >
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
<% end%>
<div class="cl"></div>
</li>
<li >
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%>
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
<div id="add_student_score_<%= work.id%>" class="mt10 evaluation">
<%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
</div>
<% end%>
<div class="cl"></div>
</li>
<% end%>
<div class="cl"></div>
</li>
</ul>
<div id="revise_attachment">
<%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %>
</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;' : ''%>">
<%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}%>
</div>
<% end%>
<% if is_member_work && student_work_scores.empty? && !@is_teacher %>
<p class="c_red" style="text-align: center">暂无评分</p>
<% end %>
</div>
<div class="cl"></div>
<!---ping_box end--->

View File

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

View File

@ -11,8 +11,18 @@ var num = $("#work_num_<%= @work.id%>").html();
$("#score_list_<%= @work.id%>").removeAttr("style");
<% if @is_teacher %>
$("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);
<% 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}) %>");
$("#work_num_<%= @work.id%>").html(num);
<% end %>
<% else %>
$("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);

View File

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

View File

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

View File

@ -31,9 +31,9 @@
</div>
<div class="ml15 mt10">
<span class="grayTxt">
发布者: <%=(u.try(:realname) != " " ? u.lastname + u.firstname : u.try(:login)) %>
发布者: <%= activity.author.show_name %>
</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=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>

View File

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

View File

@ -43,7 +43,7 @@
</div>
<div class="ml15 mt10 f12">
<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 class="grayTxt">更新:<%= format_time(activity.children.any? ? activity.children.last[:created_on] : activity[:created_on] ) %></span>
<% all_comments = []%>

View File

@ -1,105 +1,108 @@
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<% if User.current.logged? %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
</li>
<li>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</li>
<li>
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
<% unless activity.author.nil? %>
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTo break_word" style="width:620px">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<% if User.current.logged? %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<li>
<%= link_to l(:button_edit), issue_path(activity.id, :edit => 'true'), :class => 'postOptionLink', :accesskey => accesskey(:edit) if activity.editable? && User.current.allowed_to?(:edit_issues, activity.project) %>
</li>
<li>
<% if !defined?(project_id) && !defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(project_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "project_page", :page_id => project_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% elsif defined?(user_id) %>
<%= link_to l(:button_delete), issue_path(activity.id, :page_classify => "user_page", :page_id => user_id), :data => {:confirm => issues_destroy_confirmation_message(activity)}, :method => :delete, :class => 'postOptionLink' if User.current.allowed_to?(:delete_issues, activity.project) %>
<% end %>
</li>
<li>
<%= link_to l(:button_copy), project_copy_issue_path(activity.project, activity), :class => 'postOptionLink' if User.current.allowed_to?(:add_issues, activity.project) %>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<% end %>
<div class="homepagePostTitle break_word">
<% case activity.tracker_id %>
<% when 1%>
<span class="fl" title="缺陷">【缺陷】</span>
<% when 2%>
<span class="fl" title="功能">【功能】</span>
<% when 3%>
<span class="fl" title="支持">【支持】</span>
<% when 4%>
<span class="fl" title="任务">【任务】</span>
<% when 5%>
<span class="fl" title="周报">【周报】</span>
<% end %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
</div>
<% end %>
<div class="homepagePostTitle break_word">
<% case activity.tracker_id %>
<% when 1%>
<span class="fl" title="缺陷">【缺陷】</span>
<% when 2%>
<span class="fl" title="功能">【功能】</span>
<% when 3%>
<span class="fl" title="支持">【支持】</span>
<% when 4%>
<span class="fl" title="任务">【任务】</span>
<% when 5%>
<span class="fl" title="周报">【周报】</span>
<% end %>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
<%= get_issue_priority(activity.priority_id)[1] %>
</span>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo"><span class="fontGrey3">指派给</span>&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
</div>
<div class="homepagePostSubmitContainer">
<div class="homepagePostAssignTo"><span class="fontGrey3">指派给</span>&nbsp;&nbsp;
<% unless activity.assigned_to_id.nil? %>
<% if activity.try(:assigned_to).try(:realname) == ' ' %>
<%= link_to activity.try(:assigned_to), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:assigned_to).try(:realname), user_path(activity.assigned_to_id), :class => "newsBlue mr15" %>
<% end %>
<% end %>
</div>
<div class="homepagePostDeadline fl">
发布时间:
<%=format_time(activity.created_on) %>
</div>
<div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
</div>
<div class="cl"></div>
</div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %>
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<%# 局部刷新修改xissue属性 %>
<% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
<% unless params[:action] == "index" %>
<div id="div_user_issue_detail_<%=activity.id %>">
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
</div>
<% end %>
<% end %>
</div>
<div class="homepagePostDeadline fl">
发布时间:
<%=format_time(activity.created_on) %>
</div>
<div class="homepagePostDate fl ml15">
更新时间:<%= format_time(ForgeActivity.where("forge_act_type='#{activity.class}' and forge_act_id =#{activity.id}").first.updated_at) %>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
</div>
</div>
<div class="cl"></div>
</div>
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id => user_activity_id, :content => activity.description} %>
<div id="intro_content_show_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
<div id="intro_content_hide_<%= user_activity_id %>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
<div class="cl"></div>
<%# 局部刷新修改xissue属性 %>
<% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %>
<% unless params[:action] == "index" %>
<div id="div_user_issue_detail_<%=activity.id %>">
<%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %>
</div>
<% end %>
<% end %>
<div class="cl"></div>
<div class="mt10" style="font-weight:normal;">
<%= render :partial=>"attachments/activity_attach", :locals=>{:activity => activity} %>
<div id="div_user_issue_reply_<%=user_activity_id%>">
<%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
</div>
</div>
<div class="cl"></div>
</div>
<div id="div_user_issue_reply_<%=user_activity_id%>">
<%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
</div>
</div>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>
<script type="text/javascript">
$(function(){
user_card_show_hide();
});
</script>
<% end %>

View File

@ -1,27 +1,27 @@
<span class="f16 fontBlue">分组设置</span>
<a href="javascript:void(0);" class="popClose" title="关闭弹框"></a>
<div class="mt10">
<span class="f14 fontGrey3 mr5">每组最小人数:</span>
<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 id="groupHomework">
<div> <span class="f14 mt5 fl fontGrey3 mr10">分组设置:</span>
<div class="mr50 fl"> <span class="f14 fontGrey3 mr5">每组最小人数:</span>
<input id="min_num" type="text" name="min_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.min_num : 2 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
</div>
<div class="fl"> <span class="f14 fontGrey3 mr5">每组最大人数:</span>
<input id="max_num" type="text" name="max_num" class="markInput" value="<%=(edit_mode && homework.is_group_homework?) ? homework.homework_detail_group.max_num : 10 %>" <%=not_allow_select ? 'disabled' : '' %>/>人
</div>
<span class="c_red undis ml20 mt7 fl" id="min_max_num_notice"></span>
<div class="cl"></div>
<div class="ml80">
<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" <%=not_allow_select ? 'disabled' : '' %>/>
<span class="f14 fontGrey3 mr10">基于项目实施</span>
</label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
</div>
<div class="cl"></div>
</div>
</div>
<div class="mt10">
<span class="f14 fontGrey3 mr5">每组最大人数:</span>
<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>
<p class="c_red undis" id="min_max_num_notice"></p>
<div class="mb10 mt10">
<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"/>
<span class="f14 fontGrey3 mr10">基于项目实施</span>
</label>
<p class="c_red">提醒勾选后各小组必须在Trustie平台创建项目教师可随时观察平台对各小组最新进展的实时统计</p>
</div>
<div class="courseSendSubmit">
<a href="javascript:void(0);" class="group_save_btn sendSourceText">确定</a>
</div>
<div class="courseSendCancel">
<a href="javascript:void(0);" class="sendSourceText linkGrey6" id="cancel_group">取消</a>
</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) -->
<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 %>
<% 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>
<% 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 %>
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
@ -5,14 +6,31 @@
<script type="text/javascript">
var first_click = true;
$(function(){
$("#homework_type_option").on("change",function(){
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{
$("#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',true);
} else {
$("#anonymous_comment").attr('checked',false);
} else {
$("#anonymous_comment").attr('checked',true);
}
if($.trim($("#base_on_project").val()) == 1) {
$("#base_on_project").attr('checked','checked');
}
<% if edit_mode && homework.homework_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}) %>");
<% 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? %>
$("#BluePopupBox a.BlueCirBtn").click();
<% end %>
@ -21,15 +39,15 @@
<% end %>
<% if edit_mode %>
$("#anonymous_comment").on('click',function(){
$("#anonymous_hint").show();
$("#homework_end_time_span").html("更改后评分比例将恢复默认值");
});
<% end %>
});
function checked_val() {
if ($("#anonymous_comment").is(":checked")) {
$("#anonymous_comment").val(1);
} else {
$("#anonymous_comment").val(0);
} else {
$("#anonymous_comment").val(1);
}
}
function nh_reset_homework_form(params){
@ -63,6 +81,10 @@
else if(!regex_course_id()){
$("#course_id").focus();
}
else if($("#homework_type_option").val() == 2 && !regex_program_attr()) {
}
else if($("#homework_type_option").val() == 3 && !regex_group_attr()) {
}
else{
params.textarea.html(params.editor.html());
params.editor.sync();
@ -154,28 +176,32 @@
<div class="HomeWorkCon">
<a id="submit_homework"></a>
<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>
</div>
<div class="cl"></div>
<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%>
<% unless edit_mode %>
<input type="hidden" name="quotes" id="ref_homework_id" value=""/>
<div class="mt10">
<% group_pro = homework.homework_type == 3 && homework.student_work_projects.count != 0 %>
<select class="homework-type-option fl mr10" name="homework_type" <%=(not_allow_select || group_pro) ? 'disabled' : '' %> id="homework_type_option">
<%= 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 %>
<%# if edit_mode %>
<label class="fl c_grey f14" style="margin-top: 4px;">截止日期:</label>
<%# end %>
<label class="fl c_grey f14 mt5">截止日期:</label>
<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 %>
<%= calendar_for('homework_end_time')%>
<% end %>
</div>
<%# if edit_mode %>
<label class="fl c_grey f14" style="margin-top: 4px;">发布日期(可选)</label>
<%# end %>
<label class="fl c_grey f14 mt5" style="margin-top: 4px;">发布日期(可选):</label>
<div class="calendar_div fl">
<% 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%>" >
@ -184,10 +210,10 @@
<% end %>
</div>
<% 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"/>
<span class="f14 c_grey">用匿评</span>
<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span>
<span class="f14 c_grey">用匿评</span>
<!--<span id="anonymous_hint" style="display: none; font-size: 12px;" class="c_red">更改后评分比例将恢复默认值</span>-->
</div>
<% end %>
</div>
@ -216,9 +242,13 @@
<p id="e_tips" class="c_grey"></p>
<div class="cl"></div>
<div class="mt10 b_grey undis" style="padding:10px;" id="homeworkSetting">
</div>
<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 class="mt5">
@ -234,50 +264,21 @@
<% end %>
<div class="cl"></div>
</div>
<input type="hidden" name="homework_type" value="<%= edit_mode ? homework.homework_type : 1 %>">
</div>
</div>
<div class="cl"></div>
<script id="t:test-answer-list" type="text/html">
<div class="mt10">
<label class="fl mt5" name="inputs_label">&nbsp;&nbsp;&nbsp;</label>
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" name="program[input][]"></textarea>
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" name="program[output][]"></textarea>
<div class="mt10" style="margin-left:63px;">
<label class="fl fontGrey2 mr10 mt5" name="inputs_label">&nbsp;&nbsp;&nbsp;</label>
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]"></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_remove" title="删除测试组"></a>
<div class="cl"></div>
</div>
</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 %>
<div class="BluePopupBox" style="display:none;" id="NoticePopupBox">
<%= 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>
<h2 class="BluePopuph2 fl">编程作业的测试集设置</h2>
<div class="cl"></div>
<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) %>
</select>
</div>
<div style="height: 320px; overflow-y:auto; width:756px;">
<div id="programHomework">
<span class="f14 mt5 fl fontGrey3 mr10">测试集设置:</span>
<select class="InputBox W120 language_type" name="language_type" <%=not_allow_select ? 'disabled' : '' %>>
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
</select>
<span class="f12 c_red mt5 fr">温馨提示:您可以在发布作业后,在作业"模拟答题"中进行标准代码的检测。</span>
<div class="cl"></div>
<% if edit_mode && homework.is_program_homework? %>
<% homework.homework_tests.each_with_index do |test, index| %>
<div class="mt10">
<label class="fl 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 W320 fl mr5" placeholder="测试输出" name="program[output][]"><%= test.output %></textarea>
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
<% if index != 0 %>
<div class="mt10" style="margin-left:63px;">
<label class="fl fontGrey2 mr10 mt5" name="inputs_label"><%=index+1 %>&nbsp;&nbsp;</label>
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" <%=not_allow_select ? 'disabled' : '' %>><%= test.input %></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>
<% if index != 0 %>
<a href="javascript:void(0);" class=" fl icon_remove" title="删除测试组"></a>
<% end %>
<div class="cl"></div>
<% end %>
<% end %>
<div class="cl"></div>
</div>
<% end %>
<% else %>
<div class="mt10">
<label class="fl 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 W320 fl mr5" placeholder="测试输出" name="program[output][]" id="textarea_output_test"></textarea>
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
<div class="cl"></div>
<div class="mt10" style="margin-left:63px;">
<label class="fl fontGrey2 mr10 mt5" name="inputs_label">1&nbsp;&nbsp;</label>
<textarea class="InputBox w265 fl mr10" placeholder="测试输入" name="program[input][]" id="textarea_input_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>
<div class="cl"></div>
</div>
<% end %>
</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-->
</div>
<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 %>
var text = document.getElementById("textarea_input_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)%>");
//$("input[name='homework_type']").val("<%#= @homework.homework_type%>");
<% if @homework_detail_programing %>
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
$("#BluePopupBox a.BlueCirBtn").click();
$("#homeworkSetting").removeClass("undis");
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
<% elsif @homework_detail_group %>
$('span.group_detail_info').text('分组人数:<%=@homework_detail_group.min_num %>-<%=@homework_detail_group.max_num %> 人');
$("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
$("#GroupPopupBox a.group_save_btn").click();
$("#homeworkSetting").removeClass("undis");
$("#homeworkSetting").html("<%=escape_javascript(render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework=>@homework, :not_allow_select => false}) %>");
<% end %>
$("#homework_type_option option[value='<%=@homework.homework_type %>']").attr("selected",true);
$("#homework_editor").show();

View File

@ -358,7 +358,7 @@ zh:
# 意见反馈
#
label_feedback: 意见反馈
label_feedback_tips: "请在此发布平台问题和建议,或直接加入答疑群,谢谢!"
label_feedback_tips: "在此输入对平台问题和建议您也可以通过QQ、微信留言,谢谢!"
label_technical_support: "QQ 在线支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
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}
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
saved_attachments.each do |attachment|
self.attachments << attachment

View File

@ -11,7 +11,7 @@
<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="mt5" style="line-height:20px">
<span class="ml15 c-grey3">性别</span>
@ -33,6 +33,12 @@
<span class="f12 c-red fl ml15" ng-show="regFrm.email.$error.email">电子邮箱地址不合法</span>
</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">
<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>

View File

@ -4,13 +4,13 @@
<form name="loginFrm" novalidate>
<div class="blue-title">绑定<span class="f13 blue-title-sub" ng-click="goReg()">注册</span></div>
<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">
<span ng-show="loginFrm.login.$error.required" class="c-red fl f12">电子邮箱地址或登录名不能为空</span>
</div>
</div>
<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">
<span ng-show="loginFrm.password.$error.required" class="c-red fl f12">密码不能为空</span>
</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()
{
var name = $.trim($("#homework_attach_name").val());

View File

@ -1,148 +1,148 @@
(function($){
$.fn.fix = function(options){
var u = navigator.userAgent;
if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){
$("#scrollsidebar").css("display","none");
return;
}
var defaults = {
float : 'right',
minStatue : true,
skin : 'blue',
durationTime : 1000
};
var options = $.extend(defaults, options);
this.each(function(){
//???????
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content');
var defaultTop = thisBox.offset().top; //????????top
thisBox.css(options.float, 0);
if(options.minStatue == "true"){
show_btn.css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 28);
}
//close
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '28px'},"fast");
cookiesave('minStatue','true','','','');
});
//show
show_btn.bind("click",function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
cookiesave('minStatue','false','','','');
});
}); //end this.each
};
})(jQuery);
function f_submit()
{
$("#new_memo").submit();
}
function cookiesave(n, v, mins, dn, path)
{
if(n)
{
if(!mins) mins = 365 * 24 * 60;
if(!path) path = "/";
var date = new Date();
date.setTime(date.getTime() + (mins * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
if(dn) dn = "domain=" + dn + "; ";
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
}
}
function cookieget(n)
{
var name = n + "=";
var ca = document.cookie.split(';');
for(var i=0;i<ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(name) == 0){
return c.substring(name.length,c.length);
}
}
return false;
}
$(function(){
var u = navigator.userAgent;
if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){
$("#scrollsidebar").css("display","none");
return;
}
$(".closeSidebar").click(function(){
$(".show_btn").css("display","none");
$("#scrollsidebar").css("display","none");
return false;
});
$("#button1").click(function(){
myTips("反馈成功","success");
});
$("#scrollsidebar").fix({
float: 'right', //default.left or right
minStatue: cookieget('minStatue'),
skin: 'green', //default.gray or blue
durationTime: 600
});
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
}).keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
});
});
//var browser={
// versions:function(){
// var u = navigator.userAgent, app = navigator.appVersion;
// return {//移动终端浏览器版本信息
// trident: u.indexOf('Trident') > -1, //IE内核
// presto: u.indexOf('Presto') > -1, //opera内核
// webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
// gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
// mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端
// ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
// android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
// iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
// iPad: u.indexOf('iPad') > -1, //是否iPad
// webApp: u.indexOf('Safari') == -1 //是否web应该程序没有头部与底部
// };
// }(),
// language:(navigator.browserLanguage || navigator.language).toLowerCase()
//}
//document.writeln("语言版本: "+browser.language);
//document.writeln(" 是否为移动终端: "+browser.versions.mobile);
//document.writeln(" ios终端: "+browser.versions.ios);
//document.writeln(" android终端: "+browser.versions.android);
//document.writeln(" 是否为iPhone: "+browser.versions.iPhone);
//document.writeln(" 是否iPad: "+browser.versions.iPad);
(function($){
$.fn.fix = function(options){
var u = navigator.userAgent;
if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){
$("#scrollsidebar").css("display","none");
return;
}
var defaults = {
float : 'right',
minStatue : true,
skin : 'blue',
durationTime : 1000
};
var options = $.extend(defaults, options);
this.each(function(){
//???????
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content');
var defaultTop = thisBox.offset().top; //????????top
thisBox.css(options.float, 0);
if(options.minStatue == "true"){
show_btn.css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 28);
}
//close
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '28px'},"fast");
cookiesave('minStatue','true','','','');
});
//show
show_btn.bind("click",function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '180px'},"fast");
cookiesave('minStatue','false','','','');
});
}); //end this.each
};
})(jQuery);
function f_submit()
{
$("#new_memo").submit();
}
function cookiesave(n, v, mins, dn, path)
{
if(n)
{
if(!mins) mins = 365 * 24 * 60;
if(!path) path = "/";
var date = new Date();
date.setTime(date.getTime() + (mins * 60 * 1000));
var expires = "; expires=" + date.toGMTString();
if(dn) dn = "domain=" + dn + "; ";
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
}
}
function cookieget(n)
{
var name = n + "=";
var ca = document.cookie.split(';');
for(var i=0;i<ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(name) == 0){
return c.substring(name.length,c.length);
}
}
return false;
}
$(function(){
var u = navigator.userAgent;
if((u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 ||u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1)){
$("#scrollsidebar").css("display","none");
return;
}
$(".closeSidebar, .hide-side-bar").click(function(){
$(".show_btn").css("display","none");
$("#scrollsidebar").css("display","none");
return false;
});
$("#button1").click(function(){
myTips("反馈成功","success");
});
$("#scrollsidebar").fix({
float: 'right', //default.left or right
minStatue: cookieget('minStatue'),
skin: 'green', //default.gray or blue
durationTime: 600
});
$("#subject").keydown(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
}).keyup(function(){
var curLength=$("#subject").val().length;
if(curLength>50){
var num=$("#subject").val().substr(0,50);
$("#subject").val(num);
}
else{
$("#textCount").text(50-$("#subject").val().length)
}
});
});
//var browser={
// versions:function(){
// var u = navigator.userAgent, app = navigator.appVersion;
// return {//移动终端浏览器版本信息
// trident: u.indexOf('Trident') > -1, //IE内核
// presto: u.indexOf('Presto') > -1, //opera内核
// webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
// gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
// mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端
// ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
// android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
// iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
// iPad: u.indexOf('iPad') > -1, //是否iPad
// webApp: u.indexOf('Safari') == -1 //是否web应该程序没有头部与底部
// };
// }(),
// language:(navigator.browserLanguage || navigator.language).toLowerCase()
//}
//document.writeln("语言版本: "+browser.language);
//document.writeln(" 是否为移动终端: "+browser.versions.mobile);
//document.writeln(" ios终端: "+browser.versions.ios);
//document.writeln(" android终端: "+browser.versions.android);
//document.writeln(" 是否为iPhone: "+browser.versions.iPhone);
//document.writeln(" 是否iPad: "+browser.versions.iPad);
//document.writeln(navigator.userAgent);

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){
$.get(

View File

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

View File

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

View File

@ -270,6 +270,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
.w350{ width:350px;}
.w610{ width:610px;}
.w600{ width:600px !important;}
.w603{ width:603px !important;}
.w606{ width:606px; }
.w620{ width:620px;}
.w680{ width: 680px;}
@ -607,7 +608,6 @@ a:hover.sy_btn_blue{ background: #2788d0;}
.is_public_checkbox{margin-left: 15px;margin-right: 10px;}
.author_name{color: #3ca5c6 !important;}
.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;}

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;}
.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;}
.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;}
.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;}
@ -515,9 +516,6 @@ a.blueCir{ display:inline-block; padding:2px 5px; background-color:#ffffff;borde
a:hover.blueCir{ background:#3598db; color:#fff;}
.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;}
.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 }

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;}
/*意见反馈*/
.qr-code-border {border:2px solid #269ac9;}
html{ overflow-x:hidden;}
.scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; }
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; float:left; margin-top:200px; cursor:pointer;}
.show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(/images/sidebar_bg.png) no-repeat; }
.side_content{width:180px; height:auto; overflow:hidden; float:left;}
.side_content .side_list {width:180px;overflow:hidden;}
.show_btn{ width:0; height:100px; overflow:hidden; float:left; margin-top:200px; cursor:pointer; background-color:#fff;}
.close_btn{cursor:pointer;}
.side_title,.side_bottom {background:url(/images/sidebar_bg.png) no-repeat; }
.side_title {height:35px;}
.side_bottom { height:8px;}
.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;}
.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; }
.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:hover{background: #297fb8; }
/* blue skin as the default skin */
.side_title {background-position:-195px 0;}
.side_center {background:url(/images/blue_line.png) repeat-y center; }
.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: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;}
@ -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 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{}
.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 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;}
@ -617,6 +617,7 @@ a.user_leftinfo_img { display:block; width:80px; height:80px; margin:15px auto;}
width:20px;
height:20px;
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: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;
}
.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 ul li:hover ul {display:block; }