commit
abe710d955
|
@ -124,6 +124,16 @@ class AdminController < ApplicationController
|
|||
render :action => "projects", :layout => false if request.xhr?
|
||||
end
|
||||
|
||||
def contests
|
||||
@name = params[:name]
|
||||
@contests = Contest.where("id >= 780 and name like '%#{@name}%'").order('created_at desc')
|
||||
@contests = paginateHelper @contests,30
|
||||
@page = (params['page'] || 1).to_i - 1
|
||||
respond_to do |format|
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
def syllabuses
|
||||
@name = params[:name]
|
||||
@syllabuses = Syllabus.like(@name).order('created_at desc')
|
||||
|
|
|
@ -97,11 +97,11 @@ class ContestantWorksController < ApplicationController
|
|||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
# format.xls {
|
||||
# filename = "#{@contest.user.lastname.to_s + @contest.user.firstname}_#{@contest.name}_#{@contestwork.name}#{l(:excel_homework_list)}.xls"
|
||||
# send_data(homework_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present",
|
||||
# :filename => filename_for_content_disposition(filename))
|
||||
# }
|
||||
format.xls {
|
||||
filename = "#{@contest.user.show_name.to_s}_#{@contest.name}_#{@contestwork.name}_#{l(:excel_homework_list)}_#{DateTime.parse(Time.now.to_s).strftime('%Y%m%d%H%M%S').to_s}.xls"
|
||||
send_data(work_score_to_xls(@stundet_works), :type => "text/excel;charset=utf-8; header=present",
|
||||
:filename => filename_for_content_disposition(filename))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -472,4 +472,140 @@ class ContestantWorksController < ApplicationController
|
|||
def is_logged
|
||||
redirect_to signin_path unless User.current.logged?
|
||||
end
|
||||
|
||||
#提交成绩导出
|
||||
def work_score_to_xls items
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "work"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
sheet1.row(0).default_format = blue
|
||||
if @contestwork.work_type == 1 #普通作业
|
||||
#开启在线评审
|
||||
if @contestwork.online_evaluation
|
||||
sheet1.row(0).concat([l(:excel_contestant_id),l(:excel_user_name),l(:excel_nickname),l(:excel_mail),l(:excel_school),l(:excel_homework_name),l(:excel_homework_des)])
|
||||
if @contestwork.work_detail_manual.evaluation_num != -1
|
||||
num = @contestwork.work_detail_manual.evaluation_num
|
||||
n = num < (contest_judges @contest).size ? num : (contest_judges @contest).size
|
||||
else
|
||||
n = (contest_judges @contest).size
|
||||
end
|
||||
for i in 1 .. n do i
|
||||
sheet1.row(0).concat([l(:label_judge_score, :num => i),l(:label_judge_comment, :num => i)])
|
||||
end
|
||||
sheet1.row(0).concat([l(:label_highest_score),l(:label_lowest_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
|
||||
count_row = 1
|
||||
items.each do |contestant_work|
|
||||
sheet1[count_row,0] = contestant_work.user.id
|
||||
sheet1[count_row,1] = contestant_work.user.show_name
|
||||
sheet1[count_row,2] = contestant_work.user.login
|
||||
sheet1[count_row,3] = contestant_work.user.mail
|
||||
sheet1[count_row,4] = contestant_work.user.user_extensions.school.nil? ? "" : contestant_work.user.user_extensions.school.name
|
||||
sheet1[count_row,5] = contestant_work.name
|
||||
sheet1[count_row,6] = strip_html contestant_work.description if !contestant_work.description.nil?
|
||||
work_scores = contestant_work_score_record contestant_work
|
||||
for i in 1 .. n do i
|
||||
sheet1[count_row,6 + i*2 -1] = (work_scores.nil? || work_scores[i - 1].nil?) ? l(:label_without_score) : work_scores[i - 1].score
|
||||
sheet1[count_row,6 + i*2] = (work_scores.nil? || work_scores[i - 1].nil?) ? "" : work_scores[i - 1].comment
|
||||
end
|
||||
sheet1[count_row,7+2*n] = (work_scores.nil? || work_scores.reorder("score desc").first.nil?) ? l(:label_without_score) : work_scores.reorder("score desc").first.score
|
||||
sheet1[count_row,8+2*n] = (work_scores.nil? || work_scores.reorder("score desc").last.nil?) ? l(:label_without_score) : work_scores.reorder("score desc").last.score
|
||||
sheet1[count_row,9+2*n] = contestant_work.work_score.nil? ? l(:label_without_score) : contestant_work.work_score.round(2)
|
||||
sheet1[count_row,10+2*n] = format_time contestant_work.commit_time
|
||||
count_row += 1
|
||||
end
|
||||
|
||||
#未开启在线评审
|
||||
else
|
||||
sheet1.row(0).concat([l(:excel_contestant_id),l(:excel_user_name),l(:excel_nickname),l(:excel_mail),l(:excel_school),l(:excel_homework_name),l(:excel_homework_des),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
items.each do |contestant_work|
|
||||
sheet1[count_row,0] = contestant_work.user.id
|
||||
sheet1[count_row,1] = contestant_work.user.show_name
|
||||
sheet1[count_row,2] = contestant_work.user.login
|
||||
sheet1[count_row,3] = contestant_work.user.mail
|
||||
sheet1[count_row,4] = contestant_work.user.user_extensions.school.nil? ? "" : contestant_work.user.user_extensions.school.name
|
||||
sheet1[count_row,5] = contestant_work.name
|
||||
sheet1[count_row,6] = strip_html contestant_work.description if !contestant_work.description.nil?
|
||||
sheet1[count_row,7] = format_time contestant_work.commit_time
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
|
||||
elsif @contestwork.work_type == 3 #分组作业
|
||||
if @contestwork.online_evaluation
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_group_leader),l(:excel_group_leader_login),l(:excel_group_leader_mail),l(:excel_school)])
|
||||
if @contestwork.work_detail_group.base_on_project
|
||||
sheet1.row(0).concat([l(:excel_homework_project),l(:excel_homework_name),l(:excel_homework_des)])
|
||||
else
|
||||
sheet1.row(0).concat([l(:excel_homework_name),l(:excel_homework_des)])
|
||||
end
|
||||
if @contestwork.work_detail_manual.evaluation_num != -1
|
||||
num = @contestwork.work_detail_manual.evaluation_num
|
||||
n = num < (contest_judges @contest).size ? num : (contest_judges @contest).size
|
||||
else
|
||||
n = (contest_judges @contest).size
|
||||
end
|
||||
for i in 1 .. n do i
|
||||
sheet1.row(0).concat([l(:label_judge_score, :num => i),l(:label_judge_comment, :num => i)])
|
||||
end
|
||||
sheet1.row(0).concat([l(:label_highest_score),l(:label_lowest_score),l(:excel_f_score),l(:excel_commit_time)])
|
||||
|
||||
count_row = 1
|
||||
items.each do |contestant_work|
|
||||
sheet1[count_row,0] = get_contest_group_member_names contestant_work
|
||||
sheet1[count_row,1] = contestant_work.user.show_name
|
||||
sheet1[count_row,2] = contestant_work.user.login
|
||||
sheet1[count_row,3] = contestant_work.user.mail
|
||||
sheet1[count_row,4] = contestant_work.user.user_extensions.school.nil? ? "" : contestant_work.user.user_extensions.school.name
|
||||
if @contestwork.work_detail_group.base_on_project
|
||||
sheet1[count_row,5] = (contestant_work.project_id == 0 || contestant_work.project_id.nil?) ? l(:excel_no_project) : contestant_work.project.name
|
||||
current_column = 6
|
||||
else
|
||||
current_column = 5
|
||||
end
|
||||
sheet1[count_row,current_column] = contestant_work.name
|
||||
sheet1[count_row,current_column + 1] = strip_html contestant_work.description if !contestant_work.description.nil?
|
||||
work_scores = contestant_work_score_record contestant_work
|
||||
for i in 1 .. n do i
|
||||
sheet1[count_row,current_column + 1 + i*2 -1] = (work_scores.nil? || work_scores[i - 1].nil?) ? l(:label_without_score) : work_scores[i - 1].score
|
||||
sheet1[count_row,current_column + 1 + i*2] = (work_scores.nil? || work_scores[i - 1].nil?) ? "" : work_scores[i - 1].comment
|
||||
end
|
||||
sheet1[count_row,current_column + 2 +2*n] = (work_scores.nil? || work_scores.reorder("score desc").first.nil?) ? l(:label_without_score) : work_scores.reorder("score desc").first.score
|
||||
sheet1[count_row,current_column + 3 +2*n] = (work_scores.nil? || work_scores.reorder("score desc").last.nil?) ? l(:label_without_score) : work_scores.reorder("score desc").last.score
|
||||
sheet1[count_row,current_column + 4 +2*n] = contestant_work.work_score.nil? ? l(:label_without_score) : contestant_work.work_score.round(2)
|
||||
sheet1[count_row,current_column + 5 +2*n] = format_time contestant_work.commit_time
|
||||
count_row += 1
|
||||
end
|
||||
|
||||
else
|
||||
if @contestwork.work_detail_group.base_on_project
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_group_leader),l(:excel_group_leader_login),l(:excel_group_leader_mail),l(:excel_school),l(:excel_homework_project),l(:excel_homework_name),l(:excel_homework_des),l(:excel_commit_time)])
|
||||
else
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_group_leader),l(:excel_group_leader_login),l(:excel_group_leader_mail),l(:excel_school),l(:excel_homework_name),l(:excel_homework_des),l(:excel_commit_time)])
|
||||
end
|
||||
count_row = 1
|
||||
items.each do |contestant_work|
|
||||
sheet1[count_row,0] = get_contest_group_member_names contestant_work
|
||||
sheet1[count_row,1] = contestant_work.user.show_name
|
||||
sheet1[count_row,2] = contestant_work.user.login
|
||||
sheet1[count_row,3] = contestant_work.user.mail
|
||||
sheet1[count_row,4] = contestant_work.user.user_extensions.school.nil? ? "" : contestant_work.user.user_extensions.school.name
|
||||
if @contestwork.work_detail_group.base_on_project
|
||||
sheet1[count_row,5] = (contestant_work.project_id == 0 || contestant_work.project_id.nil?) ? l(:excel_no_project) : contestant_work.project.name
|
||||
current_column = 6
|
||||
else
|
||||
current_column = 5
|
||||
end
|
||||
sheet1[count_row,current_column] = contestant_work.name
|
||||
sheet1[count_row,current_column + 1] = strip_html contestant_work.description if !contestant_work.description.nil?
|
||||
sheet1[count_row,current_column + 2] = format_time contestant_work.commit_time
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
end
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ class ContestsController < ApplicationController
|
|||
include AvatarHelper
|
||||
|
||||
before_filter :find_contest, :only => [:show, :settings, :update, :destroy, :contest_activities, :search_member, :private_or_public, :switch_role, :set_invite_code_halt, :renew,
|
||||
:member]
|
||||
:member, :export_all_members, :feedback]
|
||||
before_filter :is_logged, :only => [:index, :new, :create]
|
||||
before_filter :is_admin?, :only => [:settings, :set_invite_code_halt, :destroy]
|
||||
before_filter :is_member?, :only => [:show, :contest_activities]
|
||||
|
@ -115,6 +115,30 @@ class ContestsController < ApplicationController
|
|||
@contest.update_attributes(:is_delete => true)
|
||||
end
|
||||
|
||||
def feedback
|
||||
if (User.current.admin? || @contest.is_public || (!@contest.is_public && User.current.member_of_contest?(@contest)))
|
||||
ContestMessage.where(:user_id => User.current.id, :contest_id => @contest.id, :contest_message_type => 'JournalsForMessage', :contest_message_id => @contest.journals_for_messages.map{|jour|jour.id}).update_all(:viewed => true)
|
||||
page = params[:page]
|
||||
# Find the page of the requested reply
|
||||
@jours = @contest.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
|
||||
@jour_count = @jours.count
|
||||
@limit = 10
|
||||
if params[:r] && page.nil?
|
||||
offset = @jours.count(:conditions => ["#{JournalsForMessage.table_name}.id > ?", params[:r].to_i])
|
||||
page = 1 + offset / @limit
|
||||
end
|
||||
@jour = paginateHelper @jours,10
|
||||
@state = false
|
||||
@left_nav_type = 6
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_contests'}
|
||||
format.api
|
||||
end
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
def private_or_public
|
||||
@contest.update_attributes(:is_public => !@contest.is_public)
|
||||
|
||||
|
@ -284,8 +308,52 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def export_all_members
|
||||
sql = "SELECT DISTINCT(cmr.id) AS cmr_id, cmr.role_id, users.`login`, users.id AS user_id, users.`mail`, cmr.created_at FROM users, contest_members cm, contest_member_roles cmr, user_extensions ue, schools " +
|
||||
"WHERE users.id = cm.`user_id` AND users.id=ue.`user_id` AND cmr.`contest_member_id` = cm.`id` AND cm.`contest_id` = #{@contest.id} AND (ue.`school_id` IS NULL OR ue.`school_id` = schools.`id`) " +
|
||||
"ORDER BY role_id ASC, CONVERT(schools.`name` USING gbk) COLLATE gbk_chinese_ci DESC, CONVERT(users.`lastname` USING gbk) COLLATE gbk_chinese_ci DESC"
|
||||
@members = ContestMemberRole.find_by_sql sql
|
||||
respond_to do |format|
|
||||
format.xls {
|
||||
filename = "#{@contest.name.to_s}-成员列表-#{DateTime.parse(Time.now.to_s).strftime('%Y%m%d%H%M%S').to_s}.xls"
|
||||
send_data(member_to_xls(@members), :type => "text/excel;charset=utf-8; header=present",
|
||||
:filename => filename_for_content_disposition("#{filename}.xls"))
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def member_to_xls members
|
||||
xls_report = StringIO.new
|
||||
book = Spreadsheet::Workbook.new
|
||||
sheet1 = book.create_worksheet :name => "成员列表"
|
||||
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
|
||||
#sheet1.row(0).default_format = blue
|
||||
#sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_class),l(:excel_f_score),l(:excel_commit_time)])
|
||||
sheet1[0,0] = "id"
|
||||
sheet1[0,1] = "姓名"
|
||||
sheet1[0,2] = "登录名"
|
||||
sheet1[0,3] = "电子邮箱"
|
||||
sheet1[0,4] = "单位"
|
||||
sheet1[0,5] = "角色"
|
||||
sheet1[0,6] = "加入时间"
|
||||
count_row = 1
|
||||
members.each_with_index do |member, i|
|
||||
user = User.find(member.user_id)
|
||||
sheet1[count_row,0]= user.id
|
||||
sheet1[count_row,1] = user.show_name
|
||||
sheet1[count_row,2] = user.login
|
||||
sheet1[count_row,3] = user.mail
|
||||
sheet1[count_row,4] = user.user_extensions.school_id.blank? ? "" : (user.user_extensions.school.blank? ? "" : user.user_extensions.school.name)
|
||||
sheet1[count_row,5] = member.role_id == 13 ? "管理员" : (member.role_id == 14 ? "评委" : "参赛者")
|
||||
sheet1[count_row,6] = format_time member.created_at
|
||||
count_row += 1
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
end
|
||||
|
||||
def find_contest
|
||||
if params[:id].to_i < 780
|
||||
render_403
|
||||
|
|
|
@ -187,6 +187,7 @@ class CoursesController < ApplicationController
|
|||
# @is_remote = true
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
@search_name = "#{params[:name].strip}"
|
||||
q = "#{params[:name].strip}"
|
||||
if params[:incourse]
|
||||
results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
|
||||
|
@ -350,19 +351,17 @@ class CoursesController < ApplicationController
|
|||
@search = params[:search]
|
||||
q = params[:search] ? "#{params[:search].strip}" : ""
|
||||
@members = []
|
||||
@members = @course.members.where("course_group_id = 0").joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id asc").select{|m| m.roles.to_s.include?("Student")}
|
||||
if q.nil? || q == ""
|
||||
@course.members.includes(:user =>[:user_extensions =>[]]).where("course_group_id = 0").each do |m|
|
||||
if m && m.user && m.user.join_in?(@course)
|
||||
@members << m
|
||||
end
|
||||
end
|
||||
else
|
||||
@course.members.includes(:user =>[:user_extensions =>[]]).where("course_group_id = 0").each do |m|
|
||||
members = []
|
||||
@members.each do |m|
|
||||
username = m.user[:lastname].to_s.downcase + m.user[:firstname].to_s.downcase
|
||||
if m && m.user && m.user.join_in?(@course) && (m.user[:login].to_s.downcase.include?(q) || m.user.user_extensions[:student_id].to_s.downcase.include?(q) || username.include?(q))
|
||||
@members << m
|
||||
if m && m.user && (m.user[:login].to_s.downcase.include?(q) || m.user.user_extensions[:student_id].to_s.downcase.include?(q) || username.include?(q))
|
||||
members << m
|
||||
end
|
||||
end
|
||||
@members = members
|
||||
end
|
||||
@is_search = params[:is_search] ? 1 : 0
|
||||
respond_to do |format|
|
||||
|
@ -402,6 +401,7 @@ class CoursesController < ApplicationController
|
|||
@is_remote = true
|
||||
@sort_type = 'score'
|
||||
@score_sort_by = "desc"
|
||||
@search_name = ""
|
||||
if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
|
||||
@group = CourseGroup.find(params[:group_id])
|
||||
@results = student_homework_score(@group.id,0, 0,"desc")
|
||||
|
@ -455,6 +455,7 @@ class CoursesController < ApplicationController
|
|||
@is_remote = true
|
||||
@course_groups = @course.course_groups if @course.course_groups
|
||||
@show_serch = params[:role] == '2'
|
||||
@search_name = ""
|
||||
case @role
|
||||
when '1'
|
||||
@subPage_title = l :label_teacher_list
|
||||
|
@ -490,15 +491,16 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def export_course_member_excel
|
||||
q = "#{params[:name].strip}"
|
||||
if params[:group_id] && params[:group_id] != "0" && params[:group_id] != "-1"
|
||||
group = CourseGroup.find params[:group_id]
|
||||
unless group.nil?
|
||||
@all_members = student_homework_score(group.id,0,0,"desc")
|
||||
@all_members = searchmember_by_name(student_homework_score(group.id,0,0,"desc"), q)
|
||||
end
|
||||
elsif params[:group_id] && params[:group_id] == "-1"
|
||||
@all_members = student_homework_score(-1, 0, 10,"desc")
|
||||
@all_members = searchmember_by_name(student_homework_score(-1, 0, 10,"desc"), q)
|
||||
else
|
||||
@all_members = student_homework_score(0, 0, 10,"desc")
|
||||
@all_members = searchmember_by_name(student_homework_score(0, 0, 10,"desc"), q)
|
||||
end
|
||||
|
||||
@homeworks = @course.homework_commons.where("publish_time <= '#{Date.today}'").order("created_at asc")
|
||||
|
@ -657,6 +659,7 @@ class CoursesController < ApplicationController
|
|||
course_status.destroy if course_status
|
||||
course_status = CourseStatus.create(:course_id => @course.id, :grade => 0)
|
||||
end
|
||||
@syllabus = @course.syllabus
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
|
@ -89,7 +89,7 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new
|
||||
param_end_time = Time.parse(params[:homework_common][:end_time]).strftime("%Y-%m-%d")
|
||||
homework_end_time = Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d")
|
||||
homework_end_time = @homework.end_time ? Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") : ''
|
||||
if homework_end_time != param_end_time
|
||||
if homework_end_time > param_end_time
|
||||
@homework.student_works.where("work_status = 1").each do |st|
|
||||
|
@ -172,7 +172,7 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
|
||||
#分组作业
|
||||
if @homework.homework_type == 3
|
||||
if @homework.homework_type == 3 && @homework.student_works.has_committed.count == 0
|
||||
@homework.homework_detail_group ||= HomeworkDetailGroup.new
|
||||
@homework_detail_group = @homework.homework_detail_group
|
||||
@homework_detail_group.min_num = params[:min_num].to_i if params[:min_num]
|
||||
|
|
|
@ -8,7 +8,7 @@ class StudentWorkController < ApplicationController
|
|||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:program_test_ex,
|
||||
:set_score_rule,:forbidden_anonymous_comment,:delete_work,:new_student_work_project,:student_work_project,:cancel_relate_project,
|
||||
:search_course_students,:work_canrepeat,:add_group_member,:change_project]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work,:revise_attachment]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work, :retry_work, :revise_attachment, :hide_score_detail]
|
||||
before_filter :member_of_course, :only => [:new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule, :forbidden_anonymous_comment]
|
||||
|
@ -950,6 +950,19 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def hide_score_detail
|
||||
student_work_score = StudentWorksScore.where(:id => params[:score_id]).first
|
||||
if student_work_score
|
||||
student_work_score.update_attributes(:is_hidden => 1)
|
||||
end
|
||||
@is_member_work = @homework.homework_type == 3 && @work.student_work_projects.empty?
|
||||
@student_work_scores = student_work_score_record(@work)
|
||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
#缺评列表显示
|
||||
def student_work_absence_penalty
|
||||
order = params[:order] || "desc"
|
||||
|
|
|
@ -109,6 +109,19 @@ class WordsController < ApplicationController
|
|||
end
|
||||
return
|
||||
end
|
||||
elsif @journal_destroyed.jour_type == "Contest"
|
||||
@contest = Contest.find(@journal_destroyed.jour_id)
|
||||
@jours_count = @contest.journals_for_messages.where('m_parent_id IS NULL').count
|
||||
@user_activity_id = params[:user_activity_id] if params[:user_activity_id]
|
||||
@activity = JournalsForMessage.where("id = #{params[:activity_id].to_i}").first if params[:activity_id]
|
||||
unless @activity
|
||||
if params[:user_activity_id] == params[:activity_id]
|
||||
redirect_to feedback_contest_path(@contest)
|
||||
else
|
||||
redirect_to contest_activities_contest_path(@contest)
|
||||
end
|
||||
return
|
||||
end
|
||||
elsif @journal_destroyed.jour_type == 'HomeworkCommon'
|
||||
@homework = HomeworkCommon.find @journal_destroyed.jour_id
|
||||
if params[:user_activity_id]
|
||||
|
@ -305,6 +318,18 @@ class WordsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def leave_contest_message
|
||||
if User.current.logged?
|
||||
@contest = Contest.find params[:id]
|
||||
if params[:new_form][:content].size>0 && User.current.logged?
|
||||
@contest.journals_for_messages << JournalsForMessage.new(:user_id => User.current.id, :notes => params[:new_form][:content], :reply_id => 0, :status => true, :is_readed => false)
|
||||
end
|
||||
redirect_to feedback_contest_path(@contest)
|
||||
else
|
||||
render_403
|
||||
end
|
||||
end
|
||||
|
||||
#作业的回复
|
||||
def leave_homework_message
|
||||
if User.current.logged?
|
||||
|
|
|
@ -4012,6 +4012,23 @@ def get_group_member_names work
|
|||
result
|
||||
end
|
||||
|
||||
def get_contest_group_member_names work
|
||||
result = ""
|
||||
unless work.nil?
|
||||
work.contestant_work_projects.each do |member|
|
||||
user = User.where(:id => member.user_id).first
|
||||
unless user.nil?
|
||||
if result != ""
|
||||
result += "、#{user.show_name}"
|
||||
else
|
||||
result += user.show_name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
result
|
||||
end
|
||||
|
||||
def course_syllabus_option user = User.current
|
||||
syllabus_members = SyllabusMember.where("user_id = #{user.id}")
|
||||
syllabus_ids = syllabus_members.empty? ? "(-1)" : "(" + syllabus_members.map{|mem| mem.syllabus_id}.join(',') + ")"
|
||||
|
@ -4127,6 +4144,10 @@ def searchstudent_by_name users, name
|
|||
mems
|
||||
end
|
||||
|
||||
def contest_feedback_count
|
||||
@contest.journals_for_messages.where('m_parent_id IS NULL').count
|
||||
end
|
||||
|
||||
def add_reply_adapter obj, options
|
||||
#modify by nwb
|
||||
#添加对课程留言的支持
|
||||
|
@ -4138,6 +4159,8 @@ def add_reply_adapter obj, options
|
|||
Project.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Course'
|
||||
Course.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
when 'Contest'
|
||||
Contest.add_new_jour(nil, nil, obj.jour_id, options)
|
||||
#when 'Bid'
|
||||
# obj.jour.add_jour(nil, nil, nil, options)
|
||||
#when 'Contest'
|
||||
|
|
|
@ -36,8 +36,7 @@ module ContestantWorksHelper
|
|||
def contestant_work_score_record work
|
||||
sql = "SELECT MAX(id) id FROM contestant_work_scores WHERE reviewer_role = 2 AND score IS NOT NULL AND contestant_work_id = #{work.id} GROUP BY user_id"
|
||||
tea_ts_ids = ContestantWorkScore.find_by_sql sql
|
||||
tea_ts_ids = tea_ts_ids.empty? ? "(-1)" : "(" + tea_ts_ids.map{|tea| tea.id}.join(",") + ")"
|
||||
scores = work.contestant_work_scores.where("score IS NULL or reviewer_role = 3 or id in #{tea_ts_ids}").order("updated_at desc")
|
||||
scores = work.contestant_work_scores.where(:id => tea_ts_ids.map{|tea| tea.id}).order("updated_at desc")
|
||||
return scores
|
||||
end
|
||||
|
||||
|
|
|
@ -69,12 +69,13 @@ module StudentWorkHelper
|
|||
str
|
||||
end
|
||||
|
||||
#获取学生作品的评分记录:同一个教师或教辅只显示最后一次评分
|
||||
#获取学生作品的评分记录:同一个教师或教辅只显示未隐藏的评分
|
||||
def student_work_score_record work
|
||||
sql = "SELECT MAX(id) id FROM student_works_scores WHERE (reviewer_role = 2 OR reviewer_role = 1) AND score IS NOT NULL AND student_work_id = #{work.id} GROUP BY user_id"
|
||||
tea_ts_ids = StudentWorksScore.find_by_sql sql
|
||||
tea_ts_ids = tea_ts_ids.empty? ? "(-1)" : "(" + tea_ts_ids.map{|tea| tea.id}.join(",") + ")"
|
||||
scores = work.student_works_scores.where("score IS NULL or reviewer_role = 3 or id in #{tea_ts_ids}").order("updated_at desc")
|
||||
# sql = "SELECT MAX(id) id FROM student_works_scores WHERE (reviewer_role = 2 OR reviewer_role = 1) AND score IS NOT NULL AND is_hidden = 0 AND student_work_id = #{work.id} GROUP BY user_id"
|
||||
# tea_ts_ids = StudentWorksScore.find_by_sql sql
|
||||
# tea_ts_ids = tea_ts_ids.empty? ? "(-1)" : "(" + tea_ts_ids.map{|tea| tea.id}.join(",") + ")"
|
||||
# scores = work.student_works_scores.where("score IS NULL or reviewer_role = 3 or id in #{tea_ts_ids}").order("updated_at desc")
|
||||
scores = work.student_works_scores.where(:is_hidden => false).order("created_at desc")
|
||||
return scores
|
||||
end
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ module WatchersHelper
|
|||
text = collected == 1 ? l(:label_project_collect_cancel) : l(:label_project_collect)
|
||||
url = store_mine_project_path(project_id)
|
||||
method = 'post'
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{project_id}", :class => "pro_new_topbtn_left fl", :title => "#{collected == 1 ? '点击将其从个人主页的项目列表中移除' : '点击将其添加至人主页的项目列表中'}")
|
||||
link = link_to(text, url, :remote => true, :method => method, :id => "#{project_id}", :class => "pro_new_topbtn_left fl", :title => "#{collected == 1 ? '点击将其从左侧导航的项目列表中移除' : '点击将其添加至左侧导航的项目列表中'}")
|
||||
# link.html_safe
|
||||
end
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ class Contest < ActiveRecord::Base
|
|||
has_many :contestant_work_projects, :dependent => :destroy
|
||||
has_many :boards, :dependent => :destroy, :order => "position ASC"
|
||||
has_many :files
|
||||
|
||||
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
||||
|
||||
has_many :news, :dependent => :destroy, :include => :author
|
||||
|
||||
|
@ -131,4 +131,16 @@ class Contest < ActiveRecord::Base
|
|||
logger.error "[Contest Model] ===> Auto create board when contest saved, because #{@board.full_messages}"
|
||||
end
|
||||
end
|
||||
|
||||
# 新增竞赛留言
|
||||
def self.add_new_jour(user, notes, id, options={})
|
||||
contest = Contest.find(id)
|
||||
if options.count == 0
|
||||
pjfm = contest.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
|
||||
else
|
||||
pjfm = contest.journals_for_messages.build(options)
|
||||
end
|
||||
pjfm.save
|
||||
pjfm
|
||||
end
|
||||
end
|
||||
|
|
|
@ -76,7 +76,7 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
has_one :praise_tread_cache, as: :object, dependent: :destroy
|
||||
|
||||
validates :notes, presence: true, if: :is_homework_jour?
|
||||
after_create :act_as_course_activity, :act_as_course_message,
|
||||
after_create :act_as_course_activity, :act_as_course_message, :act_as_contest_activity,
|
||||
act_as_at_message(:notes, :user_id), :act_as_user_feedback_message,
|
||||
:act_as_principal_activity
|
||||
# after_create :reset_counters!
|
||||
|
@ -222,6 +222,13 @@ class JournalsForMessage < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
#竞赛动态公共表记录
|
||||
def act_as_contest_activity
|
||||
if self.jour_type == 'Contest' && self.m_parent_id.nil?
|
||||
self.contest_acts << ContestActivity.new(:user_id => self.user_id,:contest_id => self.jour_id)
|
||||
end
|
||||
end
|
||||
|
||||
# 课程/作品回复 留言消息通知
|
||||
def act_as_course_message
|
||||
if self.jour_type == 'StudentWorksScore'
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
class StudentWorksScore < ActiveRecord::Base
|
||||
#reviewer_role: 1:教师评分;2:教辅评分;3:学生匿评
|
||||
#appeal_status: 0:正常;1:申诉中,2:撤销申诉;3:申诉成功;4申诉被拒绝
|
||||
attr_accessible :student_work_id, :user_id, :score, :comment, :reviewer_role
|
||||
attr_accessible :student_work_id, :user_id, :score, :comment, :reviewer_role, :is_hidden
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :student_work
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#encoding: utf-8
|
||||
class StudentsForCourse < ActiveRecord::Base
|
||||
attr_accessible :course_id, :student_id
|
||||
|
||||
|
@ -9,7 +10,7 @@ class StudentsForCourse < ActiveRecord::Base
|
|||
validates_uniqueness_of :student_id, :scope => :course_id
|
||||
|
||||
after_destroy :delete_student_works
|
||||
after_create :recovery_student_works
|
||||
after_create :recovery_student_works, :create_student_works
|
||||
|
||||
#退出班级或删除学生时隐藏学生的作品
|
||||
def delete_student_works
|
||||
|
@ -26,4 +27,14 @@ class StudentsForCourse < ActiveRecord::Base
|
|||
student_works = StudentWork.where("user_id = #{self.student_id} && homework_common_id in #{homework_ids}")
|
||||
student_works.update_all(:is_delete => 0)
|
||||
end
|
||||
|
||||
#加入班级时创建已发布作业的作品
|
||||
def create_student_works
|
||||
course = self.course
|
||||
course.homework_commons.each do |hw|
|
||||
if hw.homework_type != 3 && hw.student_works.where("user_id = #{self.student_id}").count == 0
|
||||
hw.student_works << StudentWork.new(:user_id => self.student_id, :name => hw.name.to_s+"的作品提交", :work_status => 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
<h3>
|
||||
<%=l(:label_contest_plural)%>
|
||||
</h3>
|
||||
|
||||
<%= form_tag({}, :method => :get) do %>
|
||||
<fieldset>
|
||||
<label for='name'>
|
||||
竞赛:
|
||||
</label>
|
||||
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '竞赛名称' %>
|
||||
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
|
||||
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'contests'}, :class => 'icon icon-reload' %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="autoscroll">
|
||||
<table class="list" style="width: 100%;table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 40px;">
|
||||
序号
|
||||
</th>
|
||||
<th style="width: 200px;">
|
||||
竞赛
|
||||
</th>
|
||||
<th style="width: 40px;">
|
||||
公开
|
||||
</th>
|
||||
<th style="width: 100px;">
|
||||
创建者
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
成员数
|
||||
</th>
|
||||
<th style="width: 30px;">
|
||||
提交数
|
||||
</th>
|
||||
<th style="width: 70px;">
|
||||
创建于
|
||||
</th>
|
||||
<th style="width: 120px;">
|
||||
最新动态时间
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @contests.each do |contest| %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td style="text-align: center;">
|
||||
<%= contest.id %>
|
||||
</td>
|
||||
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=contest.name%>'>
|
||||
<span>
|
||||
<%= link_to contest.name, contest_path(contest), :target => '_blank' %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= checked_image contest.is_public %>
|
||||
</td>
|
||||
<td style="text-align: center; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=contest.user.show_name%>'>
|
||||
<span>
|
||||
<%= link_to contest.user.show_name, user_path(contest.user), :target => '_blank' %>
|
||||
</span>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=contest.contest_members.count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%=contest.works.count %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= format_date(contest.created_at) %>
|
||||
</td>
|
||||
<td align="center">
|
||||
<%= contest.contest_acts.order("updated_at asc").last.updated_at.strftime('%Y-%m-%d %H:%M:%S') %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="pagination">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_project_plural)) -%>
|
|
@ -37,51 +37,6 @@
|
|||
$("#relatePWrap_<%=@contestwork.id %>").toggleClass('relatePWrap');
|
||||
$("#moreProject_<%=@contestwork.id %>").show();
|
||||
});
|
||||
|
||||
// 匿评弹框提示
|
||||
<%# if @is_evaluation && !@stundet_works.empty?%>
|
||||
// $(function(){
|
||||
// $('#ajax-modal').html('<%#= escape_javascript(render :partial => 'student_work/praise_alert') %>');
|
||||
// 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");
|
||||
// });
|
||||
<%# end%>
|
||||
|
||||
// function set_score_rule_submit() {
|
||||
// if($("#late_penalty_num").val() == ""){
|
||||
// $("#late_penalty_num").val("0");
|
||||
// }
|
||||
// if($("#absence_penalty_num").val() == ""){
|
||||
// $("#absence_penalty_num").val("0");
|
||||
// }
|
||||
// $('#muban_popup_box').find('form').submit();
|
||||
// hideModal();
|
||||
// }
|
||||
|
||||
// //设置评分规则
|
||||
// function set_score_rule(){
|
||||
<!--<%# if @homework.homework_type == 2 %>-->
|
||||
<!--<%# if @homework.anonymous_comment == 0 %>-->
|
||||
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
// pop_box_new(htmlvalue, 570, 355);
|
||||
<!--<%# else %>-->
|
||||
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
// pop_box_new(htmlvalue, 500, 285);
|
||||
<!--<%# end %>-->
|
||||
<!--<%# else %>-->
|
||||
<!--<%# if @homework.anonymous_comment == 0 %>-->
|
||||
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
// pop_box_new(htmlvalue, 500, 325);
|
||||
<!--<%# else %>-->
|
||||
// var htmlvalue = "<%#= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => true, :user_activity_id => -1,:hw_status => 5}) %>";
|
||||
// pop_box_new(htmlvalue, 500, 225);
|
||||
<!--<%# end %>-->
|
||||
<!--<%# end %>-->
|
||||
// }
|
||||
</script>
|
||||
|
||||
<div class="homepageRight mt0 ml10">
|
||||
|
@ -116,28 +71,28 @@
|
|||
<!---menu_r end--->
|
||||
</div>
|
||||
<!--div class="hworkInfor"><a href="javascript:void(0);" class="linkBlue">作业信息</a></div-->
|
||||
<%# if @is_teacher%>
|
||||
<!--<div class="fr mt5">-->
|
||||
<!--<ul class="">-->
|
||||
<!--<li class="pr export_icon_li">-->
|
||||
<!--<a href="javascript:void(0);" class="export_icon linkBlue2">导出</a>-->
|
||||
<!--<ul class="hworkMenu" style="top: 30px; left: -100px;">-->
|
||||
<!--<!–<li>–>-->
|
||||
<!--<!–<%#= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>–>-->
|
||||
<!--<!–</li>–>-->
|
||||
<% if @is_teacher%>
|
||||
<div class="fr mt5">
|
||||
<ul class="">
|
||||
<li class="pr export_icon_li">
|
||||
<a href="javascript:void(0);" class="export_icon linkBlue2">导出</a>
|
||||
<ul class="hworkMenu" style="top: 30px; left: -100px;">
|
||||
<li>
|
||||
<%= link_to "导出提交成绩", contestant_works_path(:work => @contestwork.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :format => 'xls'),:class=>'hworkExport postTypeGrey', :id => "export_student_work"%>
|
||||
</li>
|
||||
<!--<li>-->
|
||||
<!--<%# if @contestwork.contestant_works.empty?%>-->
|
||||
<!--<%# if @homework.student_works.empty?%>-->
|
||||
<!--<%#= link_to "导出作业附件", "javascript:void(0)", class: "hworkExport resourcesGrey", :onclick => "alert('没有学生提交作业,无法下载附件')" %>-->
|
||||
<!--<%# else%>-->
|
||||
<!--<%#= link_to "导出作业附件", zipdown_assort_path(obj_class: @contestwork.class, obj_id: @contestwork, format: :json),-->
|
||||
<!--<%#= 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>-->
|
||||
<!--</ul>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<%# end%>
|
||||
<!--</li> -->
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
<% when 'Poll' %>
|
||||
<%#= render :partial => 'users/contest_poll', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<%#= render :partial => 'users/contest_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_course => 1} %>
|
||||
<%= render :partial => 'users/contest_journalsformessage', :locals => {:activity => act, :user_activity_id => activity.id, :is_contest => 1} %>
|
||||
<% when 'Attachment' %>
|
||||
<%#= render :partial => 'users/contest_attachment', :locals => {:activity => act, :user_activity_id => activity.id} %>
|
||||
<% when 'Contest' %>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: true, prettify: false, init_activity: true) %>
|
||||
<%#= javascript_include_tag "init_KindEditor","user" %>
|
||||
<% end %>
|
||||
|
||||
<%if jours %>
|
||||
<% jours.each do |jour|%>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
sd_create_editor_from_data(<%= jour.id%>, null, "100%", "<%=jour.class.to_s%>");
|
||||
});
|
||||
</script>
|
||||
<%= render :partial => 'users/contest_journalsformessage', :locals => {:activity => jour,:user_activity_id =>jour.id, :is_contest => 1} %>
|
||||
<%#= render :partial => 'user_jours_new', :locals => {:jour => jour} %>
|
||||
<%end%>
|
||||
<% end%>
|
||||
<% if (jours.count + page * 10) < count %>
|
||||
<%= link_to "点击展开更多",feedback_contest_path(@contest.id, :page => page),:id => "show_more_jours",:remote => "true",:class => "loadMore mt10 f_grey"%>
|
||||
<% end %>
|
|
@ -2,7 +2,8 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th style="width: 35px;">序号</th>
|
||||
<th style="width:320px;">姓名</th>
|
||||
<th style="width:180px;">姓名</th>
|
||||
<th style="width:140px;">单位</th>
|
||||
<th>角色</th>
|
||||
<th class="sy_new_namebox">操作</th>
|
||||
</tr>
|
||||
|
@ -12,7 +13,10 @@
|
|||
<tr>
|
||||
<td><%= index + 1 %></td>
|
||||
<td>
|
||||
<%= link_to member.user.show_name, user_path(member.user), :class => "pro_new_idname ml10", :title => "#{member.user.show_name}" %>
|
||||
<%= link_to member.user.show_name, user_path(member.user), :class => "pro_new_idname ml10 mr10", :title => "#{member.user.show_name}" %>
|
||||
</td>
|
||||
<td>
|
||||
<span class="pro_new_school_name ml5 mr5"><%=member.user.user_extensions.school ? member.user.user_extensions.school.name : '--' %></span>
|
||||
</td>
|
||||
<td style="width: 200px">
|
||||
<span id="member_role_<%=member.id %>"><%= zh_contest_role(h member.roles.sort.collect(&:to_s).join(', ')) %></span>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li><%= link_to !@contest.is_public ? "设为公开" : "设为私有", {:controller => 'contests', :action => 'private_or_public', :id => @contest},:remote=>true,:confirm=>"您确定要设置为"+(!@contest.is_public ? "公开" : "私有")+"吗", :class => "postOptionLink" %></li>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink" onclick="delete_confirm_box('<%=private_or_public_contest_path(@contest) %>', '您确定要设置为<%= !@contest.is_public ? '公开' : '私有'%>吗')"><%= !@contest.is_public ? '设为公开' : '设为私有'%></a></li>
|
||||
<% if @contest.invite_code_halt == 0 %>
|
||||
<li><a href="javascript:void(0);" class="postOptionLink" onclick="alert_halt_code();">暂停加入</a></li>
|
||||
<% elsif @contest.invite_code_halt == 1 %>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<div class="pro_new_setting_conbox fl " style="width:100%; border:none;">
|
||||
<a href="javascript:void(0);" class="fl sy_btn_green mb10 ml15" onclick="add_contest_member();">添加成员</a>
|
||||
<a href="javascript:void(0);" class="fl sy_btn_green mb10 ml15" onclick="add_contest_member();">添加成员</a>
|
||||
<%= link_to "Excel导出", export_all_members_contest_path(@contest, :format => 'xls'), :class => 'fl sy_btn_green mb10 ml15' %>
|
||||
<div class="cl"></div>
|
||||
<div class=" sy_new_tchbox clear undis" style="margin-left:10px; margin-right:10px" id="add_contest_member">
|
||||
<%= form_tag url_for(:controller => 'contest_members', :action => 'create', :contest => @contest.id),:id => 'contest_member_add_form', :remote => true do |f|%>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<li><%= link_to "通知动态", contest_activities_contest_path(@contest, :type => 'news'), :class => "homepagePostTypeNotice postTypeGrey"%></li>
|
||||
<!--<li><%#= link_to "资源库动态", {:controller => "courses", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey"%></li>-->
|
||||
<li><%= link_to "论坛动态", contest_activities_contest_path(@contest, :type => 'message'), :class => "homepagePostTypeForum postTypeGrey"%></li>
|
||||
<!--<li><%#= link_to "留言动态", {:controller => "courses", :action => "show", :type => "journalsForMessage"}, :class => "homepagePostTypeMessage postTypeGrey"%></li>-->
|
||||
<li><%= link_to "留言动态", contest_activities_contest_path(@contest, :type => 'journalsForMessage'), :class => "homepagePostTypeMessage postTypeGrey"%></li>
|
||||
<!--<li><%#= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%></li>-->
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<div class="homepageRight mt0 ml10">
|
||||
<div class="homepageRightBanner mb10">
|
||||
<div class="NewsBannerName pr"><span id="mesLabel">竞赛留言</span></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div id="messageContent">
|
||||
<div class="resources"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
||||
<div class="fl" style="width:658px;">
|
||||
<%= form_for('new_form',:url => leave_contest_message_path(@contest.id), :html =>{:id => "contest_feedback_new"}, :method => "post") do |f|%>
|
||||
<%= render :partial => "users/jour_form", :locals => {:f => f, :object => @contest} %>
|
||||
<input id="private_flag" name="private" type="hidden" value="0"/>
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr mt5" id="submit_feedback_user" >留言</a>
|
||||
<a href="javascript:void(0);" onclick="cancel_jour_submit()" class="greyBtn2 postReplySubmit mt5 mr15">取消</a>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<%=render :partial => "contest_jours_list", :locals => {:jours =>@jours, :page => 0, :count => @jour_count} %>
|
||||
<div class="cl"></div>
|
||||
</div><!--message_box end-->
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#submit_feedback_user").one('click',function() {
|
||||
contest_jour_submit();
|
||||
});
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1 @@
|
|||
$("#show_more_jours").replaceWith("<%= escape_javascript( render :partial => 'contests/contest_jours_list',:locals => {:jours => @jours, :page => @page, :count => @jour_count} )%>");
|
|
@ -6,7 +6,7 @@
|
|||
<%= labelled_form_for @contest do |f| %>
|
||||
<li class="mt10 ml45">
|
||||
<label><span class="c_red">*</span> <%= l(:label_tags_contest_name)%> :</label>
|
||||
<input type="text" name="contest[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:顶尖移动应用开发大赛" onkeyup="regex_contest_name('new');">
|
||||
<input type="text" name="contest[name]" id="new_course_name" class="courses_input" maxlength="100" placeholder="例如:全国大学生软件创新大赛" onkeyup="regex_contest_name('new');">
|
||||
<div class="cl"></div>
|
||||
<span class="c_red ml80" id="new_course_name_notice" style="display: none;">竞赛名称不能为空且至少有两个字符</span>
|
||||
</li>
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
hideModal();
|
||||
$("#contest_base_info").html('<%=escape_javascript(render :partial=>'contests/contest_base_info') %>');
|
||||
if(document.getElementById("contest_is_public")) {
|
||||
<% if !@contest.is_public %>
|
||||
|
|
|
@ -1,21 +1,31 @@
|
|||
<div class="f14 fb fontGrey3 mb10">选择成员加入分班</div>
|
||||
<div class="fl mr10">
|
||||
<input type="text" name="search" value="<%=@search %>" placeholder="输入学生登录名/姓名/学号进行搜索" class="subjectSearch" />
|
||||
<div class="cl"></div>
|
||||
<%= form_tag(add_members_course_path(@course, :group_id => @group.id), method: 'post',:class => "f_l",:id => "add_group_members") do %>
|
||||
<div id="search_member_list">
|
||||
<%=render :partial => 'search_member_list', :locals => {:members => members} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<span class="c_red none" id="add_members_notice"></span>
|
||||
<div class="cl"></div>
|
||||
<div class="courseSendSubmit mr15"><a href="javascript:void(0);" class="sendSourceText" onclick="submit_add_members_form();">确定</a></div>
|
||||
<div class="courseSendCancel"><a href="javascript:void(0);" class="sendSourceText" onclick="hideModal();">取消</a></div>
|
||||
<div id="muban_popup_box" style="width:400px;">
|
||||
<div class="muban_popup_top">
|
||||
<h3 class="fl">添加成员</h3>
|
||||
<a href="javascript:void(0);" class="muban_icons_close fr"></a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="muban_popup_con clear">
|
||||
<div class="f14 fb fontGrey3 mb10 mt15 ml20">选择成员加入分班</div>
|
||||
<div class="fl mr10 ml20 w350">
|
||||
<input type="text" name="search" value="<%=@search %>" placeholder="输入学生登录名/姓名/学号进行搜索" class="subjectSearch" />
|
||||
<div class="cl"></div>
|
||||
<%= form_tag(add_members_course_path(@course, :group_id => @group.id), method: 'post',:class => "",:id => "add_group_members") do %>
|
||||
<div id="search_member_list">
|
||||
<%=render :partial => 'search_member_list', :locals => {:members => members} %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<span class="c_red none" id="add_members_notice"></span>
|
||||
<div class="cl"></div>
|
||||
<div class="mt10">
|
||||
<a href="javascript:void(0);" class="fl sy_btn_blue mr10" onclick="submit_add_members_form();">确定</a>
|
||||
<a href="javascript:void(0);" class="fl sy_btn_grey" onclick="hideModal();">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<%=link_to "成员管理", {:controller => 'courses', :action => 'settings', :id => @course.id, :tab => 'member'}, :class => 'link-blue ml10 fr mt5' %>
|
||||
<% end %>
|
||||
<%= link_to "导出成绩", export_course_member_excel_course_path(@course,:group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0),:format => 'xls'), :class => 'link-blue fr mt5'%>
|
||||
<%= link_to "导出成绩", export_course_member_excel_course_path(@course,:group_id => (@group ? (@group == -1 ? -1 : @group.id) : 0), :name => @search_name,:format => 'xls'), :class => 'link-blue fr mt5'%>
|
||||
<div class="cl"></div>
|
|
@ -5,7 +5,7 @@
|
|||
<li>
|
||||
<span class="sy_sq_orange fl mr5 mt5"><%= i+1 %></span>
|
||||
<div class="fl" style="width:185px;">
|
||||
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle mb10" %>
|
||||
<%=link_to e_course.name, course_path(e_course.id), :class => "sy_class_ltitle mb10", :target => '_blank' %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<p class="sy_cgrey ml20">
|
||||
|
|
|
@ -74,7 +74,7 @@ var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muba
|
|||
pop_box_new(htmlvalue, 300, 140);
|
||||
<% elsif @state == 14 %>
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">此二维码已停用,请与老师联系</p><div class="cl"></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">此邀请码已停用,请与老师联系</p><div class="cl"></div>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 119px;" onclick="hideModal();">确 定</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
<% else %>
|
||||
|
|
|
@ -11,11 +11,15 @@
|
|||
window.location.href = "<%=course_files_path(@course) %>";
|
||||
}
|
||||
<% else %>
|
||||
<% if @course.is_public? %>
|
||||
if($("#syllabus_course_ul_<%=@syllabus.id %>").length > 0){
|
||||
window.location.href = "<%= user_courselist_user_path(User.current)%>";
|
||||
} else{
|
||||
<% if @course.is_public? %>
|
||||
$("#show_course_<%= @course.id %>").attr("title","公开班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% else %>
|
||||
<% else %>
|
||||
$("#show_course_<%= @course.id %>").attr("title","私有班级:<%= @course.name %>(<%= @course.time.to_s+ @course.term %>)");
|
||||
<% end %>
|
||||
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
||||
<% end %>
|
||||
$("#set_course_public_<%= @course.id %>").replaceWith('<%= escape_javascript(link_to @course.is_public == 0 ? "设为公开" : "设为私有", {:controller => "courses", :action => "private_or_public", :id => @course,:user_page => true},
|
||||
:id => "set_course_public_#{@course.id.to_s}",:remote=>true,:confirm=>"您确定要设置为"+(@course.is_public == 0 ? "公开" : "私有")+"吗") %>');
|
||||
}
|
||||
<% end %>
|
|
@ -1,6 +1,6 @@
|
|||
<% if @is_search == 0 %>
|
||||
var htmlvalue = "<%= escape_javascript( render :partial => 'courses/add_members', :locals => {:members => @members} )%>";
|
||||
pop_up_box(htmlvalue,400,30,50);
|
||||
pop_box_new(htmlvalue,400,510);
|
||||
<% else %>
|
||||
$("#search_member_list").html("<%= escape_javascript(render :partial => 'search_member_list', :locals => {:members => @members}) %>");
|
||||
<% end %>
|
|
@ -3,4 +3,5 @@
|
|||
*/
|
||||
$('#new_group_name').hide();
|
||||
$('#edit_group_form').hide();
|
||||
$("#course_member_opr").html("<%= escape_javascript( render :partial => 'course_member_opr')%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
|
|
@ -83,8 +83,7 @@
|
|||
<% content = User.find(ma.course_message_id).name+"申请成为班级\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content && ma.content.include?('9') ? "教师" : "教辅"}" %>
|
||||
<li><a href="<%=user_path(User.find(ma.course_message_id), :course_id => ma.course_id) %>" target="_blank" title="系统提示 您有了新的班级成员申请:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>您有了新的班级成员申请:<%=content %></a></li>
|
||||
<% elsif ma.course_message_type == "CourseRequestDealResult" %>
|
||||
<% content = ma.status == 1 ? '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content == '9' ? '老师' : '教辅')+'申请已通过' : '您申请成为班级"'+Course.find(ma.course_id).name+'"的'+(ma.content && ma.content.include?('9') ? '教师' : '教辅')+'的申请被拒绝' %>
|
||||
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="系统提示 班级申请进度反馈:<%=content %>"><span class="shadowbox_news_user">系统提示 </span>班级申请进度反馈:<%=content %></a></li>
|
||||
<li><a href="<%=course_path(Course.find(ma.course_id)) %>" target="_blank" title="<%= User.find(ma.user_id).show_name%> 申请以“<%= ma.content.include?('9') ? '教师' : '教辅' %>”身份加入:<%=Course.find(ma.course_id).name %> <%=User.find(ma.course_message_id).show_name%><%=ma.status == 1 ? '已通过' : '已拒绝' %>"><span class="shadowbox_news_user"><%= User.find(ma.user_id).show_name%> </span>申请以“<%= ma.content.include?('9') ? '教师' : '教辅' %>”身份加入:<%=Course.find(ma.course_id).name %> <%=User.find(ma.course_message_id).show_name%><%=ma.status == 1 ? '已通过' : '已拒绝' %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 0 %>
|
||||
<li><a href="<%=course_member_path(ma.course) %>" target="_blank" title="<%=User.find(ma.course_message_id).show_name %> 将您加入了班级:<%=ma.course.name %>"><span class="shadowbox_news_user"><%=User.find(ma.course_message_id).show_name %> </span>将您加入了班级:<%=ma.course.name %></a></li>
|
||||
<% elsif ma.course_message_type == "JoinCourse" and ma.status == 1 %>
|
||||
|
@ -120,6 +119,7 @@
|
|||
<li><a href="<%= contest_feedback_path(ma.contest_id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> <%= ma.contest_message.m_parent_id.nil? ? "发布了竞赛留言:" : "回复了竞赛留言:"%><%= message_content(ma.contest_message.notes)%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span><%= ma.contest_message.m_parent_id.nil? ? "发布了竞赛留言:" : "回复了竞赛留言:"%><%= message_content(ma.contest_message.notes)%></a></li>
|
||||
<% end %>
|
||||
<% elsif ma.contest_message_type == "ContestRequestDealResult" %>
|
||||
<% user = User.find(ma.user_id) %>
|
||||
<% if ma.content
|
||||
role_str = ""
|
||||
if ma.content.include?('13') && ma.content.include?('14')
|
||||
|
@ -132,7 +132,7 @@
|
|||
role_str = "参赛者"
|
||||
end
|
||||
end %>
|
||||
<li><a href="<%=contest_path(ma.contest_id) %>" target="_blank" title='系统提示 竞赛申请进度反馈:您申请成为竞赛"<%=Contest.find(ma.contest_id).name %>"的"<%=role_str %>"<%= ma.status == 1 ? "申请已通过" : "的申请被拒绝"%>'><span class="shadowbox_news_user">系统提示 </span>竞赛申请进度反馈:您申请成为竞赛"<%=Contest.find(ma.contest_id).name %>"的"<%=role_str %>"<%= ma.status == 1 ? "申请已通过" : "的申请被拒绝"%></a></li>
|
||||
<li><a href="<%=contest_path(ma.contest_id) %>" target="_blank" title='<%= user.show_name%> <%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"," %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%>'><span class="shadowbox_news_user"><%= user.show_name%> </span><%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"," %>申请以"<%= role_str%>"的身份加入竞赛:<%=Contest.find(ma.contest_id).name %> <%= User.find(ma.contest_message_id).show_name %><%= ma.status == 1 ? "已同意" : "已拒绝"%></a></li>
|
||||
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 0 %>
|
||||
<li><a href="<%=contest_path(ma.contest) %>" target="_blank" title="<%=User.find(ma.contest_message_id).show_name %> 将您加入了竞赛:<%= ma.contest.name%>"><span class="shadowbox_news_user"><%=User.find(ma.contest_message_id).show_name %> </span>将您加入了竞赛:<%= ma.contest.name%></a></li>
|
||||
<% elsif ma.contest_message_type == "JoinContest" and ma.status == 1 %>
|
||||
|
|
|
@ -71,7 +71,10 @@
|
|||
<%= link_to "", contest_news_index_path(@contest,:is_new => 1), :class => "sy_class_add" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<!--<li id="sy_06" class="sy_icons_feedback"> <a href="">留言<span>26</span></a> <a href="javascript:void(0);" class="sy_class_add"></a></li>-->
|
||||
<li id="sy_06" class="sy_icons_feedback">
|
||||
<a href="<%= feedback_contest_path(@contest) %>">留言<span id="course_jour_count"><%=contest_feedback_count %></span></a>
|
||||
<%= link_to( "", feedback_contest_path(@contest), :class => 'sy_class_add', :title =>"#{l(:label_course_feedback)}") if User.current.member_of_contest?(@contest) %>
|
||||
</li>
|
||||
</ul>
|
||||
</div><!--sy_class_leftnav end-->
|
||||
</div><!--sy_class_l end-->
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<% if hidden_unproject_infos %>
|
||||
<ul class="users_accordion mb10">
|
||||
<li id="user_01" class="user_icons_course">
|
||||
<%= link_to '班级',{:controller => "users", :action => "user_courselist", :id => @user}, :id => "user_course_list" %>
|
||||
<%= link_to '班级',user_courselist_user_path(@user), :id => "user_course_list" %>
|
||||
<font class="show-all-sub"><%= link_to '全部',{:controller => "users", :action => "user_courselist", :id => @user}, :style => "color:#aaa;" %></font>
|
||||
<% courses = @user.favorite_courses.visible.where("is_delete =?", 0).select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").limit(10) %>
|
||||
<div class="<%= courses.empty? ? 'none' : ''%>" id="homepage_left_course_list">
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
<% if @project.is_public? %>
|
||||
if($("#collect_project_icon_<%= @project.id %>").length > 0){
|
||||
window.location.href = "<%= user_projectlist_user_path(User.current)%>";
|
||||
} else {
|
||||
<% if @project.is_public? %>
|
||||
$("#show_project_<%= @project.id %>").attr("title","公开项目:<%= @project.name %>");
|
||||
<% else %>
|
||||
<% else %>
|
||||
$("#show_project_<%= @project.id %>").attr("title","私有项目:<%= @project.name %>");
|
||||
<% end %>
|
||||
$("#set_project_public_<%= @project.id %>").replaceWith('<%= escape_javascript(link_to @project.is_public? ? "设为私有" : "设为公开", {:controller => "projects", :action => "set_public_or_private", :id => @project.id,:user_page => true},
|
||||
:id => "set_project_public_"+ @project.id.to_s,:method => "post",:remote=>true,:confirm=>"您确定要设置为"+(@project.is_public? ? "私有" : "公开")+"吗") %>');
|
||||
<% end %>
|
||||
$("#set_project_public_<%= @project.id %>").replaceWith('<%= escape_javascript(link_to @project.is_public? ? "设为私有" : "设为公开", {:controller => "projects", :action => "set_public_or_private", :id => @project.id,:user_page => true},
|
||||
:id => "set_project_public_"+ @project.id.to_s,:method => "post",:remote=>true,:confirm=>"您确定要设置为"+(@project.is_public? ? "私有" : "公开")+"吗") %>');
|
||||
}
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
<%= show_real_score ? score.score : "**" %>分
|
||||
</a>
|
||||
<% end %>
|
||||
<% if @is_teacher && score.user == User.current && score.reviewer_role != 3 %>
|
||||
<% scores = User.current.student_works_scores.where("student_work_id = #{score.student_work_id} and reviewer_role != 3").order("created_at desc") %>
|
||||
<% if scores.first != score %>
|
||||
<a onclick="delete_confirm_box('<%=hide_score_detail_student_work_path(score.student_work_id, :score_id => score.id) %>', '本条评分详情将不再显示<br/>您是否确定隐藏')"
|
||||
href="javascript:void(0);" class="fr linkBlue ml10 mr5">隐藏</a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<a href="javascript:void(0);" class="fr linkBlue mr5" onclick="$('#add_score_reply_<%= score.id%>').slideToggle();">回复</a>
|
||||
<% if @homework.anonymous_appeal == 1 %>
|
||||
<% if score.student_work.user == User.current && score.reviewer_role == 3 && score.appeal_status == 0 %>
|
||||
|
@ -48,10 +55,10 @@
|
|||
<div class="ping_back mt10" style="border-top: 1px dashed #CCCCCC; padding-top: 10px;">
|
||||
<span class="fl">申诉</span>
|
||||
<% if score.appeal_status == 1 && score.student_work.user == User.current %>
|
||||
<a href="javascript:void(0)" onclick="deal_appeal_score(<%=score.id %>, 2);" class="fr linkBlue mr5 ml20">撤销申诉</a>
|
||||
<a href="javascript:void(0)" onclick="delete_confirm_box('<%=deal_appeal_score_student_work_index_path(:is_last=>true,:score_id=>score.id,:status=>2) %>', '撤销后将不能再对该成绩发起申诉<br/>您是否确认撤销申诉');" class="fr linkBlue mr5 ml20">撤销申诉</a>
|
||||
<% elsif @is_teacher && score.appeal_status == 1 %>
|
||||
<a href="javascript:void(0)" onclick="deal_appeal_score(<%=score.id %>, 3);" class="fr linkBlue mr5">接受</a>
|
||||
<a href="javascript:void(0)" onclick="deal_appeal_score(<%=score.id %>, 4);" class="fr linkBlue mr10 ml20">拒绝</a>
|
||||
<a href="javascript:void(0)" onclick="delete_confirm_box('<%=deal_appeal_score_student_work_index_path(:is_last=>true,:score_id=>score.id,:status=>3) %>', '此匿评成绩将被废弃,且评阅人的作品将被违规扣分<br/>您是否确定接受');" class="fr linkBlue mr5">接受</a>
|
||||
<a href="javascript:void(0)" onclick="delete_confirm_box('<%=deal_appeal_score_student_work_index_path(:is_last=>true,:score_id=>score.id,:status=>4) %>', '此匿评成绩将被认为合理<br/>您是否确定拒绝');" class="fr linkBlue mr10 ml20">拒绝</a>
|
||||
<% end %>
|
||||
<span class="fr c_grey">
|
||||
<%=format_time score.student_works_scores_appeal.updated_at %>
|
||||
|
@ -73,24 +80,3 @@
|
|||
</div>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
function deal_appeal_score(score_id, status){
|
||||
if(status == '2'){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">撤销后将不能再对该成绩发起申诉</p><p class="text_c mt10 f14">您是否确认撤销申诉</p><div class="cl"></div>'+
|
||||
'<a href="/student_work/deal_appeal_score?is_last=true&score_id='+ score_id + '&status=2" class="fr sy_btn_blue mr135 mt10" data-remote="true">确 定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
||||
}else if(status == '3'){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">此匿评成绩将被废弃,且评阅人的作品将被违规扣分</p><p class="text_c mt10 f14">您是否确定接受</p><div class="cl"></div>'+
|
||||
'<a href="/student_work/deal_appeal_score?is_last=true&score_id='+ score_id + '&status=3" class="fr sy_btn_blue mr135 mt10" data-remote="true">确 定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
||||
}else if(status == '4'){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">此匿评成绩将被认为合理</p><p class="text_c mt10 f14">您是否确定拒绝</p><div class="cl"></div>'+
|
||||
'<a href="/student_work/deal_appeal_score?is_last=true&score_id='+ score_id + '&status=4" class="fr sy_btn_blue mr135 mt10" data-remote="true">确 定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取 消</a></div></div>';
|
||||
}
|
||||
pop_box_new(htmlvalue, 400, 180);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
hideModal();
|
||||
$("#score_list_<%= @work.id%>").html("<%=escape_javascript(render :partial => 'student_work_score_records', :locals => {:student_work_scores => @student_work_scores, :is_member_work => @is_member_work}) %>");
|
|
@ -1,7 +1,7 @@
|
|||
<% member = Member.where("user_id = #{@user.id} and course_id = #{course.id}").first %>
|
||||
<% if User.current == @user %>
|
||||
<% if member %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :course => course.id), :class => "#{member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的班级列表中移除' : '点击将其添加至个人主页的班级列表中'}" %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :course => course.id), :class => "#{member.is_collect == 1 ? 'icons_sy_favorite' : 'icons_sy_star'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从左侧导航的班级列表中移除' : '点击将其添加至左侧导航的班级列表中'}" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if member %>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<% member = Member.where("user_id = #{@user.id} and project_id = #{project.id}").first %>
|
||||
<% if User.current == @user %>
|
||||
<% if member %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从个人主页的项目列表中移除' : '点击将其添加至个人主页的项目列表中'}" %>
|
||||
<%= link_to "", cancel_or_collect_user_path(@user, :project => project.id), :class => "#{member.is_collect == 1 ? 'icons_project_favorite mt3' : 'icons_project_star mt3'}",:target => '_blank', :remote => true, :title => "#{member.is_collect == 1 ? '点击将其从左侧导航的项目列表中移除' : '点击将其添加至左侧导航的项目列表中'}" %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% if member %>
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
<div class="resources mt10" id="user_activity_<%= user_activity_id%>">
|
||||
<div class="homepagePostBrief">
|
||||
<div class="homepagePostPortrait">
|
||||
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user), :alt => "用户头像" %>
|
||||
<%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.user} %>
|
||||
</div>
|
||||
<div class="homepagePostDes">
|
||||
<div class="homepagePostTo break_word">
|
||||
<%= link_to activity.user.show_name, user_path(activity.user), :class => "newsBlue mr15" %>
|
||||
TO
|
||||
<% contest=Contest.find(activity.jour_id) %>
|
||||
<% str = defined?(is_contest) && is_contest == 1 ? "竞赛留言" : "#{contest.name.to_s} | 竞赛留言" %>
|
||||
<%= link_to str, feedback_contest_path(contest), :class => "newsBlue ml15" %>
|
||||
</div>
|
||||
<% if activity.parent %>
|
||||
<% content = activity.parent.notes %>
|
||||
<% else %>
|
||||
<% content = activity.notes %>
|
||||
<% end %>
|
||||
<%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %>
|
||||
<div class="cl"></div>
|
||||
<div id="intro_content_show_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[展开]</a></div>
|
||||
<div id="intro_content_hide_<%= user_activity_id%>" class="fr" style="display:none;"><a href="javascript:void(0);" class="linkBlue">[收起]</a></div>
|
||||
<div class="cl"></div>
|
||||
<div class="homepagePostDate fl">
|
||||
留言时间:<%= format_time(activity.created_on) %>
|
||||
</div>
|
||||
<div class="homepagePostDate fl ml15">
|
||||
更新时间:<%= format_time(ContestActivity.where("contest_act_type='#{activity.class}' and contest_act_id =#{activity.id}").first.updated_at) %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% if defined?(is_contest) && is_contest == 1 && (activity.user == User.current || User.current.admin? || User.current.admin_of_contest?(contest))%>
|
||||
<div class="homepagePostSetting">
|
||||
<ul>
|
||||
<li class="homepagePostSettingIcon">
|
||||
<ul class="homepagePostSettiongText">
|
||||
<li>
|
||||
<a href="javascript:void(0)" class="postOptionLink" title="删除"
|
||||
onclick="delete_confirm_box_3('<%= words_destroy_path(:object_id => activity, :user_id => activity.user.id,:user_activity_id => user_activity_id, :activity_id => activity.id)%>', '确定要删除该留言吗?')">删除</a>
|
||||
<%#= link_to(l(:label_bid_respond_delete),
|
||||
{:controller => 'words', :action => 'destroy', :object_id => activity, :user_id => activity.user.id,:user_activity_id => user_activity_id, :activity_id => activity.id},
|
||||
:confirm => l(:text_are_you_sure), :method => 'delete',
|
||||
:class => "postOptionLink", :title => l(:button_delete)) %>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="homepagePostReply">
|
||||
<div id="activity_post_reply_<%=user_activity_id %>">
|
||||
<%=render :partial => 'users/user_journal_post_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
user_card_show_hide();
|
||||
});
|
||||
</script>
|
||||
|
|
@ -32,8 +32,8 @@
|
|||
<% unless student_work_scores.empty? %>
|
||||
<% last_score = student_work_scores.first %>
|
||||
<div class="mt10">
|
||||
<p class="fontGrey2"># <%=time_from_now last_score.created_at %>
|
||||
<%= link_to last_score.reviewer_role == 3 && !is_teacher ? '学生匿名' : last_score.user.show_name, last_score.reviewer_role == 3 && !is_teacher ? "javascript:void(0)" : user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
<p class="fontGrey2">
|
||||
# <%=time_from_now last_score.created_at %><%= link_to last_score.reviewer_role == 3 && !is_teacher ? '学生匿名' : last_score.user.show_name, last_score.reviewer_role == 3 && !is_teacher ? "javascript:void(0)" : user_activities_path(last_score.user_id), :class => "newsBlue ml5 mr5"%>评阅了作品,优秀排行:
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function(){
|
||||
setTimeout(function(){
|
||||
elocalStorage(jour_content_editor,'user_newfeedback_<%=User.current.id %>_<%=@user.id %>');
|
||||
elocalStorage(jour_content_editor,'user_newfeedback_<%=User.current.id %>_<%=object.id %>');
|
||||
}, 10000);
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -94,7 +94,7 @@
|
|||
<% when 'Contest' %>
|
||||
<%= render :partial => 'users/contest_create', :locals => {:activity => act, :user_activity_id => act.id} %>
|
||||
<% when 'JournalsForMessage' %>
|
||||
<%#= render :partial => 'users/contest_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<%= render :partial => 'users/contest_journalsformessage', :locals => {:activity => act, :user_activity_id => user_activity.id} %>
|
||||
<% end %>
|
||||
<% when 'Principal' %>
|
||||
<% case user_activity.act_type.to_s %>
|
||||
|
|
|
@ -1,35 +1,48 @@
|
|||
<% if ma.class == ContestMessage %>
|
||||
<% if ma.contest_message_type == "ContestRequestDealResult" %>
|
||||
<% user = User.find(ma.user_id) %>
|
||||
<% if ma.content
|
||||
role_str = ""
|
||||
if ma.content.include?('13') && ma.content.include?('14')
|
||||
role_str = "管理员、评委"
|
||||
elsif ma.content.include?('13')
|
||||
role_str = "管理员"
|
||||
elsif ma.content.include?('14')
|
||||
role_str = "评委"
|
||||
elsif ma.content.include?('15')
|
||||
role_str = "参赛者"
|
||||
end
|
||||
end %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<div class="longMessageWidth">
|
||||
<div class="shortMessageWidth">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div>
|
||||
<div class="navHomepageLogo fl">
|
||||
<%= link_to image_tag(url_to_avatar(user), :width => "30", :height => "30"), user_path(user), :target => '_blank' %>
|
||||
</div>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="newsBlue homepageNewsPublisher">
|
||||
<%=link_to user.show_name, user_path(user),
|
||||
:class => "newsBlue homepageNewsPublisher", :target => '_blank' %></span>
|
||||
<span class="homepageNewsType fl">
|
||||
竞赛申请进度反馈:</span>
|
||||
<%= user.user_extensions.school_id.blank? ? "" : "来自"+user.user_extensions.school.name+"," %>
|
||||
申请以"<%= role_str%>"的身份加入竞赛:
|
||||
</span>
|
||||
</li>
|
||||
<li class="messageInformationContents">
|
||||
<% if ma.content
|
||||
role_str = ""
|
||||
if ma.content.include?('13') && ma.content.include?('14')
|
||||
role_str = "管理员、评委"
|
||||
elsif ma.content.include?('13')
|
||||
role_str = "管理员"
|
||||
elsif ma.content.include?('14')
|
||||
role_str = "评委"
|
||||
elsif ma.content.include?('15')
|
||||
role_str = "参赛者"
|
||||
end
|
||||
end %>
|
||||
<%= link_to ma.status == 1 ?
|
||||
'您申请成为竞赛"'+Contest.find(ma.contest_id).name+'"的'+ role_str +'申请已通过'
|
||||
:
|
||||
'您申请成为竞赛"'+Contest.find(ma.contest_id).name+'"的'+ role_str +'的申请被拒绝', contest_path(Contest.find(ma.contest_id)),
|
||||
<%= link_to Contest.find(ma.contest_id).name, contest_path(ma.contest_id),
|
||||
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
|
||||
</li>
|
||||
</div>
|
||||
<li class="messageOperateContents fl">
|
||||
<span id="deal_info_<%=ma.id%>">
|
||||
<% if ma.status == 1%> <!-- 同意 -->
|
||||
<span title="<%= User.find(ma.contest_message_id).show_name %>已同意"><%= User.find(ma.contest_message_id).show_name %>已同意</span>
|
||||
<% else%> <!-- 拒绝 -->
|
||||
<span title="<%= User.find(ma.contest_message_id).show_name %>已拒绝"><%= User.find(ma.contest_message_id).show_name %>已拒绝</span>
|
||||
<%end %>
|
||||
</span>
|
||||
</li>
|
||||
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<li><%= link_to "作品动态", {:controller => "users", :action => "contest_community", :type => "contest_work"}, :class => "homepagePostTypeAssignment postTypeGrey" %></li>
|
||||
<li><%= link_to "通知动态", {:controller => "users", :action => "contest_community", :type => "contest_news"}, :class => "homepagePostTypeNotice postTypeGrey" %></li>
|
||||
<li><%= link_to "论坛动态", {:controller => "users", :action => "contest_community", :type => "contest_message"}, :class => "homepagePostTypeForum postTypeGrey" %></li>
|
||||
<!--<li><%#= link_to "竞赛留言", {:controller => "users", :action => "contest_community", :type => "contest_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>-->
|
||||
<li><%= link_to "竞赛留言", {:controller => "users", :action => "contest_community", :type => "contest_journals"}, :class => "homepagePostTypeMessage postTypeGrey" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<div class="resources"><%= link_to image_tag(url_to_avatar(User.current),:class=>"fl mr10", :width => "50", :height => "50"), :alt => "用户头像" %>
|
||||
<div class="fl" style="width:658px;">
|
||||
<%= form_for('new_form',:url => leave_user_message_path(@user.id), :html =>{:id => "user_feedback_new"}, :method => "post") do |f|%>
|
||||
<%= render :partial => "jour_form", :locals => {:f => f} %>
|
||||
<%= render :partial => "jour_form", :locals => {:f => f, :object => @user} %>
|
||||
<input id="private_flag" name="private" type="hidden" value="0"/>
|
||||
<a href="javascript:void(0);" class="blue_n_btn fr mt5" id="submit_feedback_user" >留言</a>
|
||||
<a href="javascript:void(0);" class="greyBtn2 postReplySubmit mt5 mr15" id="private_submit_feedback_user">私信</a>
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
<% if @save_succ %>
|
||||
<% if @user_activity_id %>
|
||||
<% if @activity.jour_type == 'Principal' %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% elsif @activity.jour_type == 'Course' %>
|
||||
<% if @activity.jour_type == 'Principal' || @activity.jour_type == 'Course' || @activity.jour_type == 'Contest' %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
<% end %>
|
||||
//init_activity_KindEditor_data('<%#= @user_activity_id%>', "", "87%", "UserActivity");
|
||||
|
|
|
@ -28,7 +28,12 @@
|
|||
<% else %>
|
||||
$('#course_jour_count').html("<%= @jours_count %>");
|
||||
<% end %>
|
||||
<% elsif @user && @jours_count%>
|
||||
<% elsif @contest && @jours_count%>
|
||||
<% if @user_activity_id %>
|
||||
$("#activity_post_reply_<%= @user_activity_id%>").html("<%= escape_javascript(render :partial => 'users/user_journal_post_reply', :locals => {:activity => @activity,:user_activity_id =>@user_activity_id}) %>");
|
||||
sd_create_editor_from_data('<%= @user_activity_id%>', "", "100%", "UserActivity");
|
||||
<% end %>
|
||||
<% elsif @user && @jours_count%>
|
||||
$('#jour_count').html("<%= @jours_count %>");
|
||||
<% elsif @homework%>
|
||||
$("#homework_post_reply_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/homework_post_reply', :locals => {:activity => @homework, :user_activity_id => @user_activity_id, :is_teacher => @is_teacher}) %>");
|
||||
|
|
|
@ -395,6 +395,7 @@ zh:
|
|||
label_edit_organization: 编辑组织
|
||||
label_organization_edit: 修改组织
|
||||
label_project_plural: 项目列表
|
||||
label_contest_plural: 竞赛列表
|
||||
|
||||
label_first_page_made: 首页定制
|
||||
label_project_first_page: 项目托管平台首页
|
||||
|
@ -1878,6 +1879,13 @@ zh:
|
|||
label_contest_delete: 删除竞赛
|
||||
label_noawards_current: 暂未评奖
|
||||
|
||||
excel_contestant_id: 参赛者id
|
||||
excel_school: 单位
|
||||
label_judge_score: "评委%{num}评分"
|
||||
label_judge_comment: "评委%{num}评价"
|
||||
label_highest_score: 最高得分
|
||||
label_lowest_score: 最低得分
|
||||
|
||||
excel_user_id: 学生id
|
||||
excel_user_name: 用户名
|
||||
excel_nickname: 登录名
|
||||
|
@ -1889,6 +1897,9 @@ zh:
|
|||
excel_homework_project: 关联项目
|
||||
excel_no_project: 无关联项目
|
||||
excel_group_member: 组员
|
||||
excel_group_leader: 组长用户名
|
||||
excel_group_leader_login: 组长登录名
|
||||
excel_group_leader_mail: 组长电子邮箱
|
||||
excel_t_score: 教师评分
|
||||
excel_ta_score: 教辅评分
|
||||
excel_n_score: 匿名评分
|
||||
|
|
|
@ -331,6 +331,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'add_comments_to_work'
|
||||
get 'praise_student_work'
|
||||
get 'forbidden_anonymous_comment'
|
||||
get 'hide_score_detail'
|
||||
end
|
||||
collection do
|
||||
post 'add_score_reply'
|
||||
|
@ -637,6 +638,8 @@ RedmineApp::Application.routes.draw do
|
|||
get 'set_invite_code_halt'
|
||||
get 'renew'
|
||||
get 'member'
|
||||
get 'export_all_members'
|
||||
get 'feedback'
|
||||
end
|
||||
|
||||
resources :boards
|
||||
|
@ -1223,6 +1226,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'admin/export_rep_static_users', :via => :get
|
||||
get 'admin/courses', as: :all_courses
|
||||
get 'admin/syllabuses', as: :all_syllabuses
|
||||
get 'admin/contests', :via => :get
|
||||
get 'admin/non_syllabus_courses', as: :non_syllabus_courses
|
||||
post 'admin/update_course_name'
|
||||
post 'admin/update_syllabus_title'
|
||||
|
@ -1437,6 +1441,7 @@ RedmineApp::Application.routes.draw do
|
|||
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
|
||||
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
|
||||
post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
|
||||
post 'words/:id/leave_contest_message', :to => 'words#leave_contest_message', :as => "leave_contest_message"
|
||||
post 'words/:id/leave_syllabus_message', :to => 'words#leave_syllabus_message', :as => "leave_syllabus_message"
|
||||
post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message"
|
||||
post 'words/:id/reply_to_homework', :to => 'words#reply_to_homework', :as => "reply_to_homework"
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
#encoding: utf-8
|
||||
class AddStudentWorkData < ActiveRecord::Migration
|
||||
def up
|
||||
count = Course.all.count / 30 + 2
|
||||
transaction do
|
||||
for i in 1 .. count do i
|
||||
Course.page(i).per(30).each do |course|
|
||||
begin
|
||||
course.student.each do |student|
|
||||
course.homework_commons.each do |hw|
|
||||
if hw.homework_type != 3 && hw.student_works.where("user_id = #{student.student_id}").count == 0
|
||||
hw.student_works << StudentWork.new(:user_id => student.student_id, :name => hw.name.to_s+"的作品提交", :work_status => 0)
|
||||
end
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
logger.error "[AddStudentWorkData] ===> #{e}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddIsHiddenToStudentWorksScore < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :student_works_scores, :is_hidden, :boolean, :default => false
|
||||
end
|
||||
end
|
|
@ -374,6 +374,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
|
|||
menu.push :organization, {:controller => 'admin', :action => 'organization'}, :caption => :label_organization_list
|
||||
menu.push :projects, {:controller => 'admin', :action => 'projects'}, :caption => :label_project_plural
|
||||
menu.push :syllabuses, {:controller => 'admin', :action => 'syllabuses'}, :caption => :label_course_all
|
||||
menu.push :contests, {:controller => 'admin', :action => 'contests'}, :caption => :label_contest_plural
|
||||
menu.push :users, {:controller => 'admin', :action => 'users'}, :caption => :label_user_plural
|
||||
menu.push :messages, {:controller => 'admin', :action => 'messages'}, :caption => :label_system_message
|
||||
menu.push :schools, {:controller => 'admin', :action => 'schools'}, :caption => :label_school_plural
|
||||
|
|
|
@ -189,8 +189,10 @@ module Redmine
|
|||
title = h(caption) + "(#{Organization.all.count})"
|
||||
when '项目列表'
|
||||
title = h(caption) + "(#{Project.all.count})"
|
||||
when '课程列表'
|
||||
when '班级列表'
|
||||
title = h(caption) + "(#{Course.all.count})"
|
||||
when '竞赛列表'
|
||||
title = h(caption) + "(#{Contest.where("id >= 780").count})"
|
||||
when '用户列表'
|
||||
title = h(caption) + "(#{User.all.count})"
|
||||
when '分享作业申请'
|
||||
|
|
|
@ -1744,12 +1744,12 @@ function expand_course_list(id, target, btnid, count) {
|
|||
//点击删除时的确认弹框: 不走destroy方法
|
||||
function delete_confirm_box(url, str){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f16 fontGrey7">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mt10" style="margin-right: 92px;" data-remote="true">确定</a>'+
|
||||
'<div class="clear mt15"><p class="text_c f14 fontGrey7">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mt10" style="margin-right: 92px;" data-remote="true">确定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
}
|
||||
|
||||
//点击删除时的确认弹框: 走destroy方法
|
||||
//点击删除时的确认弹框: 走destroy方法,remote为true
|
||||
function delete_confirm_box_2(url, str){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14 fontGrey7">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mt10" style="margin-right: 92px;" data-method="delete" data-remote="true">确定</a>'+
|
||||
|
@ -1757,10 +1757,18 @@ function delete_confirm_box_2(url, str){
|
|||
pop_box_new(htmlvalue, 300, 140);
|
||||
}
|
||||
|
||||
//点击删除时的确认弹框: 走destroy方法
|
||||
function delete_confirm_box_3(url, str){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14 fontGrey7">' + str + '</p><div class="cl"></div><a href="'+ url +'" class="fr sy_btn_blue mt10" style="margin-right: 92px;" data-method="delete">确定</a>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_grey mt10 mr10" onclick="hideModal();">取消</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
}
|
||||
|
||||
//提示框:只有一个确定按钮,点击关闭弹框
|
||||
function notice_box(str){
|
||||
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f16">' + str + '</p><div class="cl"></div>'+
|
||||
'<div class="clear mt15"><p class="text_c f14">' + str + '</p><div class="cl"></div>'+
|
||||
'<a href="javascript:void(0);" class="fr sy_btn_blue mt10 mr10" onclick="hideModal();" style="margin-right: 124px;">确定</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
}
|
||||
|
|
|
@ -144,3 +144,35 @@ function regex_evaluation_num(){
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//留言
|
||||
function contest_jour_submit(){
|
||||
if(jourReplyVerify()){
|
||||
jour_content_editor.sync();//提交内容之前要sync,不然服务器端取不到值
|
||||
$("#contest_feedback_new").submit();
|
||||
}
|
||||
}
|
||||
|
||||
function jourReplyVerify() {
|
||||
var content = jour_content_editor.html();//$.trim($("#message_content").val());
|
||||
if (jour_content_editor.isEmpty()) {
|
||||
$("#jour_content_span").text("留言不能为空");
|
||||
$("#jour_content_span").css('color', '#ff0000');
|
||||
$("#submit_feedback_user").one('click',function() {
|
||||
contest_jour_submit();
|
||||
});
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
$("#jour_content_span").text("填写正确");
|
||||
$("#jour_content_span").css('color', '#008000');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function cancel_jour_submit(){
|
||||
jour_content_editor.html("");
|
||||
$("#jour_content_span").text("");
|
||||
$("#jour_content_span").hide();
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
.mt12{ margin-top:12px;}
|
||||
.pro_new_idbox{ width: 40%; padding-left: 30px;}
|
||||
.pro_new_idlist{ width: 50%; border-right: 1px solid #e5e5e5; padding-right: 30px; min-height: 100px;}
|
||||
.pro_new_idname{display:block;width:300px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
||||
.pro_new_idname{display:block;width:160px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
||||
.pro_new_school_name{display:block;width:130px; overflow:hidden;white-space: nowrap; text-overflow:ellipsis;}
|
||||
.sy_new_tchbox p{ line-height: 30px;}
|
||||
.pro_newsetting_con p,.pro_newsetting_con { line-height: 30px;}
|
||||
.w650{ width: 650px;}
|
||||
|
|
|
@ -185,8 +185,8 @@ a.homepagePostTypeResource {background:url(../images/homepage_icon.png) no-repea
|
|||
a.homepagePostTypeForum {background:url(../images/homepage_icon.png) -10px -310px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeMine {background:url(../images/homepage_icon.png) -187px -277px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -185px -308px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeMine {background:url(../images/homepage_icon.png) -189px -277px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -187px -308px no-repeat; padding-left:23px;}
|
||||
a.homepagePostTypeMessage {background:url(../images/homepage_icon.png) -3px -518px no-repeat; padding-left:23px;}
|
||||
.homepagePostTypeMore {width:180px; border-top:1px dashed #dddddd; margin-top:5px;}
|
||||
a.homepageTypeUnread {background:url(/images/homepage_icon.png) -6px -579px no-repeat; padding-left:23px;}
|
||||
|
|
Loading…
Reference in New Issue