merge
This commit is contained in:
commit
bebc602efc
|
@ -0,0 +1,3 @@
|
|||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
|
@ -0,0 +1,3 @@
|
|||
// Place all the styles related to the SystemMessages controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
|
@ -79,6 +79,11 @@ class AdminController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 系统消息
|
||||
def messages
|
||||
@admin_messages = SystemMessage.new
|
||||
end
|
||||
|
||||
def plugins
|
||||
@plugins = Redmine::Plugin.all
|
||||
end
|
||||
|
|
|
@ -49,6 +49,9 @@ class CommentsController < ApplicationController
|
|||
# end
|
||||
# # <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>̬<EFBFBD>ļ<EFBFBD>¼add end
|
||||
flash[:notice] = l(:label_comment_added)
|
||||
user_activity = UserActivity.where("act_type='News' and act_id =#{@news.id}").first
|
||||
user_activity.updated_at = @comment.created_on
|
||||
user_activity.save
|
||||
end
|
||||
|
||||
if params[:user_activity_id]
|
||||
|
|
|
@ -468,13 +468,17 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def new
|
||||
@course_type = params[:course_type] ||= params[:course]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
@course = Course.new
|
||||
@course.safe_attributes = params[:course]
|
||||
# month = Time.now.month
|
||||
render :layout => 'new_base'
|
||||
if User.current.login?
|
||||
@course_type = params[:course_type] ||= params[:course]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@trackers = Tracker.sorted.all
|
||||
@course = Course.new
|
||||
@course.safe_attributes = params[:course]
|
||||
# month = Time.now.month
|
||||
render :layout => 'new_base'
|
||||
else
|
||||
redirect_to signin_url
|
||||
end
|
||||
end
|
||||
|
||||
def desc_sort_course_by_avtivity(activity_count, courses)
|
||||
|
|
|
@ -156,7 +156,6 @@ class HomeworkCommonController < ApplicationController
|
|||
if @homework.homework_type == 2
|
||||
@homework.homework_detail_programing ||= HomeworkDetailPrograming.new
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
|
||||
@homework_detail_programing.language = params[:language_type].to_i
|
||||
|
||||
@homework.homework_tests.delete_all
|
||||
|
@ -190,11 +189,11 @@ class HomeworkCommonController < ApplicationController
|
|||
#开启匿评
|
||||
#statue 1:启动成功,2:启动失败,作业总数大于等于2份时才能启动匿评,3:已开启匿评,请务重复开启,4:没有开启匿评的权限
|
||||
def start_anonymous_comment
|
||||
@statue =4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
|
||||
@statue = 4 and return unless User.current.admin? || User.current.allowed_to?(:as_teacher,@course)
|
||||
@statue = 5 and return if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
if @homework_detail_manual.comment_status == 1
|
||||
student_works = @homework.student_works
|
||||
if student_works && student_works.size >=2
|
||||
if student_works && student_works.size >= 2
|
||||
student_works.each_with_index do |work, index|
|
||||
user = work.user
|
||||
n = @homework_detail_manual.evaluation_num
|
||||
|
@ -218,7 +217,7 @@ class HomeworkCommonController < ApplicationController
|
|||
#关闭匿评
|
||||
def stop_anonymous_comment
|
||||
@homework_detail_manual.update_column('comment_status', 3)
|
||||
|
||||
#计算缺评扣分
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@homework.student_works.each do |student_work|
|
||||
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
|
||||
|
|
|
@ -114,8 +114,10 @@ class IssuesController < ApplicationController
|
|||
def show
|
||||
# 当前用户查看指派给他的缺陷消息,则设置消息为已读
|
||||
query = @issue.forge_messages
|
||||
if User.current.id == @issue.assigned_to_id
|
||||
query.update_all(:viewed => true)
|
||||
query.each do |m|
|
||||
if m.user_id == User.current.id
|
||||
m.update_attribute(:viewed, true)
|
||||
end
|
||||
end
|
||||
# 缺陷状态更新
|
||||
query_journals = @issue.journals
|
||||
|
@ -392,6 +394,9 @@ class IssuesController < ApplicationController
|
|||
jour.notes = params[:notes]
|
||||
jour.journalized = @issue
|
||||
jour.save
|
||||
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@issue.id}").first
|
||||
user_activity.updated_at = jour.created_on
|
||||
user_activity.save
|
||||
@user_activity_id = params[:user_activity_id]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -161,6 +161,9 @@ class MessagesController < ApplicationController
|
|||
@reply.content = @quote + @reply.content
|
||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||
@topic.children << @reply
|
||||
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
||||
user_activity.updated_at = @reply.created_on
|
||||
user_activity.save
|
||||
#@topic.update_attribute(:updated_on, Time.now)
|
||||
if !@reply.new_record?
|
||||
if params[:asset_id]
|
||||
|
|
|
@ -216,6 +216,7 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
}
|
||||
format.api { render :action => 'show', :status => :created, :location => url_for(:controller => 'projects', :action => 'show', :id => @project.id) }
|
||||
format.js
|
||||
end
|
||||
else
|
||||
respond_to do |format|
|
||||
|
@ -322,6 +323,12 @@ class ProjectsController < ApplicationController
|
|||
end
|
||||
|
||||
def settings
|
||||
# 修改查看消息状态
|
||||
applied_messages = ForgeMessage.where("user_id =? and project_id =? and forge_message_type =? and viewed =?", User.current.id, @project, "AppliedProject", 0)
|
||||
applied_messages.each do |applied_message|
|
||||
applied_message.update_attributes(:viewed => true)
|
||||
end
|
||||
# end
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @project.members.new
|
||||
|
@ -342,7 +349,7 @@ class ProjectsController < ApplicationController
|
|||
if params[:repository] == "pswd_is_null"
|
||||
html << l(:label_password_not_null)
|
||||
end
|
||||
flash[:error] = html if !html.to_s.blank?
|
||||
flash.now[:error] = html if !html.to_s.blank?
|
||||
end
|
||||
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
|
||||
@repository = Repository.factory(scm)
|
||||
|
|
|
@ -3,12 +3,11 @@ class StudentWorkController < ApplicationController
|
|||
include StudentWorkHelper
|
||||
require 'bigdecimal'
|
||||
require "base64"
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test]
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work]
|
||||
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list]
|
||||
protect_from_forgery :except => :set_program_score
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule]
|
||||
|
||||
###
|
||||
def program_test
|
||||
|
@ -47,13 +46,23 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def index
|
||||
# 消息状态更新
|
||||
# 作业消息状态更新
|
||||
@homework.course_messages.each do |homework_message|
|
||||
if User.current.id == homework_message.user_id
|
||||
homework_message.update_attributes(:viewed => true)
|
||||
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
|
||||
|
||||
# 作品打分消息状态更新
|
||||
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
|
||||
# 作品评论消息状态更新
|
||||
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
|
||||
# 作品留言
|
||||
# 消息end
|
||||
#设置作业对应的forge_messages表的viewed字段
|
||||
query_student_work = @homework.course_messages
|
||||
|
@ -62,80 +71,33 @@ class StudentWorkController < ApplicationController
|
|||
query.update_attributes(:viewed => true)
|
||||
end
|
||||
end
|
||||
##################################################################################################################
|
||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||
course_group = CourseGroup.find_by_id(@group) if @group
|
||||
if course_group
|
||||
group_students = course_group.users
|
||||
if group_students.empty?
|
||||
student_in_group = '(0)'
|
||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
@is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||
@show_all = false
|
||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
||||
end
|
||||
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
|
||||
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
|
||||
if @show_all
|
||||
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
|
||||
if @order == "name"
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
if @order == "name"
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
end
|
||||
end
|
||||
else #学生
|
||||
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
|
||||
@is_evaluation = true
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
end
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
@show_all = true
|
||||
end
|
||||
else
|
||||
#老师 || 非匿评作业 || 匿评结束 显示所有的作品
|
||||
@show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin?
|
||||
if @show_all
|
||||
if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品
|
||||
if @order == "name"
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品
|
||||
my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
if my_work.empty?
|
||||
@stundet_works = []
|
||||
else
|
||||
if @order == "name"
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name
|
||||
else
|
||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||
end
|
||||
end
|
||||
end
|
||||
else #学生
|
||||
if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品
|
||||
@stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id)
|
||||
elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品
|
||||
@is_evaluation = true
|
||||
my_work = @homework.student_works.where(:user_id => User.current.id)
|
||||
@stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id}
|
||||
end
|
||||
end
|
||||
@stundet_works = []
|
||||
end
|
||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls {
|
||||
|
@ -170,15 +132,15 @@ class StudentWorkController < ApplicationController
|
|||
student_work.homework_common_id = @homework.id
|
||||
student_work.user_id = User.current.id
|
||||
student_work.save_attachments(params[:attachments])
|
||||
render_attachment_warning_if_needed(student_work)
|
||||
#提交作品时,计算是否迟交
|
||||
if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||
student_work.late_penalty = @homework.late_penalty
|
||||
else
|
||||
else
|
||||
student_work.late_penalty = 0
|
||||
end
|
||||
render_attachment_warning_if_needed(student_work)
|
||||
|
||||
if student_work.save
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
|
@ -231,16 +193,15 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
def show
|
||||
@score = student_work_score @work,User.current
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
@student_work_scores = @work.student_works_scores.order("updated_at desc")
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
if @homework.homework_type == 2 #编程作业,作品提交后不可以删除
|
||||
render_403
|
||||
elsif @work.destroy
|
||||
if @work.destroy
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to student_work_index_url(:homework => @homework.id)
|
||||
|
@ -251,10 +212,11 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
#添加评分,已评分则为修改评分
|
||||
def add_score
|
||||
@is_last = params[:is_last] == "true"
|
||||
render_403 and return if User.current == @work.user #不可以匿评自己的作品
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course)
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
#老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分
|
||||
render_403 and return unless @is_teacher || (@homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2)
|
||||
render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2
|
||||
@score = student_work_score @work,User.current
|
||||
if @score
|
||||
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""
|
||||
|
@ -288,35 +250,11 @@ class StudentWorkController < ApplicationController
|
|||
case @score.reviewer_role
|
||||
when 1 #教师评分:最后一个教师评分为最终评分
|
||||
@work.teacher_score = @score.score
|
||||
@work.final_score = @score.score
|
||||
when 2 #教辅评分 教辅评分显示平均分
|
||||
@work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f
|
||||
if @work.teacher_score.nil?
|
||||
if @work.student_score.nil?
|
||||
@work.final_score = @work.teaching_asistant_score
|
||||
else
|
||||
ta_proportion = @homework.homework_detail_manual.ta_proportion if @homework.homework_detail_manual
|
||||
ta_proportion = @homework.homework_detail_programing.ta_proportion if @homework.homework_detail_programing
|
||||
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
@work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
when 3 #学生评分 学生评分显示平均分
|
||||
@work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f
|
||||
if @work.teacher_score.nil?
|
||||
if @work.teaching_asistant_score.nil?
|
||||
@work.final_score = @work.student_score
|
||||
else
|
||||
final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
@work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @work.save
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -328,6 +266,7 @@ class StudentWorkController < ApplicationController
|
|||
#添加评分的回复
|
||||
def add_score_reply
|
||||
@score = StudentWorksScore.find params[:score_id]
|
||||
@is_last = params[:is_last] == "true"
|
||||
@jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0)
|
||||
if @jour.save
|
||||
@status = 1
|
||||
|
@ -420,44 +359,53 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#设置编程作业得分
|
||||
def set_program_score
|
||||
stundet_work = StudentWork.find_by_id params[:student_work_id]
|
||||
@course = stundet_work.homework_common.course
|
||||
student_score_count = 0
|
||||
if stundet_work && params[:results] && params[:results].class.to_s == "Array"
|
||||
homework_common = stundet_work.homework_common
|
||||
params[:results].each do |result|
|
||||
homework_tests = homework_common.homework_tests.where("input = '#{result[:input]}' AND output = '#{result[:output]}'")
|
||||
homework_tests.each do |homework_test|
|
||||
student_work_test = StudentWorkTest.new
|
||||
student_work_test.student_work = stundet_work
|
||||
student_work_test.homework_test = homework_test
|
||||
student_work_test.result = result[:status]
|
||||
if student_work_test.result == 0
|
||||
student_score_count += 1
|
||||
end
|
||||
student_work_test.error_msg = params[:compile_error_msg]
|
||||
student_work_test.save!
|
||||
#设置评分规则
|
||||
def set_score_rule
|
||||
homework_detail_manual = @homework.homework_detail_manual
|
||||
homework_detail_programing = @homework.homework_detail_programing
|
||||
|
||||
unless @homework.late_penalty.to_s == params[:late_penalty].to_s
|
||||
@homework.late_penalty = params[:late_penalty]
|
||||
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
|
||||
student_work.late_penalty = @homework.late_penalty
|
||||
student_work.save
|
||||
end
|
||||
|
||||
@homework.save
|
||||
end
|
||||
|
||||
unless homework_detail_manual.absence_penalty.to_s == params[:absence_penalty].to_s
|
||||
homework_detail_manual.absence_penalty = params[:absence_penalty]
|
||||
if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值
|
||||
work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")"
|
||||
@homework.student_works.each do |student_work|
|
||||
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
|
||||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
end
|
||||
unless homework_common.homework_tests.empty?
|
||||
stundet_work.student_score = student_score_count * 100.0 / homework_common.homework_tests.count
|
||||
|
||||
if stundet_work.teacher_score.nil?
|
||||
if stundet_work.teaching_asistant_score.nil?
|
||||
stundet_work.final_score = stundet_work.student_score
|
||||
else
|
||||
final_ta_score = BigDecimal.new("#{stundet_work.teaching_asistant_score}") * BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{stundet_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
stundet_work.final_score = format("%.1f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
homework_detail_manual.save if homework_detail_manual
|
||||
end
|
||||
|
||||
stundet_work.save!
|
||||
teacher_priority = params[:teacher_priority] ? 1 : 0
|
||||
if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s)
|
||||
homework_detail_manual.ta_proportion = params[:ta_proportion]
|
||||
homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing
|
||||
@homework.teacher_priority = teacher_priority
|
||||
|
||||
@homework.save
|
||||
homework_detail_manual.save if homework_detail_manual
|
||||
homework_detail_programing.save if homework_detail_programing
|
||||
|
||||
@homework.student_works.each do |student_work|
|
||||
set_final_score @homework,student_work
|
||||
student_work.save
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html{redirect_to student_work_index_url(:homework => @homework.id)}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -490,15 +438,19 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
def teacher_of_course
|
||||
render_403 unless User.current.allowed_to?(:as_teacher,@course)
|
||||
render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
end
|
||||
|
||||
#根据条件过滤作业结果
|
||||
def search_homework_member homeworks,name
|
||||
name = name.downcase
|
||||
select_homework = homeworks.select{ |homework|
|
||||
homework.user[:login].to_s.downcase.include?(name) || homework.user.user_extensions[:student_id].to_s.downcase.include?(name) || (homework.user[:lastname].to_s.downcase + homework.user[:firstname].to_s.downcase).include?(name)
|
||||
}
|
||||
if name == ""
|
||||
select_homework = homeworks
|
||||
else
|
||||
name = name.downcase
|
||||
select_homework = homeworks.select{ |homework|
|
||||
homework.user[:login].to_s.downcase.include?(name) || homework.user.user_extensions[:student_id].to_s.downcase.include?(name) || (homework.user[:lastname].to_s.downcase + homework.user[:firstname].to_s.downcase).include?(name)
|
||||
}
|
||||
end
|
||||
select_homework
|
||||
end
|
||||
|
||||
|
@ -509,25 +461,7 @@ class StudentWorkController < ApplicationController
|
|||
sheet1 = book.create_worksheet :name => "homework"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
if @homework.homework_type == 0 #普通作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s
|
||||
sheet1[count_row,2] = homework.user.login
|
||||
sheet1[count_row,3] = homework.user.user_extensions.student_id
|
||||
sheet1[count_row,4] = homework.user.mail
|
||||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
# sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,9] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 1 #匿评作业
|
||||
if @homework.homework_type == 1 #匿评作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
|
@ -547,7 +481,7 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
elsif @homework.homework_type == 2 #编程作业
|
||||
sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name),
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
|
@ -558,9 +492,10 @@ class StudentWorkController < ApplicationController
|
|||
sheet1[count_row,5] = homework.name
|
||||
sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score)
|
||||
sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score)
|
||||
sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
sheet1[count_row,8] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score)
|
||||
sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score)
|
||||
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score)
|
||||
sheet1[count_row,11] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
|
@ -660,4 +595,103 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
JSON.parse(res.body)
|
||||
end
|
||||
|
||||
#成绩计算
|
||||
def set_final_score homework,student_work
|
||||
if homework && homework.homework_detail_manual
|
||||
if homework.homework_type == 1 #匿评作业
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
elsif student_work.student_score.nil?
|
||||
student_work.final_score = student_work.teaching_asistant_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
else #不考虑教师评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
elsif student_work.student_score.nil?
|
||||
student_work.final_score = student_work.teaching_asistant_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
elsif student_work.student_score.nil? #学生未评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
else
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
else #不考虑教师评分
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
elsif student_work.student_score.nil? #学生未评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
else
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,94 @@
|
|||
class SystemMessagesController < ApplicationController
|
||||
# before_filter :message_author, :only => [:show]
|
||||
#
|
||||
# def message_author
|
||||
# if(!User.current.logged? && !token.nil?)
|
||||
#
|
||||
# User.current =try_to_autologin1
|
||||
# end
|
||||
# if @system_messages
|
||||
# render_403 :message => :notice_not_authorized_message
|
||||
# else
|
||||
# deny_access
|
||||
# end
|
||||
# end
|
||||
|
||||
def index
|
||||
@system_messages = SystemMessage.all
|
||||
end
|
||||
|
||||
# def show
|
||||
# @system_messages = SystemMessage.find(params[:id])
|
||||
# end
|
||||
|
||||
# GET /products/new
|
||||
# def new
|
||||
# @product = Product.new
|
||||
# end
|
||||
|
||||
# GET /products/1/edit
|
||||
# def edit
|
||||
# end
|
||||
|
||||
# POST /products
|
||||
# POST /products.json
|
||||
def create
|
||||
unless User.current.admin?
|
||||
render_403
|
||||
return
|
||||
end
|
||||
@system_messages = SystemMessage.new
|
||||
@system_messages.content = params[:system_message][:content]
|
||||
@system_messages.user_id = User.current.id
|
||||
respond_to do |format|
|
||||
if @system_messages.save
|
||||
format.html {redirect_to user_message_path(User.current, :type => "system_messages")}
|
||||
flash[:notice] = l(:notice_successful_message)
|
||||
else
|
||||
if params[:system_message][:content].empty?
|
||||
flash[:error] = l(:label_content_blank_fail)
|
||||
else
|
||||
flash[:error] = l(:label_admin_message_fail)
|
||||
end
|
||||
format.html {redirect_to admin_messages_path}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /products/1
|
||||
# PATCH/PUT /products/1.json
|
||||
# def update
|
||||
# respond_to do |format|
|
||||
# if @product.update(product_params)
|
||||
# format.html { redirect_to @product, notice: 'Product was successfully updated.' }
|
||||
# format.json { render :show, status: :ok, location: @product }
|
||||
# else
|
||||
# format.html { render :edit }
|
||||
# format.json { render json: @product.errors, status: :unprocessable_entity }
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
# DELETE /products/1
|
||||
# DELETE /products/1.json
|
||||
# def destroy
|
||||
# @system_messages.destroy
|
||||
# respond_to do |format|
|
||||
# format.html { redirect_to products_url, notice: 'Product was successfully destroyed.' }
|
||||
# format.json { head :no_content }
|
||||
# end
|
||||
# end
|
||||
|
||||
# private
|
||||
# # Use callbacks to share common setup or constraints between actions.
|
||||
# def set_product
|
||||
# @product = Product.find(params[:id])
|
||||
# end
|
||||
#
|
||||
# # Never trust parameters from the scary internet, only allow the white list through.
|
||||
# def message_params
|
||||
# params.require(:admin_system_messages).permit(:content)
|
||||
# end
|
||||
|
||||
|
||||
end
|
|
@ -230,6 +230,53 @@ class TagsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#更新某个tag名称
|
||||
def update_tag_name
|
||||
@tag_name = params[:tagName]
|
||||
@rename_tag_name = params[:renameName]
|
||||
@taggable_id = params[:taggableId]
|
||||
@taggable_type = numbers_to_object_type(params[:taggableType])
|
||||
|
||||
|
||||
@rename_tag = (ActsAsTaggableOn::Tag.find_by_name(@rename_tag_name)) #查找重命名后的tag
|
||||
@tag_id = (ActsAsTaggableOn::Tag.find_by_name(@tag_name)).id #重命名前的tag_id
|
||||
@taggings = ActsAsTaggableOn::Tagging.find_by_tag_id_and_taggable_id_and_taggable_type(@tag_id,@taggable_id,@taggable_type)
|
||||
@obj = get_object(@taggable_id,params[:taggableType])
|
||||
if(@rename_tag.nil?) #这次命名的是新的tag
|
||||
|
||||
# 是否还有其他记录 引用了 tag_id
|
||||
@tagging = ActsAsTaggableOn::Tagging.where("tag_id = #{@tag_id}")
|
||||
# 如果taggings表中记录为 1 ,那么改变@tag_id对应的tag的名字
|
||||
if @tagging.count == 1
|
||||
@tag = ActsAsTaggableOn::Tag.find_by_id(@tag_id)
|
||||
@tag.update_attributes({:name=>@rename_tag_name})
|
||||
else #如果tagging表中的记录大于1,那么就要新增tag记录
|
||||
|
||||
unless @obj.nil?
|
||||
@obj.tag_list.add(@rename_tag_name.split(","))
|
||||
@obj.save
|
||||
end
|
||||
#删除原来的对应的taggings的记录
|
||||
unless @taggings.nil?
|
||||
@taggings.delete
|
||||
end
|
||||
end
|
||||
else #这是已有的tag
|
||||
# 更改taggings记录里的tag_id
|
||||
unless @taggings.nil?
|
||||
@taggings.update_attributes({:tag_id=>@rename_tag.id})
|
||||
end
|
||||
end
|
||||
@obj_flag = params[:taggableType]
|
||||
if @obj && @obj_flag == '6' && @obj.container.kind_of?(Course)
|
||||
@course = @obj.container
|
||||
@tag_list = @tag_list = get_course_tag_list @course
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
def tag_save
|
||||
@select_tag_name = params[:tag_for_save][:tag_name]
|
||||
@tags = params[:tag_for_save][:name]
|
||||
|
|
|
@ -27,19 +27,13 @@ class UsersController < ApplicationController
|
|||
menu_item :user_course, :only => :user_courses
|
||||
menu_item :user_homework, :only => :user_homeworks
|
||||
menu_item :user_project, :only => [:user_projects, :watch_projects]
|
||||
# menu_item :requirement_focus, :only => :watch_bids
|
||||
menu_item :requirement_focus, :only => :watch_contests
|
||||
menu_item :user_newfeedback, :only => :user_newfeedback
|
||||
menu_item :user_messages, :only => :user_messages
|
||||
|
||||
|
||||
#Ended by young
|
||||
|
||||
# edit
|
||||
|
||||
#
|
||||
before_filter :can_show_course, :only => [:user_courses,:user_homeworks]
|
||||
#edit has been deleted by huang, 2013-9-23
|
||||
before_filter :find_user, :only => [:user_fanslist, :user_watchlist, :show, :edit, :update, :destroy, :edit_membership, :user_courses,
|
||||
:user_homeworks, :destroy_membership, :user_activities, :user_projects, :user_newfeedback, :user_comments,
|
||||
:watch_contests, :info, :watch_projects, :show_score, :topic_score_index, :project_score_index,
|
||||
|
@ -105,6 +99,19 @@ class UsersController < ApplicationController
|
|||
redirect_to signin_url
|
||||
return
|
||||
end
|
||||
# 记录当前点击按钮的时间
|
||||
# 考虑到用户未退出刷新消息页面
|
||||
if OnclickTime.where("user_id =?", User.current).first.nil?
|
||||
message_new_time = OnclickTime.new
|
||||
message_new_time.user_id = User.current.id
|
||||
message_new_time.onclick_time = Time.now
|
||||
message_new_time.save
|
||||
else
|
||||
message_new_time = OnclickTime.where("user_id =?", User.current).first
|
||||
message_last_time = message_new_time.onclick_time
|
||||
message_new_time.update_attributes(:onclick_time => Time.now)
|
||||
end
|
||||
@user_system_messages = SystemMessage.where("created_at >?", message_last_time).order("created_at desc")
|
||||
# 当前用户查看消息,则设置消息为已读
|
||||
if params[:viewed] == "all"
|
||||
course_querys = @user.course_messages
|
||||
|
@ -122,10 +129,23 @@ class UsersController < ApplicationController
|
|||
case params[:type]
|
||||
when nil
|
||||
@message_alls = []
|
||||
messages = MessageAll.where("user_id =?",@user).order("created_at desc")
|
||||
messages = MessageAll.where("user_id =?" ,@user).order("created_at desc")
|
||||
messages.each do |message_all|
|
||||
@message_alls << message_all.message
|
||||
end
|
||||
when 'unviewed'
|
||||
@message_alls = []
|
||||
messages = MessageAll.where("user_id =?", @user).order("created_at desc")
|
||||
messages.each do |message_all|
|
||||
# 在点击或者刷新消息列表后未读的消息存放在数组
|
||||
if message_all.message.viewed == 0
|
||||
@message_alls << message_all.message
|
||||
end
|
||||
end
|
||||
when 'system_messages'
|
||||
@message_alls = SystemMessage.order("created_at desc").all
|
||||
when 'apply'
|
||||
@message_alls = ForgeMessage.where("forge_message_type =? and user_id =?" , "AppliedProject", @user).order("created_at desc")
|
||||
when 'homework'
|
||||
@message_alls = CourseMessage.where("course_message_type =? and user_id =?", "HomeworkCommon", @user).order("created_at desc")
|
||||
when 'course_message'
|
||||
|
@ -329,11 +349,13 @@ class UsersController < ApplicationController
|
|||
#导入作业,确定按钮
|
||||
def user_select_homework
|
||||
homework = HomeworkCommon.find_by_id params[:checkMenu]
|
||||
homework_detail_programing = homework.homework_detail_programing
|
||||
@homework = HomeworkCommon.new
|
||||
if homework
|
||||
@homework.name = homework.name
|
||||
@homework.description = homework.description
|
||||
@homework.end_time = homework.end_time
|
||||
@homework.homework_type = homework.homework_type
|
||||
@homework.course_id = homework.course_id
|
||||
homework.attachments.each do |attachment|
|
||||
att = attachment.copy
|
||||
|
@ -343,6 +365,19 @@ class UsersController < ApplicationController
|
|||
att.save
|
||||
@homework.attachments << att
|
||||
end
|
||||
|
||||
if homework_detail_programing
|
||||
@homework.homework_detail_programing = HomeworkDetailPrograming.new
|
||||
@homework_detail_programing = @homework.homework_detail_programing
|
||||
@homework_detail_programing.ta_proportion = homework_detail_programing.ta_proportion
|
||||
@homework_detail_programing.language = homework_detail_programing.language
|
||||
homework.homework_tests.each_with_index do |homework_test|
|
||||
@homework.homework_tests << HomeworkTest.new(
|
||||
input: homework_test.input,
|
||||
output: homework_test.output
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
@ -384,6 +419,14 @@ class UsersController < ApplicationController
|
|||
homework = HomeworkCommon.find(params[:homework])
|
||||
student_work = StudentWork.where(homework_common_id: homework.id, user_id: User.current.id).first
|
||||
if student_work
|
||||
|
||||
#提交作品时,计算是否迟交
|
||||
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d")
|
||||
student_work.late_penalty = 1
|
||||
else
|
||||
student_work.late_penalty = 0
|
||||
end
|
||||
|
||||
student_work.save
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to student_work_index_url(:homework => params[:homework])
|
||||
|
@ -401,7 +444,8 @@ class UsersController < ApplicationController
|
|||
homework.end_time = params[:homework_common][:end_time] || Time.now
|
||||
homework.publish_time = Time.now
|
||||
homework.homework_type = params[:homework_type].to_i || 1
|
||||
homework.late_penalty = 2
|
||||
homework.late_penalty = 10
|
||||
homework.teacher_priority = 1
|
||||
homework.user_id = User.current.id
|
||||
homework.course_id = params[:course_id]
|
||||
|
||||
|
@ -409,19 +453,19 @@ class UsersController < ApplicationController
|
|||
render_attachment_warning_if_needed(homework)
|
||||
|
||||
homework_detail_manual = HomeworkDetailManual.new
|
||||
homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
|
||||
homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.3
|
||||
homework_detail_manual.comment_status = 1
|
||||
homework_detail_manual.evaluation_start = Time.now
|
||||
homework_detail_manual.evaluation_end = Time.now
|
||||
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
|
||||
homework_detail_manual.absence_penalty = 2
|
||||
homework_detail_manual.absence_penalty = 5
|
||||
homework.homework_detail_manual = homework_detail_manual
|
||||
|
||||
#编程作业相关属性
|
||||
if homework.homework_type == 2
|
||||
homework_detail_programing = HomeworkDetailPrograming.new
|
||||
homework.homework_detail_programing = homework_detail_programing
|
||||
homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
|
||||
homework_detail_programing.ta_proportion = 0.5
|
||||
homework_detail_programing.language = params[:language_type].to_i
|
||||
|
||||
inputs = params[:program][:input]
|
||||
|
@ -810,24 +854,24 @@ class UsersController < ApplicationController
|
|||
if params[:type].present?
|
||||
case params[:type]
|
||||
when "course_homework"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'HomeworkCommon'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "course_news"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'News'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "course_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "course_poll"
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Course' and container_id in #{user_course_ids} and act_type = 'Poll'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "project_issue"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Issue'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "project_message"
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("container_type = 'Project' and container_id in #{user_project_ids} and act_type = 'Message'").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
when "current_user"
|
||||
@user_activities = UserActivity.where("user_id = #{User.current.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("user_id = #{@user.id} and ((container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types}))").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
else
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
end
|
||||
else
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('created_at desc').limit(10).offset(@page * 10)
|
||||
@user_activities = UserActivity.where("(container_type = 'Project' and container_id in #{user_project_ids} and act_type in #{project_types}) or (container_type = 'Course' and container_id in #{user_course_ids} and act_type in #{course_types})").order('updated_at desc').limit(10).offset(@page * 10)
|
||||
end
|
||||
# @user_activities = paginateHelper @user_activities,500
|
||||
@type = params[:type]
|
||||
|
|
|
@ -264,7 +264,7 @@ class WikiController < ApplicationController
|
|||
end
|
||||
@page.destroy
|
||||
respond_to do |format|
|
||||
format.html { redirect_to project_wiki_index_url(@project) }
|
||||
format.html {redirect_to edit_project_wiki_page_url @project, @page.title}
|
||||
format.api { render_api_ok }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2297,27 +2297,19 @@ module ApplicationHelper
|
|||
|
||||
#获取匿评相关连接代码
|
||||
def homework_anonymous_comment homework
|
||||
# if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业
|
||||
#
|
||||
# elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
|
||||
# link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
|
||||
# else
|
||||
# link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
|
||||
# end
|
||||
|
||||
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||
link = "<span class='fr mr10 pr_join_span ' title='作业截止日期之前不可以启动匿评'>启动匿评</span>".html_safe
|
||||
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
|
||||
elsif homework.student_works.count >= 2 #作业份数大于2
|
||||
case homework.homework_detail_manual.comment_status
|
||||
when 1
|
||||
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
|
||||
when 2
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
|
||||
when 3
|
||||
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
|
||||
when 1
|
||||
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink'
|
||||
when 2
|
||||
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'postOptionLink'
|
||||
when 3
|
||||
link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
|
||||
end
|
||||
else
|
||||
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
|
||||
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于2时才可以启动匿评"
|
||||
end
|
||||
link
|
||||
end
|
||||
|
@ -2325,14 +2317,18 @@ module ApplicationHelper
|
|||
def student_new_homework homework
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil?
|
||||
link_to l(:label_commit_homework), new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
else
|
||||
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
"<span class='fr mr10 pr_join_span '>#{l(:label_edit_homework)}</span>".html_safe
|
||||
elsif homework.homework_type == 2 #编程作业不能修改作品
|
||||
"<span class='fr mr10 pr_join_span ' title='编程作业不可修改作品'>作品已交</span>".html_safe
|
||||
link_to "作品已交", "javascript:void(0);", :class => 'fr mr10 pr_join_span c_white', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_type == 2 #编程作业修改作品
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1
|
||||
link_to "作品已交", "javascript:void(0);", :class => 'fr mr10 pr_join_span c_white', :title => "开启匿评后不可修改作品"
|
||||
else
|
||||
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
else
|
||||
link_to l(:label_edit_homework), edit_student_work_path(work.id),:class => 'fr mr10 work_edit c_blue'
|
||||
link_to "修改作品", edit_student_work_path(work.id),:class => 'fr mr10 work_edit'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -2345,9 +2341,9 @@ module ApplicationHelper
|
|||
homework = default_opt[:homework]
|
||||
work = cur_user_works_for_homework homework
|
||||
if work.nil? && !is_teacher
|
||||
link_to "提交("+homework.student_works.count.to_s+")", new_student_work_path(:homework => homework.id), :class=> default_opt[:class]
|
||||
link_to "提交("+homework.student_works.count.to_s+")", new_student_work_path(:homework => homework.id,:host=> Setting.host_course), :class=> default_opt[:class]
|
||||
else
|
||||
link_to "提交("+homework.student_works.count.to_s+")", student_work_index_path(:homework => homework.id), :class=> default_opt[:class]
|
||||
link_to "提交("+homework.student_works.count.to_s+")", student_work_index_path(:homework => homework.id,:host=> Setting.host_course), :class=> default_opt[:class]
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -2363,7 +2359,7 @@ module ApplicationHelper
|
|||
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||
link_to "作品已交", "", :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||
elsif homework.homework_type == 2 #编程作业不能修改作品
|
||||
link_to "作品已交", student_work_index_path(:homework => homework.id),:class => 'c_blue',:title => "编程作业不可修改作品"
|
||||
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||
else
|
||||
link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue'
|
||||
end
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
include AvatarHelper
|
||||
include StudentWorkHelper
|
||||
module ProjectsHelper
|
||||
def link_to_version(version, options = {})
|
||||
return '' unless version && version.is_a?(Version)
|
||||
|
|
|
@ -2,17 +2,16 @@
|
|||
include UserScoreHelper
|
||||
|
||||
module StudentWorkHelper
|
||||
#获取当前用户的项目列表
|
||||
def user_projects_option
|
||||
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
|
||||
memberships = User.current.memberships.all(:conditions => cond)
|
||||
projects = memberships.map(&:project)
|
||||
projects = User.current.projects.visible
|
||||
not_have_project = []
|
||||
not_have_project << Setting.please_chose
|
||||
not_have_project << "没有可选项目,请直接为本作品创建一个项目"
|
||||
not_have_project << 0
|
||||
type = []
|
||||
type << not_have_project
|
||||
projects.each do |project|
|
||||
if project != nil
|
||||
if project
|
||||
option = []
|
||||
option << project.name
|
||||
option << project.id
|
||||
|
@ -100,4 +99,31 @@ module StudentWorkHelper
|
|||
end
|
||||
result
|
||||
end
|
||||
|
||||
#教辅评分比例下拉框
|
||||
def ta_proportion_option
|
||||
type = []
|
||||
i = 0
|
||||
while i <= 100
|
||||
option = []
|
||||
option << i.to_s + "%"
|
||||
option << i.to_f / 100
|
||||
type << option
|
||||
i += 10
|
||||
end
|
||||
type
|
||||
end
|
||||
|
||||
def ta_proportion_option_to num
|
||||
type = []
|
||||
i = 0
|
||||
while i <= num
|
||||
option = []
|
||||
option << i.to_s + "%"
|
||||
option << i.to_f / 100
|
||||
type << option
|
||||
i += 10
|
||||
end
|
||||
type
|
||||
end
|
||||
end
|
|
@ -0,0 +1,2 @@
|
|||
module SystemMessagesHelper
|
||||
end
|
|
@ -52,6 +52,40 @@ module UsersHelper
|
|||
end
|
||||
end
|
||||
|
||||
def title_for_message type
|
||||
case type
|
||||
when nil
|
||||
'消息'
|
||||
when 'unviewed'
|
||||
'未读消息'
|
||||
when 'apply'
|
||||
'用户申请'
|
||||
when 'system_messages'
|
||||
'系统消息'
|
||||
when 'homework'
|
||||
'作业消息'
|
||||
when 'course_message'
|
||||
'课程讨论'
|
||||
when 'course_news'
|
||||
'课程通知'
|
||||
when 'issue'
|
||||
'项目任务'
|
||||
when 'forum'
|
||||
'贴吧帖子'
|
||||
when 'user_feedback'
|
||||
'用户留言'
|
||||
end
|
||||
end
|
||||
|
||||
# 统计未读消息数
|
||||
def unviewed_message(user)
|
||||
course_count = CourseMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =?", user, 0).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count
|
||||
end
|
||||
|
||||
def user_mail_notification_options(user)
|
||||
user.valid_notification_options.collect {|o| [l(o.last), o.first]}
|
||||
end
|
||||
|
|
|
@ -1,8 +1,21 @@
|
|||
class AppliedProject < ActiveRecord::Base
|
||||
attr_accessible :project_id, :user_id
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
belongs_to :project
|
||||
has_many :forge_messages, :class_name => 'ForgeMessage', :as => :forge_message, :dependent => :destroy
|
||||
|
||||
after_create :send_appliled_message
|
||||
|
||||
def send_appliled_message
|
||||
# if MessageAll.where("message_type = '#{self.class.to_s}' and message_id = '#{self.id}'").first.nil?
|
||||
self.project.members.each do |m|
|
||||
if m.roles.first.to_s.include?("Manager")
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false)
|
||||
end
|
||||
end
|
||||
# end
|
||||
end
|
||||
|
||||
#删除用户申请
|
||||
def self.deleteappiled(userid, projectid)
|
||||
|
@ -11,5 +24,4 @@ class AppliedProject < ActiveRecord::Base
|
|||
applied.destroy
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -14,13 +14,19 @@ class CourseActivity < ActiveRecord::Base
|
|||
if user_activity
|
||||
user_activity.save
|
||||
else
|
||||
user_activity = UserActivity.new
|
||||
user_activity.act_id = self.course_act_id
|
||||
user_activity.act_type = self.course_act_type
|
||||
user_activity.container_type = "Course"
|
||||
user_activity.container_id = self.course_id
|
||||
user_activity.user_id = self.user_id
|
||||
user_activity.save
|
||||
if self.course_act_type == 'Message' && !self.course_act.parent_id.nil?
|
||||
user_activity = UserActivity.where("act_type = 'Message' and act_id = #{self.course_act.parent.id}").first
|
||||
user_activity.created_at = self.created_at
|
||||
user_activity.save
|
||||
else
|
||||
user_activity = UserActivity.new
|
||||
user_activity.act_id = self.course_act_id
|
||||
user_activity.act_type = self.course_act_type
|
||||
user_activity.container_type = "Course"
|
||||
user_activity.container_id = self.course_id
|
||||
user_activity.user_id = self.user_id
|
||||
user_activity.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -29,12 +29,19 @@ class ForgeActivity < ActiveRecord::Base
|
|||
if user_activity
|
||||
user_activity.save
|
||||
else
|
||||
user_activity = UserActivity.new
|
||||
user_activity.act_id = self.forge_act_id
|
||||
user_activity.act_type = self.forge_act_type
|
||||
user_activity.container_type = "Project"
|
||||
user_activity.container_id = self.project_id
|
||||
user_activity.save
|
||||
if self.forge_act_type == 'Message' && !self.forge_act.parent_id.nil?
|
||||
user_activity = UserActivity.where("act_type = 'Message' and act_id = #{self.forge_act.parent.id}").first
|
||||
user_activity.created_at = self.created_at
|
||||
user_activity.save
|
||||
else
|
||||
user_activity = UserActivity.new
|
||||
user_activity.act_id = self.forge_act_id
|
||||
user_activity.act_type = self.forge_act_type
|
||||
user_activity.container_type = "Project"
|
||||
user_activity.container_id = self.project_id
|
||||
user_activity.user_id = self.user_id
|
||||
user_activity.save
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -147,6 +147,13 @@ class Issue < ActiveRecord::Base
|
|||
unless self.author_id == self.assigned_to_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => self.assigned_to_id, :project_id => self.project_id, :viewed => false)
|
||||
end
|
||||
if self.tracker_id == 5
|
||||
self.project.members.each do |m|
|
||||
if m.roles.first.to_s.include?("Manager") && m.user_id != self.author_id && m.user_id != self.assigned_to_id
|
||||
self.forge_messages << ForgeMessage.new(:user_id => m.user_id, :project_id => self.project_id, :viewed => false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# 更新缺陷
|
||||
|
@ -1009,7 +1016,7 @@ class Issue < ActiveRecord::Base
|
|||
if leaf.start_date
|
||||
# Only move subtask if it starts at the same date as the parent
|
||||
# or if it starts before the given date
|
||||
if start_date == leaf.start_date || date > leaf.start_date
|
||||
if start_date == leaf.start_date || date > leaf.start_date
|
||||
leaf.reschedule_on!(date)
|
||||
end
|
||||
else
|
||||
|
@ -1392,6 +1399,7 @@ class Issue < ActiveRecord::Base
|
|||
def attachment_added(obj)
|
||||
if @current_journal && @current_journal.user_id == obj.author_id && JournalDetail.find_all_by_value(obj.filename).count == 0
|
||||
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :value => obj.filename)
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1400,6 +1408,9 @@ class Issue < ActiveRecord::Base
|
|||
if @current_journal && !obj.new_record?
|
||||
@current_journal.details << JournalDetail.new(:property => 'attachment', :prop_key => obj.id, :old_value => obj.filename)
|
||||
@current_journal.save
|
||||
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@current_journal.journalized_id}").first
|
||||
user_activity.updated_at = Time.now
|
||||
user_activity.save
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1506,6 +1517,9 @@ class Issue < ActiveRecord::Base
|
|||
}
|
||||
end
|
||||
@current_journal.save
|
||||
user_activity = UserActivity.where("act_type='Issue' and act_id =#{@current_journal.journalized_id}").first
|
||||
user_activity.updated_at = Time.now
|
||||
user_activity.save
|
||||
# reset current journal
|
||||
init_journal @current_journal.user, @current_journal.notes
|
||||
end
|
||||
|
|
|
@ -34,8 +34,10 @@ class Mailer < ActionMailer::Base
|
|||
end
|
||||
def method_missing(name, *args, &block)
|
||||
if Setting.delayjob_enabled? && Object.const_defined?('Delayed')
|
||||
# with delayed_job
|
||||
@target.delay.send(name, *args, &block)
|
||||
else
|
||||
# without delayed_job
|
||||
@target.send(name, *args, &block).deliver
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class OnclickTime < ActiveRecord::Base
|
||||
attr_accessible :onclick_time, :user_id
|
||||
|
||||
belongs_to :user
|
||||
end
|
|
@ -31,6 +31,7 @@ class StudentWork < ActiveRecord::Base
|
|||
else
|
||||
self.system_score = last_test.test_score
|
||||
end
|
||||
set_final_score self.homework_common,self
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -38,4 +39,102 @@ class StudentWork < ActiveRecord::Base
|
|||
self.description = last_test.src if last_test
|
||||
end
|
||||
|
||||
#成绩计算
|
||||
def set_final_score homework,student_work
|
||||
if homework && homework.homework_detail_manual
|
||||
if homework.homework_type == 1 #匿评作业
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
elsif student_work.student_score.nil?
|
||||
student_work.final_score = student_work.teaching_asistant_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
else #不考虑教师评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.student_score
|
||||
elsif student_work.student_score.nil?
|
||||
student_work.final_score = student_work.teaching_asistant_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_manual.ta_proportion
|
||||
final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_ta_score + final_s_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空
|
||||
if homework.teacher_priority == 1 #教师优先
|
||||
if student_work.teacher_score
|
||||
student_work.final_score = student_work.teacher_score
|
||||
else
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
elsif student_work.student_score.nil? #学生未评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
else
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
else #不考虑教师评分
|
||||
if student_work.teaching_asistant_score.nil? #教辅未评分
|
||||
if student_work.student_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
elsif student_work.student_score.nil? #学生未评分
|
||||
if student_work.teaching_asistant_score.nil?
|
||||
student_work.final_score = student_work.system_score
|
||||
else
|
||||
ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
else
|
||||
final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}")
|
||||
final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")
|
||||
final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}"))
|
||||
final_score = final_sy_score + final_ts_score + final_st_score
|
||||
student_work.final_score = format("%.2f",final_score.to_f)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
class SystemMessage < ActiveRecord::Base
|
||||
attr_accessible :content, :id, :user_id
|
||||
belongs_to :user
|
||||
|
||||
validates :content, presence: true
|
||||
validates_length_of :content, maximum: 255
|
||||
end
|
|
@ -132,6 +132,8 @@ class User < Principal
|
|||
has_many :course_messages
|
||||
has_many :memo_messages
|
||||
has_many :user_feedback_messages
|
||||
has_one :onclick_time
|
||||
has_many :system_messages
|
||||
|
||||
# 虚拟转换
|
||||
has_many :new_jours, :as => :jour, :class_name => 'JournalsForMessage', :conditions => "status=1"
|
||||
|
@ -209,7 +211,7 @@ class User < Principal
|
|||
before_save :update_hashed_password
|
||||
before_destroy :remove_references_before_destroy
|
||||
# added by fq
|
||||
after_create :act_as_activity
|
||||
after_create :act_as_activity, :add_onclick_time
|
||||
# end
|
||||
|
||||
scope :in_group, lambda {|group|
|
||||
|
@ -257,11 +259,18 @@ class User < Principal
|
|||
|
||||
# 新消息统计
|
||||
def count_new_message
|
||||
course_count = CourseMessage.where("user_id =? and viewed =?", User.current.id, 0).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =?", User.current.id, 0).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =?", User.current.id, 0).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =?", User.current.id, 0).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count
|
||||
if OnclickTime.where("user_id =?", User.current).first.nil?
|
||||
message_new_time = OnclickTime.new
|
||||
message_new_time.user_id = User.current.id
|
||||
message_new_time.onclick_time = User.current.last_login_on.nil? ? Time.now : User.current.last_login_on
|
||||
message_new_time.save
|
||||
end
|
||||
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
user_memo_count = MemoMessage.where("user_id =? and viewed =? and created_at >?", User.current.id, 0, User.current.onclick_time.onclick_time).count
|
||||
system_messages_count = SystemMessage.where("created_at >?", User.current.onclick_time.onclick_time).count
|
||||
messages_count = course_count + forge_count + user_feedback_count + user_memo_count + system_messages_count
|
||||
end
|
||||
|
||||
# 查询指派给我的缺陷记录
|
||||
|
@ -994,6 +1003,13 @@ class User < Principal
|
|||
self.acts << Activity.new(:user_id => self.id)
|
||||
end
|
||||
|
||||
# 注册用户的时候消息默认点击时间为用户创建时间
|
||||
def add_onclick_time
|
||||
if OnclickTime.where("user_id =?" , self.id).first.nil?
|
||||
OnclickTime.create(:user_id => self.id, :onclick_time => self.created_on)
|
||||
end
|
||||
end
|
||||
|
||||
# Removes references that are not handled by associations
|
||||
# Things that are not deleted are reassociated with the anonymous user
|
||||
def remove_references_before_destroy
|
||||
|
|
|
@ -1,50 +1,50 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<div class="homepageContent BgBox">
|
||||
<h2 class="BgBox_h2">关于我们</h2>
|
||||
<div class="AgreementBox">
|
||||
<p class="AgreementTxt">
|
||||
Trustie是一个面向高校创新实践的在线协作社区,是在中国高校推行大规模开放在线研究(Massive Open Online Research, MOORE)的支撑平台,也简称Trustie平台。老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
MOORE是国防科学技术大学杨学军院士提出的一个面向高校科研教学活动的新型创新实践概念,为全面支持高校人才培养和科学研究提供了一种新思路。MOORE是对大规模在线开放课程(Massive Open Online Course, MOOC)的拓展,是课堂教学与创新实践深度结合的全新模式,可以看作MOOC2.0。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
2005年开始,Trustie研制团队围绕网络时代的软件开发效率和质量这一核心问题展开研究,经过十年的磨砺与攻关,逐步揭示出以大众化协同开发、开放式资源共享、持续性可信评估为核心的互联网大规模协同机理,提出了全新的软件开发群体化方法。2008年起,研制团队开始探索如何将这种协同机理引入软件人才培养。MOORE概念的提出为研制团队的人才培养实践提供了新的发展方向和应用模式,使Trustie技术和工具能够更直接、更有效地与高校人才培养对接,形成了今天已被大量师生接受的在线人才培养平台。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
研制团队认为MOORE的创新人才培养模式(如图1左图)是将互联网大规模协同机理与高校创新实践活动相结合的全新人才培养方法和模式,研制团队并基于本平台的架构形成了对MOORE核心机理的三方面认识(如图1右图)。
|
||||
</p>
|
||||
<div class="AgreementImg" >
|
||||
<img src="images/aboutus_01.jpg" width="820" height="285" />
|
||||
<p class="AgreementTxt T_C fb mt10">图1 基于MOORE的创新人才培养模式与核心机理</p>
|
||||
</div>
|
||||
<p class="AgreementTxt">
|
||||
目前,Trustie平台已经初步展现出大规模开放在线研究的生态系统蓝图,其核心是在线教学实践平台和在线协同研究平台,如图2。Trustie在线教学实践平台是支持教师和学生围绕课堂学习开展实践的平台(如图2),Trustie在线协同研究平台是支持开发小组围绕实践任务或研究工作开展分布式协作的平台(如图2)。两个核心平台为一名"新手"大学生成长为具有一定创新能力的"创客"提供了从学习到研究的一个渐进式成长环境(如图2)。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
特别是,根据师生的实际需要,Trustie平台提供了私有模式和公开模式,支持针对未公开成果实施有效知识产权保护为前提的交流分享(如图2)。随着越来越多的高校、课程和研究小组的加入,MOORE创新实践模式的生态效益将不断显现出来。
|
||||
</p>
|
||||
<div class="AgreementImg" >
|
||||
<img src="images/aboutus_02.jpg" width="756" height="496" />
|
||||
<p class="AgreementTxt T_C fb mt10">图2 基于MOORE的支撑平台和生态系统</p>
|
||||
</div>
|
||||
<p class="AgreementTxt">
|
||||
研制团队特别感谢高校老师和学生的积极反馈、无私创意。平台的很多实用便捷的功能都是老师们积极参与和设计的结果,汇聚了大量师生的宝贵贡献,是研制团队和用户群体共同成长的结果。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
Trustie平台的基本思路是将开源模式与中国高校人才培养活动相结合,但其本质上是一种O2O(Online To Offline)的创新人才培养模式,只有在以下两个方面同步推进,才能在持续解决实际需求的过程中快速发展:<br />
|
||||
(1)构建实践平台,激活创新能力:成为支持不同规模的团队进行协同研究和协同开发的实践平台,支持各类可公开的课程实验任务、教研室科研任务的在线协同,能够有效提升和评估学生的创新能力、协作能力和实践能力。<br />
|
||||
(2)引入开源理念,形成创客文化:将互联网开源软件运动中的自由、对等、共享、创新的理念引入高校,使"自主创意并亲自动手实现创意"的创客精神深入人才培养活动,在学生群体中形成大胆创意、大胆实践的创新文化。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
研制团队认为,Trustie平台是一种"互联网+"思维在高校教育领域的大型探索性实践。作为一种互联网应用,Trustie平台自身的开发也采取了互联网模式:Trustie研制团队采用了"网构化软件开发模式",坚持"每周一更"的快速上线、快速体验模式,以最大程度上贴近用户实际需求提升。欢迎高校师生一同投身创新实践,共同见证MOORE创新生态的早日形成。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!---BgBox end--->
|
||||
|
||||
<div class="footer"></div>
|
||||
|
||||
|
||||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<div class="homepageContent BgBox">
|
||||
<h2 class="BgBox_h2">关于我们</h2>
|
||||
<div class="AgreementBox">
|
||||
<p class="AgreementTxt">
|
||||
Trustie是一个面向高校创新实践的在线协作社区,是在中国高校推行大规模开放在线研究(Massive Open Online Research, MOORE)的支撑平台,也简称Trustie平台。老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
MOORE是国防科学技术大学杨学军院士提出的一个面向高校科研教学活动的新型创新实践概念,为全面支持高校人才培养和科学研究提供了一种新思路。MOORE是对大规模在线开放课程(Massive Open Online Course, MOOC)的拓展,是课堂教学与创新实践深度结合的全新模式,可以看作MOOC2.0。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
2005年开始,Trustie研制团队围绕网络时代的软件开发效率和质量这一核心问题展开研究,经过十年的磨砺与攻关,逐步揭示出以大众化协同开发、开放式资源共享、持续性可信评估为核心的互联网大规模协同机理,提出了全新的软件开发群体化方法。2008年起,研制团队开始探索如何将这种协同机理引入软件人才培养。MOORE概念的提出为研制团队的人才培养实践提供了新的发展方向和应用模式,使Trustie技术和工具能够更直接、更有效地与高校人才培养对接,形成了今天已被大量师生接受的在线人才培养平台。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
研制团队认为MOORE的创新人才培养模式(如图1左图)是将互联网大规模协同机理与高校创新实践活动相结合的全新人才培养方法和模式,研制团队并基于本平台的架构形成了对MOORE核心机理的三方面认识(如图1右图)。
|
||||
</p>
|
||||
<div class="AgreementImg" >
|
||||
<img src="images/aboutus_01.jpg" width="619" height="215" />
|
||||
<p class="AgreementTxt T_C fb mt10">图1 基于MOORE的创新人才培养模式与核心机理</p>
|
||||
</div>
|
||||
<p class="AgreementTxt">
|
||||
目前,Trustie平台已经初步展现出大规模开放在线研究的生态系统蓝图,其核心是在线教学实践平台和在线协同研究平台,如图2。Trustie在线教学实践平台是支持教师和学生围绕课堂学习开展实践的平台(如图2),Trustie在线协同研究平台是支持开发小组围绕实践任务或研究工作开展分布式协作的平台(如图2)。两个核心平台为一名"新手"大学生成长为具有一定创新能力的"创客"提供了从学习到研究的一个渐进式成长环境(如图2)。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
特别是,根据师生的实际需要,Trustie平台提供了私有模式和公开模式,支持针对未公开成果实施有效知识产权保护为前提的交流分享(如图2)。随着越来越多的高校、课程和研究小组的加入,MOORE创新实践模式的生态效益将不断显现出来。
|
||||
</p>
|
||||
<div class="AgreementImg" >
|
||||
<img src="images/aboutus_02.jpg" width="616" height="405" />
|
||||
<p class="AgreementTxt T_C fb mt10">图2 基于MOORE的支撑平台和生态系统</p>
|
||||
</div>
|
||||
<p class="AgreementTxt">
|
||||
研制团队特别感谢高校老师和学生的积极反馈、无私创意。平台的很多实用便捷的功能都是老师们积极参与和设计的结果,汇聚了大量师生的宝贵贡献,是研制团队和用户群体共同成长的结果。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
Trustie平台的基本思路是将开源模式与中国高校人才培养活动相结合,但其本质上是一种O2O(Online To Offline)的创新人才培养模式,只有在以下两个方面同步推进,才能在持续解决实际需求的过程中快速发展:<br />
|
||||
(1)构建实践平台,激活创新能力:成为支持不同规模的团队进行协同研究和协同开发的实践平台,支持各类可公开的课程实验任务、教研室科研任务的在线协同,能够有效提升和评估学生的创新能力、协作能力和实践能力。<br />
|
||||
(2)引入开源理念,形成创客文化:将互联网开源软件运动中的自由、对等、共享、创新的理念引入高校,使"自主创意并亲自动手实现创意"的创客精神深入人才培养活动,在学生群体中形成大胆创意、大胆实践的创新文化。
|
||||
</p>
|
||||
<p class="AgreementTxt">
|
||||
研制团队认为,Trustie平台是一种"互联网+"思维在高校教育领域的大型探索性实践。作为一种互联网应用,Trustie平台自身的开发也采取了互联网模式:Trustie研制团队采用了"网构化软件开发模式",坚持"每周一更"的快速上线、快速体验模式,以最大程度上贴近用户实际需求提升。欢迎高校师生一同投身创新实践,共同见证MOORE创新生态的早日形成。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div><!---BgBox end--->
|
||||
|
||||
<div class="footer"></div>
|
||||
|
||||
|
||||
|
|
|
@ -1,286 +1,286 @@
|
|||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'leftside'%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// $(document).ready(function(){
|
||||
// $("#loginSignButton").click(function(){
|
||||
// $("#signUpBox").css({display:"block"});
|
||||
// $("#loginInBox").css({display:"none"});
|
||||
// });
|
||||
// $("#loginInButton").click(function(){
|
||||
// $("#signUpBox").css({display:"none"});
|
||||
// $("#loginInBox").css({display:"block"});
|
||||
// });
|
||||
// });
|
||||
// $(function(){
|
||||
// $("#username").keypress(function(e){
|
||||
// alert(11);
|
||||
// if (e.keyCode == '13') {
|
||||
// $('#main_login_form').submit();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// $("#password").keypress(function(e){
|
||||
// if (e.keyCode == '13') {
|
||||
// $('#main_login_form').submit();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".homepageSearchIcon").click(function(){
|
||||
var val=$('input:radio[name="search_type"]:checked').val();
|
||||
if(val==null){
|
||||
$("#navSearchAlert").css({display:"block"});
|
||||
}
|
||||
else {
|
||||
$("#navSearchAlert").css({display:"none"});
|
||||
}
|
||||
});
|
||||
// $("#loginInButton").click(function(){
|
||||
// $("#signUpBox").css({display:"none"});
|
||||
// $("#loginInBox").css({display:"block"});
|
||||
// });
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".navHomepageSearchBoxcontainer").mouseover(function(){
|
||||
$(".navSearchTypeBox").css({display:"block"});
|
||||
});
|
||||
$(".navHomepageSearchBoxcontainer").mouseout(function(){
|
||||
$(".navSearchTypeBox").css({display:"none"});
|
||||
});
|
||||
})
|
||||
$(document).ready(function(){
|
||||
if(<%= @login%>){
|
||||
$("#signUpBox").css({display:"none"});
|
||||
$("#loginInBox").css({display:"block"});
|
||||
}else{
|
||||
$("#signUpBox").css({display:"block"});
|
||||
$("#loginInBox").css({display:"none"});
|
||||
}
|
||||
});
|
||||
|
||||
// $('#regist_btn').bind('keyup', function(event) {
|
||||
// if (event.keyCode == "13" && $("#signUpBox").css('display') == 'block')) {
|
||||
// register();
|
||||
// }
|
||||
//});
|
||||
function clearInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
|
||||
function login(){
|
||||
$('#main_login_form').submit(); //表单提交没有任何反应的原因:js冲突
|
||||
}
|
||||
|
||||
function register(){
|
||||
if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){
|
||||
$("#main_reg_form").submit();
|
||||
}else{
|
||||
$('#user_login').blur();
|
||||
$('#user_mail').blur();
|
||||
$('#user_password').blur();
|
||||
$('#user_password_confirmation').blur();
|
||||
}
|
||||
}
|
||||
var $login_correct = false;
|
||||
var $mail_correct = false;
|
||||
var $passwd_correct = false;
|
||||
var $passwd_comfirm_correct = false;
|
||||
jQuery(document).ready(function () {
|
||||
var $login = $('#user_login')
|
||||
var $mail = $('#user_mail')
|
||||
var $password = $('#user_password')
|
||||
var $password_confirmation = $('#user_password_confirmation')
|
||||
$login.blur(function (event) {
|
||||
if ($(this).is('#user_login')) {
|
||||
$.get(
|
||||
'<%=account_valid_ajax_path%>',
|
||||
{ valid: "login",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
|
||||
$login_correct = true;
|
||||
} else {
|
||||
$('#login_req').html( '<span style="color: red">'+data.message+'</span>');
|
||||
$login_correct = false;
|
||||
}
|
||||
$('#login_req').css('display','block');
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
$mail.blur(function (event) {
|
||||
if ($(this).is('#user_mail')) {
|
||||
$.get('<%=account_valid_ajax_path%>',
|
||||
{ valid: "mail",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
|
||||
$mail_correct = true;
|
||||
} else {
|
||||
$('#mail_req').html( '<span style="color: red">'+data.message+'</span>' );
|
||||
$mail_correct = false;
|
||||
}
|
||||
$('#mail_req').css('display','block');
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
$password.blur(function () {
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var password_min_length = <%= Setting.password_min_length.to_i %>
|
||||
if (pas1.length >= password_min_length) {
|
||||
$('#passwd_req').html('');
|
||||
$passwd_correct = true;
|
||||
}
|
||||
else {
|
||||
$('#passwd_req').html( '<span style="color: red">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
|
||||
$passwd_correct = false;
|
||||
}
|
||||
$('#passwd_req').css('display','block');
|
||||
|
||||
|
||||
});
|
||||
$password_confirmation.blur(function () {
|
||||
var password_min_length = <%= Setting.password_min_length.to_i %>
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var pas2 = document.getElementById("user_password_confirmation").value;
|
||||
if (pas1.length >= password_min_length && pas1 == pas2 ) {
|
||||
$('#confirm_req').html('<span style="color: green">'+'<%= l(:setting_password_success) %>'+'</span>');
|
||||
$passwd_comfirm_correct = true;
|
||||
}
|
||||
else {
|
||||
$('#confirm_req').html('<span style="color: red">'+'<%= l(:setting_password_error) %>'+'</span>');
|
||||
$passwd_comfirm_correct = false;
|
||||
|
||||
}
|
||||
$('#confirm_req').css('display','block');
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function user_name_keypress(e){
|
||||
if (e.keyCode == '13') {
|
||||
$('#main_login_form').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="loginContentContainer">
|
||||
<div class="loginContent">
|
||||
<div class="loginLeft">
|
||||
<div class="loginLogo"><img src="images/trustie_big_log.png" width="100" height="88" alt="Trustie Logo" /></div>
|
||||
<div class="loginInro">欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。</div>
|
||||
</div>
|
||||
<div class="loginRight">
|
||||
<div id="loginInBox">
|
||||
<div class="loginChooseBox">
|
||||
<div class="mb5">
|
||||
<ul class="loginChooseList">
|
||||
<li class="loginChoose fl"><span class="loginChooseTab">登录</span></li>
|
||||
<li class="loginChooseBorder fl"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="loginSignAlert" style="color: red"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></div>
|
||||
</div>
|
||||
<div class="loginIn">
|
||||
|
||||
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
<div class="mb20">
|
||||
<%= text_field_tag 'username', params[:username], :tabindex => '1' ,
|
||||
:class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称', :onkeypress => "user_name_keypress(event);"%>
|
||||
<!--<input type="text" placeholder="请输入邮箱地址或昵称" class="loginSignBox" />-->
|
||||
</div>
|
||||
<% if Setting.openid? %>
|
||||
<div class="mb20">
|
||||
<%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<!--<input type="text" placeholder="请输密码" class="loginSignBox" />-->
|
||||
<%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%>
|
||||
</div>
|
||||
<div class="loginSignOption">
|
||||
<% if Setting.autologin? %>
|
||||
<div class="fl mt3 mr5">
|
||||
<%= check_box_tag 'autologin', 1, true, :tabindex => 4 %>
|
||||
</div>
|
||||
<%= l(:label_stay_logged_in) %>
|
||||
<% end %>
|
||||
<a href="<%= lost_password_path %>" class="newsBlue mr40 fr">
|
||||
<% if Setting.lost_password? %>
|
||||
<u>忘记密码?</u>
|
||||
<% end %>
|
||||
</a></div>
|
||||
<% end %>
|
||||
<div class="loginInButton" >
|
||||
<a href="javascript:void(0);" id="login_btn" class="c_white db" onclick="$('#main_login_form').submit();">登录</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="signUpBox">
|
||||
<div class="loginChooseBox">
|
||||
<ul class="loginChooseList">
|
||||
<li class="loginChoose fl"><span class="loginChooseTab">注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></a></span>
|
||||
<li class="loginChooseBorder fl"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="loginIn">
|
||||
<%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %>
|
||||
<%= error_messages_for 'user' %>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入邮箱地址" class="loginSignBox" />-->
|
||||
<%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%>
|
||||
<div class="loginSignAlert" id="mail_req" style="display: none" >请输入有效邮箱地址</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入密码" class="loginSignBox" />-->
|
||||
<%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %>
|
||||
<div class="loginSignAlert" id="passwd_req" style="display: none">至少需要 6 个字符</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请再次输入密码" class="loginSignBox" />-->
|
||||
<%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %>
|
||||
<div class="loginSignAlert" id="confirm_req" style="display: none">密码不一致</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入用户昵称" class="loginSignBox" />-->
|
||||
<%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%>
|
||||
<div class="loginSignAlert" id="login_req" style="display: none">用户昵称为2-18个中英文,数字或下划线</div>
|
||||
</div>
|
||||
<div class="loginSignOption">
|
||||
<div class="fl mt3 mr5">
|
||||
<input type="checkbox" id="read_and_confirm"/>
|
||||
</div>
|
||||
我已阅读并接受<a href="<%= agreement_path %>" class="newsBlue"><u>Trustie服务协议</u></a>条款</div>
|
||||
<div class="loginUpButton">
|
||||
<a href="javascript:void(0);" class="c_white db" id="regist_btn" onclick="register();">注册</a>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<%= stylesheet_link_tag 'new_user'%>
|
||||
<%= stylesheet_link_tag 'leftside'%>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// $(document).ready(function(){
|
||||
// $("#loginSignButton").click(function(){
|
||||
// $("#signUpBox").css({display:"block"});
|
||||
// $("#loginInBox").css({display:"none"});
|
||||
// });
|
||||
// $("#loginInButton").click(function(){
|
||||
// $("#signUpBox").css({display:"none"});
|
||||
// $("#loginInBox").css({display:"block"});
|
||||
// });
|
||||
// });
|
||||
// $(function(){
|
||||
// $("#username").keypress(function(e){
|
||||
// alert(11);
|
||||
// if (e.keyCode == '13') {
|
||||
// $('#main_login_form').submit();
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// $("#password").keypress(function(e){
|
||||
// if (e.keyCode == '13') {
|
||||
// $('#main_login_form').submit();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".homepageSearchIcon").click(function(){
|
||||
var val=$('input:radio[name="search_type"]:checked').val();
|
||||
if(val==null){
|
||||
$("#navSearchAlert").css({display:"block"});
|
||||
}
|
||||
else {
|
||||
$("#navSearchAlert").css({display:"none"});
|
||||
}
|
||||
});
|
||||
// $("#loginInButton").click(function(){
|
||||
// $("#signUpBox").css({display:"none"});
|
||||
// $("#loginInBox").css({display:"block"});
|
||||
// });
|
||||
});
|
||||
|
||||
$(document).ready(function(){
|
||||
$(".navHomepageSearchBoxcontainer").mouseover(function(){
|
||||
$(".navSearchTypeBox").css({display:"block"});
|
||||
});
|
||||
$(".navHomepageSearchBoxcontainer").mouseout(function(){
|
||||
$(".navSearchTypeBox").css({display:"none"});
|
||||
});
|
||||
})
|
||||
$(document).ready(function(){
|
||||
if(<%= @login%>){
|
||||
$("#signUpBox").css({display:"none"});
|
||||
$("#loginInBox").css({display:"block"});
|
||||
}else{
|
||||
$("#signUpBox").css({display:"block"});
|
||||
$("#loginInBox").css({display:"none"});
|
||||
}
|
||||
});
|
||||
|
||||
// $('#regist_btn').bind('keyup', function(event) {
|
||||
// if (event.keyCode == "13" && $("#signUpBox").css('display') == 'block')) {
|
||||
// register();
|
||||
// }
|
||||
//});
|
||||
function clearInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == content) {
|
||||
$('#' + id).val('');
|
||||
}
|
||||
}
|
||||
|
||||
function showInfo(id, content) {
|
||||
var text = $('#' + id);
|
||||
if (text.val() == '') {
|
||||
$('#' + id).val(content);
|
||||
}
|
||||
}
|
||||
|
||||
function login(){
|
||||
$('#main_login_form').submit(); //表单提交没有任何反应的原因:js冲突
|
||||
}
|
||||
|
||||
function register(){
|
||||
if($login_correct && $mail_correct && $passwd_correct && $passwd_comfirm_correct && $("#read_and_confirm").attr("checked") == 'checked'){
|
||||
$("#main_reg_form").submit();
|
||||
}else{
|
||||
$('#user_login').blur();
|
||||
$('#user_mail').blur();
|
||||
$('#user_password').blur();
|
||||
$('#user_password_confirmation').blur();
|
||||
}
|
||||
}
|
||||
var $login_correct = false;
|
||||
var $mail_correct = false;
|
||||
var $passwd_correct = false;
|
||||
var $passwd_comfirm_correct = false;
|
||||
jQuery(document).ready(function () {
|
||||
var $login = $('#user_login')
|
||||
var $mail = $('#user_mail')
|
||||
var $password = $('#user_password')
|
||||
var $password_confirmation = $('#user_password_confirmation')
|
||||
$login.blur(function (event) {
|
||||
if ($(this).is('#user_login')) {
|
||||
$.get(
|
||||
'<%=account_valid_ajax_path%>',
|
||||
{ valid: "login",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#login_req').html('<span style="color: green">'+data.message+'</span>');
|
||||
$login_correct = true;
|
||||
} else {
|
||||
$('#login_req').html( '<span style="color: red">'+data.message+'</span>');
|
||||
$login_correct = false;
|
||||
}
|
||||
$('#login_req').css('display','block');
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
|
||||
$mail.blur(function (event) {
|
||||
if ($(this).is('#user_mail')) {
|
||||
$.get('<%=account_valid_ajax_path%>',
|
||||
{ valid: "mail",
|
||||
value: this.value },
|
||||
function (data) {
|
||||
if (data.valid) {
|
||||
$('#mail_req').html( '<span style="color: green">'+data.message+'</span>' );
|
||||
$mail_correct = true;
|
||||
} else {
|
||||
$('#mail_req').html( '<span style="color: red">'+data.message+'</span>' );
|
||||
$mail_correct = false;
|
||||
}
|
||||
$('#mail_req').css('display','block');
|
||||
});
|
||||
}
|
||||
;
|
||||
});
|
||||
$password.blur(function () {
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var password_min_length = <%= Setting.password_min_length.to_i %>
|
||||
if (pas1.length >= password_min_length) {
|
||||
$('#passwd_req').html('');
|
||||
$passwd_correct = true;
|
||||
}
|
||||
else {
|
||||
$('#passwd_req').html( '<span style="color: red">'+'<%= l(:setting_password_min_length_limit, :count => Setting.password_min_length.to_i) %>'+'</span>');
|
||||
$passwd_correct = false;
|
||||
}
|
||||
$('#passwd_req').css('display','block');
|
||||
|
||||
|
||||
});
|
||||
$password_confirmation.blur(function () {
|
||||
var password_min_length = <%= Setting.password_min_length.to_i %>
|
||||
var pas1 = document.getElementById("user_password").value;
|
||||
var pas2 = document.getElementById("user_password_confirmation").value;
|
||||
if (pas1.length >= password_min_length && pas1 == pas2 ) {
|
||||
$('#confirm_req').html('<span style="color: green">'+'<%= l(:setting_password_success) %>'+'</span>');
|
||||
$passwd_comfirm_correct = true;
|
||||
}
|
||||
else {
|
||||
$('#confirm_req').html('<span style="color: red">'+'<%= l(:setting_password_error) %>'+'</span>');
|
||||
$passwd_comfirm_correct = false;
|
||||
|
||||
}
|
||||
$('#confirm_req').css('display','block');
|
||||
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function user_name_keypress(e){
|
||||
if (e.keyCode == '13') {
|
||||
$('#main_login_form').submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="loginContentContainer">
|
||||
<div class="loginContent">
|
||||
<div class="loginLeft">
|
||||
<div class="loginLogo"><img src="images/trustie_big_log.png" width="100" height="88" alt="Trustie Logo" /></div>
|
||||
<div class="loginInro"> 欢迎加入Trustie高校创新实践社区!老师、学生和科研人员可以在此开展各种在线协同学习、协同作业、协同开发等活动。<br/><br/> Trustie是在中国推行大规模开放在线研究模式(MOORE)的支撑平台。</div>
|
||||
</div>
|
||||
<div class="loginRight">
|
||||
<div id="loginInBox">
|
||||
<div class="loginChooseBox">
|
||||
<div class="mb5">
|
||||
<ul class="loginChooseList">
|
||||
<li class="loginChoose fl"><span class="loginChooseTab">登录</span></li>
|
||||
<li class="loginChooseBorder fl"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="loginSignAlert" style="color: red"><%= flash.empty? || flash[:error].nil? ? "" : flash[:error].html_safe %></div>
|
||||
</div>
|
||||
<div class="loginIn">
|
||||
|
||||
<%= form_tag(signin_path,:id=>'main_login_form',:method=>'post') do %>
|
||||
<%= back_url_hidden_field_tag %>
|
||||
<div class="mb20">
|
||||
<%= text_field_tag 'username', params[:username], :tabindex => '1' ,
|
||||
:class=>'loginSignBox',:placeholder=>'请输入邮箱地址或昵称', :onkeypress => "user_name_keypress(event);"%>
|
||||
<!--<input type="text" placeholder="请输入邮箱地址或昵称" class="loginSignBox" />-->
|
||||
</div>
|
||||
<% if Setting.openid? %>
|
||||
<div class="mb20">
|
||||
<%= text_field_tag "openid_url", nil, :tabindex => '3',:placeholder=>'请输入OpenId URL' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div>
|
||||
<!--<input type="text" placeholder="请输密码" class="loginSignBox" />-->
|
||||
<%= password_field_tag 'password', nil, :tabindex => '2',:class=>'loginSignBox' ,:placeholder=>'请输密码', :onkeypress => "user_name_keypress(event);"%>
|
||||
</div>
|
||||
<div class="loginSignOption">
|
||||
<% if Setting.autologin? %>
|
||||
<div class="fl mt3 mr5">
|
||||
<%= check_box_tag 'autologin', 1, true, :tabindex => 4 %>
|
||||
</div>
|
||||
<%= l(:label_stay_logged_in) %>
|
||||
<% end %>
|
||||
<a href="<%= lost_password_path %>" class="newsBlue mr40 fr">
|
||||
<% if Setting.lost_password? %>
|
||||
<u>忘记密码?</u>
|
||||
<% end %>
|
||||
</a></div>
|
||||
<% end %>
|
||||
<div class="loginInButton" >
|
||||
<a href="javascript:void(0);" id="login_btn" class="c_white db" onclick="$('#main_login_form').submit();">登录</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div id="signUpBox">
|
||||
<div class="loginChooseBox">
|
||||
<ul class="loginChooseList">
|
||||
<li class="loginChoose fl"><span class="loginChooseTab">注册<%= link_to l(:label_login_with_open_id_option), signin_url if Setting.openid? %></a></span>
|
||||
<li class="loginChooseBorder fl"></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="loginIn">
|
||||
<%= form_for :user, :url => register_path,:method=>'post',:html=>{:id=>'main_reg_form'} do |f| %>
|
||||
<%= error_messages_for 'user' %>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入邮箱地址" class="loginSignBox" />-->
|
||||
<%= f.text_field :mail,:size => 25, :class=>'loginSignBox' ,:placeholder=>"请输入邮箱地址"%>
|
||||
<div class="loginSignAlert" id="mail_req" style="display: none" >请输入有效邮箱地址</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入密码" class="loginSignBox" />-->
|
||||
<%= f.password_field :password, :size => 25,:placeholder=>"请输入密码",:class=>'loginSignBox' %>
|
||||
<div class="loginSignAlert" id="passwd_req" style="display: none">至少需要 6 个字符</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请再次输入密码" class="loginSignBox" />-->
|
||||
<%= f.password_field :password_confirmation, :size => 25,:placeholder=>"请再次输入密码",:class=>'loginSignBox' %>
|
||||
<div class="loginSignAlert" id="confirm_req" style="display: none">密码不一致</div>
|
||||
</div>
|
||||
<div class="loginSignRow">
|
||||
<!--<input type="text" placeholder="请输入用户昵称" class="loginSignBox" />-->
|
||||
<%= f.text_field :login, :size => 25,:placeholder=>"请输入用户昵称",:class=>'loginSignBox'%>
|
||||
<div class="loginSignAlert" id="login_req" style="display: none">用户昵称为2-18个中英文,数字或下划线</div>
|
||||
</div>
|
||||
<div class="loginSignOption">
|
||||
<div class="fl mt3 mr5">
|
||||
<input type="checkbox" id="read_and_confirm"/>
|
||||
</div>
|
||||
我已阅读并接受<a href="<%= agreement_path %>" class="newsBlue"><u>Trustie服务协议</u></a>条款</div>
|
||||
<div class="loginUpButton">
|
||||
<a href="javascript:void(0);" class="c_white db" id="regist_btn" onclick="register();">注册</a>
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<h3 style="float: left">
|
||||
<%=l(:label_system_message)%>
|
||||
</h3><br/>
|
||||
<div style="padding-top: 20px; padding-left: 5px;">
|
||||
<%= form_for(@admin_messages, :html => {:id =>'system_message-form'}) do |f| %>
|
||||
<div class="field">
|
||||
<%= f.kindeditor :content,:width=>'87%',:editor_id=>'system_message_editor' %>
|
||||
<p id="content_notice_span" class="ml55"></p>
|
||||
</div>
|
||||
<div>
|
||||
<p id="content_notice_span" class="ml55"></p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= link_to l(:label_submit), "javascript:void(0)", :class => "btn_message_free", :onclick => "system_message_editor.sync();submit_message();" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>
|
||||
function system_message_length() {
|
||||
var obj = system_message_editor.html();
|
||||
if (obj.length == 0) {
|
||||
$("#content_notice_span").text("内容不能为空");
|
||||
$("#content_notice_span").css('color', '#ff0000');
|
||||
$("#content_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else if (obj.length > 255) {
|
||||
$("#content_notice_span").text("内容过长,超过255个字符");
|
||||
$("#content_notice_span").css('color', '#ff0000');
|
||||
$("#content_notice_span").focus();
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#content_notice_span").text("填写正确");
|
||||
$("#content_notice_span").css('color', '#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
function submit_message() {
|
||||
|
||||
if (system_message_length()) {
|
||||
$("#system_message-form").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_news', :locals => {:activity => @news,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||
|
||||
init_KindEditor_data('<%= @user_activity_id%>');
|
||||
init_activity_KindEditor_data('<%= @user_activity_id%>',"","85%");
|
||||
|
|
|
@ -57,6 +57,8 @@
|
|||
:id => 'new-watcher-form') do %>
|
||||
<ul>
|
||||
<li>
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<span class="tips">课 程 ID:</span>
|
||||
<input class=" width190" name="object_id" id="object_id" type="text" value="" >
|
||||
<input type="text" style="display: none"/>
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
<ul>
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<li class="ml45">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class="ml45">
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_course_name)%> :</label>
|
||||
<input type="text" name="course[name]" id="course_name" class="courses_input" maxlength="100" onkeyup="regex_course_name();" value="<%= @course.name%>">
|
||||
<span class="c_red" id="course_name_notice" style="display: none;">课程名称不能为空</span>
|
||||
|
|
|
@ -223,6 +223,54 @@
|
|||
});
|
||||
|
||||
}
|
||||
var tagNameHtml; //当前双击的链接的父节点的html
|
||||
var tagName; //标签的值
|
||||
var parentCssBorder; //当前双击的链接的父节点
|
||||
var ele; //当前双击的链接
|
||||
var tagId; //标签的id
|
||||
var taggableType; //被标签的类型
|
||||
function rename_tag(domEle,name,id,type){
|
||||
if(domEle.children().get(0) != undefined ){ //已经是编辑框的情况下不要动
|
||||
return;
|
||||
}
|
||||
tagNameHtml = domEle.parent().html()
|
||||
tagName = name;
|
||||
parentCssBorder = domEle.parent().css("border");
|
||||
ele = domEle;
|
||||
tagId = id;
|
||||
taggableType = type;
|
||||
domEle.html('<input name="" id="renameTagName" style="width: 100px;" value="'+name+'"/>');
|
||||
domEle.parent().css("border","1px solid #ffffff");
|
||||
$("#renameTagName").focus();
|
||||
}
|
||||
//监听所有的单击事件
|
||||
$(document.body).click(function(e){
|
||||
node = document.elementFromPoint(e.clientX, e.clientY);
|
||||
if(node.tagName == "INPUT"){ //如果是输入框的聚焦,那么就不要进行下去了
|
||||
return;
|
||||
}
|
||||
if($("#renameTagName")[0] != undefined ){//存在renameTagName,则处于编辑状态
|
||||
if($("#renameTagName").val().trim() == tagName){ //如果值一样,则恢复原来的状态
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
|
||||
}else{ //否则就要更新tag名称了
|
||||
if(confirm("是否将标签改为 "+ $("#renameTagName").val().trim())){
|
||||
$.post(
|
||||
'<%= update_tag_name_path %>',
|
||||
{"taggableId":tagId,"taggableType":taggableType,"tagName":tagName,"renameName":$("#renameTagName").val().trim()}
|
||||
// function(data){
|
||||
// ele.parent().css("border","");
|
||||
// ele.parent().html(tagNameHtml);
|
||||
// }
|
||||
)
|
||||
}else{
|
||||
ele.parent().css("border","");
|
||||
ele.parent().html(tagNameHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,74 +1,74 @@
|
|||
<div class="homepageRight">
|
||||
<div class="HomeWork">
|
||||
<div class="RightBanner">
|
||||
<div class="NewsBannerName">发布作业</div>
|
||||
</div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<textarea class="InputBox W700 " placeholder="请输入作业标题" name="homework_common[name]" id="homework_name" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>"></textarea>
|
||||
</div>
|
||||
<div class=" mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.end_time%>" placeholder="截止日期"></input>
|
||||
<div class="fl DateBorder mr10"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.publish_time%>" placeholder="发布日期"></input>
|
||||
<div class="fl DateBorder"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W700 SearchIcon" placeholder="发送到课程" style="margin-top: 0px; margin-bottom: 0px; height: 29px;"></textarea>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3">上传附件</a>
|
||||
<a href="javascript:void(0);" class="FilesBtn fl mr15 mt3">资源库</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class=" fl DropBtn">高级功能</a>
|
||||
<div class="DropLine"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="advanced_option" style="display:none;">
|
||||
<div class="mt10">
|
||||
<select class="InputBox W120" required="true">
|
||||
<option value="语言选择">语言选择</option>
|
||||
<option value="C语言">C语言</option>
|
||||
<option value="C++">C++</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></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>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" onClick="submit_homework('new_homework_common');" class="BlueCirBtnMini fr">发布</a>
|
||||
<span class="fr mr10 mt3">或</span><%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'fr mr10 mt3'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
|
||||
</div>
|
||||
|
||||
<script id="t:test-answer-list" type="text/html">
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></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>
|
||||
|
||||
<div class="homepageRight">
|
||||
<div class="HomeWork">
|
||||
<div class="RightBanner">
|
||||
<div class="NewsBannerName">发布作业</div>
|
||||
</div>
|
||||
<div class="HomeWorkCon">
|
||||
<div class="mt15">
|
||||
<textarea class="InputBox W700 " placeholder="请输入作业标题" name="homework_common[name]" id="homework_name" maxlength="255" onkeyup="regex_homework_name();" value="<%= homework.name%>"></textarea>
|
||||
</div>
|
||||
<div class=" mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl mr10">导入作业</a>
|
||||
<input type="text" name="homework_common[end_time]" id="homework_end_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.end_time%>" placeholder="截止日期"></input>
|
||||
<div class="fl DateBorder mr10"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<input type="text" name="homework_common[publish_time]" id="homework_publish_time" class="InputBox fl W120 date-input" readonly="readonly" value="<%= homework.publish_time%>" placeholder="发布日期"></input>
|
||||
<div class="fl DateBorder"><a href="javascript:void(0);" class="pic_date"></a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<% if edit_mode %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor',:owner_id => homework.id,:owner_type =>OwnerTypeHelper::HOMEWORKCOMMON %>
|
||||
<% else %>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= f.kindeditor :description,:editor_id => 'homework_description_editor' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W700 SearchIcon" placeholder="发送到课程" style="margin-top: 0px; margin-bottom: 0px; height: 29px;"></textarea>
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr20">上传附件</a>
|
||||
<a href="javascript:void(0);" class="FilesBtn fl mr15 mt3">资源库</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class=" fl DropBtn">高级功能</a>
|
||||
<div class="DropLine"></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="advanced_option" style="display:none;">
|
||||
<div class="mt10">
|
||||
<select class="InputBox W120" required="true">
|
||||
<option value="语言选择">语言选择</option>
|
||||
<option value="C语言">C语言</option>
|
||||
<option value="C++">C++</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></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>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" onClick="submit_homework('new_homework_common');" class="BlueCirBtnMini fr">发布</a>
|
||||
<span class="fr mr10 mt3">或</span><%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'fr mr10 mt3'%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!----HomeWork end-->
|
||||
|
||||
</div>
|
||||
|
||||
<script id="t:test-answer-list" type="text/html">
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" required></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出" required></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>
|
||||
|
||||
|
|
|
@ -3,5 +3,4 @@ showModal('ajax-modal', '500px');
|
|||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed");
|
|
@ -27,7 +27,7 @@
|
|||
<% if @is_teacher%>
|
||||
<%= homework_anonymous_comment(homework)%>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "fr mr10 work_edit") %>
|
||||
<%#= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<%= link_to(l(:button_edit),edit_homework_common_path(homework), :class => "fr mr10 work_edit") %>
|
||||
<% elsif @is_student%>
|
||||
<%= student_anonymous_comment homework %>
|
||||
<%= student_new_homework homework %>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% if @statue == 1%>
|
||||
alert('启动成功');
|
||||
$("#<%= @homework.id %>_start_anonymous_comment").replaceWith('<%= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "fr mr10 work_edit")%>');
|
||||
$("#<%= @homework.id %>_start_anonymous_comment").replaceWith('<%= escape_javascript(link_to "关闭匿评", alert_anonymous_comment_homework_common_path(@homework), remote: true, id:"#{@homework.id}_stop_anonymous_comment",:class => "postOptionLink")%>');
|
||||
<% elsif @statue == 2 %>
|
||||
alert('启动失败\n作业总数大于等于2份时才能启动匿评');
|
||||
<% elsif @statue == 3%>
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('<span class="fr pr_join_span mr10" title="匿评结束">匿评结束</span>');
|
||||
$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('<a class="postOptionLink" title="匿评结束" href="javascript:void(0);">匿评结束</a>');
|
||||
alert('关闭成功');
|
|
@ -1,3 +1,3 @@
|
|||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_issue', :locals => {:activity => @issue,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||
|
||||
init_KindEditor_data(<%= @user_activity_id%>);
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%");
|
|
@ -33,36 +33,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="Container">
|
||||
<div id="TopBar">
|
||||
<div class="topbar_info02 fl">
|
||||
<h2>
|
||||
<a href="http://<%= Setting.host_course%>" target="_blank" class="c_blue">
|
||||
<%= l(:label_courses_community)%>
|
||||
</a>
|
||||
</h2>
|
||||
<p class="hiddent">
|
||||
<%= l(:label_user_location) %> :
|
||||
<%= link_to l(:field_homepage), home_path %>
|
||||
>
|
||||
<a href="http://<%= Setting.host_course%>">
|
||||
<%=l(:label_courses_management_platform)%>
|
||||
</a>
|
||||
>
|
||||
<%= link_to @course.name, course_path(@course) %>
|
||||
</p>
|
||||
</div>
|
||||
<!--<div class="search fl">-->
|
||||
<!--<%#= form_tag({:controller => 'courses', :action => 'search'},:id => "course_search_form", :method => :get, :class => "search_form") do %>-->
|
||||
<!--<input class="search_text fl" id="name" name="name" onkeyup="regexName('搜索条件不能为空');" placeholder="课程名称" type="text">-->
|
||||
<!--<a href="javascript:void(0)" onclick="submitSerch('<%#= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >-->
|
||||
<!--<%#= l(:label_search)%>-->
|
||||
<!--</a>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span id="project_name_span" style="float: left"></span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
</div><!--TopBar end-->
|
||||
<div class="cl"></div>
|
||||
<div id="content">
|
||||
<div id="LSide" class="fl">
|
||||
<div class="project_info">
|
||||
|
@ -77,7 +47,7 @@
|
|||
<% if is_teacher%>
|
||||
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, {:controller => 'courses', :action => 'settings', :id => @course}, :class => "pr_join_a" %>
|
||||
<%= set_course_time @course%>
|
||||
<%= link_to "<span class='pr_copy'></span>#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
|
||||
<%#= link_to "<span class='pr_copy'></span>#{l(:button_copy)}".html_safe, copy_course_course_path(@course.id), :class => "pr_join_a" %>
|
||||
<% else%>
|
||||
<div id="join_in_course_header"><%= join_in_course_header(@course, User.current) %></div>
|
||||
<% end%>
|
||||
|
@ -87,12 +57,12 @@
|
|||
<div >
|
||||
<a class="pr_info_name fl c_dark fb break_word" href="http://<%= Setting.host_course%>/courses/<%= @course.id%>" target="_blank">
|
||||
<%= @course.name %>
|
||||
<% if @course.is_public == 0%>
|
||||
</a>
|
||||
<% if @course.is_public == 0%>
|
||||
<span class="img_private ">
|
||||
<%= l(:field_is_private)%>
|
||||
</span>
|
||||
<% end %>
|
||||
</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="pr_info_foot ">
|
||||
|
@ -123,7 +93,7 @@
|
|||
<div class="subNav">
|
||||
<%= link_to l(:label_homework), homework_common_index_path(:course => @course.id), :class => "f14 c_blue02"%>
|
||||
<%= link_to "(#{@course.homework_commons.count})", homework_common_index_path(:course => @course.id), :class => "subnav_num c_orange"%>
|
||||
<%#= link_to( "+#{l(:label_course_homework_new)}", new_homework_common_path(:course => @course.id), :class => 'subnav_green c_white') if is_teacher %>
|
||||
<%= link_to( "+#{l(:label_course_homework_new)}", "javascript:void(0)", :class => 'subnav_green c_white', :onclick => "new_homework_alert();") if is_teacher %>
|
||||
</div>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_news), course_news_index_path(@course), :class => "f14 c_blue02" %>
|
||||
|
@ -175,12 +145,12 @@
|
|||
</div><!--LSide end-->
|
||||
|
||||
<div id="RSide" class="fl">
|
||||
<%= render_flash_messages %>
|
||||
<%= yield %>
|
||||
<%= call_hook :view_layouts_base_content %>
|
||||
<%#= render_flash_messages %>
|
||||
<%#= call_hook :view_layouts_base_content %>
|
||||
</div>
|
||||
|
||||
<div style="clear:both;"></div>
|
||||
<div class="cl"></div>
|
||||
|
||||
</div><!--Content end-->
|
||||
</div><!--Container end-->
|
||||
|
|
|
@ -49,16 +49,6 @@
|
|||
<%= link_to l(:field_homepage), home_path %> > <a href="http://<%= Setting.host_name %>"><%=l(:label_project_hosting_platform) %> </a>><%= link_to @project.name, project_path(@project.id) %>
|
||||
</p>
|
||||
</div>
|
||||
<!--<div class="search fl">-->
|
||||
<!--<%#= form_tag(projects_search_path, :method => :get, :id => "project_search_form", :class => "search_form") do %>-->
|
||||
<!--<%#= text_field_tag 'name', params[:name], :placeholder => "项目名称", :class => "search_text fl", :onkeyup => "regexName('#{l(:label_search_conditions_not_null)}');" %>-->
|
||||
<!--<a href="#" onclick="submitSerch('<%#= l(:label_search_conditions_not_null) %>');" class="search_btn fl f14 c_white" >-->
|
||||
<!--<%#= l(:label_search)%>-->
|
||||
<!--</a>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<span id="project_name_span" class="fl"></span>-->
|
||||
<!--<%# end %>-->
|
||||
<!--</div>-->
|
||||
</div><!--TopBar end-->
|
||||
|
||||
<div id="content">
|
||||
|
|
|
@ -331,8 +331,8 @@
|
|||
<span>48px*48px</span> <br />
|
||||
</div>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确 定</a>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确 定</a>
|
||||
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -103,15 +103,15 @@
|
|||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuCourses').slideToggle();">课程</a>
|
||||
<% if is_current_user%>
|
||||
<% if User.current.user_extensions && User.current.user_extensions.identity == 0 && User.current.allowed_to?(:add_course, nil, :global => true)%>
|
||||
<%=link_to "", new_course_path, :class => "homepageMenuSetting fr", :title => "新建课程"%>
|
||||
<%=link_to "", new_course_path(:host=> Setting.host_course), :class => "homepageMenuSetting fr", :title => "新建课程"%>
|
||||
<% else%>
|
||||
<%=link_to "", join_private_courses_courses_path, :class => "homepageMenuSetting fr",:remote => true, :title => "加入课程"%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuCourses">
|
||||
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
||||
<div class="homepageLeftMenuCourses <%= courses.empty? ? 'none' : ''%>" id="homepageLeftMenuCourses">
|
||||
<ul>
|
||||
<% courses = @user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(5)%>
|
||||
<%= render :partial => 'layouts/user_courses', :locals => {:courses => courses,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -119,18 +119,18 @@
|
|||
<a href="javascript:void(0);" class="homepageMenuText" onclick="$('#homepageLeftMenuForge').slideToggle();">项目</a>
|
||||
|
||||
<% if is_current_user%>
|
||||
<%=link_to "", new_project_path, :class => "homepageMenuSetting fr", :title => "新建项目"%>
|
||||
<%=link_to "", new_project_path(:host=> Setting.host_name), :class => "homepageMenuSetting fr", :title => "新建项目"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="homepageLeftMenuCourses" id="homepageLeftMenuForge">
|
||||
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<div class="homepageLeftMenuCourses <%= projects.empty? ? 'none' : ''%>" id="homepageLeftMenuForge">
|
||||
<ul>
|
||||
<% projects = @user.projects.visible.select("projects.*,(SELECT MAX(created_at) FROM `forge_activities` WHERE forge_activities.project_id = projects.id) AS a").order("a desc").limit(5)%>
|
||||
<%= render :partial => 'layouts/user_projects', :locals => {:projects => projects,:user => @user, :page => 0} %>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="homepageLeftMenuBlock">
|
||||
<!--<a href="javascript:void(0);" class="homepageMenuText">留言</a>-->
|
||||
<%= link_to '留言',feedback_path(@user),:class=>'homepageMenuText'%>
|
||||
<%= link_to '留言',feedback_path(@user, :host=> Setting.host_user),:class=>'homepageMenuText'%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="homepageLeftLabelContainer">
|
||||
|
@ -195,8 +195,8 @@
|
|||
<span>48px*48px</span> <br />
|
||||
</div>
|
||||
<div class="cl mb10"></div>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10">确 定</a>
|
||||
<a href="javascript:hideModal();" class=" fr grey_btn mr15 f14"> 取 消</a>
|
||||
<a href="<%= url_for(:controller => 'my', :action => 'save_user_avatar') %>" data-remote="true" class="blue_btn fr mr10 f14">确 定</a>
|
||||
</div><!--talknew end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--floatbox end-->
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<%if @project%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/project_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||
<%elsif @course%>
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id}) %>");
|
||||
$("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_message', :locals => {:activity => @topic,:user_activity_id =>@user_activity_id,:first_user_activity =>@first_user_activity,:page => @page}) %>");
|
||||
<%end%>
|
||||
init_KindEditor_data(<%= @user_activity_id%>);
|
||||
init_activity_KindEditor_data(<%= @user_activity_id%>,"","85%");
|
|
@ -1,3 +1,3 @@
|
|||
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:90px;height:90px;overflow:hidden",:alt=>"头像") %>');
|
||||
$("#nh_user_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
|
||||
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
|
||||
hideModal();
|
|
@ -32,7 +32,8 @@
|
|||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
||||
</div>
|
||||
<p class="mt10">
|
||||
<p id="add_reply_news"></p>
|
||||
<p class="mt10">
|
||||
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="KindEditor.instances[0].html('');">
|
||||
<%= l(:label_cancel_with_space) %>
|
||||
</a>
|
||||
|
@ -48,7 +49,7 @@
|
|||
<% comments.each do |comment| %>
|
||||
<% next if comment.new_record? %>
|
||||
<div class="ping_C mb10">
|
||||
<div class="ping_dispic"><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author)%></div>
|
||||
<div><%= link_to image_tag(url_to_avatar(comment.author),:width => 42,:height => 42), user_path(comment.author), :class => "problem_pic fl"%></div>
|
||||
<div class="ping_discon">
|
||||
<div class="ping_distop upload_img break_word">
|
||||
<%= link_to_user_header(comment.author,false,:class => 'c_blue fb fl mb10 ') if comment.respond_to?(:author) %>
|
||||
|
@ -76,4 +77,4 @@
|
|||
<% end %>
|
||||
|
||||
|
||||
<% html_title @news.title -%>
|
||||
<% html_title @news.title -%>
|
|
@ -1,7 +1,7 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
<li>
|
||||
<label><span class="c_red">*</span> <%= l(:field_title) %> :</label>
|
||||
<input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onkeyup="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||
<input type="text" name="news[title]" class="hwork_input_news" id="news_title" width="576px" onblur="regexTitle();" maxlength="60" placeholder="60个字符以内" value="<%= is_new ? '' : @news.title %>">
|
||||
<p id="title_notice_span" class="ml55"></p>
|
||||
</li>
|
||||
<li class="mb10">
|
||||
|
|
|
@ -12,14 +12,6 @@
|
|||
<p style="padding-right: 20px;">
|
||||
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:0px;" %>
|
||||
</p><!--by young-->
|
||||
<p>
|
||||
<%#= f.text_field :enterprise_name, :size => 60, :style => "width:490px;" %>
|
||||
<label for="project_description">
|
||||
<%= l(:field_enterprise_name)%>
|
||||
<span class="required"> </span>
|
||||
</label>
|
||||
<%= select_tag :organization_id,options_for_select(project_organizations_id_option,@project.organization_id),{} %>
|
||||
</p>
|
||||
<p style="display: none" >
|
||||
<%= f.text_field :identifier, :required => true, :size => 60, :style => "width:488px;", :disabled => @project.identifier_frozen?, :maxlength => Project::IDENTIFIER_MAX_LENGTH,
|
||||
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
$("#project_id").replaceWith("<%= escape_javascript(select_tag :project_id, options_for_select(user_projects_option), {:class => "InputBox W680 fl"})%>");
|
||||
hideModal("#popbox02");
|
||||
alert("创建成功");
|
|
@ -2,13 +2,15 @@
|
|||
$(function(){
|
||||
<%if @select_tab%>
|
||||
<%if @select_tab == "modules"%>
|
||||
project_setting(2);
|
||||
project_setting(2);
|
||||
<% elsif @select_tab == "members"%>
|
||||
project_setting(3);
|
||||
<% elsif @select_tab == "versions"%>
|
||||
project_setting(4);
|
||||
$("#pro_st_edit_ban").toggle();
|
||||
project_setting(4);
|
||||
$("#pro_st_edit_ban").toggle();
|
||||
<% elsif @select_tab == "repositories" %>
|
||||
project_setting(6);
|
||||
$("#pro_st_edit_ku").toggle();
|
||||
project_setting(6);
|
||||
$("#pro_st_edit_ku").toggle();
|
||||
<%else%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
|
|
|
@ -19,11 +19,6 @@
|
|||
<textarea class="w543" id="project_description" name="project[description]" rows="8" placeholder="最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<label class="label02"> 组织 :</label>
|
||||
<%= select_tag :organization_id,options_for_select(project_organizations_id_option,@project.organization_id),{} %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li >
|
||||
<label class="label02">公开 :</label>
|
||||
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
</a>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post"} do |f| %>
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
|
||||
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
|
||||
<ul>
|
||||
<li >
|
||||
|
@ -79,6 +79,8 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<li >
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%>:</label>
|
||||
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
|
||||
<% unless @repository.identifier_frozen? %>
|
||||
|
@ -87,7 +89,7 @@
|
|||
</li>
|
||||
<li >
|
||||
<label class="label02"><span class="c_red">*</span><%=l(:label_password)%></label>
|
||||
<%= f.password_field :upassword, :label=> "", :no_label => true %>
|
||||
<%= f.password_field :upassword, :label=> "", :no_label => true%>
|
||||
<span class="c_grey"><%= l(:label_upassword_info)%></span>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_index_path(:score_id => score.id)) do |f|%>
|
||||
<%= f.text_area 'message', :class => 'ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %>
|
||||
<input type="hidden" value="<%= is_last%>" name="is_last">
|
||||
<a href="javascript:void(0);" class="fr blue_n_btn" onclick="$('#add_score_reply_<%= score.id%>').find('form').submit();">回复</a>
|
||||
<% end%>
|
|
@ -1,47 +0,0 @@
|
|||
<li class="hwork_num ">
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class=" hwork_name f14 fb c_dark">
|
||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "name"%>
|
||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hwork_tit">
|
||||
<span class="c_dark f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<li class=" hwork_time f14 fb c_dark">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="mr5 w40 ml15">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="mr5 w40 ml20">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="ml15 w40">
|
||||
<% if @homework.homework_type == 1%>
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% elsif @homework.homework_type == 2%>
|
||||
<%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% end %>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="ml20">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
|
@ -0,0 +1,8 @@
|
|||
<ul class="hworkUl b_grey">
|
||||
<li class="hworkList380 width625">
|
||||
<span class="c_dark f14 fb fl ml10">作品信息</span>
|
||||
</li>
|
||||
<li class="hworkList80 mr10" >
|
||||
<span class="c_dark f14 fb fl ml10">我的评分</span>
|
||||
</li>
|
||||
</ul>
|
|
@ -0,0 +1,37 @@
|
|||
<ul class="hworkUl b_grey">
|
||||
<li class="hworkList380 <%= @homework.homework_type == 2 ? '' : 'width455'%>">
|
||||
<span class="c_dark f14 fb fl ml10">作品信息</span>
|
||||
</li>
|
||||
<li class="hworkList80" >
|
||||
<%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkList80">
|
||||
<%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<li class="hworkList80">
|
||||
<%= link_to "系统评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<% if @show_all && @order == "system_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<% end%>
|
||||
<li class="hworkList50">
|
||||
<%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<% if @show_all && @order == "student_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkList50">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -0,0 +1,76 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<li class="hworkList380 <%= @homework.homework_type == 2 ? '' : 'width455'%>">
|
||||
<ul>
|
||||
<li class="hworkName mt12">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<ul class="mt12">
|
||||
<li class="hworkDetail mr15">
|
||||
姓名:<%= student_work.user.show_name%>
|
||||
</li>
|
||||
<li class="hworkDetail mr15">
|
||||
学号:
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</li>
|
||||
<li class="hworkDate">
|
||||
时间:
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">迟交</span>
|
||||
<% else%>
|
||||
<%= format_time student_work.created_at%>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="hworkList80 <%= score_color student_work.teacher_score%>">
|
||||
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>
|
||||
</li>
|
||||
<li class="hworkList80 <%= score_color student_work.teaching_asistant_score%>">
|
||||
<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
|
||||
</li>
|
||||
|
||||
<% if @homework.homework_type == 2%>
|
||||
<!-- 系统评分 -->
|
||||
<li class="hworkList80 <%= score_color student_work.system_score%>">
|
||||
<%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
|
||||
</li>
|
||||
<% end%>
|
||||
<li class="hworkList50 <%= score_color student_work.student_score%> student_score_info">
|
||||
<%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%>
|
||||
<% unless student_work.student_score.nil?%>
|
||||
<span class="linkBlue">
|
||||
(<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>)
|
||||
</span>
|
||||
<div class="infoNi none">
|
||||
现共有
|
||||
<span class="c_red"> <%= student_work.student_works_scores.where(:reviewer_role => 3).count%> </span>
|
||||
名学生进行了匿评,平均分为
|
||||
<span class="c_red"> <%= format("%.1f",student_work.student_score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
|
||||
<!-- 成绩 -->
|
||||
<% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%>
|
||||
<li class="hworkList50 <%= score_color score%> student_final_scor_info">
|
||||
<%= score.nil? ? "--" : format("%.1f",score)%>
|
||||
<% unless score.nil?%>
|
||||
<div class="infoNi none width180">
|
||||
作品最终评分为
|
||||
<span class="c_red"> <%= student_work.final_score%> </span>分。
|
||||
迟交扣分
|
||||
<span class="c_red"> <%= student_work.late_penalty%> </span>分,
|
||||
缺评扣分
|
||||
<span class="c_red"> <%= student_work.absence_penalty%> </span>分,
|
||||
最终成绩为
|
||||
<span class="c_red"> <%= format("%.1f",score)%> </span>分。
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
</ul>
|
|
@ -1,29 +1,51 @@
|
|||
<!-- 匿评作品列表,显示某一个作品的信息 -->
|
||||
<ul class="hwork_ul <%= cycle("b_grey", "") %>" id="student_work_<%= student_work.id%>">
|
||||
<ul class="hworkListRow" id="student_work_<%= student_work.id%>">
|
||||
<% is_my_work = student_work.user == User.current%>
|
||||
<li class="hwork_num">
|
||||
<% if is_my_work%>
|
||||
<span>
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% else%>
|
||||
<span class="ml30">--</span>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hwork_name">
|
||||
<% if is_my_work%>
|
||||
<%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02" %>
|
||||
<% else%>
|
||||
<%= link_to "匿名","javascript:void(0)", :class => "c_blue02"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class=" hwork_tit_e" style="width: 410px">
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%>
|
||||
<li class="hworkList380 width620">
|
||||
<ul>
|
||||
<li class="hworkName mt12 m_width620">
|
||||
<% if is_my_work%>
|
||||
<% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%>
|
||||
<%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
<% else%>
|
||||
<%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%>
|
||||
<% end%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
<li>
|
||||
<ul class="mt12">
|
||||
<li class="hworkDetail mr15">
|
||||
姓名:
|
||||
<% if is_my_work%>
|
||||
<%= student_work.user.show_name%>
|
||||
<% else%>
|
||||
匿名
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkDetail mr15">
|
||||
学号:
|
||||
<% if is_my_work%>
|
||||
<span>
|
||||
<%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%>
|
||||
</span>
|
||||
<% else%>
|
||||
--
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hworkDate">
|
||||
时间:
|
||||
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
|
||||
<span class="c_red">迟交</span>
|
||||
<% else%>
|
||||
<%= format_time student_work.created_at%>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<% my_score = student_work_score(student_work,User.current) %>
|
||||
<li class=" hwork_code <%= my_score.nil? ? 'c_grey' : 'c_red'%>">
|
||||
<%= my_score.nil? ? "--" : format("%.2f",my_score.score)%>
|
||||
<li class="hworkList80 <%= my_score.nil? ? 'c_grey' : score_color(my_score.score)%> mr10">
|
||||
<%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul><!---hwork_ul end-->
|
||||
</ul>
|
|
@ -1,12 +0,0 @@
|
|||
<li class="hwork_num ">
|
||||
<span class="f14 f_b c_dark fl ">学号</span>
|
||||
</li>
|
||||
<li class="hwork_name f14 fb c_dark">
|
||||
<span class="c_dark f14 fb fl ">学生姓名</span>
|
||||
</li>
|
||||
<li class="hwork_tit_e">
|
||||
<span class="c_dark f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<li class="w70 mr5" >
|
||||
<%= link_to "我的评分","javascript:void(0)",:class => "c_dark f14 fb fl"%>
|
||||
</li>
|
|
@ -6,9 +6,9 @@
|
|||
</a>
|
||||
<% if jour.user==User.current || User.current.admin? %>
|
||||
<%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id),
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr c_purple") %>
|
||||
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr linkBlue mr5") %>
|
||||
<% end %>
|
||||
<span class=" fr c_grey mr10">
|
||||
<span class=" fr c_grey mr20">
|
||||
<%=format_time jour.created_on %>
|
||||
</span>
|
||||
<div class="cl mb5"></div>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<div class="BluePopupBox" id="popbox02">
|
||||
<%= labelled_form_for(Project.new,:remote => "true") do |f| %>
|
||||
<h2 class="BluePopuph2 fl">新建项目</h2>
|
||||
<div class="cl"></div>
|
||||
<div class="">
|
||||
<div class="mt10 mb10">
|
||||
<input type="text" class="none" />
|
||||
<input class="InputBox W700" placeholder="项目名称" name="project[name]" id="project_name" onkeyup="regex_project_name();" />
|
||||
<p id="project_name_error_msg" class="c_red"></p>
|
||||
</div>
|
||||
<div class="mb10">
|
||||
<textarea class="InputBox W700" placeholder="项目描述" id="project_description" name="project[description]" onkeyup="regex_project_desc();"></textarea>
|
||||
<p id="project_desc_error_msg" class="c_red"></p>
|
||||
<script>
|
||||
var text = document.getElementById("project_description");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<div class="fl">
|
||||
<input type="checkbox" name="project[is_public]" class="mt5" checked value="1" /><label class=" ml5 ">公开</label>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_project();">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<a href="javascript:void(0);" class=" fr mr10 mt3" onclick="clickCanel();">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div><!----BluePopupBox end-->
|
|
@ -1,78 +1,102 @@
|
|||
<div class="show_hwork_arrow"></div>
|
||||
<div class="show_hwork">
|
||||
<div class="showHwork">
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">
|
||||
上交时间:
|
||||
</span>
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time @work.created_at %>
|
||||
</li>
|
||||
<% if @work.user != User.current%>
|
||||
<!-- 不是自己显示为点赞,编程作业不可编辑和删除 -->
|
||||
|
||||
<% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
|
||||
</li>
|
||||
<li class="fr" >
|
||||
<%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= @work.id%>">
|
||||
<%= render :partial => 'student_work_praise' %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">
|
||||
编程代码:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<%= text_format @work.description%>
|
||||
<span class="tit_fb ">编程代码:</span>
|
||||
<div class="showHworkP break_word">
|
||||
<%= text_format(@work.description) if @work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
||||
<% if @is_teacher%>
|
||||
<li ><span class="tit_fb ">测试结果:</span>
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr class=" b_lblue fb c_w">
|
||||
<td class="td_tit ">输入</td>
|
||||
<td class="td_tit border_l ">输出</td>
|
||||
<td class="td_50 border_l ">测试结果</td>
|
||||
</tr>
|
||||
<%@homework.homework_tests.each do |test|%>
|
||||
<tr class="<%= cycle("", "b_grey") %>">
|
||||
<td class="td_tit hidden">
|
||||
<%= test.input%>
|
||||
</td>
|
||||
<td class="td_tit border_l hidden">
|
||||
<%= test.output%>
|
||||
</td>
|
||||
<% student_work_test = StudentWorkTest.where(:homework_test_id => test.id,:student_work_id => @work.id).first%>
|
||||
<td class="td_50 c_red border_l"><%= student_work_test.nil? ? "正在编译" : student_work_test.status_to_s%></td>
|
||||
<input type="hidden" value="<%= student_work_test.result if student_work_test%>">
|
||||
</tr>
|
||||
<% end%>
|
||||
<% student_work_test = @work.student_work_test.first%>
|
||||
<% if student_work_test && student_work_test.error_msg && !student_work_test.error_msg.empty?%>
|
||||
<tr class="border_t" >
|
||||
<td colspan="3" class="td_end" >
|
||||
<%= student_work_test.error_msg%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
<li class="mt10 fl">
|
||||
<span class="tit_fb ">
|
||||
测试结果:
|
||||
</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<% @work.student_work_tests.each_with_index do |test, index| %>
|
||||
<div class="ProResultTop">
|
||||
<p class="c_blue fl">
|
||||
第<%= @work.student_work_tests.count - index%>次测试
|
||||
</p>
|
||||
<span class="fr c_grey">
|
||||
<%= test.created_at.to_s(:db) %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% if test.status.to_i == -2 %>
|
||||
<div class="ProResultCon ">
|
||||
<%= test.results.first %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="ProResultTable " >
|
||||
<ul class="ProResultUl " >
|
||||
<% test.results.each_with_index do |x, i| %>
|
||||
<li >
|
||||
<span class="w60 T_C">测试<%=i+1%></span>
|
||||
<% if x["status"].to_i != 0 %>
|
||||
<span class="w150 c_red">测试错误!</span>
|
||||
<span class="w60">您的输出:</span>
|
||||
<span class="width150"><%=x["result"]%></span>
|
||||
<span class="w60">正确输出:</span>
|
||||
<span class="width150"><%=x["output"]%></span>
|
||||
<div class="cl"></div>
|
||||
<% else %>
|
||||
<span class="w150 c_green">测试正确!</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</li>
|
||||
<!-- 编程作业老师才可以评分 -->
|
||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@work.student_works_scores.order("updated_at desc").each do |score|%>
|
||||
<div class="ping_box fl" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@student_work_scores.each do |score|%>
|
||||
<div id="work_score_<%= score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score}%>
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div><!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||
</div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div><!---show_hwork end--->
|
||||
</div>
|
|
@ -0,0 +1,63 @@
|
|||
<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%>
|
||||
<div class="markPopup" id="popbox02">
|
||||
<span class="uploadText">评分设置</span>
|
||||
<div class="mt15">
|
||||
<span class="f14 fontGrey3 mr10">迟交扣分</span>
|
||||
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="请输入0-50数值" class=" markInput" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>
|
||||
</div>
|
||||
<div>
|
||||
<span class="f14 fontGrey3 mr10">缺评扣分</span>
|
||||
<input type="text" name="absence_penalty" id="absence_penalty_num" placeholder="请输入0-50数值" class="markInput" value="<%= homework.homework_detail_manual.absence_penalty%>" onkeyup="check_late_penalty('absence_penalty_num')"/>
|
||||
</div>
|
||||
|
||||
<% if homework.homework_type == 2%>
|
||||
<div>
|
||||
<span class="f14 fontGrey3 mr10">系统评分</span>
|
||||
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "markPercentage"} %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$("#sy_proportion").change(function(){
|
||||
var ta_proportion = 100 - parseInt($("#sy_proportion").val() * 100);
|
||||
$("#ta_proportion").replaceWith(build_selector(ta_proportion));
|
||||
$("#student_proportion").val("0%");
|
||||
});
|
||||
|
||||
$("#ta_proportion").live("change",function(){
|
||||
var ta_proportion = 100 - parseInt($("#sy_proportion").val() * 100) - parseInt($("#ta_proportion").val() * 100);
|
||||
$("#student_proportion").val(ta_proportion + "%");
|
||||
});
|
||||
</script>
|
||||
<% else%>
|
||||
<script>
|
||||
$("#ta_proportion").change(function(){
|
||||
var ta_proportion = $("#ta_proportion").val();
|
||||
$("#student_proportion").val((100 - parseInt(ta_proportion * 100)) + "%");
|
||||
});
|
||||
</script>
|
||||
<% end%>
|
||||
|
||||
<div>
|
||||
<span class="f14 fontGrey3 mr10">教辅评分</span>
|
||||
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option_to(100-(homework.homework_detail_programing ? homework.homework_detail_programing.ta_proportion * 100 : 0).to_i),homework.homework_detail_manual.ta_proportion), {:class => "markPercentage"} %>
|
||||
</div>
|
||||
<div>
|
||||
<span class="f14 fontGrey3 mr10">学生匿评</span>
|
||||
<input type="text" id="student_proportion" value="<%= (100 - homework.homework_detail_manual.ta_proportion * 100).to_i - (homework.homework_detail_programing ? homework.homework_detail_programing.ta_proportion * 100 : 0).to_i%>%" class="markPercentage" readonly>
|
||||
</div>
|
||||
<div class="mb20">
|
||||
<span class="f14 fontGrey3 mr10">教师优先</span>
|
||||
<input type="checkbox" name="teacher_priority" <%= homework.teacher_priority == 1 ? 'checked' : ''%>/>
|
||||
<span class="f12 c_red ml10">教师评分为最终评分</span>
|
||||
</div>
|
||||
<div>
|
||||
<div class="courseSendSubmit">
|
||||
<a href="javascript:void(0);" class="sendSourceText" onclick="$('#ajax-modal').find('form').submit();">确定</a>
|
||||
</div>
|
||||
<div class="courseSendCancel">
|
||||
<a href="javascript:void(0);" class="sendSourceText linkGrey6" onclick="clickCanel();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end%>
|
|
@ -1,72 +1,74 @@
|
|||
<div class="show_hwork_arrow"></div>
|
||||
<div class="show_hwork">
|
||||
<ul>
|
||||
<li class="fl">
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time @work.created_at %>
|
||||
</li>
|
||||
<div class="showHwork">
|
||||
<ul>
|
||||
<li class="fl" >
|
||||
<span class="tit_fb">上交时间:</span>
|
||||
<%=format_time @work.created_at %>
|
||||
</li>
|
||||
|
||||
<% if !@is_teacher && @work.user == User.current && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1) %>
|
||||
<!-- 我的作业 && (非匿评作业 || 为开启匿评),显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
|
||||
</li>
|
||||
<li class="fr" >
|
||||
<%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3) && @work.user != User.current%>
|
||||
<!-- 普通作业或者编程作业,或者是匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= @work.id%>">
|
||||
<%= render :partial => 'student_work_praise' %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--<li >-->
|
||||
<!--<span class="tit_fb"> 参与人员:</span>-->
|
||||
<!--程梦雯 王强-->
|
||||
<!--</li>-->
|
||||
<% if @work.project%>
|
||||
<li >
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<%= link_to( @work.project.name, project_path(@work.project.id), :class => "c_blue02" )%>
|
||||
</li>
|
||||
<% end%>
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="show_hwork_p break_word">
|
||||
<%= text_format(@work.description) if @work.description%>
|
||||
</div>
|
||||
<% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %>
|
||||
<!-- 我的作业 && 匿评作业 && 未开启匿评,显示编辑和删除按钮 -->
|
||||
<li class="fr" >
|
||||
<%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %>
|
||||
</li>
|
||||
<li class="fr" >
|
||||
<%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%>
|
||||
</li>
|
||||
<% end%>
|
||||
<% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%>
|
||||
<!-- 匿评结束阶段,显示点赞按钮 -->
|
||||
<li class="fr" id="student_work_praise_<%= @work.id%>">
|
||||
<%= render :partial => 'student_work_praise' %>
|
||||
</li>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% if @work.attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl">
|
||||
<%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %>
|
||||
|
||||
<!--<li ><span class="tit_fb"> 参与人员:</span>程梦雯 王强</li>-->
|
||||
|
||||
<% if @work.project%>
|
||||
<li >
|
||||
<span class="tit_fb"> 关联项目:</span>
|
||||
<%= link_to( @work.project.name, project_path(@work.project.id), :class => "linkBlue" )%>
|
||||
</li>
|
||||
<% end%>
|
||||
|
||||
<li >
|
||||
<span class="tit_fb ">内容:</span>
|
||||
<div class="showHworkP break_word">
|
||||
<%= text_format(@work.description) if @work.description%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<span class="tit_fb"> 附件:</span>
|
||||
<% if @work.attachments.empty?%>
|
||||
<span style="color: #999999">尚未提交附件</span>
|
||||
<% else%>
|
||||
<div class="fl" style="width: 90%;">
|
||||
<%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li >
|
||||
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%>
|
||||
<!-- 老师 || 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@student_work_scores.each do |score|%>
|
||||
<div id="work_score_<%= score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</li>
|
||||
</div>
|
||||
<!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr linkBlue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if @is_teacher || (@homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%>
|
||||
<!-- 老师 || 匿评作业 && 开启匿评状态 && 不是当前用户自己的作品 -->
|
||||
<div id="add_student_score_<%= @work.id%>" class="mt10 evaluation">
|
||||
<%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</ul>
|
||||
|
||||
<div class="ping_box mt10" id="score_list_<%= @work.id%>" style="<%= @work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%@work.student_works_scores.order("updated_at desc").each do |score|%>
|
||||
<div id="work_score_<%= score.id%>">
|
||||
<%= render :partial => 'student_work_score',:locals => {:score => score}%>
|
||||
</div>
|
||||
<% end%>
|
||||
</div><!---ping_box end--->
|
||||
<a href="javascript:void(0);" class="fr c_blue mt5 mb5" onclick="$('#about_hwork_<%= @work.id%>').html('');">收起</a>
|
||||
<div class="cl"></div>
|
||||
</div><!---show_hwork end--->
|
||||
</div>
|
|
@ -1,24 +1,31 @@
|
|||
<ul class="ping_box_ul ping_line">
|
||||
<ul class="ping_box_ul <%= is_last ? '' : 'ping_line'%> fl">
|
||||
<% show_real_name = @is_teacher || score.user == User.current || score.user.allowed_to?(:as_teacher,@course) %>
|
||||
<%= link_to image_tag(url_to_avatar(show_real_name ? score.user : ""), :width => "34", :height => "34"), show_real_name ? user_path(score.user) : "javascript:void(0)",:class => "ping_pic fl" %>
|
||||
<div class="ping_box_tit">
|
||||
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "c_blue fl" %>
|
||||
<span class="ml5 fl">(<%= student_work_score_role score%>)</span>
|
||||
<div class="pingBoxTit">
|
||||
<%= link_to show_real_name ? score.user.show_name : "匿名", show_real_name ? user_path(score.user) : "javascript:void(0)", :title => show_real_name ? score.user.show_name : "匿评用户", :class => "linkBlue fl" %>
|
||||
<span class="ml5 fl">
|
||||
(<%= student_work_score_role score%>)
|
||||
</span>
|
||||
<span class="ml20 fl">评分:</span>
|
||||
<a href="javascript:void(0);" class="c_orange fl" ><%= score.score%>分</a>
|
||||
<a href="javascript:void(0);" class="fr c_purple mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
||||
<span class=" fr c_grey mr20">
|
||||
<%=format_time score.updated_at %>
|
||||
</span>
|
||||
<a href="javascript:void(0);" class="c_orange fl" >
|
||||
<%= score.score%>分
|
||||
</a>
|
||||
<a href="javascript:void(0);" class="fr linkBlue mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
||||
<span class=" fr c_grey mr20">
|
||||
<%=format_time score.updated_at %>
|
||||
</span>
|
||||
<div class="cl mb5"></div>
|
||||
|
||||
<p class="break_word">
|
||||
<%= score.comment%>
|
||||
</p>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => 'work_attachments', :locals => {:attachments => score.attachments} %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="add_score_reply_<%= score.id%>" class="undis">
|
||||
<%= render :partial => 'add_score_reply',:locals => {:score => score}%>
|
||||
<%= render :partial => 'add_score_reply',:locals => {:score => score,:is_last => is_last}%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -27,6 +34,6 @@
|
|||
<%= render :partial => 'jour_replay',:locals => {:jour => jour}%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
</ul>
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
<li class="hwork_num ">
|
||||
<span class="c_dark f14 fb fl">学号</span>
|
||||
</li>
|
||||
<li class=" hwork_name f14 fb c_dark">
|
||||
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "name"%>
|
||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="hwork_tit_une">
|
||||
<span class="c_dark f14 fb fl">作品名称</span>
|
||||
</li>
|
||||
<li class=" hwork_time f14 fb c_dark">
|
||||
<%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "created_at"%>
|
||||
<%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="mr5 w40 ml15">
|
||||
<%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "teacher_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="mr5 w40 ml20">
|
||||
<%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "teaching_asistant_score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
|
||||
<% end%>
|
||||
</li>
|
||||
<li class="ml20">
|
||||
<%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%>
|
||||
<% if @show_all && @order == "score"%>
|
||||
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%>
|
||||
<% end%>
|
||||
</li>
|
|
@ -1,8 +1,8 @@
|
|||
<% attachments.each_with_index do |attachment,i| %>
|
||||
<div id="attachment_<%= attachment.id%>">
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %>
|
||||
<span class="ml5">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %>
|
||||
<span class="ml5 fl">(<%= number_to_human_size attachment.filesize %>)</span>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end -%>
|
||||
|
|
|
@ -2,39 +2,16 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
|
|||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
|
||||
<% if @is_new%>
|
||||
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %></div>");
|
||||
$("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line");
|
||||
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %></div>");
|
||||
<% else %>
|
||||
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>");
|
||||
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>");
|
||||
<% end%>
|
||||
|
||||
$("#score_list_<%= @work.id%>").removeAttr("style");
|
||||
|
||||
<% if @is_teacher %>
|
||||
<% if @homework.homework_type == 1%>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
|
||||
<% elsif @homework.homework_type == 2%>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>");
|
||||
<% else%>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>");
|
||||
<% end%>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work}) %>");
|
||||
<% else %>
|
||||
$("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>");
|
||||
<% end%>
|
||||
|
||||
|
||||
$(function(){
|
||||
//匿评评分提示
|
||||
$(".student_score_info").bind("mouseover",function(e){
|
||||
$(this).find("div").show();
|
||||
});
|
||||
$(".student_score_info").bind("mouseout",function(e){
|
||||
$(this).find("div").hide();
|
||||
});
|
||||
//最终成绩提示
|
||||
$(".student_final_scor_info").bind("mouseover",function(e){
|
||||
$(this).find("div").show();
|
||||
});
|
||||
$(".student_final_scor_info").bind("mouseout",function(e){
|
||||
$(this).find("div").hide();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score}) %>");
|
||||
$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score,:is_last => @is_last}) %>");
|
||||
<% if @status && @status == 1%>
|
||||
$("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>");
|
||||
$("#add_score_reply_<%= @score.id%>").hide();
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
<script type="text/javascript">
|
||||
<% if @homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher && @stundet_works.count > 1%>
|
||||
$(function(){
|
||||
$("#RSide").removeAttr("id");
|
||||
$("#homework_page_right").css("min-height",$("#LSide").height()-30);
|
||||
$("#Container").css("width","1000px");
|
||||
});
|
||||
|
||||
// 匿评弹框提示
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
$(function(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/praise_alert') %>');
|
||||
showModal('ajax-modal', '500px');
|
||||
|
@ -10,212 +17,111 @@
|
|||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
});
|
||||
<% end%>
|
||||
|
||||
//设置评分规则
|
||||
function set_score_rule(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework}) %>');
|
||||
showModal('ajax-modal', '350px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="project_r_h">
|
||||
<div id="menu_r">
|
||||
<ul class="menu_r">
|
||||
<li><a href="javascript:void(0);" class="parent">作业批次</a>
|
||||
<ul>
|
||||
<% @homework_commons.each_with_index { |homework_common,index |%>
|
||||
<li>
|
||||
<%= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
|
||||
</li>
|
||||
<%}%>
|
||||
<div class="homepageRight mt0 ml10">
|
||||
<div class="resources" id="homework_page_right">
|
||||
<div class="hworkListBanner">
|
||||
<div id="menu_r" class="fl">
|
||||
<ul class="menu_r">
|
||||
<li><a href="javascript:void(0);" class="parent">作业批次</a>
|
||||
<ul>
|
||||
<% @homework_commons.each_with_index do |homework_common,index |%>
|
||||
<li>
|
||||
<%= link_to "第#{@homework_commons.count - index}次作业",student_work_index_path(:homework => homework_common.id)%>
|
||||
</li>
|
||||
<% end%>
|
||||
</ul>
|
||||
</li>
|
||||
<!---level1 end--->
|
||||
</ul>
|
||||
</li><!---level1 end--->
|
||||
</ul><!---menu_r end--->
|
||||
</div>
|
||||
</div><!--contentbox end-->
|
||||
|
||||
<div class="to_top" id="goTopBtn" style="display: none;">
|
||||
返<br/>回<br/>顶<br/>部
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div id="contentbox">
|
||||
<div id="tb_" class="hwork_tb_">
|
||||
<ul>
|
||||
<li id="tb_1" class="hwork_hovertab" onclick="course_setting(1)">全部作品</li>
|
||||
<li id="tb_2" class="hwork_normaltab" onclick="course_setting(2)">作业信息</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="ctt">
|
||||
<div class="dis" id="tbc_01">
|
||||
<div class="code_list">
|
||||
<span class="fl mt3">
|
||||
<%= link_to "所有作品(<span class='c_red'>#{@stundet_works.count}</span>)".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%>
|
||||
</span>
|
||||
<% if @show_all%>
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="昵称、学号、姓名搜索" class="min_search ml10 fl" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);">
|
||||
<%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if(@is_teacher && course_group_list(@course).count > 0) %>
|
||||
<a class="student_work_search fl" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)">搜索</a>
|
||||
<%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %>
|
||||
<% end%>
|
||||
<!---menu_r end--->
|
||||
</div>
|
||||
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
|
||||
<% if @is_teacher%>
|
||||
<div class="fr">
|
||||
<% unless @homework.homework_type == 2%>
|
||||
<% if @homework.student_works.empty?%>
|
||||
<%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
|
||||
<% else%>
|
||||
<%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
|
||||
remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %>
|
||||
<% end%>
|
||||
<div class="info_ni_download" style="<%= @homework.homework_type == 1 ? '' : 'margin-left: 130px;'%>">
|
||||
使用
|
||||
<span class="c_red">winzip</span>
|
||||
工具进行解压可能会导致
|
||||
<span class="c_red">下载文件乱码</span>
|
||||
,建议您使用
|
||||
<span class="c_red">winrar</span>
|
||||
工具进行解压
|
||||
</div>
|
||||
<% end%>
|
||||
<%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
|
||||
<%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%>
|
||||
<%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%>
|
||||
<span class="mt3 fr " style="color:#136b3b;">导出全部:</span>
|
||||
<div class="fr mt5">
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected">
|
||||
<a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="hworkMenu">
|
||||
<li>
|
||||
<%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey'%>
|
||||
</li>
|
||||
<li>
|
||||
<% if @homework.student_works.empty?%>
|
||||
<%= link_to "导出作业附件", "javascript:void(0)", class: "hworkExport resourcesGrey", :onclick => "alert('没有学生提交作业,无法下载附件')" %>
|
||||
<% else%>
|
||||
<%= link_to "导出作业附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json),
|
||||
remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %>
|
||||
<% end%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("导出缺评情况", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey')%>
|
||||
</li>
|
||||
<li>
|
||||
<a href="javascript:void(0);" class="hworkSetting resourcesGrey" onclick="set_score_rule();">评分设置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div><!---code_list end--->
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if @is_evaluation%>
|
||||
<ul class="hwork_ul">
|
||||
<%= render :partial => 'evaluation_work_title'%>
|
||||
</ul><!---hwork_ul end-->
|
||||
<div class="cl"></div>
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<%= render :partial => "evaluation_work",:locals => {:student_work => student_work}%>
|
||||
<div id="about_hwork_<%= student_work.id%>" ></div>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<% if @homework.homework_type == 1 || @homework.homework_type == 2%>
|
||||
<ul class="hwork_ul">
|
||||
<%= render :partial => 'evaluation_student_work_title'%>
|
||||
</ul><!---hwork_ul end-->
|
||||
<div class="cl"></div>
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<%= render :partial => "evaluation_student_work",:locals => {:student_work => student_work}%>
|
||||
<div id="about_hwork_<%= student_work.id%>" ></div>
|
||||
</div>
|
||||
<div class="hworkListContainer">
|
||||
<div class="ctt2">
|
||||
<div class="dis" id="tbc_01">
|
||||
<div class="codeList">
|
||||
<span class="fl mt3">
|
||||
<%= link_to "所有作品<font class='f12 c_red'>[共#{@homework.student_works.count}份]</font>".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<form class="resourcesSearchloadBox fr">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="输入资源关键词进行搜索" class="searchResource" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="homepageSearchIcon" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</form>
|
||||
<% end%>
|
||||
<% else%>
|
||||
<ul class="hwork_ul">
|
||||
<%= render :partial => 'student_work_title'%>
|
||||
</ul><!---hwork_ul end-->
|
||||
<div class="cl"></div>
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<%= render :partial => "student_work",:locals => {:student_work => student_work}%>
|
||||
<div id="about_hwork_<%= student_work.id%>" ></div>
|
||||
</div>
|
||||
<!---code_list end--->
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div><!---tbc_01 end-->
|
||||
|
||||
<div class="undis" id="tbc_02">
|
||||
<div class="problem_main mt10">
|
||||
<%= link_to(image_tag(url_to_avatar(@homework.user), :width => "42", :height => "42"), user_path(@homework.user), :class => "problem_pic fl") %>
|
||||
<div class="problem_txt fl mt5">
|
||||
<h4 class="r_txt_tit mb5">
|
||||
<%= @homework.name%>
|
||||
</h4>
|
||||
<% if @is_teacher%>
|
||||
<%= homework_anonymous_comment(@homework)%>
|
||||
<% else%>
|
||||
<%= student_anonymous_comment @homework %>
|
||||
<%= student_new_homework @homework %>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="bid_description_<%= @homework.id%>" class="mt5 upload_img">
|
||||
<%= @homework.description.html_safe %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
|
||||
<% if @is_teacher%>
|
||||
<table class="border_ce" cellpadding="0" cellspacing="0">
|
||||
<tbody>
|
||||
<tr class="<%= cycle("", "b_grey") %>">
|
||||
<td class="td_tit">
|
||||
输入
|
||||
</td>
|
||||
<td class="td_tit">
|
||||
输出
|
||||
</td>
|
||||
</tr>
|
||||
<% @homework.homework_tests.each do |test|%>
|
||||
<tr class="<%= cycle("", "b_grey") %>">
|
||||
<td class="td_tit">
|
||||
<%=test.input%>
|
||||
</td>
|
||||
<td class="td_tit">
|
||||
<%= test.output%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
||||
<div class="mt5">
|
||||
<span class="tit_fb" style="width: auto;"> 开发语言:</span>
|
||||
<div class="fl">
|
||||
<% if @homework.homework_detail_programing.language.to_i == 1%>
|
||||
C
|
||||
<% elsif @homework.homework_detail_programing.language.to_i == 2%>
|
||||
C++
|
||||
<% end%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
||||
<div class="mt5">
|
||||
<% unless @homework.attachments.empty?%>
|
||||
<span class="tit_fb" style="width: auto;"> 附件:</span>
|
||||
<div class="fl mb5">
|
||||
<%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %>
|
||||
</div>
|
||||
</div>
|
||||
<!---hwork_ul end--->
|
||||
<div class="cl"></div>
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<!---hwork_ul end--->
|
||||
<div id="about_hwork_<%= student_work.id%>"></div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<!--div class="mt5">
|
||||
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
|
||||
<div class="fl mb5 c_red">
|
||||
<%# if @homework.homework_type == 1%>
|
||||
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
|
||||
<%# else%>
|
||||
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
|
||||
<%# end%>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div-->
|
||||
<span class="fl">截止时间:<%= @homework.end_time%></span>
|
||||
<div >
|
||||
<% if betweentime(@homework.end_time) < 0 %>
|
||||
<span class='fr mr10 c_red '>
|
||||
<%= l(:label_commit_limit)%>
|
||||
</span>
|
||||
<% else %>
|
||||
<script type="text/javascript">
|
||||
window.setInterval(function(){show_bid_dead_line(<%= @homework.end_time.year%>,<%= @homework.end_time.month%>,<%= @homework.end_time.day + 1%>,"bid_deadline_<%= @homework.id%>");},1000)
|
||||
</script>
|
||||
<div id="bid_deadline_<%= @homework.id%>">
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div> <!--problem_txt end-->
|
||||
<div class="cl"></div>
|
||||
</div><!--problem_main end-->
|
||||
</div><!---tbc_02 end-->
|
||||
|
||||
|
||||
</div><!--ctt end-->
|
||||
</div><!--contentbox end-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
|
@ -9,12 +9,18 @@
|
|||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","40%");
|
||||
$('#ajax-modal').parent().addClass("anonymos_work");
|
||||
// alert("当前作业已开启匿评,您提交作品后将不会收到任何匿评作品,您的作品也不会被其他用户匿评,如需获得最终成绩,请您联系主讲老师对您的作品单独进行评分");
|
||||
});
|
||||
<% end%>
|
||||
|
||||
//匿评弹框取消按钮
|
||||
function clickCanel(){hideModal("#popbox02");}
|
||||
//快速创建项目的弹框
|
||||
function new_project(){
|
||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_project') %>');
|
||||
showModal('ajax-modal', '800px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","30%").css("left","20%").css("position","fixed");
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="homepageRightBanner mb10">
|
||||
|
@ -75,6 +81,18 @@
|
|||
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false} %>
|
||||
</div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="RalationIcon fl mt3" onclick="show_project();">关联项目</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt10 none" id="about_project">
|
||||
<%= select_tag :project_id, options_for_select(user_projects_option, @student_work.project_id), {:class => "InputBox W680 fl"} %>
|
||||
<%#=link_to "", new_project_path, :class => "ml5 mt5 SetUpIcon fl", :title => "快速创建"%>
|
||||
<a class=" ml5 mt5 SetUpIcon fl" href="javascript:void(0)" title="快速创建" onclick="new_project();"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="new_student_work();">确定</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
|
@ -83,4 +101,4 @@
|
|||
<div class="cl"></div>
|
||||
<% end%>
|
||||
</div><!----HomeWorkCon end-->
|
||||
</div>
|
||||
</div>
|
|
@ -1,11 +1,11 @@
|
|||
if($("#about_hwork_<%= @work.id%>").children().length > 0)
|
||||
{$("#about_hwork_<%= @work.id%>").html("");}
|
||||
else
|
||||
{
|
||||
<% if @homework.homework_type == 2%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>");
|
||||
<% else%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>");
|
||||
<% end%>
|
||||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
}
|
||||
if($("#about_hwork_<%= @work.id%>").children().length > 0){
|
||||
$("#about_hwork_<%= @work.id%>").html("");
|
||||
}
|
||||
else{
|
||||
<% if @homework.homework_type == 2%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>");
|
||||
<% else%>
|
||||
$("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>");
|
||||
<% end%>
|
||||
$('#score_<%= @work.id%>').peSlider({range: 'min'});
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
<% @system_messages.each do |sm| %>
|
||||
<ul><li><%= sm.content %></li></ul>
|
||||
<% end %>
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
<% if @tags.size > 0 %>
|
||||
<% @tags.each do |tag| %>
|
||||
<span class="re_tag f_l"> <%= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
<span class="re_tag f_l"> <%#= link_to tag, :controller => "tags", :action => "index", :q => tag, :object_flag => object_flag, :obj_id => obj.id %>
|
||||
<a ondblclick="rename_tag($(this),'<%= tag %>',<%= obj.id%>,<%= object_flag%>);"><%= tag %></a>
|
||||
<!-- 对用户主页 是本人 ,对项目,需求,问题是管理员 -->
|
||||
<% case object_flag %>
|
||||
<% when '10' %>
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
//本js使用的新的tag显示方法
|
||||
<% if @obj_flag == '3'%>
|
||||
$('#tags_show_issue').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
//$('#put-tag-form-issue').hide();
|
||||
$('#name-issue').val("");
|
||||
<% elsif @obj_flag == '1'%>
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_user_new_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$('#tags_name3').val("");
|
||||
<% elsif @obj_flag == '2'%>
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_project_new_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$('#tags_name2').val("");
|
||||
<% elsif @obj_flag == '6'%>
|
||||
<%if @course%>
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/tag_list',
|
||||
:locals => {:obj => @obj,:object_flag => @obj_flag,:select_tag_name => @select_tag_name}) %>');
|
||||
$("#files_tag").html("<%= escape_javascript(render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @select_tag_name}) %>");
|
||||
<%else%>
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").empty();
|
||||
$("#tags_show-<%=@obj.class%>-<%=@obj.id%>").html('<%= escape_javascript(render :partial => 'tags/course_attachment_tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
<%end%>
|
||||
|
||||
$("#tags_name_<%=@obj.id%>").val("");
|
||||
$("#add_tag_<%=@obj.id%>").hide();
|
||||
<% elsif @obj_flag == '9'%>
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/new_tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$('#tags_name').val("");
|
||||
<% elsif @obj_flag == '10'%>
|
||||
//$("#put-tag-form-<%#=@obj.class%>-<%#=@obj.id%>").hide();
|
||||
<% else%>
|
||||
$('#tags_show').html('<%= escape_javascript(render :partial => 'tags/tag_name',
|
||||
:locals => {:obj => @obj,:non_list_all => false,:object_flag => @obj_flag}) %>');
|
||||
$('#tags_name').val("");
|
||||
//$('#put-tag-form').hide();
|
||||
<% end %>
|
|
@ -6,14 +6,14 @@
|
|||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:user).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:user), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:user).try(:realname), user_path(activity.user_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %> TO <!--+"(课程名称)" -->
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id), :class => "newsBlue ml15"%>
|
||||
<%= link_to activity.course.name.to_s+" | 课程作业", homework_common_index_path(:course => activity.course.id, :host=> Setting.host_course), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word"> <!--+"(作业名称)"-->
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id), :class => "postGrey"%>
|
||||
<%= link_to activity.name.to_s, student_work_index_path(:homework => activity.id,:host=> Setting.host_course), :class => "postGrey"%>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
<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 => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<% if activity.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:author), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% else %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
|
||||
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id,:host=>Setting.host_user), :class => "newsBlue mr15" %>
|
||||
<% end %>
|
||||
TO
|
||||
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course), :class => "newsBlue ml15 mr5"%>
|
||||
<%= link_to activity.course.name.to_s+" | 课程讨论区", course_boards_path(activity.course,:host=> Setting.host_course), :class => "newsBlue ml15 mr5"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle break_word">
|
||||
<% if activity.parent_id.nil? %> <!--+"(帖子标题)"-->
|
||||
<%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id), :class=> "postGrey" %>
|
||||
<%= link_to activity.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.id, :topic_id => activity.id,:host=> Setting.host_course), :class=> "postGrey" %>
|
||||
<% else %>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id), :class=> "postGrey"%>
|
||||
<%= link_to activity.parent.subject.to_s.html_safe, course_boards_path(activity.course,:parent_id =>activity.parent_id, :topic_id => activity.id,:host=> Setting.host_course), :class=> "postGrey"%>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="homepagePostDate">
|
||||
发帖时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="homepagePostIntro break_word upload_img" id="activity_description_<%= user_activity_id%>">
|
||||
<% if activity.parent_id.nil? %>
|
||||
<%= activity.content.to_s.html_safe%>
|
||||
|
@ -49,7 +48,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
|
@ -67,21 +66,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px;"></div>
|
||||
<a id="new_message_cancel_btn_<%= user_activity_id%>" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">发送</a>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent ? activity.parent : activity%>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
|
@ -91,14 +75,14 @@
|
|||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.author_id,:host=>Setting.host_user), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
<% if reply.try(:author).try(:realname) == ' ' %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to reply.try(:author), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% else %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id), :class => "newsBlue mr10 f14" %>
|
||||
<%= link_to reply.try(:author).try(:realname), user_path(reply.author_id,:host=>Setting.host_user), :class => "newsBlue mr10 f14" %>
|
||||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
|
@ -112,5 +96,25 @@
|
|||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left; margin-left: 5px; padding-top:3px;"></div>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count=activity.comments.count %>
|
||||
<div class="homepagePostReplyBannerCount">
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">
|
||||
回复(<%= count %>)
|
||||
</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
|
@ -40,20 +40,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px;"></div>
|
||||
<a id="new_message_cancel_btn_<%= user_activity_id%>" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">发送</a>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
|
@ -62,7 +48,7 @@
|
|||
<% replies_all_i = replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i > 2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "45", :height => "45"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(comment.author), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
|
@ -81,5 +67,22 @@
|
|||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller => 'comments', :action => 'create', :id => activity},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="comment"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,177 +0,0 @@
|
|||
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
|
||||
|
||||
<% if @news.commentable? %>
|
||||
<div class="msg_box fl">
|
||||
<h4><%= l(:label_comment_add) %></h4>
|
||||
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form") do %>
|
||||
<div class="box" id="news_comment">
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<%= kindeditor_tag :comment, '',:height=>'100',:editor_id =>'comment_editor', :placeholder=>"最多250个字"%>
|
||||
</div>
|
||||
<p class="mt10">
|
||||
<a href="javascript:void(0)" class="grey_btn fr ml10" onclick="KindEditor.instances[0].html('');">
|
||||
<%= l(:label_cancel_with_space) %>
|
||||
</a>
|
||||
<a href="javascript:void(0)" class="blue_btn fr" onclick="submitComment();">
|
||||
<%= l(:label_comment_with_space) %>
|
||||
</a>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyInputContainer" id='leave-message' nhname="new_message">
|
||||
|
||||
<%= form_for('new_form', :method => :post,
|
||||
:url => {:controller => 'words', :action => 'leave_course_message'},:html => {:id=>'leave_message_form'}) do |f|%>
|
||||
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
|
||||
<textarea class="homepagePostReplyInput" nhname="new_message_textarea" name="new_form[course_message]" placeholder="请输入回复"></textarea>
|
||||
<p nhname="contentmsg"></p>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div>
|
||||
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||
<a href="javascript:void(0)" class="grey_btn fr ml10 mt10" nhname="cancel_btn">取 消</a>
|
||||
<a href="javascript:void(0)" onclick='$("#leave_message_form").submit();' class="blue_btn fr mt10">
|
||||
发送
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
||||
function init_editor(params){
|
||||
var editor = params.kindutil.create(params.textarea, {
|
||||
resizeType : 1,minWidth:"1px",width:"100%",height:"45px",
|
||||
items:['emoticons'],
|
||||
afterChange:function(){//按键事件
|
||||
nh_check_field({content:this,contentmsg:params.contentmsg,textarea:params.textarea});
|
||||
},
|
||||
afterCreate:function(){
|
||||
var toolbar = $("div[class='ke-toolbar']",params.div_form);
|
||||
$(".ke-outline>.ke-toolbar-icon",toolbar).append('表情');
|
||||
params.toolbar_container.append(toolbar);
|
||||
}
|
||||
}).loadPlugin('paste');
|
||||
return editor;
|
||||
}
|
||||
|
||||
function nh_check_field(params){
|
||||
var result=true;
|
||||
if(params.content!=undefined){
|
||||
if(params.content.isEmpty()){
|
||||
result=false;
|
||||
}
|
||||
if(params.content.html()!=params.textarea.html() || params.issubmit==true){
|
||||
params.textarea.html(params.content.html());
|
||||
params.content.sync();
|
||||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
params.contentmsg.css({color:'#008000'});
|
||||
}
|
||||
params.contentmsg.show();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function init_form(params){
|
||||
params.form.submit(function(){
|
||||
var flag = false;
|
||||
if(params.form.attr('data-remote') != undefined ){
|
||||
flag = true
|
||||
}
|
||||
var is_checked = nh_check_field({
|
||||
issubmit:true,
|
||||
content:params.editor,
|
||||
contentmsg:params.contentmsg,
|
||||
textarea:params.textarea
|
||||
});
|
||||
if(is_checked){
|
||||
if(flag){
|
||||
return true;
|
||||
}else{
|
||||
$(this)[0].submit();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
function nh_reset_form(params){
|
||||
params.form[0].reset();
|
||||
params.textarea.empty();
|
||||
if(params.editor != undefined){
|
||||
params.editor.html(params.textarea.html());
|
||||
}
|
||||
params.contentmsg.hide();
|
||||
}
|
||||
|
||||
KindEditor.ready(function(K){
|
||||
$("a[nhname='reply_btn']").live('click',function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.container = $(this).parent('div').parent('div');
|
||||
params.div_form = $(">.respond-form",params.container);
|
||||
params.form = $("form",params.div_form);
|
||||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
params.cancel_btn.click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
setTimeout(function(){
|
||||
if(!params.div_form.is(':hidden')){
|
||||
params.textarea.show();
|
||||
params.textarea.focus();
|
||||
params.textarea.hide();
|
||||
}
|
||||
},300);
|
||||
params.textarea.data('init',1);
|
||||
});
|
||||
|
||||
$("div[nhname='new_message']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[nhname='new_message_textarea']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined){
|
||||
params.editor = init_editor(params);
|
||||
init_form(params);
|
||||
$("a[nhname='cancel_btn']",params.div_form).click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
params.textarea.data('init',1);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<!--
|
||||
<textarea class="homepagePostReplyInput" placeholder="请输入回复"></textarea>
|
||||
<div class="homepagePostReplyEmotion"><a href="javascript:void(0);" class="replyGrey">表情</a></div>
|
||||
<div class="homepagePostReplyCancel"><a href="javascript:void(0);" class="postReplyCancel">取消</a>
|
||||
</div>
|
||||
<div class="homepagePostReplySubmit"><a href="javascript:void(0);" class="postReplySubmit">发送</a>
|
||||
</div>-->
|
|
@ -67,7 +67,7 @@
|
|||
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = activity.journals.count %>
|
||||
<div class="homepagePostReplyBannerCount">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(<%= count %>)</div>
|
||||
<div class="homepagePostReplyBannerTime"><%#= format_date(activity.updated_on) %></div>
|
||||
<% if count > 2 %>
|
||||
<div class="homepagePostReplyBannerMore">
|
||||
|
@ -78,20 +78,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px;"></div>
|
||||
<a id="new_message_cancel_btn_<%= user_activity_id%>" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">发送</a>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
<div class="" id="reply_div_<%= user_activity_id %>">
|
||||
|
@ -100,7 +86,7 @@
|
|||
<% replies_all_i=replies_all_i + 1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "45", :height => "45"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(reply.user), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.user_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
|
@ -111,17 +97,14 @@
|
|||
<% end %>
|
||||
<%= format_time(reply.created_on) %>
|
||||
</div>
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<%= string %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<%= reply.notes.html_safe %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepagePostReplyContent break_word">
|
||||
<% if reply.details.any? %>
|
||||
<% details_to_strings(reply.details).each do |string| %>
|
||||
<p><%= string %></p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<P><%= reply.notes.html_safe %></P>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
|
@ -129,6 +112,24 @@
|
|||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => add_journal_issue_path(activity.id),:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="notes"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<% count = 0 %>
|
||||
<div class="homepagePostReplyBannerCount">回复(
|
||||
<div class="homepagePostReplyBannerCount" onclick="expand_reply_input('#reply_input_<%= user_activity_id %>');">回复(
|
||||
<% if activity.parent %>
|
||||
<% count=activity.parent.children.count%>
|
||||
<% else %>
|
||||
|
@ -53,21 +53,6 @@
|
|||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px;"></div>
|
||||
<a id="new_message_cancel_btn_<%= user_activity_id%>" href="javascript:void(0)" class="grey_n_btn fr " style="margin-top:6px;">取消</a>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr mr5 " style="margin-top:6px;">发送</a>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<% activity= activity.parent_id.nil? ? activity : activity.parent %>
|
||||
<% replies_all_i = 0 %>
|
||||
<% if count > 0 %>
|
||||
|
@ -77,7 +62,7 @@
|
|||
<% replies_all_i=replies_all_i+1 %>
|
||||
<li class="homepagePostReplyContainer" nhname="reply_rec" style="display:<%= replies_all_i>2 ? 'none' : '' %>">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "45", :height => "45"), user_path(reply.author_id), :alt => "用户头像" %>
|
||||
<%= link_to image_tag(url_to_avatar(reply.author), :width => "33", :height => "33", :class =>"mt8"), user_path(reply.author_id), :alt => "用户头像" %>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher">
|
||||
|
@ -96,5 +81,25 @@
|
|||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= user_activity_id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %></div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div nhname='new_message_<%= user_activity_id%>' style="display:none;">
|
||||
<%= form_for('new_form',:url => {:controller=>'messages',:action => 'reply', :id => activity.id, :board_id => activity.board_id, :is_board => 'true'},:method => "post", :remote => true) do |f|%>
|
||||
<input type="hidden" name="quote[quote]" value="">
|
||||
<input type="hidden" name="user_activity_id" value="<%=user_activity_id%>">
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= user_activity_id%>' name="reply[content]"></textarea>
|
||||
<div nhname='toolbar_container_<%= user_activity_id%>' style="float:left;padding-top:3px; margin-left: 5px;"></div>
|
||||
<a id="new_message_submit_btn_<%= user_activity_id%>" href="javascript:void(0)" class="blue_n_btn fr" style="margin-top:6px;">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= user_activity_id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
|
@ -59,8 +59,8 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<div class="courseSendSubmit"><a href="javascript:void(0);" onclick="$(this).parent().parent().parent().submit();" class="sendSourceText">确定</a></div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" onclick="hideModal();" class="sendSourceText">取消</a></div>
|
||||
<a href="javascript:void(0);" onclick="$(this).parent().parent().submit();" class="db courseSendSubmit sendSourceText">确定</a>
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="db courseSendCancel sendSourceText">取消</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
|
|
@ -1,73 +1,79 @@
|
|||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_KindEditor" %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
div.ke-toolbar .ke-outline{border:none;}
|
||||
.ke-inline-block{display: none;}
|
||||
</style>
|
||||
<% user_activities.each do |user_activity|
|
||||
if user_activities %>
|
||||
<script>
|
||||
function expand_reply(container,btnid){
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.html('收起回复('+btn.data('count')+')');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
btn.html('展开更多('+btn.data('count')+')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
init_KindEditor_data(<%= user_activity.id%>);
|
||||
});
|
||||
</script>
|
||||
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if user_activities.count == 10%>
|
||||
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %></div>
|
||||
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#show_more_activities").mouseover(function(){
|
||||
$("#more_activities_link").click();
|
||||
});
|
||||
<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
|
||||
<style type="text/css">
|
||||
/*回复框*/
|
||||
div.ke-toolbar{display:none;width:400px;border:none;background:none;padding:0px 0px;}
|
||||
span.ke-toolbar-icon{line-height:26px;font-size:14px;padding-left:26px;}
|
||||
span.ke-toolbar-icon-url{background-image:url( /images/public_icon.png )}
|
||||
div.ke-toolbar .ke-outline{padding:0px 0px;line-height:26px;font-size:14px;}
|
||||
span.ke-icon-emoticons{background-position:0px -671px;width:50px;height:26px;}
|
||||
span.ke-icon-emoticons:hover{background-position:-79px -671px;width:50px;height:26px;}
|
||||
div.ke-toolbar .ke-outline{border:none;}
|
||||
.ke-inline-block{display: none;}
|
||||
div.ke-container{float:left;}
|
||||
</style>
|
||||
<% first_user_activity = user_activities.first.id unless user_activities.first.nil? %>
|
||||
<% user_activities.each do |user_activity|
|
||||
if user_activities %>
|
||||
<script>
|
||||
function expand_reply(container,btnid){
|
||||
var target = $(container);
|
||||
var btn = $(btnid);
|
||||
if(btn.data('init')=='0'){
|
||||
btn.data('init',1);
|
||||
btn.html('收起回复('+btn.data('count')+')');
|
||||
target.show();
|
||||
}else{
|
||||
btn.data('init',0);
|
||||
btn.html('展开更多('+btn.data('count')+')');
|
||||
target.hide();
|
||||
target.eq(0).show();
|
||||
target.eq(1).show();
|
||||
}
|
||||
}
|
||||
|
||||
function expand_reply_input(id) {
|
||||
$(id).toggle();
|
||||
}
|
||||
|
||||
$(function() {
|
||||
init_activity_KindEditor_data(<%= user_activity.id%>,"","85%");
|
||||
});
|
||||
</script>
|
||||
<% act= user_activity.act unless user_activity.act_type == "ProjectCreateInfo" %>
|
||||
<% case user_activity.container_type.to_s %>
|
||||
<% when 'Course' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'HomeworkCommon' %>
|
||||
<%= render :partial => 'course_homework', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'News' %>
|
||||
<%= render :partial => 'course_news', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Message'%>
|
||||
<%= render :partial => 'course_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Poll' %>
|
||||
<%= render :partial => 'course_poll', :locals => {:activity => act, :user_activity_id => user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% when 'Project' %>
|
||||
<% if act %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
<% when 'Issue' %>
|
||||
<%= render :partial => 'project_issue', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% when 'Message' %>
|
||||
<%= render :partial => 'project_message', :locals => {:activity => act,:user_activity_id =>user_activity.id,:first_user_activity =>first_user_activity,:page => page} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if user_activities.count == 10%>
|
||||
<div id="show_more_activities" class="loadMore mt10 f_grey">展开更多<%=link_to "", user_activities_path(@user.id,:type => type,:page => page),:id => "more_activities_link",:remote => "true",:class => "none" %></div>
|
||||
<%#= link_to "点击展开更多",user_activities_path(@user.id,:type => type,:page => page),:id => "show_more_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end%>
|
||||
|
||||
<script type="text/javascript">
|
||||
$("#show_more_activities").mouseover(function(){
|
||||
$("#more_activities_link").click();
|
||||
});
|
||||
</script>
|
|
@ -47,11 +47,11 @@
|
|||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3" onclick="$('#_file').click();">上传附件</a>
|
||||
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mr15 mt3",:remote => true%>
|
||||
<a href="javascript:void(0);" class="AnnexBtn fl mt3 mr20" onclick="$('#_file').click();">上传附件</a>
|
||||
<%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr20",:remote => true%>
|
||||
<% if defined?(has_program) && has_program %>
|
||||
<a href="javascript:void(0);" class="ProBtn fl mt3">编程</a>
|
||||
<span class="fl C_lgrey mt3 program_detail_info"></span>
|
||||
<a href="javascript:void(0);" class="ProBtn fl mt3">编程</a>
|
||||
<span class="fl C_lgrey mt3 program_detail_info"></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
<div class="HomeWorkCon">
|
||||
<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 w701" maxlength="255" onfocus="$('#homework_editor').show()" onkeyup="regex_homework_name();" placeholder="发布作业,请先输入作业标题" value="<%= homework.name%>" >
|
||||
<p id="homework_name_span" class="c_red mt5"></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
@ -89,41 +89,5 @@
|
|||
|
||||
|
||||
<div class="BluePopupBox" id="BluePopupBox" style="display:none">
|
||||
<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}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
<% homework.homework_tests.each_with_index do |test, index| %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"><%= test.input %></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出"><%= test.output %></textarea>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"></textarea><textarea class="InputBox W320 fl mr5" placeholder="测试输出"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div><!----HomeWorkCon end-->
|
||||
|
||||
<%= render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework} %>
|
||||
</div><!----BluePopupBox end-->
|
||||
|
|
|
@ -11,18 +11,35 @@
|
|||
TO
|
||||
<%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
|
||||
</div>
|
||||
<div class="homepagePostTitle hidden">
|
||||
<span class="homepagePostTitle hidden m_w530 fl">
|
||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||
</div>
|
||||
</span>
|
||||
<% if homework_common.homework_detail_manual.comment_status == 1%>
|
||||
<span class="grey_btn_cir ml10">未开启匿评</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
||||
<span class="green_btn_cir ml10">匿评中</span>
|
||||
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
|
||||
<span class="grey_btn_cir ml10">匿评已结束</span>
|
||||
<% end%>
|
||||
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit">
|
||||
<%= user_for_homework_common homework_common,is_teacher %>
|
||||
</div>
|
||||
<% if homework_common.homework_type == 2 && is_teacher%>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<div class="homepagePostSubmit">
|
||||
<%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if homework_common.homework_type == 2%>
|
||||
<div class="homepagePostDeadline mr15">
|
||||
语言:
|
||||
<% if homework_common.homework_detail_programing.language.to_i == 1%>
|
||||
C
|
||||
<% elsif homework_common.homework_detail_programing.language.to_i == 2%>
|
||||
C++
|
||||
<% end%>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="homepagePostDeadline">
|
||||
<%= l(:label_end_time)%>:<%= homework_common.end_time%>
|
||||
|
@ -47,6 +64,9 @@
|
|||
<li>
|
||||
<%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= homework_anonymous_comment homework_common %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<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}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||
</select>
|
||||
</div>
|
||||
<% if edit_mode && homework.is_program_homework? %>
|
||||
<% homework.homework_tests.each_with_index do |test, index| %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"><%= test.input %></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"><%= test.output %></textarea>
|
||||
<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>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="mt10">
|
||||
<textarea class="InputBox W320 fl mr10" placeholder="测试输入" id="textarea_input_test"></textarea>
|
||||
<textarea class="InputBox W320 fl mr5" placeholder="测试输出" id="textarea_output_test"></textarea>
|
||||
<a href="javascript:void(0);" class=" fl icon_add" title="增加测试组"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="mt10">
|
||||
<span class="f12 c_red db mt5 fl">温馨提示:您可以在发布作业后,在作业“模拟答题”中进行标准代码的检测和提交。</span>
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fr">确 定</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
</div><!----HomeWorkCon end-->
|
||||
|
||||
<script>
|
||||
var text = document.getElementById("textarea_input_test");
|
||||
var text2 = document.getElementById("textarea_output_test");
|
||||
autoTextarea2(text,text2);
|
||||
autoTextarea2(text2,text);
|
||||
</script>
|
|
@ -49,11 +49,17 @@
|
|||
<div class="HomeWork">
|
||||
<div class="HomeWorkBox">
|
||||
<div class="">
|
||||
<div class="homepagePostTitle fl"><%= @homework.name %></div><span class="fr c_grey">截止时间:<%= @homework.end_time %></span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue"><%= @homework.user.show_name %></a>
|
||||
<p class="HomeWorkP"><%= @homework.description.html_safe %> <br />
|
||||
</p>
|
||||
<div class="homepagePostTitle fl">
|
||||
<%= @homework.name %>
|
||||
</div>
|
||||
<span class="fr c_grey">
|
||||
截止时间:<%= @homework.end_time %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<a href="javascript:void(0);" class="c_blue"><%= @homework.user.show_name %></a>
|
||||
<p class="HomeWorkP">
|
||||
<%= @homework.description.html_safe %>
|
||||
</p>
|
||||
</div>
|
||||
<!--p class="c_grey mt15">注:迟交扣<span class="c_red">2</span>分,缺评一个作品扣<span class="c_red">2</span>分</p-->
|
||||
</div><!---HomeWorkBox end -->
|
||||
|
@ -70,11 +76,15 @@
|
|||
<div class="mt15">
|
||||
<span>请使用 <%= @homework.language_name %> 语言编写</span>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<div class="mt10">
|
||||
<%= f.text_area :name, id: 'program-title', class:"InputBox W700", placeholder:"请概括你的代码的功能" %>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<%= f.text_area :description, id: 'program-src', class:"InputBox W700 H150", placeholder:"请贴入你的代码", rows: 10 %>
|
||||
<script>
|
||||
var text = document.getElementById("program-src");
|
||||
autoTextarea(text);// 调用
|
||||
</script>
|
||||
</div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">更多</li>
|
||||
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "我的动态", {:controller => "users", :action => "show", :type => "current_user"}, :class =>"homepagePostTypeMine postTypeGrey"%>
|
||||
<li class="mt-4"><%= link_to "全部动态", {:controller => "users", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -1,279 +0,0 @@
|
|||
<div class="resources">
|
||||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">最新动态</div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="homepagePostType">
|
||||
<li>
|
||||
<ul class="homepagePostTypeHomework fl">
|
||||
<li class="f14">课程动态</li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeAssignment postTypeGrey">作业动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeNotice postTypeGrey">通知动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>
|
||||
<!--<li><a href="javascript:void(0);" class="homepagePostTypeQuiz postTypeGrey">问卷动态</a></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<ul class="homepagePostTypeProject fl">
|
||||
<li class="f14">项目动态</li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeQuestion postTypeGrey">问题动态</a></li>
|
||||
<li><a href="javascript:void(0);" class="homepagePostTypeForum postTypeGrey">论坛动态</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostBrief" onmouseover="$('.homepagePostSetting').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(作业名称)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief" onmouseover="$('.homepagePostSetting').css('visibility','visible')" onmouseout="$('.homepagePostSetting').css('visibility','hidden')">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">分布式计算环境(课程名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">ckeditor值设置的默认在光标聚焦控件后应自动消失的处理(作业名称)</a></div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostSubmit"><a href="javascript:void(0);" class="c_blue">提交(10)</a></div>
|
||||
<div class="homepagePostDeadline">截止时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(作业描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="homepagePostSetting" style="visibility: hidden">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(5)</div>
|
||||
<div class="homepagePostReplyBannerTime">2015-07-28</div>
|
||||
<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<textarea class="homepagePostReplyInput" placeholder="请输入回复"></textarea>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyEmotion"><a href="javascript:void(0);" class="replyGrey">表情</a></div>
|
||||
<div class="homepagePostReplyCancel"><a href="javascript:void(0);" class="postReplyCancel">取消</a></div>
|
||||
<div class="homepagePostReplySubmit"><a href="javascript:void(0);" class="postReplySubmit">发送</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">尹教授</a> 2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
|
||||
<div class="homepagePostReplyContent">请大家说下软件工程是什么!</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">Tang 学生</a> 2015-08-02<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
|
||||
<div class="homepagePostReplyContent">软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。</div>
|
||||
<div class="homepagePostReplyInputContainer2">
|
||||
<textarea class="homepagePostReplyInput2" placeholder="请输入回复"></textarea>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer2 mb10">
|
||||
<div class="homepagePostReplyEmotion"><a href="javascript:void(0);" class="replyGrey">表情</a></div>
|
||||
<div class="homepagePostReplyCancel"><a href="javascript:void(0);" class="postReplyCancel">取消</a></div>
|
||||
<div class="homepagePostReplySubmit"><a href="javascript:void(0);" class="postReplySubmit">发送</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait"><a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像" /></a></div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr15 f14">尹教授</a><span class="f14">回复</span><a href="javascript:void(0);" class="newsBlue mr10 ml15 f14">Tang学生</a>刚刚<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><a href="javascript:void(0);" class="newsBlue fr">回复</a></div>
|
||||
<div class="homepagePostReplyContent">回答非常好!</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15 mr5">黄井泉</a><span class="c_blue">,</span><a href="javascript:void(0);" class="newsBlue ml5">陈正东</a>
|
||||
</div>
|
||||
<div class="homepagePostTitle"><a href="javascript:void(0);" class="postGrey">假期开心吗?(讨论区内容)</a></div>
|
||||
<div class="homepagePostDate">
|
||||
时间:2015-07-31
|
||||
</div>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(5)</div>
|
||||
<div class="homepagePostReplyBannerTime">2015-07-31</div>
|
||||
<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<textarea class="homepagePostReplyInput" placeholder="请输入回复"></textarea>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyEmotion"><a href="javascript:void(0);" class="replyGrey">表情</a></div>
|
||||
<div class="homepagePostReplyCancel"><a href="javascript:void(0);" class="postReplyCancel">取消</a></div>
|
||||
<div class="homepagePostReplySubmit"><a href="javascript:void(0);" class="postReplySubmit">发送</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像"/></a>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">黄井泉 学生</a>
|
||||
2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent">很开心!</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer borderBottomNone">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像"/></a>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">陈正东 学生</a>
|
||||
2015-08-02<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent">假期好热,没出去。</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="resources mt15">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="50" height="50" alt="用户头像"/></a></div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo"><a href="javascript:void(0);" class="newsBlue mr15">尹教授</a> TO
|
||||
<a href="javascript:void(0);" class="newsBlue ml15">Trustie Forge(项目名称)</a></div>
|
||||
<div class="homepagePostTitle">
|
||||
<a href="javascript:void(0);" class="postGrey">上传资源未显示在项目动态中(缺陷标题)</a><span class="homepagePostProjectState">正常</span>
|
||||
</div>
|
||||
<div class="homepagePostSubmitContainer">
|
||||
<div class="homepagePostAssignTo">指派给 <a href="javascript:void(0);" class="newsBlue mr15">苏稳</a>
|
||||
</div>
|
||||
<div class="homepagePostDeadline">时间:2015-08-20</div>
|
||||
</div>
|
||||
<div class="homepagePostIntro">(缺陷描述)系统中有多个ckeditor,且每个ckeditor的id未知,怎么样做到当光标聚焦某个ckeditor的文本框中,该编辑器的默认值应自动消失的处理;网络拓扑图开发;</div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class="homepagePostFileAtt newsBlue">文件附件.zip</a><span class="postAttSize">(123KB)</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="javascript:void(0);" class="homepagePostImageAtt newsBlue">图片附件.png</a><span class="postAttSize">(123KB)</span>
|
||||
</div>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">编辑</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">复制</a></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink">删除</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReply">
|
||||
<div class="homepagePostReplyBanner">
|
||||
<div class="homepagePostReplyBannerCount">回复(5)</div>
|
||||
<div class="homepagePostReplyBannerTime">2015-07-26</div>
|
||||
<div class="homepagePostReplyBannerMore"><a href="javascript:void(0);" class="replyGrey">点击展开更多回复</a></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<textarea class="homepagePostReplyInput" placeholder="请输入回复"></textarea>
|
||||
</div>
|
||||
<div class="homepagePostReplyInputContainer">
|
||||
<div class="homepagePostReplyEmotion"><a href="javascript:void(0);" class="replyGrey">表情</a></div>
|
||||
<div class="homepagePostReplyCancel"><a href="javascript:void(0);" class="postReplyCancel">取消</a></div>
|
||||
<div class="homepagePostReplySubmit"><a href="javascript:void(0);" class="postReplySubmit">发送</a></div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像"/></a>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">尹教授</a>
|
||||
2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent">请大家说下软件工程是什么!</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="homepagePostReplyContainer">
|
||||
<div class="homepagePostReplyPortrait">
|
||||
<a href="javascript:void(0);"><img src="images/homepageImage.jpg" width="45" height="45" alt="用户头像"/></a>
|
||||
</div>
|
||||
<div class="homepagePostReplyDes">
|
||||
<div class="homepagePostReplyPublisher"><a href="javascript:void(0);" class="newsBlue mr10 f14">Tang 学生</a>
|
||||
2015-08-01<a href="javascript:void(0);" class="replyGrey fr ml10">删除</a><!--<a href="javascript:void(0);" class="newsBlue fr">回复</a>-->
|
||||
</div>
|
||||
<div class="homepagePostReplyContent">软件工程是一门研究用工程化方法构建和维护有效的、实用的和高质量的软件的学科。它涉及程序设计语言、数据库、软件开发工具、系统平台、标准、设计模式等方面。</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,9 +1,11 @@
|
|||
<div class="homepageRightBanner">
|
||||
<div class="NewsBannerName">消息</div>
|
||||
<div class="NewsBannerName"><%= title_for_message(params[:type]) %></div>
|
||||
<ul class="resourcesSelect">
|
||||
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
|
||||
<ul class="newsType">
|
||||
<li><%= link_to "全部",user_message_path(User.current), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "未读消息", user_message_path(User.current, :type => 'unviewed'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "用户申请", user_message_path(User.current, :type => 'apply'), :class => "resourcesGrey" %></li>
|
||||
<%# 课程相关消息 %>
|
||||
<li><%= link_to "作业消息", user_message_path(User.current, :type => 'homework'), :class => "resourcesGrey" %></li>
|
||||
<li><%= link_to "课程讨论",user_message_path(User.current, :type => 'course_message'), :class => "resourcesGrey" %></li>
|
||||
|
@ -22,19 +24,51 @@
|
|||
<li><%= link_to "贴吧帖子", user_message_path(User.current, :type => 'forum'), :class => "resourcesGrey" %></li>
|
||||
<%# 系统贴吧 %>
|
||||
<li><%= link_to "用户留言",user_message_path(User.current, :type => 'user_feedback'), :class => "resourcesGrey" %></li>
|
||||
|
||||
<%# 系统消息 %>
|
||||
<li><%= link_to "系统消息", user_message_path(User.current, :type => 'system_messages'), :class => "resourcesGrey" %></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="resources mt10" id="users_setting">
|
||||
<div>
|
||||
<% if params[:type].nil? %>
|
||||
<div class="newsReadSetting">
|
||||
有 <span class="c_red"><%= User.current.count_new_message %></span> 条未读<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @message_alls.count >0 %>
|
||||
<% if params[:type].nil? || params[:type] == "unviewed" %>
|
||||
<div class="newsReadSetting">
|
||||
有 <span class="c_red"><%= unviewed_message(@user) %></span> 条未读
|
||||
<% unless (unviewed_message(@user) == 0 || User.current != @user) %>
|
||||
<a href="javascript:void(0);" class="ml15"><%= link_to "全部设为已读", user_message_path(User.current, :viewed => 'all') %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<%# 系统消息 %>
|
||||
<% if params[:type] != 'system_messages' %>
|
||||
<% @user_system_messages.each do |usm| %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%= image_tag("/images/logo.png", width: "30px", height: "30px", class: "mt3") %>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to usm.content.html_safe, user_message_path(User.current, :type => "system_messages"),
|
||||
:class => "newsRed",
|
||||
:onmouseover => "message_titile_show($(this),event);",
|
||||
:onmouseout => "message_titile_hide($(this));"
|
||||
%>
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red">
|
||||
<%= usm.content.html_safe %>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(usm.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 课程消息 %>
|
||||
<% unless @message_alls.nil? %>
|
||||
<% @message_alls.each do |ma| %>
|
||||
|
@ -65,7 +99,7 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status != 1 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布了作业:</span></li>
|
||||
|
@ -74,6 +108,23 @@
|
|||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 1 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
||||
<% if ma.viewed == 0 %>
|
||||
<li class="homepageHomeworkContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
|
||||
</li>
|
||||
<li class="homepageHomeworkContentWarn fl"> 截止时间快到了!</li>
|
||||
<% else %>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :title => "#{ma.course_message.name}" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.course_message_type == "Poll" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||
|
@ -131,6 +182,21 @@
|
|||
<% end %>
|
||||
<!--项目消息-->
|
||||
<% if ma.class == ForgeMessage %>
|
||||
<% if ma.forge_message_type == "AppliedProject" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.forge_message.user), :width => "30", :height => "30"), user_path(ma.forge_message.user) %></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<%=link_to ma.forge_message.user, user_path(ma.forge_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">申请加入项目:</span>
|
||||
</li>
|
||||
<li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
|
||||
<%= link_to ma.project, settings_project_path(:id => ma.project, :tab => "members"), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",:title => "#{ma.project}" %></a>
|
||||
</li>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% if ma.forge_message_type == "Issue" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
|
@ -272,6 +338,30 @@
|
|||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%# 系统消息 %>
|
||||
<% if ma.class == SystemMessage %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);">
|
||||
<div class="navHomepageLogo fl">
|
||||
<%=image_tag("/images/logo.png",width:"30px", height: "30px",class: "mt3")%>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl"><span class="newsBlue homepageNewsPublisher" >Trustie平台</span><span class="homepageNewsType fl">发布新消息:</span></li>
|
||||
<li class="homepageNewsContent fl">
|
||||
<%= link_to ma.content.html_safe, user_message_path(User.current, :type => "system_messages"),
|
||||
:class => "#{params[:type]=="unviewed" ? "newsBlack" : "newsRed"}",
|
||||
:onmouseover =>"message_titile_show($(this),event);",
|
||||
:onmouseout => "message_titile_hide($(this));"
|
||||
%>
|
||||
</li>
|
||||
<div style="display:none;" class="message_title_red">
|
||||
<%= ma.content.html_safe%>
|
||||
</div>
|
||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<ul class="wlist" style=" border:none; padding-top: 15px;">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
|
|
|
@ -5,4 +5,7 @@ $("#homework_end_time").val("<%= @homework.end_time%>");
|
|||
$("#course_id").val("<%= @homework.course_id%>");
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>");
|
||||
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
|
||||
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
|
||||
//$("input[name='homework_type']").val("<%#= @homework.homework_type%>");
|
||||
$("#homework_editor").show();
|
||||
$("#BluePopupBox a.BlueCirBtn").click();
|
||||
|
|
|
@ -11,3 +11,5 @@ en:
|
|||
label_registration_activation_by_email: account activation by email
|
||||
label_registration_manual_activation: manual account activation
|
||||
label_registration_automatic_activation: automatic account activation
|
||||
|
||||
label_system_message: system messages
|
||||
|
|
|
@ -14,3 +14,7 @@ zh:
|
|||
label_registration_manual_activation: 手动激活帐号
|
||||
label_registration_automatic_activation: 自动激活帐号
|
||||
|
||||
label_system_message: 系统消息
|
||||
label_admin_message_fail: 消息内容过长!
|
||||
label_content_blank_fail: 消息内容不能为空!
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ zh:
|
|||
notice_create_failed: 创建失败,请先完善个人信息
|
||||
notice_failed_create: 创建失败
|
||||
notice_successful_update: 更新成功
|
||||
notice_successful_message: 消息创建成功!
|
||||
notice_successful_edit: 修改成功
|
||||
notice_failed_edit: 修改失败
|
||||
notice_successful_delete: 删除成功
|
||||
|
@ -49,6 +50,7 @@ zh:
|
|||
notice_not_contest_setting_authorized: 对不起,您无权配置此竞赛。
|
||||
notice_not_contest_delete_authorized: 对不起,您无权删除此竞赛。
|
||||
notice_not_authorized_archived_project: 要访问的项目已经归档。
|
||||
notice_not_authorized_message: 您访问的消息不存在!
|
||||
notice_email_sent: "邮件已发送至 %{value}"
|
||||
notice_email_error: "发送邮件时发生错误 (%{value})"
|
||||
notice_feeds_access_key_reseted: 您的RSS存取键已被重置。
|
||||
|
|
|
@ -119,8 +119,9 @@ RedmineApp::Application.routes.draw do
|
|||
get 'student_work_absence_penalty'
|
||||
get 'absence_penalty_list'
|
||||
get 'evaluation_list'
|
||||
post 'set_program_score'
|
||||
# post 'set_program_score'
|
||||
post 'program_test'
|
||||
post 'set_score_rule'
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -260,6 +261,15 @@ RedmineApp::Application.routes.draw do
|
|||
match '/users/search', :via => [:get, :post]
|
||||
#end
|
||||
|
||||
# 消息相关路由
|
||||
resources :system_messages do
|
||||
collection do
|
||||
post 'create', :as => 'system_messages'
|
||||
get 'index', :as => 'index'
|
||||
end
|
||||
end
|
||||
# match 'system_messages/index', to: 'system_messages#index', :via => :get, :as => 'system_messages'
|
||||
|
||||
match 'account/heartbeat', to: 'account#heartbeat', :via => :get
|
||||
match 'login', :to => 'account#login', :as => 'signin', :via => [:get, :post]
|
||||
match 'logout', :to => 'account#logout', :as => 'signout', :via => [:get, :post]
|
||||
|
@ -702,6 +712,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'admin/projects', :via => :get
|
||||
get 'admin/courses'
|
||||
match 'admin/users', :via => :get
|
||||
match 'admin/messages', :via => :get
|
||||
match 'admin/first_page_made', as: :first_page_made
|
||||
match 'admin/course_page_made', as: :course_page_made
|
||||
match 'admin/contest_page_made', as: :contest_page_made
|
||||
|
@ -874,6 +885,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'tags/remove_tag', :as=>"remove_tag"
|
||||
match 'tags/remove_tag_new', :as=>"remove_tag_new"
|
||||
match 'tags/tag_save', :as => "save_tag"
|
||||
match 'tags/update_tag_name',:as => "update_tag_name"
|
||||
|
||||
match 'words/add_brief_introdution'
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
class CreateOnclickTimes < ActiveRecord::Migration
|
||||
def change
|
||||
create_table :onclick_times do |t|
|
||||
t.integer :user_id
|
||||
t.datetime :onclick_time
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue