Compare commits
No commits in common. "master" and "dev_message" have entirely different histories.
master
...
dev_messag
|
|
@ -533,22 +533,11 @@ class CoursesController < ApplicationController
|
|||
|
||||
@search = params[:search]
|
||||
q = params[:search] ? "#{params[:search].strip}" : ""
|
||||
# if @order == "student_id"
|
||||
# @members = @course.members.joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id #{@r_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
# else
|
||||
# @members = @course.members.joins("join users on members.user_id = users.id").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@r_sort}, login #{@r_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
# end
|
||||
@members = Member.find_by_sql("SELECT members.*,(
|
||||
SELECT SUM(student_works.work_score)
|
||||
FROM student_works,homework_commons
|
||||
WHERE student_works.homework_common_id = homework_commons.id
|
||||
AND homework_commons.homework_type in (1, 4)
|
||||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{@course.id} ORDER BY score desc")
|
||||
if @order == "student_id"
|
||||
@members = @course.members.joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id #{@r_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
else
|
||||
@members = @course.members.joins("join users on members.user_id = users.id").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@r_sort}, login #{@r_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
end
|
||||
if q.nil? || q == ""
|
||||
else
|
||||
members = []
|
||||
|
|
@ -587,22 +576,11 @@ class CoursesController < ApplicationController
|
|||
|
||||
@search = params[:search]
|
||||
q = params[:search] ? "#{params[:search].strip}" : ""
|
||||
@members = Member.find_by_sql("SELECT members.*,(
|
||||
SELECT SUM(student_works.work_score)
|
||||
FROM student_works,homework_commons
|
||||
WHERE student_works.homework_common_id = homework_commons.id
|
||||
AND homework_commons.homework_type in (1, 4)
|
||||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{@course.id} AND members.course_group_id = 0 ORDER BY score desc")
|
||||
# if @order == "student_id"
|
||||
# @members = @course.members.where(:course_group_id => 0).joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id #{@sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
# else
|
||||
# @members = @course.members.where(:course_group_id => 0).joins("join users on members.user_id = users.id").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@sort}, login #{@b_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
# end
|
||||
if @order == "student_id"
|
||||
@members = @course.members.where(:course_group_id => 0).joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id #{@sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
else
|
||||
@members = @course.members.where(:course_group_id => 0).joins("join users on members.user_id = users.id").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@sort}, login #{@b_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
end
|
||||
if q.nil? || q == ""
|
||||
else
|
||||
members = []
|
||||
|
|
@ -635,28 +613,17 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
|
||||
def has_group_student_list
|
||||
#@order, @r_sort = params[:order] || "student_id", params[:sort] || "asc"
|
||||
#@sort = @r_sort == "desc" ? "asc" : "desc"
|
||||
@order, @r_sort = params[:order] || "student_id", params[:sort] || "asc"
|
||||
@sort = @r_sort == "desc" ? "asc" : "desc"
|
||||
|
||||
@search = params[:search]
|
||||
q = params[:search] ? "#{params[:search].strip}" : ""
|
||||
@group = @course.course_groups.find params[:group_id]
|
||||
@members = Member.find_by_sql("SELECT members.*,(
|
||||
SELECT SUM(student_works.work_score)
|
||||
FROM student_works,homework_commons
|
||||
WHERE student_works.homework_common_id = homework_commons.id
|
||||
AND homework_commons.homework_type in (1, 4)
|
||||
AND homework_commons.course_id = #{@course.id}
|
||||
AND student_works.user_id = members.user_id
|
||||
) AS score FROM members
|
||||
JOIN students_for_courses
|
||||
ON students_for_courses.student_id = members.user_id AND students_for_courses.course_id = members.course_id
|
||||
WHERE members.course_id = #{@course.id} AND members.course_group_id = #{@group.id} ORDER BY score desc")
|
||||
# if @order == "student_id"
|
||||
# @members = @course.members.where(:course_group_id => @group.id).joins("join user_extensions on members.user_id = user_extensions.user_id").select{|m| m.roles.to_s.include?("Student")}.reorder("student_id #{@sort}")
|
||||
# else
|
||||
# @members = @course.members.where(:course_group_id => @group.id).joins("join users on members.user_id = users.id").select{|m| m.roles.to_s.include?("Student")}.reorder("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@sort}, login #{@b_sort}")
|
||||
# end
|
||||
if @order == "student_id"
|
||||
@members = @course.members.where(:course_group_id => @group.id).joins("join user_extensions on members.user_id = user_extensions.user_id").order("student_id #{@sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
else
|
||||
@members = @course.members.where(:course_group_id => @group.id).joins("join users on members.user_id = users.id").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@sort}, login #{@b_sort}").select{|m| m.roles.to_s.include?("Student")}
|
||||
end
|
||||
if q.nil? || q == ""
|
||||
else
|
||||
members = []
|
||||
|
|
@ -668,7 +635,6 @@ class CoursesController < ApplicationController
|
|||
end
|
||||
@members = members
|
||||
end
|
||||
|
||||
#分页
|
||||
@member_count = @members.count
|
||||
@all_member_ids = @members.map(&:id).join(",")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
# encoding: utf-8
|
||||
class DiscussesController < ApplicationController
|
||||
include ApplicationHelper
|
||||
before_filter :find_dis_object, :except => [:destroy]
|
||||
|
|
@ -7,40 +6,10 @@ class DiscussesController < ApplicationController
|
|||
def create
|
||||
if @model
|
||||
if params[:reply_id].blank?
|
||||
notes = User.current.show_name.to_s + " 评论了你发布的实训:<a href='#{shixun_discuss_shixun_path(@model)}'>#{params[:content]}</a>"
|
||||
@model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :praise_count => 0, :challenge_id => params[:challenge_id])
|
||||
JournalsForMessage.create(
|
||||
:jour_id => @model.user_id,
|
||||
:jour_type => "Principal",
|
||||
:user_id => User.current.id,
|
||||
:reply_id => 0,
|
||||
:is_readed => 0,
|
||||
:private => 1,
|
||||
:notes => notes
|
||||
)
|
||||
else
|
||||
notes = User.current.show_name.to_s + " 评论了你的回复:<a href='#{shixun_discuss_shixun_path(@model)}'>#{params[:content]}</a>"
|
||||
user_id = Discuss.find(params[:reply_id]).try(:user_id)
|
||||
@model.discusses << Discuss.new(
|
||||
:content => params[:content],
|
||||
:user_id => User.current.id,
|
||||
:parent_id => params[:reply_id],
|
||||
:root_id => params[:reply_id],
|
||||
:praise_count => 0,
|
||||
:challenge_id => params[:challenge_id]
|
||||
)
|
||||
JournalsForMessage.create(
|
||||
:jour_id => user_id,
|
||||
:jour_type => "Principal",
|
||||
:user_id => User.current.id,
|
||||
:reply_id => 0,
|
||||
:is_readed => 0,
|
||||
:private => 1,
|
||||
:notes => notes
|
||||
)
|
||||
@model.discusses << Discuss.new(:content => params[:content], :user_id => User.current.id, :parent_id => params[:reply_id], :root_id => params[:reply_id], :praise_count => 0, :challenge_id => params[:challenge_id])
|
||||
end
|
||||
|
||||
|
||||
if params[:dis_type] == "Shixun"
|
||||
redirect_to shixun_discuss_shixun_path(@model, :challenge_id => params[:challenge_id])
|
||||
end
|
||||
|
|
|
|||
|
|
@ -525,7 +525,6 @@ class ExerciseController < ApplicationController
|
|||
|
||||
@exercise_users_list = search_exercise_member @exercise_users_list, @name
|
||||
|
||||
@tab = params[:tab].nil? ? 1 : params[:tab].to_i
|
||||
@score = @b_sort == "desc" ? "asc" : "desc"
|
||||
@exercise_count = @exercise_users_list.count
|
||||
@has_commit_count = @exercise.exercise_users.where(:commit_status => 1).count
|
||||
|
|
@ -824,13 +823,11 @@ class ExerciseController < ApplicationController
|
|||
# 查作者是我,或者作者是当前课程的老师,且不在当前课程内的试卷 进行导入
|
||||
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
|
||||
@r_sort = @b_sort == "desc" ? "asc" : "desc"
|
||||
@search = params[:search] ? params[:search].to_s.strip.downcase : ""
|
||||
#courses = User.current.courses.not_deleted.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
#course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
courses = User.current.courses.not_deleted.select { |course| User.current.allowed_to?(:as_teacher,course)}
|
||||
course_ids = courses.empty? ? "(-1)" : "(" + courses.map { |course| course.id}.join(',') + ")"
|
||||
#none_courses = User.current.courses.where("is_delete = 1 or #{Course.table_name}.id = #{params[:course_id].to_i}")
|
||||
#none_course_ids = none_courses.empty? ? "(-1)" : "(" + none_courses.map { |course| course.id}.join(',') + ")"
|
||||
#@exercises = Exercise.where("(user_id = #{User.current.id} or course_id in #{course_ids}) and course_id != #{params[:course_id].to_i} and exercise_name like '%#{@search}%'").order("#{@order} #{@b_sort}")
|
||||
@exercises = Exercise.where("user_id = #{User.current.id} and exercise_name like '%#{@search}%'").order("#{@order} #{@b_sort}")
|
||||
@exercises = Exercise.where("(user_id = #{User.current.id} or course_id in #{course_ids}) and course_id != #{params[:course_id].to_i}").order("#{@order} #{@b_sort}")
|
||||
@course_id = params[:course_id]
|
||||
@is_remote = true
|
||||
@ex_count = @exercises.count
|
||||
|
|
@ -865,15 +862,15 @@ class ExerciseController < ApplicationController
|
|||
def import_other_exercise
|
||||
course_id = params[:course_id]
|
||||
@course = Course.find(course_id)
|
||||
if params[:exercise_id]
|
||||
exercise = Exercise.find(params[:exercise_id])
|
||||
params[:exercise_id].each_with_index do |ex,i|
|
||||
exercise = Exercise.find(ex)
|
||||
option = {
|
||||
:exercise_name => exercise.exercise_name,
|
||||
:exercise_status => 1,
|
||||
:user_id => User.current.id,
|
||||
:show_result => 1,
|
||||
:course_id => @course.id,
|
||||
:time => -1,
|
||||
:time => exercise.time,
|
||||
:exercise_description => exercise.exercise_description
|
||||
}
|
||||
@exercise = Exercise.create option
|
||||
|
|
@ -905,6 +902,9 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
@exercise.save
|
||||
end
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ class GamesController < ApplicationController
|
|||
layout "base_myshixun"
|
||||
skip_before_filter :verify_authenticity_token, :only => [:file_update]
|
||||
before_filter :find_myshixun, :only => [:index]
|
||||
before_filter :find_game, :only => [:show, :game_build, :entry,:next_step, :prev_step,:outputs_show, :file_edit, :file_update, :get_waiting_time, :web_display,
|
||||
before_filter :find_game, :only => [:show, :game_build, :entry,:next_step, :prev_step,:outputs_show, :file_edit, :file_update, :get_waiting_time,
|
||||
:game_status, :change_status, :answer, :minus_score, :refresh_game_list, :reset_original_code, :reset_new_code, :evaluating_choice, :sync_codes]
|
||||
before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update, :reset_original_code, :reset_new_code, :html_show]
|
||||
before_filter :allowd_manager
|
||||
|
|
@ -91,28 +91,12 @@ class GamesController < ApplicationController
|
|||
# git_repository_url @myshixun, "Myshixun"
|
||||
# @st 0 实践任务 1 选择题任务
|
||||
def show
|
||||
# g = Gitlab.client
|
||||
# g_name = g.project(@myshixun.gpid).try(:name)
|
||||
# g_rep = @myshixun.repository
|
||||
# g_identifier = g_rep.try(:identifier)
|
||||
# if g_name.include?("-") || g_identifier.include?("-")
|
||||
# g_user_id = @myshixun.owner.try(:gid)
|
||||
# g_name = g_name.split("-")
|
||||
# g_project_name = g_name[0]
|
||||
# num = g_name[1]
|
||||
# g_id = g.current_user_project(g_user_id, g_project_name).first.try(:id)
|
||||
# sql = "update `repositories` set identifier='#{g_project_name}' where id=#{g_rep.id}"
|
||||
# ActiveRecord::Base.connection.execute(sql)
|
||||
# @myshixun.update_attribute(:gpid, g_id)
|
||||
# end
|
||||
# 展示全部实训
|
||||
# git_myshixun_url_ip @myshixun, user_id
|
||||
# 展示全部实训
|
||||
@is_subject = params[:is_subject]
|
||||
if @game.status == 1
|
||||
# 放置页面ajax数据还没获取就关闭
|
||||
@game.update_attribute(:status, 0)
|
||||
end
|
||||
|
||||
# logger.info("#################%%%%%%#{@game.outputs.first.out_put}")
|
||||
# @games = @myshixun.games.includes(:challenge)
|
||||
@game_challenge = @game.challenge
|
||||
|
|
@ -512,20 +496,6 @@ class GamesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# web渲染
|
||||
def web_display
|
||||
path = @game.challenge.path.strip
|
||||
port = (50000 + @game.myshixun_id).to_s
|
||||
# 测试
|
||||
#path = "src/step1/Helloworld.php"
|
||||
#port = (50000+4116).to_s
|
||||
@url = "http://106.75.96.108:" + port + '/' + path
|
||||
|
||||
respond_to do |format|
|
||||
format.html{render :layout => false}
|
||||
end
|
||||
end
|
||||
|
||||
def minus_score
|
||||
@game_challenge = @game.challenge
|
||||
user = User.current
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ class HomeworkCommonController < ApplicationController
|
|||
before_filter :find_course, :only => [:index,:new,:create]
|
||||
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,
|
||||
:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,:open_student_works,
|
||||
:set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_homework,:setting,:set_public,:homework_setting,:update_explanation]
|
||||
:set_score_open,:alert_score_open_modal,:add_to_homework_bank,:publish_homework,:setting,:set_public,:homework_setting]
|
||||
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,
|
||||
:start_evaluation_set,:set_evaluation_attr,:score_rule_set,:alert_forbidden_anonymous_comment,:alert_open_student_works,
|
||||
:open_student_works,:add_to_homework_bank,:publish_homework,:update_explanation]
|
||||
:open_student_works,:add_to_homework_bank,:publish_homework]
|
||||
before_filter :member_of_course, :only => [:index,:setting]
|
||||
|
||||
def index
|
||||
|
|
@ -335,11 +335,11 @@ class HomeworkCommonController < ApplicationController
|
|||
if @homework.homework_type == 4
|
||||
if @homework_detail_manual.answer_open_evaluation != params[:answer_open_evaluation].to_i
|
||||
@homework_detail_manual.answer_open_evaluation = params[:answer_open_evaluation].to_i
|
||||
if @homework.end_time < Time.now
|
||||
@homework.student_works.each do |student_work|
|
||||
set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation
|
||||
end
|
||||
end
|
||||
# if @homework.end_time < Time.now
|
||||
# @homework.student_works.each do |student_work|
|
||||
# set_shixun_final_score @homework, student_work, @homework_detail_manual.answer_open_evaluation
|
||||
# end
|
||||
# end
|
||||
end
|
||||
@homework.score_open = params[:homework_score_open] ? 1 : 0
|
||||
else
|
||||
|
|
@ -471,13 +471,6 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#更新作业说明
|
||||
def update_explanation
|
||||
@is_teacher = User.current.admin? || User.current.allowed_to?(:as_teacher, @course)
|
||||
@homework.update_attribute('explanation', params[:homework_common][:explanation])
|
||||
redirect_to student_work_index_path(:homework => @homework.id, :tab => 2)
|
||||
end
|
||||
|
||||
#加入到题库
|
||||
def add_to_homework_bank
|
||||
if params[:type] && (params[:type].to_i == 1 || params[:type].to_i == 3)
|
||||
|
|
|
|||
|
|
@ -434,7 +434,7 @@ end
|
|||
@menu_type = 6
|
||||
@sub_type = 2
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
@department = Department.where(:is_auth => 1)
|
||||
@department = ApplyAddDepartment.where(:status => 1)
|
||||
search=params[:search]
|
||||
if search.blank?
|
||||
@department = @department
|
||||
|
|
@ -553,54 +553,6 @@ end
|
|||
|
||||
end
|
||||
|
||||
# 修改单位名称
|
||||
def upload_logo
|
||||
@menu_type = 6
|
||||
@sub_type = 1
|
||||
@next_type = 1
|
||||
@school = School.find(params[:school])
|
||||
end
|
||||
|
||||
# 修改单位名称为其他
|
||||
def school_upload_logo
|
||||
school = School.where(:id => params[:applied_id]).first
|
||||
ApplyAddSchools.where(:school_id => params[:applied_id]).destroy_all
|
||||
before_apply_departments = Department.where(:school_id => params[:applied_id])
|
||||
after_apply_deparments = Department.where(:school_id => params[:school_id])
|
||||
before_apply_departments.each do |department|
|
||||
after_dep = Department.where(:school_id => params[:school_id], :name => department.name).first
|
||||
if after_dep
|
||||
UserExtensions.where(:school_id => params[:applied_id], :department_id => department.id).update_all(:department_id => after_dep.id)
|
||||
else
|
||||
new_department = Department.create(:name => department.name,:school_id =>params[:school_id], :is_auth => 1)
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:department_id => new_department.id)
|
||||
end
|
||||
ApplyAddDepartment.where(:department_id => department.id).destroy_all
|
||||
department.destroy
|
||||
end
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id])
|
||||
school.destroy
|
||||
redirect_to departments_part_managements_path
|
||||
end
|
||||
|
||||
# 修改单位信息
|
||||
def school_message_update
|
||||
school = School.where(:name =>params[:schoolname]).first
|
||||
school_id = school.id
|
||||
School.where(:id => school_id).update_all(:province => params[:province],:city =>params[:city],:address => params[:address],:shool_code => params[:school_code])
|
||||
redirect_to departments_part_managements_path
|
||||
end
|
||||
|
||||
# 删除单位
|
||||
def delete_school
|
||||
school = School.where(:id => params[:school]).first
|
||||
UserExtensions.where(:school_id => params[:school]).update_all(:school_id => nil, :department_id => nil)
|
||||
ApplyAddSchools.where(:school_id => params[:school]).destroy_all
|
||||
ApplyAddDepartment.where(:school_id => params[:school]).destroy_all
|
||||
school.destroy
|
||||
redirect_to departments_part_managements_path
|
||||
end
|
||||
|
||||
def save_school
|
||||
uploaded_io = params[:logo]
|
||||
sl = School.create(:name => params[:schoolname],:province => params[:province],:city => params[:city],:address => params[:address])
|
||||
|
|
@ -657,9 +609,6 @@ end
|
|||
applied_department = ApplyAddDepartment.find(params[:id])
|
||||
applied_message = AppliedMessage.where(:applied_id => applied_department.id, :applied_type => "ApplyAddDepartment")
|
||||
applied_message.update_all(:status => 1)
|
||||
if applied_department.department
|
||||
applied_department.department.update_attributes(:is_auth => 1)
|
||||
end
|
||||
applied_department.update_attribute(:status, 1) unless applied_department.nil?
|
||||
AppliedMessage.create(:user_id => applied_department.user_id, :status => 1, :viewed => 0, :applied_id => applied_department.id, :applied_type => "ApplyAddDepartment", :name => applied_department.name )
|
||||
UserExtensions.where(:user_id => applied_department.user_id).update_all(:department_id => applied_department.department_id)
|
||||
|
|
@ -810,16 +759,17 @@ end
|
|||
# 单位审批修改
|
||||
def all_schools
|
||||
apply_schools = ApplyAddSchools.where("status = 0")
|
||||
apply_school_ids = apply_schools.empty? ? "(#{params[:school_id].to_i})" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
apply_school_ids = apply_schools.empty? ? "(-1)" : "(" + apply_schools.map{|sc| sc.school_id}.join(',') + ")"
|
||||
if !params[:search].nil?
|
||||
search = "%#{params[:search].to_s.strip.downcase}%"
|
||||
@schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i} and #{School.table_name}.name like :p", :p => search)
|
||||
@schools = School.where("id not in #{apply_school_ids} and #{School.table_name}.name like :p", :p => search)
|
||||
#@schools = School.all
|
||||
else
|
||||
@schools = School.where("id not in #{apply_school_ids} and id != #{params[:school_id].to_i}")
|
||||
#@course = @user.courses.where("is_delete = 0 and #{Course.table_name}.id != #{homework.course_id}").select { |course| @user.allowed_to?(:as_teacher,course)}
|
||||
@schools = School.where("id not in #{apply_school_ids}")
|
||||
end
|
||||
@edit_id = params[:school_id]
|
||||
@search = params[:search]
|
||||
@upload = params[:upload]
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
|
|
@ -839,28 +789,9 @@ end
|
|||
AppliedMessage.create(:user_id => aas.user_id, :status => 2, :viewed => 0, :applied_id => aas.id, :applied_type => "ApplyAddSchools", :name => school.name )
|
||||
users = UserExtensions.where("school_id = #{aas.school_id}")
|
||||
users.update_all(:school_id => school.id)
|
||||
ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
# 判断重复
|
||||
before_apply_departments = Department.where(:school_id => params[:applied_id])
|
||||
after_apply_deparments = Department.where(:school_id => params[:school_id])
|
||||
before_apply_departments.each do |department|
|
||||
after_dep = Department.where(:school_id => params[:school_id], :name => department.name).first
|
||||
if after_dep
|
||||
UserExtensions.where(:school_id => params[:applied_id], :department_id => department.id).update_all(:department_id => after_dep.id)
|
||||
else
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:department_id => new_department.id)
|
||||
if after_dep.status == 2 ||after_dep.status == 3
|
||||
new_department = Department.create(:name => department.name,:school_id =>params[:school_id], :is_auth => 1)
|
||||
else
|
||||
new_department = Department.create(:name => department.name,:school_id =>params[:school_id], :is_auth => 0)
|
||||
end
|
||||
end
|
||||
ApplyAddDepartment.where(:department_id => department.id).destroy_all
|
||||
department.destroy
|
||||
end
|
||||
UserExtensions.where(:school_id => params[:applied_id]).update_all(:school_id => params[:school_id])
|
||||
|
||||
# Department.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
ApplyAddDepartment.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
Department.where(:school_id => aas.school_id).update_all(:school_id => school.id)
|
||||
aas.school.destroy
|
||||
aas.update_attribute(:school_id, school.id)
|
||||
end
|
||||
|
|
@ -889,10 +820,10 @@ end
|
|||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@courselist = @courselist.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
else
|
||||
@courselist = @courselist.where("name like '%#{search}%'")
|
||||
@courselist= @courselist.where("name like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
@courselist = @courselist.order("created_at #{@sx_order}")
|
||||
@courselist = @courselist.order("id #{@sx_order}")
|
||||
@courselist_count = @courselist.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -957,9 +888,7 @@ end
|
|||
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'")
|
||||
end
|
||||
else
|
||||
school = School.where("name like '%#{@search}%'").map(&:id)
|
||||
@courses = @courses.where(:school_id => school)
|
||||
# @courses= @courses.where("name like '%#{@search}%'")
|
||||
@courses= @courses.where("name like '%#{@search}%'")
|
||||
end
|
||||
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime #{@sx_order}")
|
||||
@export_courses = @courses
|
||||
|
|
@ -1089,7 +1018,7 @@ end
|
|||
|
||||
# 0 全部;1 活动的; 2 已注册; 3 锁定
|
||||
def users
|
||||
@menu_type = 7
|
||||
@menu_type
|
||||
@sub_type = 1
|
||||
status = params[:user_status].nil? ? 0 : params[:user_status].to_i
|
||||
@us_order = params[:us_order].blank? ? "desc" : params[:us_order] # 排序
|
||||
|
|
@ -1276,7 +1205,6 @@ end
|
|||
@menu_type = 7
|
||||
@sub_type = 3
|
||||
@apply_action = School.where(:auto_users_trial => 1).order('updated_at desc')
|
||||
@auto_school_ids = @apply_action.empty? ? "(-1)" : "(" + @apply_action.map(&:id).join(",") + ")"
|
||||
@apply_action_count = @apply_action.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ class MyshixunsController < ApplicationController
|
|||
# resubmit 1:表示已通关后重新评测;0:表示非重新评测
|
||||
# retry_status 0:初始值;1:重新评测失败;2:重新评测成功
|
||||
def training_task_status
|
||||
#params[:jsonTestDetails] = '{"buildID":"1","compileSuccess":"1","msg":[{"caseId":"1","expectedOutput":"56ysMOS9jeWQjOWtpueahOaAu+WIhuS4ujoyNDcK56ysMeS9jeWQjOWtpueahOaAu+WIhuS4ujoz MjIK","input":"Mg0KMjMsNTYsNzgsOTANCjIxLDU2LDc4LDc2LDkx","output":"56ysMOS9jeWQjOWtpueahOaAu+WIhuS4ujoyNDcK56ysMeS9jeWQjOWtpueahOaAu+WIhuS4ujoz MjIK","passed":"1"},{"caseId":"2","expectedOutput":"56ysMOS9jeWQjOWtpueahOaAu+WIhuS4ujoyMjgK56ysMeS9jeWQjOWtpueahOaAu+WIhuS4ujoy MzUK56ysMuS9jeWQjOWtpueahOaAu+WIhuS4ujoyMDYK","input":"Mw0KOTgsNzYsNTQNCjkwLDU0LDg3LDQNCjc4LDI2LDEyLDkw","output":"56ysMOS9jeWQjOWtpueahOaAu+WIhuS4ujoyMjgK56ysMeS9jeWQjOWtpueahOaAu+WIhuS4ujoy MzUK56ysMuS9jeWQjOWtpueahOaAu+WIhuS4ujoyMDYK","passed":"1"}],"outPut":"Y29tcGlsZSBzdWNjZXNzZnVsbHk","resubmit":"57D9COBR_5806","status":"0"}'
|
||||
jsonTestDetails = JSON.parse(params[:jsonTestDetails])
|
||||
status = jsonTestDetails['status']
|
||||
game_id = jsonTestDetails['buildID']
|
||||
|
|
@ -132,9 +131,7 @@ class MyshixunsController < ApplicationController
|
|||
challenge = game.challenge
|
||||
unless jenkins_testsets.blank?
|
||||
jenkins_testsets.each do |j_test_set|
|
||||
logger.info("j_test_set: ############## #{j_test_set['output']}")
|
||||
actual_output = tran_base64_decode64(j_test_set['output'])
|
||||
logger.info "actual_output:################################################# #{actual_output}"
|
||||
game_outputs = Output.create(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
|
||||
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => game.query_index, :compile_success => compile_success.to_i)
|
||||
# output = Output.where(:game_id => game.id, :test_set_position => j_test_set['caseId'].to_i).first
|
||||
|
|
|
|||
|
|
@ -126,22 +126,12 @@ class SchoolController < ApplicationController
|
|||
chinese << char
|
||||
end
|
||||
end
|
||||
if params[:no_school_ids]
|
||||
if(condition == '')
|
||||
@school = School.where("id not in #{params[:no_school_ids]}").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
else
|
||||
@school = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("id not in #{params[:no_school_ids]} and name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
end
|
||||
if(condition == '')
|
||||
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
else
|
||||
if(condition == '')
|
||||
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.count
|
||||
else
|
||||
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
end
|
||||
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
|
||||
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
|
||||
end
|
||||
|
||||
result = []
|
||||
|
|
@ -181,8 +171,6 @@ class SchoolController < ApplicationController
|
|||
school.name = params[:name].strip
|
||||
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
|
||||
school.province = params[:province]
|
||||
school.city = params[:city]
|
||||
school.address = params[:address]
|
||||
|
||||
#status 0未处理 1通过 2拒绝
|
||||
applyschool = ApplyAddSchools.new
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ class ShixunsController < ApplicationController
|
|||
s.sync_user(User.current)
|
||||
end
|
||||
gshixun = g.fork(@shixun.gpid, User.current.gid)
|
||||
if gshixun.try(:id).present?
|
||||
if !gshixun.try(:id).blank?
|
||||
myshixun.update_column(:gpid, gshixun.id) if myshixun.try(:gpid).blank?
|
||||
# educoder 加入到myshixun中
|
||||
myshixun_admin_gid = User.where(:login => "educoder").first.try(:gid)
|
||||
|
|
@ -626,7 +626,7 @@ class ShixunsController < ApplicationController
|
|||
user_gid = User.find_by_mail("eduforge@163.com").try(:gid)
|
||||
gshixun = g.fork(@shixun.gpid, user_gid)
|
||||
raise "版本库创建失败" if gshixun.try(:id).blank?
|
||||
#gshixun = g.edit_project(gshixun.id, new_shixun.identifier, new_shixun.identifier)
|
||||
gshixun = g.edit_project(gshixun.id, new_shixun.identifier, new_shixun.identifier)
|
||||
raise "实训复制失败" if (gshixun.try(:name) != new_shixun.identifier || gshixun.try(:path) != new_shixun.identifier)
|
||||
new_shixun.update_column(:gpid, gshixun.id)
|
||||
# 同步复制者至gitlab,必须要求用户绑定了邮箱
|
||||
|
|
@ -725,16 +725,6 @@ class ShixunsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def fork_list
|
||||
@shixuns = Shixun.where(:fork_from => @shixun.id)
|
||||
@shixuns_count = @shixuns.count
|
||||
@limit = 16
|
||||
@is_remote = true
|
||||
@shixun_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1
|
||||
@offset ||= @shixun_pages.offset
|
||||
@shixuns = paginateHelper @shixuns, @limit
|
||||
end
|
||||
|
||||
def show
|
||||
respond_to do |format|
|
||||
format.html{redirect_to shixun_challenges_path(@shixun)}
|
||||
|
|
@ -803,20 +793,15 @@ class ShixunsController < ApplicationController
|
|||
end
|
||||
|
||||
def shixun_discuss
|
||||
@discusses = @shixun.discusses.reorder("created_at desc")
|
||||
@discusses = @shixun.discusses.where(:parent_id => nil).reorder("created_at desc")
|
||||
@discusses_count = @discusses.count
|
||||
#@limit = 15
|
||||
#@is_remote = true
|
||||
#@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1
|
||||
# @offset ||= @discusses_pages.offset
|
||||
#@discusses = paginateHelper @discusses, @limit
|
||||
@limit = 15
|
||||
@is_remote = true
|
||||
@discusses_pages = Paginator.new @discusses_count, @limit, params['page'] || 1
|
||||
@offset ||= @discusses_pages.offset
|
||||
@discusses = paginateHelper @discusses, @limit
|
||||
#@game_challenge = params[:challenge_id].blank? ? Challenge.find(@discusses.challenge_id) : Challenge.find(params[:challenge_id])
|
||||
challenge_id = params[:challenge_id].nil? ? @shixun.challenges.first.try(:id) : params[:challenge_id].to_i
|
||||
@game_challenge = Challenge.find(challenge_id)
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
@game_challenge = Challenge.find(params[:challenge_id].to_i)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
|||
|
|
@ -1701,54 +1701,34 @@ class StudentWorkController < ApplicationController
|
|||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 3 #分组作业
|
||||
if @homework.anonymous_comment ==0
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||
else
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||
end
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0] = get_group_member_names homework
|
||||
sheet1[count_row,1] = homework.name
|
||||
sheet1[count_row,2] = (homework.project_id == 0 || homework.project_id.nil?) ? l(:excel_no_project) : homework.project.name
|
||||
sheet1[count_row,3] = strip_html homework.description
|
||||
sheet1[count_row,4] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||
sheet1[count_row,5] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||
if @homework.anonymous_comment ==0
|
||||
sheet1[count_row,6] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
||||
sheet1[count_row,7] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.absence_penalty
|
||||
sheet1[count_row,8] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_n_score),l(:excel_a_penalty),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||
else
|
||||
sheet1[count_row,6] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
|
||||
sheet1[count_row,7] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||
sheet1[count_row,8] = format_time(homework.created_at)
|
||||
sheet1.row(0).concat([l(:excel_group_member),l(:excel_homework_name),l(:excel_homework_project),l(:excel_homework_des),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||
end
|
||||
count_row = 1
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0] = get_group_member_names homework
|
||||
sheet1[count_row,1] = homework.name
|
||||
sheet1[count_row,2] = (homework.project_id == 0 || homework.project_id.nil?) ? l(:excel_no_project) : homework.project.name
|
||||
sheet1[count_row,3] = strip_html homework.description
|
||||
sheet1[count_row,4] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||
sheet1[count_row,5] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||
if @homework.anonymous_comment ==0
|
||||
sheet1[count_row,6] = homework.student_score.nil? ? l(:label_without_score) : homework.student_score.round(2)
|
||||
sheet1[count_row,7] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.absence_penalty
|
||||
sheet1[count_row,8] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
|
||||
sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||
sheet1[count_row,10] = format_time(homework.created_at)
|
||||
else
|
||||
sheet1[count_row,6] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
|
||||
sheet1[count_row,7] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||
sheet1[count_row,8] = format_time(homework.created_at)
|
||||
end
|
||||
count_row += 1
|
||||
end
|
||||
count_row += 1
|
||||
end
|
||||
elsif @homework.homework_type == 4 #普通作业
|
||||
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_homework_complete_status),
|
||||
l(:excel_t_score),l(:excel_ta_score),l(:excel_l_penalty),l(:excel_f_score),l(:excel_commit_time)])
|
||||
count_row = 1
|
||||
shixun = @homework.homework_commons_shixuns.shixun
|
||||
items.each do |homework|
|
||||
sheet1[count_row,0]=homework.user.id
|
||||
sheet1[count_row,1] = homework.user.show_name
|
||||
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.work_status == 0 ? '--' : had_passed_changllenge_num(shixun, homework.user).to_s+"/"+shixun.challenges.count.to_s
|
||||
sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2)
|
||||
sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2)
|
||||
sheet1[count_row,9] = (@homework.teacher_priority == 1 && !homework.teacher_score.nil?) ? 0 : homework.late_penalty
|
||||
sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : homework.score.round(2) : l(:label_without_score)
|
||||
sheet1[count_row,11] = format_time(homework.created_at)
|
||||
count_row += 1
|
||||
end
|
||||
end
|
||||
book.write xls_report
|
||||
xls_report.string
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ class SubjectsController < ApplicationController
|
|||
before_filter :find_subject, :except => [:index, :new, :create, :create_subject, :new_subject, :append_to_stage]
|
||||
|
||||
include ApplicationHelper
|
||||
include SubjectsHelper
|
||||
|
||||
def index
|
||||
@order = params[:order] || "myshixun_count"
|
||||
|
|
@ -34,7 +33,6 @@ class SubjectsController < ApplicationController
|
|||
|
||||
def show
|
||||
@stages = @subject.stages
|
||||
@is_manager = User.current.manager_of_subject?(@subject)
|
||||
end
|
||||
|
||||
def new
|
||||
|
|
|
|||
|
|
@ -116,26 +116,9 @@ module ApplicationHelper
|
|||
# res返回结果0表示正确,-1表示有异常
|
||||
def add_shixun_modify_status shixun, type
|
||||
shixun_tomcat = Redmine::Configuration['shixun_tomcat']
|
||||
# 更新测试集
|
||||
gameInfo = shixun.gameInfo
|
||||
uri ="#{shixun_tomcat}/bridge/game/publishGame"
|
||||
# 更新脚本
|
||||
tpiList =[]
|
||||
myshixuns = shixun.myshixuns
|
||||
if myshixuns.present?
|
||||
myshixuns.each do |myshixun|
|
||||
logger.info("tpiID is #{myshixun.id}")
|
||||
tpiID = myshixun.id
|
||||
instanceGitURL = git_myshixun_url_ip(myshixun, myshixun.try(:user_id))
|
||||
logger.info("instanceGitURL is #{instanceGitURL}")
|
||||
tpiList << {:tpiID => tpiID, :instanceGitURL => instanceGitURL}
|
||||
logger.info("###############{tpiList.to_json unless tpiList.blank?}")
|
||||
end
|
||||
end
|
||||
tpiList = Base64.urlsafe_encode64(tpiList.to_json) unless tpiList.blank?
|
||||
params = {:gameInfo => "#{gameInfo}", :tpiList => "#{tpiList}" }
|
||||
logger.info("%%%%%%%%%%%%params is #{params}")
|
||||
# end
|
||||
params = {gameInfo:gameInfo}
|
||||
res = uri_exec uri, params
|
||||
if res && res['code'].to_i != 0
|
||||
raise("实训云平台繁忙(繁忙等级:90)")
|
||||
|
|
@ -145,26 +128,9 @@ module ApplicationHelper
|
|||
|
||||
def shixun_modify_status_publish shixun, type
|
||||
shixun_tomcat = Redmine::Configuration['shixun_tomcat']
|
||||
# 更新测试集
|
||||
gameInfo = shixun.gameInfo
|
||||
uri ="#{shixun_tomcat}/bridge/game/publishGame"
|
||||
# 更新脚本
|
||||
tpiList =[]
|
||||
myshixuns = shixun.myshixuns
|
||||
if myshixuns.present?
|
||||
myshixuns.each do |myshixun|
|
||||
logger.info("tpiID is #{myshixun.id}")
|
||||
tpiID = myshixun.id
|
||||
instanceGitURL = git_myshixun_url_ip(myshixun, myshixun.try(:user_id))
|
||||
logger.info("instanceGitURL is #{instanceGitURL}")
|
||||
tpiList << {:tpiID => tpiID, :instanceGitURL => instanceGitURL}
|
||||
logger.info("###############{tpiList.to_json unless tpiList.blank?}")
|
||||
end
|
||||
end
|
||||
tpiList = Base64.urlsafe_encode64(tpiList.to_json) unless tpiList.blank?
|
||||
params = {:gameInfo => "#{gameInfo}", :tpiList => "#{tpiList}" }
|
||||
logger.info("%%%%%%%%%%%%params is #{params}")
|
||||
# end
|
||||
params = {gameInfo:gameInfo}
|
||||
res = uri_exec uri, params
|
||||
if res && res['code'].to_i != 0
|
||||
raise("实训云平台繁忙(繁忙等级:90)")
|
||||
|
|
@ -4879,7 +4845,7 @@ def get_hw_index(hw,is_teacher,type=0)
|
|||
end
|
||||
end
|
||||
hw_ids = homeworks.map{|hw| hw.id} if !homeworks.blank?
|
||||
index = hw_ids.length - 1 - hw_ids.index(hw.id)
|
||||
index = hw_ids.index(hw.id)
|
||||
return index
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -3,21 +3,4 @@ module SubjectsHelper
|
|||
shixuns = Shixun.where(:id => subject.stage_shixuns.map(&:shixun_id))
|
||||
co_users = User.where(:id => shixuns.map(&:user_id)).where("id != #{subject.user_id}")
|
||||
end
|
||||
|
||||
def subject_data subject
|
||||
result = {}
|
||||
subject_choices = 0
|
||||
subject_shixuns = 0
|
||||
subject_score = 0
|
||||
subject.stage_shixuns.each do |stage_shixun|
|
||||
shixun = stage_shixun.shixun
|
||||
subject_choices += shixun.challenges.where(:st => [1, 2]).count
|
||||
subject_shixuns += shixun.challenges.where(:st => 0).count
|
||||
subject_score += shixun.shixun_score
|
||||
end
|
||||
result[:subject_choices] = subject_choices
|
||||
result[:subject_shixuns] = subject_shixuns
|
||||
result[:subject_score] = subject_score
|
||||
result
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Memo < ActiveRecord::Base
|
|||
# 若是主题帖,则内容可以是空
|
||||
#validates :content, presence: true, if: Proc.new{|o| !o.parent_id.nil? }
|
||||
validates_length_of :subject, maximum: 50
|
||||
|
||||
validates_length_of :content, maximum: 30000
|
||||
validate :cannot_reply_to_locked_topic, :on => :create
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class School < ActiveRecord::Base
|
||||
default_scope :order => 'created_at desc'
|
||||
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial,:shool_code
|
||||
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial
|
||||
has_many :courses
|
||||
has_many :departments, :dependent => :destroy
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class StudentsForCourse < ActiveRecord::Base
|
|||
def create_exercise_users
|
||||
course = self.course
|
||||
str = ""
|
||||
exercises = course.exercises.where("exercise_status > 1")
|
||||
exercises = course.exercises.where("exercise_status > 0")
|
||||
if exercises.count != 0
|
||||
exercises.each do |ex|
|
||||
if ex.exercise_users.where("user_id = #{self.student_id}").count == 0
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
# 使用请了解以下描述,不清楚请@Hjqreturn
|
||||
#
|
||||
# user_id: 信息接收人
|
||||
# trigger_user_id: 信息的触发者,具体情况可能有所不同。eg:产生消息的用户ID;处理消息的用户ID等
|
||||
# container_id:消息实体的ID。eg:issue的id
|
||||
# container_type:消息实体的类型。eg:“Issue","Board"
|
||||
# parent_container_id:消息实体的父实体消息的id,是为了生成url时使用,避免反复查数据库。eg:message中的board 的id
|
||||
# parent_container_type:消息实体的父实体消息类型,便于分类。eg:“Message","Board"
|
||||
# belong_container_id:消息实体所属的实体ID。eg:project_id,course_id,organization_id
|
||||
# belong_container_type:消息实体所属的实体类型。eg:“Project”,“Course”,"Shixun"
|
||||
# status:消息实体的状态。eg:“已处理”,“未处理”
|
||||
# viewed:消息是否已读。eg:1 -> 已读; 0 -> 未读
|
||||
#
|
||||
class Tiding < ActiveRecord::Base
|
||||
attr_accessible :belong_container_id, :belong_container_type, :container_id, :container_type, :parent_container_id,
|
||||
:parent_container_type, :status, :trigger_user_id, :user_id, :viewed
|
||||
|
||||
|
||||
end
|
||||
|
|
@ -593,7 +593,7 @@ class CoursesService
|
|||
|
||||
#多个角色加入课程
|
||||
def join_course_roles params,current_user
|
||||
course = Course.find_by_invite_code(params[:invite_code].strip) if params[:invite_code]
|
||||
course = Course.find_by_invite_code(params[:invite_code]) if params[:invite_code]
|
||||
go_coursegroup_flag = 0
|
||||
course_id = 0
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<div class="avatar-upload">
|
||||
<input class="avatar-src" name="avatar_src" type="hidden">
|
||||
<input class="avatar-data" name="avatar_data" type="hidden">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange ml5" type="button" onClick="$('input[id=avatarInput]').click();">本地上传</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue ml5" type="button" onClick="$('input[id=avatarInput]').click();">本地上传</a>
|
||||
<span id="avatar-name"></span>
|
||||
<input class="avatar-input" style="display:none;" id="avatarInput" name="avatar_file" type="file">
|
||||
<input type="hidden" id="source_id" value="<%= @user.id %>"/>
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
testend = teststr.match(/[^\\]+\.[^\(]+/i); //直接完整文件名的
|
||||
filename.innerHTML = testend;
|
||||
$(filename).css("color", '#333');
|
||||
$(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-orange");
|
||||
$(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-blue");
|
||||
$(".avatar-save").on("click", save_avatar);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<% if @user.phone.blank? %>
|
||||
<li class="font-14 mt10 color-grey"><i class="fa fa-exclamation-circle color-orange mr5"></i>未绑定</li>
|
||||
<li class="font-14 mt10"> </li>
|
||||
<li><a href="<%= change_or_bind_path(:type => 'phone') %>" class="task-btn task-btn-orange">绑定</a></li>
|
||||
<li><a href="<%= change_or_bind_path(:type => 'phone') %>" class="task-btn task-btn-blue">绑定</a></li>
|
||||
<% else %>
|
||||
<li class="font-14 mt10 color-grey"><i class="fa fa-check-circle color-light-green mr5"></i>已绑定</li>
|
||||
<li class="font-14 mt10 t_l color-grey">您绑定的手机:<%= @user.user_phone %></li>
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
<% if @user.mail.blank? %>
|
||||
<li class="font-14 mt10 color-grey"><i class="fa fa-exclamation-circle color-orange mr5"></i>未绑定</li>
|
||||
<li class="font-14 mt10"> </li>
|
||||
<li><a href="<%= change_or_bind_path(:type => 'mail') %>" class="task-btn task-btn-orange">绑定</a></li>
|
||||
<li><a href="<%= change_or_bind_path(:type => 'mail') %>" class="task-btn task-btn-blue">绑定</a></li>
|
||||
<% else %>
|
||||
<li class="font-14 mt10 color-grey"><i class="fa fa-check-circle color-light-green mr5"></i>已绑定</li>
|
||||
<li class="font-14 mt10 t_l color-grey">您绑定的邮箱:<%= @user.user_mail %></li>
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
<!--<li class="font-20"><i class="fa fa-wechat color-grey font-16 mr5"></i>微信绑定</li>-->
|
||||
<!--<li class="font-14 mt10 color-grey"><i class="fa fa-exclamation-circle color-orange mr5"></i>未绑定</li>-->
|
||||
<!--<li class="font-14 mt10"> </li>-->
|
||||
<!--<li><a href="#" class=" task-btn task-btn-orange">绑定</a></li>-->
|
||||
<!--<li><a href="#" class=" task-btn task-btn-blue">绑定</a></li>-->
|
||||
<!--</ul>-->
|
||||
|
||||
<!--<ul class="panel-user-setting-ul clearfix">-->
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<input type="text" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="我得说点儿什么,最多200个字符">
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="submit_reject_reason('<%= apply_user.id %>', this);" >确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="submit_reject_reason('<%= apply_user.id %>', this);" >确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="hide_reject_reason(this);" >取消</a>
|
||||
</li>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
<% if activity.attachments.any? %>
|
||||
<% activity.attachments.each do |attachment| %>
|
||||
<li class="color-grey">
|
||||
<a href="javascript:void(0)" class="color-grey">
|
||||
<a href="javascript:void(0)" class="link-color-grey">
|
||||
<i class="fa fa-folder" aria-hidden="true"></i>
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'color-grey', :download => true %>
|
||||
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link-color-grey', :download => true %>
|
||||
<span class="color-grey">(
|
||||
<%= number_to_human_size attachment.filesize %>)
|
||||
</span>
|
||||
<% user_name = attachment.author.show_real_name.empty? ? attachment.author : attachment.author.show_real_name %>
|
||||
<span title="<%= user_name %>">
|
||||
<%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "color-grey" %>,
|
||||
<%= link_to h(truncate(user_name, length: 15, omission: '...')),user_path(attachment.author),:class => "link-color-grey" %>,
|
||||
<%= format_time(attachment.created_on) %>
|
||||
</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,56 +1,56 @@
|
|||
<div class="mt10">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '' : 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => ie8? ? '' : 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js',:project =>nil),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" id="upload_file_local" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" data-tip-down="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<div class="mt10">
|
||||
<span id="attachments_fields" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => '_file',
|
||||
:class => ie8? ? '' : 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => ie8? ? '' : 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js',:project =>nil),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<!-- , user_import_resource_user_path(User.current.id,:homework_id=>container.id) -->
|
||||
<a href="javascript:void(0);" id="upload_file_local" class="AnnexBtn fl mt3 mr15" onclick="$('#_file').click();" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
|
@ -10,8 +10,8 @@
|
|||
<p class="task-popup-text-center font-16" id="compare-tips-1">代码查重已完成,点击查看结果</p>
|
||||
</div>
|
||||
<div class="task-popup-submit clearfix" style="width: 174px;">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fl" onclick = "compare_code_btn(<%=homework.id%>,<%=courseid%>)">重新查重</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick = "see_last_compare_code(<%=courseid%>,<%=homework.id%>)">查看结果</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fl" onclick = "compare_code_btn(<%=homework.id%>,<%=courseid%>)">重新查重</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick = "see_last_compare_code(<%=courseid%>,<%=homework.id%>)">查看结果</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<p class="task-popup-text-center font-16"><%=des%></p>
|
||||
</div>
|
||||
<div class="task-popup-sure clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange" onclick="yes_btn(<%=status%>,<%=courseid%>,<%=homework.id%>)">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue" onclick="yes_btn(<%=status%>,<%=courseid%>,<%=homework.id%>)">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,9 @@
|
|||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
<div class="ml10 pr edu-position-hidebox mr10">
|
||||
<div class="ml10 edu-dropdown">
|
||||
<span class="mr8 color-orange03">新建</span><i class="fa fa-sort-down fl fr mt3 color-orange03"></i>
|
||||
<ul class="edu-position-hide undis" id="all_status_list" style="top:29px;">
|
||||
<ul class="edu-dropdown-menu" id="all_status_list" style="top:29px;left: -12px;width: 90px;text-align: center">
|
||||
<li style="text-align:center;">
|
||||
<%= link_to '普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-grey" %>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</li>
|
||||
<p id="none_checked_notice" class="color-red none f12" style="margin-left: 54px;">请至少选择一个身份</p>
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr mr60" onclick="submit_join_course();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr mr60" onclick="submit_join_course();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="hideModal()">取消</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<div class="con-content">
|
||||
<%= labelled_form_for @course do |f| %>
|
||||
<ul>
|
||||
<li class="clearfix pt20 mb110">
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课程名称 </label>
|
||||
<div class="pr fl with75">
|
||||
<input type="text" name="course[course_list]" autocomplete="off" style="width: 100%;" id="new_course_list" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:数据结构">
|
||||
|
|
@ -19,18 +19,6 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange fl none" id="new_course_syllabus_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请先输入课程</span>
|
||||
|
||||
<div class="tusi" style="left:108% ">
|
||||
<div class="entry">
|
||||
<em></em>
|
||||
<span class="after"></span>
|
||||
<p class="color-grey mt10" style="height: 26px;line-height: 26px;">注意:只需要填写课程的全称即可</p>
|
||||
<p class="color-grey ml50" style="height: 26px;line-height: 26px;margin-left: 35px;"><i class="fa fa-check-circle color-light-green mr5"></i>正确示例:数据结构</p>
|
||||
<p class="color-grey" style="height: 26px;line-height: 26px;margin-left: 35px;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例:数据结构2017本部</p>
|
||||
<p class="color-grey" style="height: 26px;line-height: 26px;margin-left: 35px;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例:数据结构2017秋季</p>
|
||||
<p class="color-grey" style="height: 26px;line-height: 26px;margin-left: 35px;"><i class="fa fa-times-circle color-orange mr5"></i>错误示例:数据结构2017电子商务1班</p>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<li class="pt20 clearfix mb40">
|
||||
<label class="panel-form-label label fl color-dark-grey"><span class="color-orange mr5">*</span>课堂名称 </label>
|
||||
|
|
@ -84,7 +72,7 @@
|
|||
</li>
|
||||
<li class=" clearfix pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fl mr20" onclick="submit_new_course();">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fl mr20" onclick="submit_new_course();">保存</a>
|
||||
<%= link_to '取消', courses_path, :class => 'task-btn fl' %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
</li>
|
||||
<li class="mt20 clearfix pb20">
|
||||
<label class="panel-form-label label fl"> </label>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fl mr20" onclick="submit_edit_course(<%= @course.id%>);">保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fl mr20" onclick="submit_edit_course(<%= @course.id%>);">保存</a>
|
||||
<%= link_to '取消', course_path(@course), :class => 'task-btn fl ' %>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
</ul>
|
||||
|
||||
<a href="javascript:void(0);" class="pop_close task-btn" style="margin-top: 197px;">取消</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange" style="margin-top: 197px;" onclick="submit_add_teacher_form()">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue" style="margin-top: 197px;" onclick="submit_add_teacher_form()">确定</a>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@
|
|||
</li>
|
||||
<% if @no_group_count > 0 %>
|
||||
<li data-option="noclass" data-course-id="<%= @course.id %>">
|
||||
<p class="p1"><span class = "ml15">未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
<p class="p1"><span>未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
|
||||
<p class="p1">
|
||||
<span class = "ml15"><%= group.name %></span>
|
||||
<span><%= group.name %></span>
|
||||
<em><%= group.members.count %></em>
|
||||
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
|
||||
</p>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<script>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
if($(".setting_group_<%= group.id %> span").width() == 96){
|
||||
if($(".setting_group_<%= group.id %> span").width() == 115){
|
||||
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
|
||||
}
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
</li>
|
||||
<% if @no_group_count > 0 %>
|
||||
<li data-option="noclass" data-course-id="<%= @course.id %>">
|
||||
<p class="p1"><span class = "ml15">未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
<p class="p1"><span>未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
|
||||
<p class="p1">
|
||||
<span class = "ml15"><%= group.name %></span>
|
||||
<span><%= group.name %></span>
|
||||
<em><%= group.members.count %></em>
|
||||
</p>
|
||||
</li>
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
<script>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
if($(".setting_group_<%= group.id %> span").width() == 96){
|
||||
if($(".setting_group_<%= group.id %> span").width() == 115){
|
||||
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
|
||||
}
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
<% end %>
|
||||
<span class="color-orange fl none" id="change_manager_notice"><i class="fa fa-exclamation-circle mr5" ></i>请选择一个教师</span>
|
||||
<a href="javascript:void(0);" onclick="submit_change_manager_form();" class="task-btn task-btn-orange fr">确定</a>
|
||||
<a href="javascript:void(0);" onclick="submit_change_manager_form();" class="task-btn task-btn-blue fr">确定</a>
|
||||
<a href="javascript:void(0);" class="pop_close task-btn fr mr10">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div class="task-popup-submit02 clearfix" style="width:120px;">
|
||||
<a href="javascript:void(0);" id="choose_course_group_submit" class="task-btn task-btn-orange fr sure">确定</a>
|
||||
<a href="javascript:void(0);" id="choose_course_group_submit" class="task-btn task-btn-blue fr sure">确定</a>
|
||||
<a href="javascript:void(0);" class="pop_close task-btn fr mr10 cancel">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -9,14 +9,14 @@
|
|||
</li>
|
||||
<% if @no_group_count > 0 %>
|
||||
<li data-option="noclass" data-course-id="<%= @course.id %>">
|
||||
<p class="p1"><span class = "ml15">未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
<p class="p1"><span>未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
</li>
|
||||
<% end %>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
<li class="<%= @group.id == group.id ? 'sheet' : '' %>" data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>" id = "setting_group_<%= group.id %>" >
|
||||
<p class="p1">
|
||||
<span class = "ml15"><%= group.name %></span>
|
||||
<span><%= group.name %></span>
|
||||
<em><%= group.members.count %></em>
|
||||
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
|
||||
</p>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<script>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
if($("#setting_group_<%= group.id %> span").width() == 96){
|
||||
if($("#setting_group_<%= group.id %> span").width() == 115){
|
||||
$("#setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
|
||||
}
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<div class="cl"></div>
|
||||
|
||||
<span id="upload_file_count_notice" class="fl c_red none"></span>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" style="margin-right: 27px;" id="submit_resource" onclick="submit_course_resource();hideModal();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" style="margin-right: 27px;" id="submit_resource" onclick="submit_course_resource();hideModal();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="$('#datetimepicker_mask').datetimepicker('destroy');hideModal();">取消</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
<% end %>
|
||||
</form>
|
||||
</ul>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fl" onclick="$('#update_position').submit();" >保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fl" onclick="$('#update_position').submit();" >保存</a>
|
||||
<a href="javascript:void(0);" class="task-btn fl ml10" >取消</a>
|
||||
<div class="cl"></div>
|
||||
<script>
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
'<input type="text" style="width:300px;" class="task task-height-40 panel-box-sizing fl color-grey" id="subtopic_name">' +
|
||||
'<div class="cl"></div>' +
|
||||
'</div>' +
|
||||
'<a href="javascript:void(0);" onclick="create_subtopic();" class="task-btn task-btn-orange fr">确定</a>' +
|
||||
'<a href="javascript:void(0);" onclick="create_subtopic();" class="task-btn task-btn-blue fr">确定</a>' +
|
||||
'<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fr mr10">取消</a>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
|
|
|
|||
|
|
@ -9,13 +9,13 @@
|
|||
<p class="p1"><span>全部学生</span><em class="setting_all_student_count"><%= @student_count %></em></p>
|
||||
</li>
|
||||
<li class="sheet" data-option="noclass" data-course-id="<%= @course.id %>">
|
||||
<p class="p1" ><span class = "ml15">未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
<p class="p1"><span>未分班</span><em class="setting_noGroup_student_count"><%= @no_group_count %></em></p>
|
||||
</li>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
|
||||
<p class="p1">
|
||||
<span class = "ml15"><%= group.name %></span>
|
||||
<span><%= group.name %></span>
|
||||
<em><%= group.members.count %></em>
|
||||
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
|
||||
</p>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<script>
|
||||
<% unless @course.course_groups.empty? %>
|
||||
<% @course.course_groups.each do |group| %>
|
||||
if($(".setting_group_<%= group.id %> span").width() == 96){
|
||||
if($(".setting_group_<%= group.id %> span").width() == 115){
|
||||
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
|
||||
}
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" style="" onclick="submit_add_student_form()">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" style="" onclick="submit_add_student_form()">确定</a>
|
||||
<a href="javascript:void(0);" class="pop_close task-btn fr mr10" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<table class="edu-pop-table color-grey3 edu-txt-center table-pa5 interval-td" style="border:none;" cellspacing="0" cellpadding="0" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="10%">
|
||||
<th>
|
||||
<span class="selectjoin fl open-select ml15" id="allselect">
|
||||
<% unless is_teacher %>
|
||||
序号
|
||||
|
|
@ -11,14 +11,14 @@
|
|||
<% end %>
|
||||
</span>
|
||||
</th>
|
||||
<th width="14%">用户ID</th>
|
||||
<th width="10%">姓名</th>
|
||||
<th width="12%">学号</th>
|
||||
<th width="10%">分班</th>
|
||||
<th width="13%" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis">作业成绩</th>
|
||||
<th width="10%">发布资源</th>
|
||||
<th width="10%">发布帖子</th>
|
||||
<th width="10%">回复评论</th>
|
||||
<th>用户ID</th>
|
||||
<th>姓名</th>
|
||||
<th>学号</th>
|
||||
<th>分班</th>
|
||||
<th>作业成绩</th>
|
||||
<th>发布资源</th>
|
||||
<th>发布帖子</th>
|
||||
<th>回复评论</th>
|
||||
<!--<th>操作</th>-->
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
|
|||
|
|
@ -2,14 +2,14 @@
|
|||
<a href='<%= praise_tread_praise_plus_path({:obj_id => discuss.id,
|
||||
:obj_type => discuss.class
|
||||
}) %>' data-remote="true" data-tip-down="点赞" class="fr mt5">
|
||||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<i class="fa fa-thumbs-up color_Purple_grey"></i>
|
||||
<%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %>
|
||||
</a>
|
||||
<% else %>
|
||||
<a href='<%= praise_tread_praise_minus_path({:obj_id => discuss.id,
|
||||
:obj_type => discuss.class
|
||||
}) %>' data-remote="true" class="fr mt5" data-tip-down="取消点赞" >
|
||||
<i class="fa fa-thumbs-up mr5"></i>赞
|
||||
<i class="fa fa-thumbs-up color-light-green"></i>
|
||||
<%= discuss.praise_tread_cache ? (discuss.praise_tread_cache.praise_num == 0 ? "" : discuss.praise_tread_cache.praise_num ) : "" %>
|
||||
</a>
|
||||
<% end %>
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="panel-form-width2-690 fl panel-box-sizing undis" placeholder="请输入单选题的题干"><%=exercise_question.question_title.html_safe %></textarea>
|
||||
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入单选题的题干" type="text" oninput="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
</li>
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix pr mb20">
|
||||
|
|
@ -55,10 +55,10 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" onclick="edit_poll_question($(this),<%= exercise_question.id %>,1);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,1);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end%>
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
<input style="display: none;" name="exercise_choice" id="exercise_choice_<%=exercise_question.id%>" value="<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>"/>
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="panel-form-width2-690 fl panel-box-sizing undis"><%=exercise_question.question_title.html_safe %></textarea>
|
||||
<textarea name="question_title" id="poll_questions_title_<%=exercise_question.id %>" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入多选题的题干" type="text" oninput="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
</li>
|
||||
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
|
|
@ -60,7 +60,7 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" onclick="edit_poll_question($(this),<%= exercise_question.id %>,2);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,2);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -6,26 +6,7 @@
|
|||
<textarea id="mustBe" name="exercise[exercise_description]" class="panel-box-sizing panel-form-width-100" placeholder="试卷须知:共有选择、填空、简答3种题型,其中选择题包括单选题和多选题;您可以在此处填写本次试卷答题的相关说明"><%= @exercise.try(:exercise_description) %></textarea>
|
||||
</div>
|
||||
<p class="fr">
|
||||
<a href="javascript:void(0)" onclick="ex_head_submit($(this));" class="fr task-btn mr15 task-btn-orange">保存</a>
|
||||
<a href="javascript:void(0)" onclick="ex_head_submit($(this));" class="fr task-btn mr15 task-btn-blue">保存</a>
|
||||
<a href="javascript:void(0)" onclick="ex_head_cancel();" class="fr task-btn mr10">取消</a>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$("#exercise_head_edit").on("keydown", "input[name='exercise[exercise_name]']", function(event){
|
||||
var code;
|
||||
if (!event) {
|
||||
event = window.event; //针对ie浏览器
|
||||
code = event.keyCode;
|
||||
}
|
||||
else {
|
||||
code = event.keyCode;
|
||||
}
|
||||
if(code == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
|
|
@ -13,11 +13,11 @@
|
|||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing undis" name="question_title" id="poll_questions_title_<%=exercise_question.id %>"><%=exercise_question.question_title.html_safe %></textarea>
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing" name="question_title" id="poll_questions_title_<%=exercise_question.id %>" placeholder="请输入简答题的题干" type="text" oninput="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
</li>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="option_spans">参考答案</span></label>
|
||||
<textarea class="fl panel-box-sizing with90 task-height-150 pl5 pt5 candiate_answer" name="exercise_choice" placeholder="如有参考答案,请输入参考答案" id="poll_questions_answer_<%=exercise_question.id %>"><%=exercise_question.exercise_standard_answers.empty? ? '' : exercise_question.exercise_standard_answers.first.answer_text %></textarea>
|
||||
<textarea class="fl panel-box-sizing with90 task-height-150 pl5 pt5 candiate_answer" name="exercise_choice" placeholder="如有参考答案,请输入参考答案"id="poll_questions_answer_<%=exercise_question.id %>"><%=exercise_question.exercise_standard_answers.empty? ? '' : exercise_question.exercise_standard_answers.first.answer_text %></textarea>
|
||||
</li>
|
||||
<li class="clearfix mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
<p class="fr">
|
||||
<span class="font-12 color-grey" style="display: block;">温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分</span>
|
||||
<span class="font-12 color-grey mb10 ml50" style="display: block;"> 参考答案仅作为人工评分的参考</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" onclick="edit_poll_question($(this),<%= exercise_question.id %>,4);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" onclick="edit_poll_question($(this),<%= exercise_question.id %>,4);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<input name="question_type" value="3" type="hidden">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<input name="question_type" value="<%=exercise_question.question_type %>" type="hidden">
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing questionTitle undis" name="question_title" id="poll_questions_title_<%=exercise_question.id %>"><%=exercise_question.question_title.html_safe %></textarea>
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing questionTitle" name="question_title" id="poll_questions_title_<%=exercise_question.id %>" placeholder="请输入填空题的题干(注意:目前仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title_<%=exercise_question.id %>',30)"><%=exercise_question.question_title %></textarea>
|
||||
</li>
|
||||
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix pr mb20">
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange"onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue"onclick="edit_poll_question($(this),<%= exercise_question.id %>,3);">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$('#edit_poll_questions_<%=exercise_question.id %>').hide();$('#show_poll_questions_<%=exercise_question.id %>').show();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20" id="exercise_head">
|
||||
<div class="<%= is_edit ? '' : 'none' %>" id="exercise_head_show">
|
||||
<%= render :partial => 'show_head', :locals => {:exercise => @exercise} %>
|
||||
|
|
|
|||
|
|
@ -1,356 +0,0 @@
|
|||
<% edit_mode = @is_new && @is_teacher %>
|
||||
<div id="homework_publish_setting">
|
||||
<!--发布设置-->
|
||||
<div>
|
||||
<div class="<%= edit_mode ? 'none' : '' %>" id="show_exercise_setting">
|
||||
<div class="bor-bottom-greyE pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt5">发布设置</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="javascript:void(0);" class="white-btn orange-btn fr mr15 mt15" title="编辑" onclick="show_ex_edit_setting();">编辑</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<li class="clearfix mb15 edu-position pl30">
|
||||
<label class="panel-form-label fl mr10">发布时间</label>
|
||||
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" value="<%= format_time @exercise.publish_time %>" disabled>
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>发布之前,学生不会收到试卷</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix mb15 edu-position pl30">
|
||||
<label class=" panel-form-label fl mr10">截止时间</label>
|
||||
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_end_time" value="<%= format_time @exercise.end_time %>" disabled>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<!--<li class="clearfix mb15 edu-position pl30">-->
|
||||
<!--<label class=" panel-form-label fl mr10">结束时间</label>-->
|
||||
<!--<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_archive_time" value="" disabled="">-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>结束之后,系统自动归档试卷</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bor-bottom-greyE pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt10">答题设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30" style="padding-bottom:20px;">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">答题时长</label>-->
|
||||
<!--<input type="text" value="<%#= @exercise.time.to_i == -1 ? '' : @exercise.time %>" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg">-->
|
||||
<!--<label class="fl mt8 ml5">分钟</label>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>答题时长不填写,则表示不限时长</p>-->
|
||||
<!--<p>学生答题时间即使没有超过答题时长的限制</p>-->
|
||||
<!--<p>但是已到截止时间点,则系统自动为正在答题的学生提交试卷</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix mb20 edu-position pl30">
|
||||
<label class="panel-form-label fl mr10">答题显示</label>
|
||||
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_1" disabled type="checkbox" <%= @exercise.question_random == 1 ? 'checked' : '' %>>
|
||||
<label class="fl" for="dt_1">题目顺序随机打乱</label>
|
||||
<span class="fl color-grey mt5">(选中则学生答题时,题目顺序按照题型随机显示)</span>
|
||||
<div class="cl"></div>
|
||||
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_2" disabled type="checkbox" <%= @exercise.choice_random == 1 ? 'checked' : '' %>>
|
||||
<label class="fl" for="dt_2" style="margin-left: 11%;">选项顺序随机打乱</label>
|
||||
<span class="fl color-grey mt5">(选中则学生答题时,选项顺序随机显示)</span>
|
||||
</li>
|
||||
</ul>
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">补交答题</label>-->
|
||||
<!--<input id="edit_allow_late_1" disabled="" class="magic-radio fl" type="radio" name="homework_allow_late" value="1">-->
|
||||
<!--<label for="edit_allow_late_1" class="fl mr30">允许</label>-->
|
||||
<!--<input id="edit_allow_late_0" disabled="" class="magic-radio fl" type="radio" name="homework_allow_late" value="0" checked="">-->
|
||||
<!--<label for="edit_allow_late_0" class="fl">禁止</label>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>允许补交,则在补交截止日期之前,未答题的学生可以补交答题</p>-->
|
||||
<!--<p>但是在发布截止日期~补交截止时间内才答题的学生,将被扣迟交分</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">截止时间</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">迟交扣分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bor-bottom-greyE pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt10">公开设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30 mb15">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10"> </label>
|
||||
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled <%= @exercise.score_open ? 'checked' : '' %>>
|
||||
<label class="fl">公开成绩</label>
|
||||
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开)</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10"> </label>
|
||||
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled <%= @exercise.answer_open ? 'checked' : '' %>>
|
||||
<label class="fl">公开答案</label>
|
||||
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开)</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_exercise_setting">
|
||||
<%= form_tag(ex_setting_exercise_path(@exercise), :method => "post", :id => 'exercise_setting_form') do |f| %>
|
||||
<div class="bor-bottom-greyE pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt5">发布设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<li class="clearfix mb15 edu-position pl30">
|
||||
<label class="panel-form-label fl mr10">发布时间</label>
|
||||
<input type="text" name="exercise_publish_time" readonly value="<%= format_time @exercise.publish_time %>" <%= @exercise.try(:exercise_status) > 1 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @exercise.try(:exercise_status) > 1 ? 'disabled-bg' : '' %>" placeholder="请选择发布时间">
|
||||
<span class="color-orange fl ml20 mt5 none" id="exercise_publish_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
|
||||
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p>发布之前,学生不会收到试卷</p>
|
||||
</div>
|
||||
</li>
|
||||
<li class="clearfix mb15 edu-position pl30">
|
||||
<label class="panel-form-label fl mr10">截止时间</label>
|
||||
<input type="text" name="exercise_end_time" readonly value="<%= format_time @exercise.end_time %>" <%= @exercise.try(:exercise_status) == 3 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @exercise.try(:exercise_status) == 3 ? 'disabled-bg' : '' %>" placeholder="请选择截止时间">
|
||||
<span class="color-orange fl ml20 mt5 none" id="exercise_end_time_notice">
|
||||
<i class="fa fa-exclamation-circle mr5 color-orange"></i>
|
||||
</span>
|
||||
<span class="color-orange fl mt5 none">不能早于发布时间</span>
|
||||
</li>
|
||||
<!--<li class="clearfix mb15 edu-position pl30">-->
|
||||
<!--<label class=" panel-form-label fl mr10">结束时间</label>-->
|
||||
<!--<input type="text" name="homework_archive_time" readonly="" value="" class=" fl task-form-15 task-height-40 panel-box-sizing" placeholder="请选择结束时间">-->
|
||||
<!--<span class="color-orange fl ml20 mt5 none" id="homework_archive_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>结束之后,系统自动归档试卷</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bor-bottom-greyE pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt10">答题设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30" style="padding-bottom:20px;">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">答题时长</label>-->
|
||||
<!--<input type="text" name="time" <%#= @exercise.try(:exercise_status) == 3 ? 'disabled' : '' %> value="<%#= @exercise.time.to_i == -1 ? '' : @exercise.time %>" class="fl task-form-15 task-height-40 panel-box-sizing">-->
|
||||
<!--<label class="fl mt8 ml5">分钟</label>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>答题时长不填写,则表示不限时长</p>-->
|
||||
<!--<p>学生答题时间即使没有超过答题时长的限制</p>-->
|
||||
<!--<p>但是已到截止时间点,则系统自动为正在答题的学生提交试卷</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix mb20 edu-position pl30">
|
||||
<label class="panel-form-label fl mr10">答题显示</label>
|
||||
<input name="question_random" <%= @exercise.try(:exercise_status) == 3 ? 'disabled' : '' %> class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_3" type="checkbox" <%= @exercise.question_random == 1 ? 'checked' : '' %>>
|
||||
<label class="fl" for="dt_3">题目顺序随机打乱</label>
|
||||
<span class="fl color-grey mt5">(选中则学生答题时,题目顺序按照题型随机显示)</span>
|
||||
<div class="cl"></div>
|
||||
<input name="choice_random" <%= @exercise.try(:exercise_status) == 3 ? 'disabled' : '' %> class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_4" type="checkbox" <%= @exercise.choice_random == 1 ? 'checked' : '' %>>
|
||||
<label class="fl" for="dt_4" style="margin-left: 11%;">选项顺序随机打乱</label>
|
||||
<span class="fl color-grey mt5">(选中则学生答题时,选项顺序随机显示)</span>
|
||||
</li>
|
||||
</ul>
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">补交答题</label>-->
|
||||
<!--<input id="edit_allow_late_2" class="magic-radio fl" type="radio" name="homework_allow_late_1" value="1">-->
|
||||
<!--<label for="edit_allow_late_2" class="fl mr30 mt3">允许</label>-->
|
||||
<!--<input id="edit_allow_late_3" class="magic-radio fl" type="radio" name="homework_allow_late_1" value="0" checked="">-->
|
||||
<!--<label for="edit_allow_late_3" class="fl mt3">禁止</label>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>允许补交,则在补交截止日期之前,未答题的学生可以补交答题</p>-->
|
||||
<!--<p>但是在发布截止日期~补交截止时间内才答题的学生,将被扣迟交分</p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">截止时间</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">迟交扣分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt10 pb10 pr10">
|
||||
<div class="clearfix mb15">
|
||||
<p class="ml15 fl font-16 mt10">公开设置</p>
|
||||
</div>
|
||||
<div class="ml30 mr30">
|
||||
<div class="clearfix">
|
||||
<ul>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10"> </label>
|
||||
<input name="score_open" class="magic-checkbox fl magic-checkbox_show" type="checkbox" id="public_scroe" <%= @exercise.score_open ? 'checked' : '' %>>
|
||||
<label class="fl" for="public_scroe" style="top:0px">公开成绩</label>
|
||||
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开)</span>
|
||||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl mr10"> </label>
|
||||
<input name="answer_open" class="magic-checkbox fl magic-checkbox_show" type="checkbox" id="public_answer" <%= @exercise.answer_open ? 'checked' : '' %>>
|
||||
<label class="fl" for="public_answer" style="top:0px">公开答案</label>
|
||||
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开)</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--主观题评分设置-->
|
||||
<!--<div class="bor-bottom-greyE pt10 pb10 pr10">-->
|
||||
<!--<div class="none" id="show_late_setting">-->
|
||||
<!--<div class="clearfix mb15">-->
|
||||
<!--<p class="ml15 fl font-16 mt10">主观题评分设置</p>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="ml30 mr30" style="padding-bottom:20px;">-->
|
||||
<!--<div class="clearfix">-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">助教评分</label>-->
|
||||
<!--<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_1" name="zg[]_1" disabled="" type="radio" checked="">-->
|
||||
<!--<label class="fl" for="zg_1">普通模式</label>-->
|
||||
<!--<span class="fl color-grey mt5">(选中则取各助教最终评分的平均分)</span>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_2" name="zg[]_1" disabled="" type="radio">-->
|
||||
<!--<label class="fl" for="zg_2" style="margin-left: 11%;">复审模式</label>-->
|
||||
<!--<span class="fl color-grey mt5">(选中则只取最终次的助教评分)</span>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">最终成绩</label>-->
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>计算说明</p>-->
|
||||
<!--<p class="mb10">教师评分*其百分比+助教评分+其百分比+迟交扣分</p>-->
|
||||
<!--<p>注意</p>-->
|
||||
<!--<p>非零百分比的评分选项,在没有评分记录的情况下,其百分比平摊到另外</p><p>的评分选项上。例如教师评分60% + 助教评分40% ,学生A没有得到</p><p>教师评分,则最终成绩将按照助教评分100% 进行计算 </p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">教师评分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">-->
|
||||
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">助教评分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="" id="edit_late_setting">-->
|
||||
<!--<div class="clearfix mb15">-->
|
||||
<!--<p class="ml15 fl font-16 mt10">主观题评分设置</p>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="ml30 mr30" style="padding-bottom:20px;">-->
|
||||
<!--<div class="clearfix">-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">助教评分</label>-->
|
||||
<!--<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_3" name="zg[]_2" type="radio" checked="">-->
|
||||
<!--<label class="fl" for="zg_3">普通模式</label>-->
|
||||
<!--<span class="fl color-grey mt5">(选中则取各助教最终评分的平均分)</span>-->
|
||||
<!--<div class="cl"></div>-->
|
||||
<!--<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_4" name="zg[]_2" type="radio" checked="">-->
|
||||
<!--<label class="fl" for="zg_4" style="margin-left: 11%;">复审模式</label>-->
|
||||
<!--<span class="fl color-grey mt5">(选中则只取最终次的助教评分)</span>-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--<ul>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10">最终成绩</label>-->
|
||||
|
||||
<!--<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">-->
|
||||
<!--<em></em>-->
|
||||
<!--<span></span>-->
|
||||
<!--<p>计算说明</p>-->
|
||||
<!--<p class="mb10">教师评分*其百分比+助教评分*其百分比-迟交扣分</p>-->
|
||||
<!--<p>注意</p>-->
|
||||
<!--<p>非零百分比的评分选项,在没有评分记录的情况下,其百分比平摊到另外</p><p>的评分选项上。例如教师评分60% + 助教评分40% ,学生A没有得到</p><p>教师评分,则最终成绩将按照助教评分100% 进行计算 </p>-->
|
||||
<!--</div>-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">教师评分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--<li class="clearfix mb20 edu-position pl30">-->
|
||||
<!--<label class="panel-form-label fl mr10"> </label>-->
|
||||
<!--<label class="mt8 fl mr10">助教评分</label>-->
|
||||
<!--<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">-->
|
||||
<!--</li>-->
|
||||
<!--</ul>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<div class="clearfix mt15 mb15 mr15 pr10 <%= edit_mode ? '' : 'none' %>" id="exam_setting_submit_block">
|
||||
<a href="javascript:void(0);" onclick="ex_setting_form_submit();" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_exercise_list_exercise_path(@exercise) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -82,7 +82,7 @@
|
|||
|
||||
<div class="clearfix ml15 mt10 mb15">
|
||||
<% question_list.each_with_index do |eq, index| %>
|
||||
<a href="#mao<%= index + 1 %>" style="cursor:pointer" id="ex_commit_status_<%= eq.id %>" class="checkstatus_box_big <%= User.current.exercise_answer.where(:exercise_question_id => eq.id).count > 0 ? 'post_btn_white' : 'post_btn_grey' %>"><%= index + 1 %></a>
|
||||
<span id="ex_commit_status_<%= eq.id %>" class="checkstatus_box_big <%= User.current.exercise_answer.where(:exercise_question_id => eq.id).count > 0 ? 'post_btn_white' : 'post_btn_grey' %>"><%= index + 1 %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -90,9 +90,9 @@
|
|||
<% question_list.each_with_index do |exercise_question, i| %>
|
||||
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
|
||||
<div class="clearfix pl15 pr15">
|
||||
<p class="fl font-15" id="mao<%=i+1 %>">第<%= i + 1 %>题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>]</span><span class="ml10"><%= exercise_question.question_score %></span>分</p>
|
||||
<p class="fl font-15">第<%= i + 1 %>题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>]</span><span class="ml10"><%= exercise_question.question_score %></span>分</p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 pr15"><%= exercise_question.question_title %></pre>
|
||||
<% case exercise_question.question_type %>
|
||||
<% when 1 %>
|
||||
<div class="pl15 pr15 mb15">
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
<div class="clearfix ml80 mt10 mb5">
|
||||
<% @exercise.exercise_questions.where(:question_type => [1, 2, 3]).each_with_index do |eq, index| %>
|
||||
<% is_correct = answer_is_correct(eq, user) %>
|
||||
<a href="#mao<%= eq.question_number%>" style="cursor:pointer" class="checkstatus_box_big color_white <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.question_number %></a>
|
||||
<span class="checkstatus_box_big <%= is_correct ? 'post_btn_green' : 'post_btn_red' %>"><%= eq.question_number %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
<div class="clearfix ml80 mt10 mb15">
|
||||
<% @exercise.exercise_questions.where(:question_type => 4).each_with_index do |eq, index| %>
|
||||
<% ea = User.current.exercise_answer.where(:exercise_question_id => eq.id).first %>
|
||||
<a href="#mao<%= eq.question_number%>" style="cursor:pointer" id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score != -1) ? 'post_btn_white' : 'post_btn_grey' %>"><%= eq.question_number %></a>
|
||||
<span id="ex_comment_status_<%= eq.id %>" class="checkstatus_box_big <%= (ea && ea.score != -1) ? 'post_btn_white' : 'post_btn_grey' %>"><%= eq.question_number %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
<% @exercise.exercise_questions.each_with_index do |exercise_question, i| %>
|
||||
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
|
||||
<div class="clearfix pl15 pr15">
|
||||
<p class="fl font-15" id="mao<%= exercise_question.question_number %>">第<%= exercise_question.question_number %>题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>]</span><span class="ml10"><%= exercise_question.question_score %>分</span><span class="ml10 color-red"><%= question_commit_status exercise_question, @exercise_user.user %></span></p>
|
||||
<p class="fl font-15">第<%= exercise_question.question_number %>题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>]</span><span class="ml10"><%= exercise_question.question_score %>分</span><span class="ml10 color-red"><%= question_commit_status exercise_question, @exercise_user.user %></span></p>
|
||||
<% if exercise_question.question_type != 4 %>
|
||||
<% is_correct = answer_is_correct(exercise_question, user) %>
|
||||
<p class="fr"><span class="<%= is_correct ? 'color-light-green' : 'color-red' %> mr3"><i class="mr5 fa <%= is_correct ? 'fa-check' : 'fa-close' %> font-14"></i><%= is_correct ? exercise_question.question_score : 0 %></span>分</p>
|
||||
|
|
@ -75,11 +75,11 @@
|
|||
<p class="fr" id="multi_q_score_<%= exercise_question.id %>"><span class="<%= answer.empty? ? 'color-red' : (answer.first.score == -1 || answer.first.score == 0 ? "color-red" : "color-light-green") %> mr3"><%= answer.empty? ? 0 : (answer.first.score == -1 ? "未批" : answer.first.score) %></span><%= answer.empty? ? "分" : (answer.first.score == -1 ? "" : "分") %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 pr15"><%= exercise_question.question_title %></pre>
|
||||
<% case exercise_question.question_type %>
|
||||
<% when 1 %>
|
||||
<div class="pl15 pr15 mb15">
|
||||
<% exercise_choices = exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices = @exercise.choice_random == 1 ? exercise_question.exercise_choices.shuffle : exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices.each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-radio fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="radio" disabled <%= answer_be_selected?(exercise_choice,user) ? "checked" : "" %>>
|
||||
|
|
@ -94,7 +94,7 @@
|
|||
<% end %>
|
||||
<% when 2 %>
|
||||
<div class="pl15 pr15 mb15">
|
||||
<% exercise_choices = exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices = @exercise.choice_random == 1 ? exercise_question.exercise_choices.shuffle : exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices.each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-checkbox fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="checkbox" disabled <%= answer_be_selected?(exercise_choice,user) ? "checked" : "" %>>
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@
|
|||
<li><%= link_to "编辑", edit_exercise_path(exercise) %></li>
|
||||
<% end %>
|
||||
<!--<li><%#= link_to "预览", exercise_path(exercise) %></li>-->
|
||||
<li><%= link_to "设置", student_exercise_list_exercise_path(exercise, :tab => 3) %></li>
|
||||
<li><%= link_to "设置", setting_exercise_path(exercise) %></li>
|
||||
<li><%= link_to "导出成绩", student_exercise_list_exercise_path(exercise.id,:course_id => @course.id, :format => 'xls') %></li>
|
||||
<% unless exercise.is_public %>
|
||||
<li id="set_exercise_public_<%= exercise.id %>">
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
<% if exercise.id %>
|
||||
<div nhname="new_exercise_mc_q">
|
||||
<% eq = ExerciseQuestion.new %>
|
||||
<%= form_for(eq,
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
:html => {:multipart => true},
|
||||
:url => create_exercise_question_exercise_path(exercise.id),
|
||||
:remote => true ) do |f| %>
|
||||
|
|
@ -14,9 +12,7 @@
|
|||
</div>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<!--<textarea name="question_title" id="poll_questions_title" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入单选题的题干" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>-->
|
||||
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
|
||||
|
||||
<textarea name="question_title" id="poll_questions_title" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入单选题的题干" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
|
||||
</li>
|
||||
<input style="display: none;" name="exercise_choice" id="exercise_choice_1"/>
|
||||
<li class="clearfix pr mb20">
|
||||
|
|
@ -55,14 +51,13 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<% if exercise.id %>
|
||||
<div nhname="new_exercise_mc_q">
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
:html => { :multipart => true },
|
||||
:url=>create_exercise_question_exercise_path(exercise.id),
|
||||
:remote=>true ) do |f| %>
|
||||
|
|
@ -14,7 +13,7 @@
|
|||
</div>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
|
||||
<textarea name="question_title" id="poll_questions_title" class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入多选题的题干" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
|
||||
</li>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl">
|
||||
|
|
@ -50,13 +49,12 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -12,6 +12,6 @@
|
|||
<textarea id="mustBe" name="exercise[exercise_description]" class="panel-box-sizing panel-form-width-100" placeholder="试卷须知:共有选择、填空、简答3种题型,其中选择题包括单选题和多选题;您可以在此处填写本次试卷答题的相关说明"><%= @exercise.try(:exercise_description) %></textarea>
|
||||
</div>
|
||||
<p class="fr">
|
||||
<a href="javascript:void(0)" onclick="ex_head_submit($(this));" class="fr task-btn mr15 task-btn-orange">保存</a>
|
||||
<a href="javascript:void(0)" onclick="ex_head_submit($(this));" class="fr task-btn mr15 task-btn-blue">保存</a>
|
||||
</p>
|
||||
<% end %>
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
<% if exercise.id %>
|
||||
<div nhname="new_exercise_mc_q">
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
:html => { :multipart => true },
|
||||
:url=>create_exercise_question_exercise_path(exercise.id),
|
||||
:remote=>true ) do |f| %>
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
<input name="quest_id" id="quest_id" value="0" type="hidden">
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing" name="question_title" id="poll_questions_title" placeholder="请输入简答题的题干" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
|
||||
</li>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="option_spans">参考答案</span></label>
|
||||
|
|
@ -24,13 +23,12 @@
|
|||
<p class="fr">
|
||||
<span class="font-12 color-grey" style="display: block;">温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分</span>
|
||||
<span class="font-12 color-grey mb10 ml50" style="display: block;"> 参考答案仅作为人工评分的参考</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -1,34 +1,9 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_MC();">+ 单选题</a>
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_MCQ();">+ 多选题</a>
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_single();">+ 填空题</a>
|
||||
<a href="javascript:void(0);" class="fl add_item_part" onclick="add_multi();">+ 简答题</a>
|
||||
|
||||
<div id="hidden_div_block" class="undis">
|
||||
<textarea style="display: none" id="hidden_textarea"></textarea>
|
||||
</div>
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_MC();"><i class="fa fa-plus-circle color-light-green mr5"></i>单选题</a>
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_MCQ();"><i class="fa fa-plus-circle color-light-green mr5"></i>多选题</a>
|
||||
<a href="javascript:void(0);" class="fl mr20 add_item_part" onclick="add_single();"><i class="fa fa-plus-circle color-light-green mr5"></i>填空题</a>
|
||||
<a href="javascript:void(0);" class="fl add_item_part" onclick="add_multi();"><i class="fa fa-plus-circle color-light-green mr5"></i>简答题</a>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
KindEditor.ready(function(K){
|
||||
$("#hidden_div_block").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.placeholder = "请输入单选题的题干";
|
||||
|
||||
params.textarea = $("#hidden_textarea",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
//new_quetion_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function add_MC(){
|
||||
var forms = $("form.new_exercise_question");
|
||||
if($("#exercise_head_edit").is(":visible")){
|
||||
|
|
@ -36,27 +11,10 @@
|
|||
}else if(forms.length > 0){
|
||||
notice_box("请先保存正在编辑的题目再新建。");
|
||||
} else{
|
||||
//$.get("<%#= new_exercise_question_path(:exercise => @exercise, :type => "MC") %>");
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MC', :locals => {:exercise=>@exercise}) %>");
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入单选题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
//div_form = $("div[nhname='new_exercise_mc_q']");
|
||||
//$(".ke-edit", div_form).css("height","48px");
|
||||
$("#poll_questions_title").focus();
|
||||
//sd_create_editor_from_data(<%#= @exercise.id %>, null, "100%", "<%#= @exercise.class.to_s %>");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -69,24 +27,6 @@
|
|||
} else{
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_MCQ', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#poll_questions_title").focus();
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入多选题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -99,24 +39,6 @@
|
|||
} else{
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_single', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#poll_questions_title").focus();
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入填空题的题干(注意:目前仅支持一个空)";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -129,24 +51,6 @@
|
|||
} else{
|
||||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_multi', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#poll_questions_title").focus();
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入简答题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<% if exercise.id %>
|
||||
<div nhname="new_exercise_mc_q">
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
<%= form_for(ExerciseQuestion.new,
|
||||
:html => { :multipart => true },
|
||||
:url=>create_exercise_question_exercise_path(exercise.id),
|
||||
:remote=>true ) do |f| %>
|
||||
|
|
@ -10,7 +9,7 @@
|
|||
<input name="question_type" value="3" type="hidden">
|
||||
<input name="quest_id" id="quest_id" value="0" type="hidden">
|
||||
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
|
||||
<textarea id="poll_questions_title" name="question_title" class="panel-form-width2-690 fl panel-box-sizing undis"></textarea>
|
||||
<textarea maxlength="250" class="panel-form-width2-690 fl panel-box-sizing" name="question_title" id="poll_questions_title" placeholder="请输入填空题的题干(注意:目前仅支持一个空)" type="text" oninput="autoHeight('#poll_questions_title',30)"></textarea>
|
||||
</li>
|
||||
<li class="clearfix pr mb20">
|
||||
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 一</span></label>
|
||||
|
|
@ -33,13 +32,12 @@
|
|||
<label class="fl" style="line-height: 40px;">分</label>
|
||||
<p class="fr">
|
||||
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案</span>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-orange" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().parent().remove();">取消</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn task-btn-blue" id="add_new_question">保存</a>
|
||||
<a href="javascript:void(0)" class="fr task-btn mr10" onclick="$(this).parent().parent().parent().parent().remove();">取消</a>
|
||||
</p>
|
||||
</li>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
|
|
|
|||
|
|
@ -1,36 +1,48 @@
|
|||
<div class="task-popup" style="width:620px;">
|
||||
<div class="task-popup-title clearfix">
|
||||
<h3 class="fl color-grey3">试卷选用</h3>
|
||||
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
|
||||
<div id="muban_popup_box" style="width:745px;">
|
||||
<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="task-popup-content">
|
||||
<div class="clearfix mb15 test_nav_content">
|
||||
<a href="javascript:void(0)" class="edu-filter-cir-grey mr20 active fl">我的试卷</a>
|
||||
<!--<a href="javascript:void(0)" class="edu-filter-cir-grey mr20 fl">公共试卷</a>-->
|
||||
<div class="edu-find fr with40 mr20 pr">
|
||||
<div class="edu-find-input">
|
||||
<input type="text" class="with100 panel-box-sizing" name="search" maxlength="40" placeholder="输入试卷标题的关键字进行搜索" id="exercise_list_name_search">
|
||||
<span class="edu-close" onclick="colse_searchbox();" style="top:-4px" data-tip-down="关闭">×</span>
|
||||
</div>
|
||||
<a href="javascript:void(0);" style="top:-1px" class="edu-open font-16 color-grey" onclick="search_exercise_list();"><i class="fa fa-search"></i></a>
|
||||
<div class="muban_popup_con">
|
||||
<div class="newupload_conbox">
|
||||
<div class="newupload_search_box mb10">
|
||||
<input class="newupload_search_input" placeholder="输入试卷标题的关键词进行搜索" name="search" type="text">
|
||||
<a href="javascript:void(0);" class="newupload_btn_search"></a>
|
||||
</div>
|
||||
</div>
|
||||
<!--我的试卷-->
|
||||
<%=form_tag import_other_exercise_exercise_index_path,
|
||||
method: :post,
|
||||
remote: true,
|
||||
id: "import_other_exercise_form" do %>
|
||||
<input type="hidden" name="course_id" value="<%= @course_id%>" />
|
||||
<div class="test_content" id="test_nav_1">
|
||||
<%= render :partial => "select_examination_list" %>
|
||||
<input type="hidden" name="course_id" value="<%= course_id%>" />
|
||||
<div class="ml15">
|
||||
<div id="all_import_exercises">
|
||||
<%=render :partial => 'all_import_exercises', :locals => {:exercises => exercises, :course_id => course_id, :order => @order} %>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<p class="none c_red" id="choose_exercise_notice"></p>
|
||||
<div class="clear mr15 mt10">
|
||||
<a href="javascript:void(0)" class="btn btn-blue fr" onclick="submit_import_form();">确定</a>
|
||||
<a href="javascript:void(0)" class="btn fr mr5" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
<div class="fr mr10">
|
||||
<div class="pages" style="width:auto; display:inline-block;">
|
||||
<ul id="exercise_ref_pages">
|
||||
<%= pagination_links_full @ex_pages, @ex_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
function submit_import_form(){
|
||||
var checkboxs = $("input[name='exercise_id']:checked");
|
||||
var checkboxs = $("input[name='exercise_id[]']:checked");
|
||||
if(checkboxs.length > 0) {
|
||||
$("#choose_exercise_notice").html("");
|
||||
$('#import_other_exercise_form').submit();
|
||||
|
|
@ -41,39 +53,29 @@
|
|||
}
|
||||
}
|
||||
|
||||
function search_exercise_list(){
|
||||
var lastSearchCondition = '';
|
||||
var count = 0;
|
||||
function search_exs(e){
|
||||
if($(e.target).val().trim() == lastSearchCondition && lastSearchCondition != '')
|
||||
{
|
||||
return;
|
||||
}
|
||||
lastSearchCondition = $(e.target).val().trim();
|
||||
$.ajax({
|
||||
url: '/exercise/other_exercise?search='+ $("#exercise_list_name_search").val() +'&course_id=<%=@course_id %>',
|
||||
type: 'get',
|
||||
remote: true,
|
||||
success: function(data){
|
||||
}
|
||||
url: '<%= url_for(:controller => 'exercise', :action => 'search_exercises') %>'+'?name='+ e.target.value+'&course_id=<%=course_id %>',
|
||||
type:'get'
|
||||
});
|
||||
}
|
||||
|
||||
//清空搜索框
|
||||
function colse_searchbox(){
|
||||
if($("#exercise_list_name_search").val().trim() == ""){
|
||||
return;
|
||||
}
|
||||
$("#exercise_list_name_search").val('');
|
||||
<% unless @search.blank? %>
|
||||
search_exercise_list();
|
||||
<% end %>
|
||||
function throttle(method,context,e){
|
||||
clearTimeout(method.tId);
|
||||
method.tId=setTimeout(function(){
|
||||
method.call(context,e);
|
||||
},500);
|
||||
}
|
||||
|
||||
$("input[name='search']").on("keydown", function(event){
|
||||
var code;
|
||||
if (!event) {
|
||||
event = window.event; //针对ie浏览器
|
||||
code = event.keyCode;
|
||||
}
|
||||
else {
|
||||
code = event.keyCode;
|
||||
}
|
||||
if(code == 13) {
|
||||
search_exercise_list();
|
||||
return false;
|
||||
}
|
||||
//查询项目
|
||||
$("input[name='search']").on('input', function (e) {
|
||||
throttle(search_exs,window,e);
|
||||
});
|
||||
</script>
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
<div class="mh400">
|
||||
<table class="edu-pop-table interval-td color-grey bor-grey-e" cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<% @exercises.each do |exercise| %>
|
||||
<tr>
|
||||
<td class="pl5 pr5">
|
||||
<input type="radio" name="exercise_id" value="<%= exercise.id %>" id="exercise_<%= exercise.id %>" class="ml-3 mr5 magic-radio">
|
||||
<label style="top:0px;line-height: 27px;width: 544px;" class="task-hide color-grey3" for="exercise_<%= exercise.id %>"><%= exercise.exercise_name %></label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="clearfix mt15">
|
||||
<p class="none c_red" id="choose_exercise_notice"></p>
|
||||
<div class="fl pages_little_show">
|
||||
<ul>
|
||||
<%= pagination_links_full @ex_pages, @ex_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div class="fr">
|
||||
<a href="javascript:void(0)" class="task-btn task-btn-orange fr" onclick="submit_import_form();">确定</a>
|
||||
<a href="javascript:void(0)" class="task-btn fr pop_close mr10" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
<a href="javascript:void(0)" onclick="exQuestionEdit(<%= exercise_question.id%>);"><i data-tip-down="编辑" class="fa fa-pencil color-orange05"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify upload_img table_maxWidth"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 pr15"><%= exercise_question.question_title %></pre>
|
||||
<div class="pl15 pr15 mb10">
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
|
|
@ -41,23 +41,11 @@
|
|||
} else{
|
||||
$("#insert_new_poll_question_"+quest_id).html("<%= escape_javascript(render :partial => 'new_MC', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#quest_id").val(quest_id);
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入单选题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
$("#poll_questions_title").focus();
|
||||
$(".questionTitle").on("input",function(){
|
||||
$(this).height(30);
|
||||
var scrollVal = $(this)[0].scrollHeight;
|
||||
$(this).height(scrollVal);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<a href="javascript:void(0)" onclick="exQuestionEdit(<%= exercise_question.id%>);"><i data-tip-down="编辑" class="fa fa-pencil color-orange05"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify upload_img table_maxWidth"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 pr15"><%= exercise_question.question_title %></pre>
|
||||
<div class="pl15 pr15 mb10">
|
||||
<% exercise_question.exercise_choices.reorder("choice_position").each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
|
|
@ -40,23 +40,11 @@
|
|||
} else {
|
||||
$("#insert_new_poll_question_"+quest_id).html("<%= escape_javascript(render :partial => 'new_MCQ', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#quest_id").val(quest_id);
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入多选题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
$("#poll_questions_title").focus();
|
||||
$(".questionTitle").on("input",function(){
|
||||
$(this).height(30);
|
||||
var scrollVal = $(this)[0].scrollHeight;
|
||||
$(this).height(scrollVal);
|
||||
});
|
||||
}
|
||||
}else {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<a href="javascript:void(0)" onclick="exQuestionEdit(<%= exercise_question.id%>);"><i data-tip-down="编辑" class="fa fa-pencil color-orange05"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify upload_img table_maxWidth"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 mb10 pr15"><%= exercise_question.question_title %></pre>
|
||||
<div class="clearfix bor-top-greyE padding15 answer_con">
|
||||
<p>参考答案:</p>
|
||||
<pre class="exercise_que_title" style="text-align:justify;"><%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%></pre>
|
||||
|
|
@ -33,23 +33,11 @@
|
|||
} else {
|
||||
$("#insert_new_poll_question_"+quest_id).html("<%= escape_javascript(render :partial => 'new_multi', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#quest_id").val(quest_id);
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入简答题的题干";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
$("#poll_questions_title").focus();
|
||||
$(".questionTitle").on("input",function(){
|
||||
$(this).height(30);
|
||||
var scrollVal = $(this)[0].scrollHeight;
|
||||
$(this).height(scrollVal);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
<a href="javascript:void(0)" onclick="exQuestionEdit(<%= exercise_question.id%>);"><i data-tip-down="编辑" class="fa fa-pencil color-orange05"></i></a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify upload_img table_maxWidth"><%= exercise_question.question_title.html_safe %></div>
|
||||
<pre class="exercise_que_title pl15 pr15"><%= exercise_question.question_title %></pre>
|
||||
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
|
||||
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
|
||||
<p>候选答案<%= convert_to_chi_num(index+1) %>:<%= exercise_choice.answer_text%></p>
|
||||
|
|
@ -34,23 +34,11 @@
|
|||
} else {
|
||||
$("#insert_new_poll_question_"+quest_id).html("<%= escape_javascript(render :partial => 'new_single', :locals => {:exercise=>@exercise}) %>");
|
||||
$("#quest_id").val(quest_id);
|
||||
KindEditor.ready(function(K){
|
||||
$("div[nhname='new_exercise_mc_q']").each(function(){
|
||||
var params = {};
|
||||
params.kindutil = K;
|
||||
params.div_form = $(this);
|
||||
params.form = $("form",params.div_form);
|
||||
params.placeholder = "请输入填空题的题干(注意:目前仅支持一个空)";
|
||||
if(params.form==undefined || params.form.length==0){
|
||||
return;
|
||||
}
|
||||
params.textarea = $("textarea[name='question_title']",params.div_form);
|
||||
if(params.textarea.data('init') == undefined) {
|
||||
params.editor = init_exercise_quetison_editor(params);
|
||||
new_quetion_title_editor = params.editor;
|
||||
params.textarea.data('init', 1);
|
||||
}
|
||||
});
|
||||
$("#poll_questions_title").focus();
|
||||
$(".questionTitle").on("input",function(){
|
||||
$(this).height(30);
|
||||
var scrollVal = $(this)[0].scrollHeight;
|
||||
$(this).height(scrollVal);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
|
||||
<p class="ml15 color-grey3 fl">编辑试卷</p>
|
||||
<%= link_to "返回", student_exercise_list_exercise_path(@exercise), :class => "fr font-12 color-grey mr15 mt5" %>
|
||||
<%#= link_to "设置", student_exercise_list_exercise_path(@exercise, :tab => 3), :class => "fr font-12 mr15 mt5 color-grey" %>
|
||||
<%= link_to "设置", setting_exercise_path(@exercise), :class => "fr font-12 mr15 mt5 color-grey" %>
|
||||
</div>
|
||||
|
||||
<%= render :partial => "exercise/edu_edit_form", :locals => {:is_edit => true} %>
|
||||
|
|
|
|||
|
|
@ -1 +1,9 @@
|
|||
notice_box_redirect("<%= student_exercise_list_exercise_path(@exercise, :tab => 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 muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>试卷已导入<br/>但需要您设置发布时间和截止时间,以激活相应的试卷<br/></p>' +
|
||||
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="click_OK();">知道了</a></div></div></div>';
|
||||
pop_box_new(htmlvalue, 400, 152);
|
||||
|
||||
function click_OK(){
|
||||
hideModal();
|
||||
window.location.href = "<%= exercise_index_path(:course_id => @course.id) %>";
|
||||
}
|
||||
|
|
@ -1,5 +1,12 @@
|
|||
<%= stylesheet_link_tag 'polls', :media => 'all' %>
|
||||
<script type="text/javascript">
|
||||
function close_searchbox(){
|
||||
if($("#exercise_name_search").val() != ""){
|
||||
$("#exercise_name_search").val("");
|
||||
$('#exercise_search_form').submit();
|
||||
}
|
||||
}
|
||||
|
||||
function republish_exercise(exercise_id,index)
|
||||
{
|
||||
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>'+
|
||||
|
|
@ -52,7 +59,6 @@
|
|||
<p class="ml15 color-grey3 fl">试卷列表</p>
|
||||
<% if @is_teacher %>
|
||||
<a href="<%= new_exercise_path(:course_id => @course.id) %>" class="white-btn orange-btn fr mr20 mt3" title="新建">+ 新建</a>
|
||||
<a href="<%= other_exercise_exercise_index_path(:course_id => @course.id) %>" data-remote="true" class="white-btn orange-btn fr mr20 mt3">+ 试卷选用</a>
|
||||
<!--<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="题库选用">+ 题库选用</a>-->
|
||||
<!--<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="导出成绩">导出成绩</a>-->
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
<% if @exercises.blank? %>
|
||||
notice_box("您的其它班级下没有试卷可供导入");
|
||||
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><a href="javascript:void(0);" class="fr sy_btn_blue mt10" style="margin-right: 122px;" onclick="hideModal();">确定</a></div></div>';
|
||||
pop_box_new(htmlvalue, 300, 140);
|
||||
<% else %>
|
||||
<% unless params[:search] %>
|
||||
var html_value = '<%= escape_javascript(render :partial => 'other_exercises') %>';
|
||||
pop_box_new(html_value, 620, 568);
|
||||
<% else %>
|
||||
$("#test_nav_1").html("<%= j(render :partial => "select_examination_list") %>");
|
||||
<% end %>
|
||||
var html_value = '<%= escape_javascript(render :partial => 'other_exercises',:locals => {:exercises => @exercises, :course_id=>@course_id}) %>';
|
||||
pop_box_new(html_value, 745, 600);
|
||||
<% end %>
|
||||
|
|
@ -370,7 +370,7 @@
|
|||
<!--</div>-->
|
||||
|
||||
<div class="clearfix mt15 mb15 mr15 pr10 <%= edit_mode ? '' : 'none' %>" id="exam_setting_submit_block">
|
||||
<a href="javascript:void(0);" onclick="ex_setting_form_submit();" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="ex_setting_form_submit();" class="task-btn task-btn-blue fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_exercise_list_exercise_path(@exercise) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,211 +22,98 @@
|
|||
<span><%= @exercise.exercise_name %></span>
|
||||
</p>
|
||||
<%= link_to "返回", exercise_index_path(:course_id => @course.id), :class => "fr font-12 mr15 mt3 color-grey" %>
|
||||
<% if @is_teacher %>
|
||||
<%= link_to "设置", setting_exercise_path(@exercise), :class => "fr font-12 mr15 mt3 color-grey" %>
|
||||
<% else %>
|
||||
<!--学生查看时显示-->
|
||||
<%= link_to "查看设置", setting_exercise_path(@exercise), :class => "fr font-12 mr15 mt3 color-grey" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-tab clearfix mb20">
|
||||
<ul id="edu-tab-nav" class="border-bottom-orange">
|
||||
<li id="edu-tab-nav-1" class="new-tab-nav background-orange" onclick="HoverLi(1);">
|
||||
<li id="edu-tab-nav-2" class="new-tab-nav background-orange">
|
||||
<a href="javascript:void(0);" class="tab_type">答题统计</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div id="list_count" class="user_bg_shadow bor-grey-e padding15">
|
||||
<!--老师显示部分-->
|
||||
<% if @is_teacher %>
|
||||
<li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0);" class="tab_type">试卷预览</a>
|
||||
</li>
|
||||
<li id="edu-tab-nav-3" class="new-tab-nav" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0);" class="tab_type">设置</a>
|
||||
</li>
|
||||
<%= link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :format => 'xls'), :id => "export_exercise_work", :class => "fr white-btn orange-btn ml10 mt10 mr15" %>
|
||||
<% else %>
|
||||
<li id="edu-tab-nav-3" class="new-tab-nav" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0);" class="tab_type">查看设置</a>
|
||||
</li>
|
||||
<p class="fr">
|
||||
<form id="exercise_user_search_form">
|
||||
<li class="clearfix mb5">
|
||||
<%= link_to "导出成绩", student_exercise_list_exercise_path(@exercise, :course_id => @course.id, :format => 'xls'), :id => "export_exercise_work", :class => "fr white-btn orange-btn ml10 mt8" %>
|
||||
<div class="edu-find fr mr40 with20 pr">
|
||||
<div class="edu-find-input">
|
||||
<input type="text" class="with100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="student_user_name">
|
||||
<!--<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>-->
|
||||
<span class="edu-close" onclick="clear_searchbox();" data-tip-down="关闭">×</span>
|
||||
</div>
|
||||
<a href="javascript:void(0);" onclick="SearchByName_ex();" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
<input id="exercise_id" type="hidden" value="<%= @exercise.id %>">
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">你的评阅:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_comment_no_limit" class="<%= @comment.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<input id="not_comment" class="magic-checkbox fl" type="checkbox" value="0" name="ex_comment[]" <%= !@comment.blank? && @comment.include?('0') ? 'checked' : '' %>>
|
||||
<label for="not_comment" class="fl mr25" style="top: 0px;">未评<span>(<%= un_commit_num @exercise %>)</span></label>
|
||||
<input id="has_comment" class="magic-checkbox fl" type="checkbox" value="1" name="ex_comment[]" <%= !@comment.blank? && @comment.include?('1') ? 'checked' : '' %>>
|
||||
<label for="has_comment" class="fl mr25" style="top: 0px;">已评<span>(<%= has_commit_num @exercise %>)</span></label>
|
||||
</li>
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">作品状态:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_status_no_limit" class="<%= @status.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="ex_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>>
|
||||
<label for="work_status_1" class="fl mr25" style="top: 0px;">未提交<span>(<%= un_commit_num @exercise %>)</span></label>
|
||||
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="ex_status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>>
|
||||
<label for="work_status_2" class="fl mr25" style="top: 0px;">已提交<span>(<%= has_commit_num @exercise %>)</span></label>
|
||||
</li>
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">分班情况:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_group_no_limit" class="<%= @group.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<% @exercise.course.course_groups.each do |group| %>
|
||||
<input id="group_<%= group.id %>" class="magic-checkbox fl" type="checkbox" value="<%= group.id %>" name="ex_group[]" <%= !@group.blank? && @group.include?(group.id) ? 'checked' : '' %>>
|
||||
<label for="group_<%= group.id %>" class="fl mr25" style="top: 0px;"><%= group.name %><span>(<%= group.members.count %>)</span></label>
|
||||
<% end %>
|
||||
<input id="group_0" class="magic-checkbox fl" type="checkbox" value="0" name="ex_group[]">
|
||||
<label for="group_0" class="fl mr25" style="top: 0px;">未分班<span>(<%= @no_group_count %>)</span></label>
|
||||
</li>
|
||||
</form>
|
||||
<% elsif User.current.member_of_course?(@exercise.course) %>
|
||||
<!--学生显示部分-->
|
||||
<p class="clearfix">
|
||||
<% ex_user = @exercise.exercise_users.where(:user_id => User.current).first %>
|
||||
<% if ex_user %>
|
||||
<% if ex_user.commit_status > 0 %>
|
||||
<%= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
|
||||
<span class="edu-filter-btn edu-filter-btn-orange mb15">你已提交</span>
|
||||
<%= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %>
|
||||
<% else %>
|
||||
<span class="edu-filter-btn edu-filter-btn-orange mb15">你未提交</span>
|
||||
<% if @exercise.exercise_status == 2 %>
|
||||
<%= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr mt10 mr15" %>
|
||||
<%= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
<p class="clearfix font-12">
|
||||
<span class="fr color-grey ml10">(<%= @has_commit_count %>人已交)</span>
|
||||
<% if @exercise.exercise_status == 2 && @exercise.end_time > Time.now %>
|
||||
<% end_time = @exercise.end_time.to_time.to_i %>
|
||||
<span class="fr color-grey">答题剩余时间:<span class="color-orange03"><%= (end_time - Time.now.to_i) / (24*60*60) %></span>天<span class="color-orange03"><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%></span>小时<span class="color-orange03"><%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span>分</span>
|
||||
<% elsif @exercise.exercise_status == 3 %>
|
||||
<span class="color-orange ml30">提交已截止</span>
|
||||
<% end %>
|
||||
</p>
|
||||
<% end %>
|
||||
</ul>
|
||||
<div id="edu-tab-con-1">
|
||||
<div id="list_count" class="user_bg_shadow bor-grey-e padding15">
|
||||
<!--老师显示部分-->
|
||||
<% if @is_teacher %>
|
||||
<form id="exercise_user_search_form">
|
||||
<li class="clearfix mb5">
|
||||
|
||||
<div class="edu-find fr mr20 with20 pr">
|
||||
<div class="edu-find-input">
|
||||
<input type="text" class="with100 panel-box-sizing" maxlength="20" placeholder="姓名、学号关键字检索" value="<%= @name %>" id="student_user_name">
|
||||
<!--<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>-->
|
||||
<span class="edu-close" onclick="clear_searchbox();" data-tip-down="关闭">×</span>
|
||||
</div>
|
||||
<a href="javascript:void(0);" onclick="SearchByName_ex();" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
<input id="exercise_id" type="hidden" value="<%= @exercise.id %>">
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">你的评阅:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_comment_no_limit" class="<%= @comment.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<input id="not_comment" class="magic-checkbox fl" type="checkbox" value="0" name="ex_comment[]" <%= !@comment.blank? && @comment.include?('0') ? 'checked' : '' %>>
|
||||
<label for="not_comment" class="fl mr25" style="top: 0px;">未评<span>(<%= un_commit_num @exercise %>)</span></label>
|
||||
<input id="has_comment" class="magic-checkbox fl" type="checkbox" value="1" name="ex_comment[]" <%= !@comment.blank? && @comment.include?('1') ? 'checked' : '' %>>
|
||||
<label for="has_comment" class="fl mr25" style="top: 0px;">已评<span>(<%= has_commit_num @exercise %>)</span></label>
|
||||
</li>
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">作品状态:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_status_no_limit" class="<%= @status.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<input id="work_status_1" class="magic-checkbox fl" type="checkbox" value="0" name="ex_status[]" <%= !@status.blank? && @status.include?('0') ? 'checked' : '' %>>
|
||||
<label for="work_status_1" class="fl mr25" style="top: 0px;">未提交<span>(<%= un_commit_num @exercise %>)</span></label>
|
||||
<input id="work_status_2" class="magic-checkbox fl" type="checkbox" value="1" name="ex_status[]" <%= !@status.blank? && @status.include?('1') ? 'checked' : '' %>>
|
||||
<label for="work_status_2" class="fl mr25" style="top: 0px;">已提交<span>(<%= has_commit_num @exercise %>)</span></label>
|
||||
</li>
|
||||
<li class="clearfix mb5">
|
||||
<span class="ml33 fl mr10 color-grey">分班情况:</span>
|
||||
<span class="fl mr25">
|
||||
<a href="javascript:void(0);" id="ex_group_no_limit" class="<%= @group.blank? ? 'color-orange03' : '' %>">不限</a>
|
||||
</span>
|
||||
<% @exercise.course.course_groups.each do |group| %>
|
||||
<input id="group_<%= group.id %>" class="magic-checkbox fl" type="checkbox" value="<%= group.id %>" name="ex_group[]" <%= !@group.blank? && @group.include?(group.id) ? 'checked' : '' %>>
|
||||
<label for="group_<%= group.id %>" class="fl mr25" style="top: 0px;"><%= group.name %><span>(<%= group.members.count %>)</span></label>
|
||||
<% end %>
|
||||
<input id="group_0" class="magic-checkbox fl" type="checkbox" value="0" name="ex_group[]">
|
||||
<label for="group_0" class="fl mr25" style="top: 0px;">未分班<span>(<%= @no_group_count %>)</span></label>
|
||||
</li>
|
||||
</form>
|
||||
<% elsif User.current.member_of_course?(@exercise.course) %>
|
||||
<!--学生显示部分-->
|
||||
<div class="clearfix mb10">
|
||||
<p class="fl">
|
||||
<% ex_user = @exercise.exercise_users.where(:user_id => User.current).first %>
|
||||
<% if ex_user %>
|
||||
<% if ex_user.commit_status > 0 %>
|
||||
<span class="edu-filter-btn edu-filter-btn-orange">你已提交</span>
|
||||
<%#= link_to '查看答题', ex_user.commit_status == 1 ? exercise_path(@exercise,:user_id => User.current.id) : show_student_result_exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %>
|
||||
<% else %>
|
||||
<span class="edu-filter-btn edu-filter-btn-orange">你未提交</span>
|
||||
<%# if @exercise.exercise_status == 2 %>
|
||||
<%#= link_to (ex_user.start_at.nil? ? "开始答题" : "继续答题"), exercise_path(@exercise,:user_id => User.current.id), :class => "white-btn orange-btn fr" %>
|
||||
<%# end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
||||
<p class="fr font-12 mt8">
|
||||
<span class="fr color-grey ml10">(<%= @has_commit_count %>人已交)</span>
|
||||
<% if @exercise.exercise_status == 2 && @exercise.end_time > Time.now %>
|
||||
<% end_time = @exercise.end_time.to_time.to_i %>
|
||||
<span class="fr color-grey">答题剩余时间:<span class="color-orange03"><%= (end_time - Time.now.to_i) / (24*60*60) %></span>天<span class="color-orange03"><%= ((end_time - Time.now.to_i) % (24*60*60)) / (60*60)%></span>小时<span class="color-orange03"><%= (((end_time - Time.now.to_i) % (24*60*60)) % (60*60)) / 60%></span>分</span>
|
||||
<% elsif @exercise.exercise_status == 3 %>
|
||||
<span class="color-orange ml30">提交已截止</span>
|
||||
<% end %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="exercise_student_work_list">
|
||||
<%= render :partial => "exercise/student_exercise"%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="edu-tab-con-2" class="undis">
|
||||
<div id="exercise_question_list">
|
||||
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
|
||||
<div class="ml15 mr15">
|
||||
<% if @is_teacher && @exercise.exercise_status == 1 %>
|
||||
<%= link_to '编辑', edit_exercise_path(@exercise), :class => "white-btn orange-btn fr mb10 mt5" %>
|
||||
<% end %>
|
||||
<p style="text-align: center; font-size: 16px; width: 98%;" class="fl"><%= @exercise.try(:exercise_name) %></p>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="ml15 mr15 mt15">
|
||||
<pre class="color-grey font-14 exercise_que_title"><%= @exercise.try(:exercise_description).nil? ? "" : @exercise.try(:exercise_description).html_safe%></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="total_questions_score">
|
||||
<%= render :partial => "exercise/total_questions_score" %>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<% @exercise.exercise_questions.each_with_index do |exercise_question, i| %>
|
||||
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
|
||||
<div class="clearfix pl15 pr15">
|
||||
<p class="fl font-15" id="mao<%= exercise_question.question_number %>">第<%= exercise_question.question_number %>题:<span class="color-orange03 ml10">[<%= exercise_question.question_type_name %>]</span><span class="ml10"><%= exercise_question.question_score %>分</span></p>
|
||||
</div>
|
||||
<div class="pl15 pr15 justify upload_img table_maxWidth"><%= exercise_question.question_title.html_safe %></div>
|
||||
<% case exercise_question.question_type %>
|
||||
<% when 1 %>
|
||||
<div class="pl15 pr15 mb15">
|
||||
<% exercise_choices = exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices.each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-radio fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="radio">
|
||||
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%></label>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
|
||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
||||
</div>
|
||||
<% when 2 %>
|
||||
<div class="pl15 pr15 mb15">
|
||||
<% exercise_choices = exercise_question.exercise_choices.reorder("choice_position") %>
|
||||
<% exercise_choices.each_with_index do |exercise_choice,index| %>
|
||||
<li class="clearfix">
|
||||
<input name="exercise_choice_<%= exercise_question.id %>" class="magic-checkbox fl mt5 magic-checkbox_show" id="exercise_<%= exercise_choice.id %>_exercise_choice_id" type="checkbox">
|
||||
<label class="fl color-grey3" for="exercise_<%= exercise_choice.id %>_exercise_choice_id"><%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%></label>
|
||||
</li>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
|
||||
标准答案:<%= convert_to_char(exercise_question.exercise_standard_answers.first.exercise_choice_id.to_s) %>
|
||||
</div>
|
||||
<% when 3 %>
|
||||
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
|
||||
<% exercise_question.exercise_standard_answers.reorder("created_at").each_with_index do |exercise_choice,index| %>
|
||||
<p>候选答案<%= convert_to_chi_num(index+1) %>:<%= exercise_choice.answer_text%></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% when 4 %>
|
||||
<div class="clearfix bor-top-greyE padding15 answer_con">
|
||||
<p>参考答案</p>
|
||||
<pre class="exercise_que_title"><%= exercise_question.exercise_standard_answers.count > 0 ? exercise_question.exercise_standard_answers.first.answer_text : "无"%></pre>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="exercise_student_work_list">
|
||||
<%= render :partial => "exercise/student_exercise"%>
|
||||
</div>
|
||||
</div>
|
||||
<div id="edu-tab-con-3" class="user_bg_shadow bor-grey-e undis">
|
||||
<%= render :partial => "exercise_setting" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
<% if @tab == 3 %>
|
||||
$("#edu-tab-nav-3").click();
|
||||
<% end %>
|
||||
})
|
||||
|
||||
function HoverLi(n){
|
||||
for(var i=1;i<=3;i++){
|
||||
$('#edu-tab-nav-'+i).removeClass('background-orange');
|
||||
$('#edu-tab-con-'+i).addClass('undis');
|
||||
}
|
||||
$('#edu-tab-con-'+n).removeClass('undis');
|
||||
$('#edu-tab-nav-'+n).addClass('background-orange');
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
|
|
@ -29,6 +29,4 @@
|
|||
$("#show_poll_questions_<%= @exercise_question.id %>").html("<%= escape_javascript(render :partial => 'show_single', :locals => {:exercise_question => @exercise_question}) %>");
|
||||
<% elsif @exercise_question.question_type == 4%>
|
||||
$("#show_poll_questions_<%= @exercise_question.id %>").html("<%= escape_javascript(render :partial => 'show_multi', :locals => {:exercise_question => @exercise_question}) %>");
|
||||
<% end%>
|
||||
$(".data-tip-down").html("");
|
||||
$(".data-tip-down").hide();
|
||||
<% end%>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
</p>
|
||||
|
||||
<div class="clearfix">
|
||||
<a href="javascript:void(0);" onclick ="upload_attachment_version(event);" onfocus = 'this.blur()' id='upload_files_submit_btn' class="task-btn task-btn-orange fr">确定</a>
|
||||
<a href="javascript:void(0);" onclick ="upload_attachment_version(event);" onfocus = 'this.blur()' id='upload_files_submit_btn' class="task-btn task-btn-blue fr">确定</a>
|
||||
<a href="javascript:void(0);" onclick="attachment_fresh_for_destroy()" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
<td class="text_c"><%= history.try(:quotes).to_i %></td>
|
||||
<td class="text_c"><%= format_time(history.created_on) %></td>
|
||||
<td class="text_c">
|
||||
<%= link_to( '<i class="fa fa-trash color-grey" data-tip-down = "删除该版本资源" id = "deleteResource"></i>'.html_safe, attachment_path(history.attachment, :history_id => history, :type => "history_delete"),
|
||||
<%= link_to( '<i class="fa fa-trash color-grey"></i>'.html_safe, attachment_path(history.attachment, :history_id => history, :type => "history_delete"),
|
||||
:remote => true,
|
||||
:method => :delete,:class => "mr5") if allow_to_delete_attachment(history) %>
|
||||
</td>
|
||||
|
|
@ -34,9 +34,8 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class = "clearfix">
|
||||
<p class="color-orange fl">只删除资源的历史版本,请点击相应版本的删除按钮</p>
|
||||
<p class="color-orange">只删除资源的历史版本,请点击相应版本的删除按钮</p>
|
||||
<div>
|
||||
<% if @attachment.container_type == "Project" %>
|
||||
<%#= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :method => :delete,:class => "fr fontGrey2 mb5 btn", :onclick =>"hideModal();") if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
|
||||
<% if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
|
||||
|
|
@ -53,12 +52,6 @@
|
|||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$("#deleteResource").click(function(){
|
||||
$(".-task-title").hide();
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<div class="clearfix">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" id="submit_file" onclick="submit_republish_file();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" id="submit_file" onclick="submit_republish_file();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="$('#datetimepicker_mask').datetimepicker('destroy');hideModal();">取消</a>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@
|
|||
<% if file.attachment_histories.count == 0 %>
|
||||
<%= link_to truncate(file.filename,length: 40, omission: '...'),
|
||||
download_named_attachment_path(file.id, file.filename),
|
||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "color-grey3 f_14" %>
|
||||
:title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkGrey3 f_14" %>
|
||||
<% else %>
|
||||
<%= link_to truncate(file.filename,length: 40, omission: '...'), attachment_history_download_path(file.id),
|
||||
:title => file.filename+"\n"+file.description.to_s,
|
||||
:class => "color-grey3 f_14",
|
||||
:class => "linkGrey3 f_14",
|
||||
:style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;", :remote=>true %>
|
||||
<% end %>
|
||||
<%#= file_preview_eye(file, class: 'preview') %>
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
<span id="upload_file_count_notice" class="fl c_red none"></span>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" style="margin-right: 27px;" id="submit_resource" onclick="submit_course_resource();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" style="margin-right: 27px;" id="submit_resource" onclick="submit_course_resource();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="$('#datetimepicker_mask').datetimepicker('destroy');hideModal();">取消</a>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
<!--)-->
|
||||
<!--</span>-->
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" data-tip-down="请选择文件上传">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
<li class="clearfix mb5 pl30 pr30">
|
||||
<div class="mt5 clearfix">
|
||||
<label class="panel-form-label fl"> </label>
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" data-tip-down="请选择文件上传">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -1,29 +1,29 @@
|
|||
<div class="edu-class-container edu-position">
|
||||
<p class="mb10 font-14">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> > 讨论区
|
||||
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> > 论坛
|
||||
</p>
|
||||
<div class="edu-class-top clearfix mb30 pr user_bg_shadow bor-grey-e">
|
||||
<div class="clearfix">
|
||||
<div class="fl with60 mt5">
|
||||
<a href="<%= user_path(@user) %>" class="fl">
|
||||
<a href="<%= user_path(@user.show_name) %>" class="fl">
|
||||
<%= image_tag(url_to_avatar(User.current), :width => 60, :height => 60,:alt=>'贴吧图像', :class=>"bor-radius-all" ) %>
|
||||
</a>
|
||||
<div class="fl ml15">
|
||||
<li class="font-16"><a href="<%= user_path(@user) %>" class="color-grey3"><%= @user.show_name %></a></li>
|
||||
<li class="mt5 color-grey font-12"><%= time_from_now @user.last_login_on %></li><!--三分钟前登录-->
|
||||
<li class="font-16"><a href="<%= user_path(@user.show_name) %>" class="color-grey3"><%= @user.show_name %></a></li>
|
||||
<li class="mt5 color-grey"><%= @user.login %></li>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="fr" style="padding: 10px 0px;text-align:right">
|
||||
<li class="fl" style="text-align:center"><span class="color-orange03 font-bd" id="all_syllabuses"><%= @memos_praise_count %></span><br><span>被赞</span></li>
|
||||
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange03 font-bd" id="all_syllabuses"><%= @my_memos_count %></span><br><span>回复/评论</span></li>
|
||||
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange03 font-bd" id="all_syllabuses"><%= @my_forums_count %></span><br><span>主题</span></li>
|
||||
<li class="fl" style="text-align:center"><span class="color-orange font-bd" id="all_syllabuses"><%= @memos_praise_count %></span><br><span>被赞</span></li>
|
||||
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_memos_count %></span><br><span>回复/评论</span></li>
|
||||
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_forums_count %></span><br><span>主题</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix user_bg_shadow bor-grey-e">
|
||||
<div class="clearfix pt10 pb10 pl15 pr15 bor-bottom-greyE">
|
||||
<p class="color-grey3 fl font-16">帖子</p>
|
||||
<p class="color-grey3 fl font-16">问吧</p>
|
||||
<a href="<%= new_forum_memo_path(:forum_id => Forum.first.id, :forum_index => true) %>" class="mt3 white-btn orange-btn fr">+ 新话题</a>
|
||||
</div>
|
||||
<div id="forum_list" class="forum_table mh650">
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
<%= memo.subject %>
|
||||
</a>
|
||||
<% if memo.sticky %>
|
||||
<span class="btn-top btn-cir-orange mt6 ml5 fl">顶</span>
|
||||
<span class="btn-top btn-cir-red mt7 ml5 fl">顶</span>
|
||||
<% end %>
|
||||
</p>
|
||||
<div style="width: 1091px; height: 30px;" class="overellipsis color-dark-grey mb10"><%= memo.content.html_safe %></div>
|
||||
|
|
@ -47,16 +47,10 @@
|
|||
<span class="fl ml30"><%= time_from_now memo.updated_at %></span>
|
||||
<!--<span class="fl ml50">最后回复:</span>-->
|
||||
<p class="font-12 mt5 fr">
|
||||
<% if memo.viewed_count > 0%>
|
||||
<span class="mr10 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
|
||||
<% end %>
|
||||
<% if get_praise_num(memo) > 0%>
|
||||
<span class="mr10 ml10 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
|
||||
<% end %>
|
||||
<% if Memo.where(:root_id => memo.id).count > 0%>
|
||||
<span class="mr10 ml10 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
|
||||
<% end %>
|
||||
<!--<span class="fl">类别:分享</span>-->
|
||||
<span class="mr20 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
|
||||
<span class="mr20 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
|
||||
<span class="mr10 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
|
||||
<!--<span class="fl">类别:分享</span>-->
|
||||
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
<span class="mt10 -flex c_grey ml15" id="time-consuming"></span>
|
||||
<!--<span class="mt10 mr15" style="color: #2dad96;" id="game_wating_time"></span>-->
|
||||
<% if @myshixun.shixun.try(:language) == "PHP/Web" %>
|
||||
<div id="php_display" class="undis">
|
||||
<a href="<%= Redmine::Configuration['tomcat_php'] + ':' + (50000 + @game.myshixun_id).to_s + '/' + @game.challenge.path.strip %>" target="_blank" class="shixun-task-btn task-btn-orange mr15 mt8">
|
||||
查看网页效果
|
||||
</a>
|
||||
<!--
|
||||
<a href="<%#= "http://106.75.96.108:" + (50000+4111).to_s + '/' + "src/step1/Helloworld.php" %>" target="_blank" class="shixun-task-btn task-btn-orange mr15 mt8">查看网页效果</a>
|
||||
-->
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @st == 0 %>
|
||||
<div id="reset_code_to_bengin" class="<%= @game.status == 2 ? "" : "undis" %>">
|
||||
<a href="javascript:void(0)" class="shixun-task-btn task-btn-green mr15 mt8" onclick="delete_confirm_box('<%= reset_new_code_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>', '你在本关中修改的内容将丢失<br />是否确定重新加载上次通过的代码');">加载上次通过的代码</a>
|
||||
|
|
@ -18,14 +8,14 @@
|
|||
<div id="prev_step_area">
|
||||
<% if @game.challenge.position > 1 %>
|
||||
<%= link_to "上一关 ", {:controller => 'games', :action => "prev_step", :id => @game, :myshixun_id => @myshixun},
|
||||
:class => "shixun-task-btn task-btn-orange mr15 mt8", :id => "prev_step", :remote => true %>
|
||||
:class => "shixun-task-btn task-btn-blue mr15 mt8", :id => "prev_step", :remote => true %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="code_test">
|
||||
<% if @st == 0 %>
|
||||
<a href="javascript:void(0)" class="shixun-task-btn task-btn-orange mr15 mt8" onclick="training_task_submmit();">评测</a>
|
||||
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="training_task_submmit();">评测</a>
|
||||
<% else %>
|
||||
<a href="javascript:void(0)" class="shixun-task-btn task-btn-orange mr15 mt8" onclick="choice_submmit();">评测</a>
|
||||
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="choice_submmit();">评测</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<div id="code_estimate">
|
||||
|
|
@ -35,11 +25,11 @@
|
|||
<% if @had_done == 0 %>
|
||||
<% if show_next_stage?(@game, @myshixun.shixun.try(:status)) %>
|
||||
<%= link_to "下一关 ", {:controller => 'games', :action => "next_step", :id => @game, :myshixun_id => @myshixun},
|
||||
:class => "shixun-task-btn task-btn-orange mr15 mt8", :id => "next_step", :remote => true %>
|
||||
<!--<a href="javascript:void(0);" onclick="shixun_next_step();" class="task-btn task-btn-orange mr15 mt8">下 一 步</a>-->
|
||||
:class => "shixun-task-btn task-btn-blue mr15 mt8", :id => "next_step", :remote => true %>
|
||||
<!--<a href="javascript:void(0);" onclick="shixun_next_step();" class="task-btn task-btn-blue mr15 mt8">下 一 步</a>-->
|
||||
<% end %>
|
||||
<% else %>
|
||||
<a href="<%= shixun_path(@myshixun.shixun) %>" id="exit_shixun" class="shixun-task-btn task-btn-orange mt8 mr15">离开</a>
|
||||
<a href="<%= shixun_path(@myshixun.shixun) %>" id="exit_shixun" class="shixun-task-btn task-btn-blue mt8 mr15">离开</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>
|
||||
|
|
@ -49,7 +39,6 @@
|
|||
<% end %>
|
||||
// 渲染用户的HTML的CODE。
|
||||
function tpi_html_show(){
|
||||
$($(".blacktab_con")[0]).trigger("click");
|
||||
var contents = editor_CodeMirror.getValue();
|
||||
$("#data_param").val(contents);
|
||||
$("#html_form").attr("action", "/iframes/html_content");
|
||||
|
|
@ -157,16 +146,16 @@
|
|||
$.ajax({
|
||||
url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
success: function (data){
|
||||
/* timeID = setInterval(function(){
|
||||
timeID = setInterval(function(){
|
||||
$.ajax({
|
||||
url: '<%#= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
url: '<%= get_waiting_time_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
data:{resubmit:data.resubmit},
|
||||
async: false,
|
||||
success: function(data){
|
||||
console.log(data);
|
||||
if(data.onRun == 1){
|
||||
clearInterval(timeID);
|
||||
$("#game_wating_time").html("");*/
|
||||
$("#game_wating_time").html("");
|
||||
// 每2s匹配一次状态,成功2 评测中1 评测 0
|
||||
var intId = setInterval(function(){
|
||||
var ajaxTimeoutTest = $.ajax({
|
||||
|
|
@ -181,8 +170,6 @@
|
|||
if(data.status == 2 || data.status == 0){
|
||||
if(data.language == "Html"){
|
||||
tpi_html_show();
|
||||
}else if(data.language == "PHP/Web"){
|
||||
$("#php_display").show();
|
||||
}
|
||||
clearInterval(intId);
|
||||
nEvalContent.show();
|
||||
|
|
@ -207,10 +194,8 @@
|
|||
data.language,
|
||||
data.compile_success
|
||||
);
|
||||
$("#blacktab_nav_1").trigger("click");
|
||||
if(data.status == 2){
|
||||
if(data.language == "Html"){
|
||||
tpi_html_show();
|
||||
}
|
||||
clearInterval(cm);
|
||||
clearInterval(intId);
|
||||
var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon
|
||||
|
|
@ -225,28 +210,28 @@
|
|||
icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center");
|
||||
icon.find("a:last").attr("title", "已完成");
|
||||
if( data.had_done == 0 ) {
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >离开</a>");
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >离开</a>");
|
||||
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>";
|
||||
}else{
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >离开</a>");
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >离开</a>");
|
||||
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 1}) %>";
|
||||
}
|
||||
// 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕
|
||||
pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight);
|
||||
$("#reset_code_to_bengin").show(); // 显示加载上次通过的代码
|
||||
}
|
||||
var html = "<a href='javascript:void(0)' class='task-btn task-btn-orange mr15 mt8' onclick='training_task_submmit();'>评测</a>";
|
||||
var html = "<a href='javascript:void(0)' class='task-btn task-btn-blue mr15 mt8' onclick='training_task_submmit();'>评测</a>";
|
||||
$("#code_test").html(html); // 恢复评测
|
||||
if(data.position > 1){
|
||||
$("#prev_step_area").html("<a href='<%= prev_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='prev_step' data-remote='true'>上一关</a>")
|
||||
$("#prev_step_area").html("<a href='<%= prev_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='prev_step' data-remote='true'>上一关</a>")
|
||||
}
|
||||
var codeEstimate = $("#code_estimate").children("a").html();
|
||||
if(codeEstimate == undefined){
|
||||
return;
|
||||
}else if(codeEstimate.trim() == "下一关"){
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >离开</a>");
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >离开</a>");
|
||||
} else if(codeEstimate.trim() == "离开"){
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >离开</a>");
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >离开</a>");
|
||||
}
|
||||
}
|
||||
// 访问60次,即120s后后台还未改变状态即执行
|
||||
|
|
@ -262,12 +247,12 @@
|
|||
nAjaxLoading.hide();
|
||||
nInfoAjaxLoading.hide();
|
||||
if(data.position > 1){
|
||||
$("#prev_step_area").html("<a href='<%= prev_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='prev_step' data-remote='true'>上一关</a>")
|
||||
$("#prev_step_area").html("<a href='<%= prev_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='prev_step' data-remote='true'>上一关</a>")
|
||||
}
|
||||
if( data.had_done == 0 ) {
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >离开</a>");
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a><a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >离开</a>");
|
||||
}
|
||||
var html = "<a href='javascript:void(0)' class='task-btn task-btn-orange mr15 mt8' onclick='training_task_submmit();'>评测</a>";
|
||||
var html = "<a href='javascript:void(0)' class='task-btn task-btn-blue mr15 mt8' onclick='training_task_submmit();'>评测</a>";
|
||||
|
||||
var html_1 = "实训云平台繁忙(繁忙等级:88)";
|
||||
$("#code_test").html(html);
|
||||
|
|
@ -286,7 +271,7 @@
|
|||
}}
|
||||
});
|
||||
}, 2000);
|
||||
/*}else if(data.onRun == 0){
|
||||
}else if(data.onRun == 0){
|
||||
mintes = parseInt(data.waitingTime / 60);
|
||||
if(mintes > 1){
|
||||
$("#game_wating_time").html("目前正有" + data.waitNum + "个任务正在等待,大约需要等待" + mintes + "分钟")
|
||||
|
|
@ -296,7 +281,7 @@
|
|||
}
|
||||
}
|
||||
})
|
||||
}, 2000);*/
|
||||
}, 2000);
|
||||
}
|
||||
|
||||
});
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<div class="task-popup-content">
|
||||
<p class="task-popup-text-center font-16">
|
||||
<% if @viewed == 2 %>
|
||||
将扣除<%= @challenge_score %>点金币<br />是否确认查看答案<br/>注意:先查看参考答案,再通过评测的学生,实训作业有可能是零分哦~
|
||||
将扣除<%= @challenge_score %>点金币<br />是否确认查看答案
|
||||
<% else %>
|
||||
本操作需要扣除<%= @challenge_score %>点金币<br />你的金币不够
|
||||
<% end %>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
</div>
|
||||
<div class="task-popup-submit clearfix">
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl">取消</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="<%= @viewed == 2 ? "minus_shixun_score();" : "" %>hideModal();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="<%= @viewed == 2 ? "minus_shixun_score();" : "" %>hideModal();">确定</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -74,25 +74,19 @@
|
|||
</div>
|
||||
</div>
|
||||
<div id="tab_con_4" class="tab-info" style="display: none">
|
||||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll panel-box-sizing new_li task-padding10" id="game_comment_show" style="padding: 0px;">
|
||||
<%#= render :partial => "games/shixun_comment_list" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%#= render :partial => "games/shixun_comment_list" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="-layout-h -padding-h-16 -horizontal -footer-left" id="bottom_points" style = "position:relative;">
|
||||
<ul class="-task-ml80 -layout df" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
|
||||
<ul class="-task-ml80 -layout" style="overflow:hidden;align-items:flex-end;flex-wrap:wrap;">
|
||||
<%= render :partial => "games/shixun_comment_block" %>
|
||||
<!-- <li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>-->
|
||||
<li class="fl ml20 mt15 mb10 mr10" style="min-width:85px;">
|
||||
<span data-tip-top="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
|
||||
<li class="fl mt10 ml20 " style="width:54px;margin-bottom:10px;"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>
|
||||
<li class="fl ml20 mt15" style="width:85px;margin-bottom:10px;">
|
||||
<span data-tip-left="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise('<%= @game_challenge.id %>', '<%= @game_challenge.class %>')" id="game_praise_tread" class="pt5 color-grey mr20">
|
||||
<i class="fa fa-thumbs-up font-20 mr3 <%= @praise.nil? ? "" : "color-light-green" %>" alt="赞" ></i><span class="font-12 font-bd" id="game_praise_count"><%= @praise_count %></span>
|
||||
</span>
|
||||
<span data-tip-top="<%= @tread.nil? ? "踩" : "取消踩" %>" onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;">
|
||||
<span data-tip-right="<%= @tread.nil? ? "踩" : "取消踩" %>" onclick="game_tread('<%= @game_challenge.id %>')" id="game_tread" class="color-grey" style="padding-top:7px;">
|
||||
<i class="fa fa-thumbs-down font-20 mr3 <%= @tread.nil? ? "" : "color-orange" %>" ></i><span class="font-12 font-bd" id="game_tread_count"><%= @tread_count %></span>
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@
|
|||
<div id="codetab_con_2" class="undis -relative"></div>
|
||||
<div id="current_repository_path" class="undis"><%= file_update_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %></div>
|
||||
<script>
|
||||
$(function(){
|
||||
<% if @myshixun.shixun.try(:webssh) %>
|
||||
LoadingWebssh();
|
||||
<% end %>
|
||||
});
|
||||
var H = 2;
|
||||
function g_l(o){return document.getElementById(o);}
|
||||
function HoverLi_new(n){
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</div>
|
||||
<div class=" clearfix mb20 mr15">
|
||||
<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fr">取消</a>
|
||||
<a href="javascript:void(0);" onclick="problem_report('<%= User.current.id %>');" class="task-btn task-btn-orange fr mr10">确定</a>
|
||||
<a href="javascript:void(0);" onclick="problem_report('<%= User.current.id %>');" class="task-btn task-btn-blue fr mr10">确定</a>
|
||||
</div>
|
||||
<script>
|
||||
// 给导师和管理员发送error
|
||||
|
|
|
|||
|
|
@ -1,27 +1,13 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
|
||||
<% end %>
|
||||
<li class="comment-input fl" id="shixun_comment_block" style="flex: 1">
|
||||
<!-- <%#= form_for('', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<textarea id="comment_news" name="content" placeholder="我想说点什么~" MultiLine = True ScrollBars = 2 type="text"></textarea>
|
||||
<input type="hidden" id="dis_reply_id" name="reply_id" value="">
|
||||
<%# end %>-->
|
||||
|
||||
<div nhname='new_message_<%= @shixun.id%>' class="fr" style="display:none; width: 99%;">
|
||||
<%= form_for('discuss', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<div nhname='toolbar_container_<%= @shixun.id%>'></div>
|
||||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @shixun.id %>' name="content"></textarea>
|
||||
<a id="new_message_submit_btn_<%= @shixun.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="mt10 task-btn task-btn-blue fr">发送</a>
|
||||
<div class="cl"></div>
|
||||
<p nhname='contentmsg_<%= @shixun.id%>'></p>
|
||||
<% end%>
|
||||
</div>
|
||||
<li class="comment-input fl" id="shixun_comment_block">
|
||||
<%= form_for('', :url => {:controller => 'discusses', :action => 'create', :dis_id => @shixun.id, :dis_type => "Shixun", :challenge_id => @game_challenge.try(:id)}, :method => "post", :remote => true, :html => {:id => 'new_comment_form'}) do |f| %>
|
||||
<textarea id="comment_news" name="content" placeholder="我想说点什么~" MultiLine = True ScrollBars = 2 type="text"></textarea>
|
||||
<input type="hidden" id="dis_reply_id" name="reply_id" value="">
|
||||
<% end %>
|
||||
</li>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
//autoTextarea(document.getElementById("comment_news"),0,150);
|
||||
sd_create_editor_from_shixun_data(<%= @shixun.id %>, null, "100%", "<%= @shixun.class.to_s %>");
|
||||
autoTextarea(document.getElementById("comment_news"),0,150);
|
||||
});
|
||||
var click = true;
|
||||
function send_dis_to_shixun(){
|
||||
|
|
|
|||
|
|
@ -1,123 +1,93 @@
|
|||
<% no_children_comments = get_no_children_comments_all @discusses %>
|
||||
<div class="panel-comment_item">
|
||||
<% if @discusses.blank? %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<% else %>
|
||||
<% no_children_comments.each do |comment| %>
|
||||
<% unless comment.nil? %>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
showNormalImage('reply_content_<%= comment.id %>');
|
||||
autoUrl('reply_content_<%= comment.id %>');
|
||||
});
|
||||
</script>
|
||||
<div class="comment_item_cont df clearfix" style="padding:10px 10px">
|
||||
<div class="J_Comment_Face fl">
|
||||
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
|
||||
</div>
|
||||
<div class="t_content fl">
|
||||
<div class="J_Comment_Reply">
|
||||
<div class="comment_orig_content" style="margin:0px">
|
||||
<% if !comment.parent.nil? %>
|
||||
<% parents_rely = [] %>
|
||||
<% parents_rely = get_reply_parents parents_rely, comment %>
|
||||
<% length = parents_rely.length %>
|
||||
<div id="comment_reply_<%= comment.id %>" class="mb5">
|
||||
<% if length <= 5 %>
|
||||
<%=render :partial => 'shixuns/shixun_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => @game_challenge.id, :type => @game_challenge.class.to_s} %>
|
||||
<% else %>
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<div class="orig_cont clearfix">
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<div class="orig_cont_hide clearfix">
|
||||
<i class="fa fa-long-arrow-down mr5"></i>
|
||||
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => @game_challenge.id, :parent_id => comment.id),:remote=>true, :class => '' %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[3], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[2], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[1], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<%=render :partial => 'shixuns/shixun_reply_detail', :locals => {:comment => parents_rely[0], :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id, :parent_id => comment.id} %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll panel-box-sizing new_li task-padding10" id="game_comment_show" style="padding: 10px 15px;">
|
||||
<div id="comments_content">
|
||||
<% if @shixun.discusses.blank? %>
|
||||
<%= render :partial => "welcome/no_data" %>
|
||||
<% else %>
|
||||
<% @discusses.each do |dis| %>
|
||||
<div class="comments_item_content comment_item_bottom clearfix mt5" onmouseover="$('#discuss_opr_<%= dis.id %>').show();$('#child_discuss_opr_<%= dis.id %>').show();" onmouseout="$('#discuss_opr_<%= dis.id %>').hide();$('#child_discuss_opr_<%= dis.id %>').hide();">
|
||||
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 35, :height => 35), user_path(dis.user),:class => "fl mt5", :target => '_blank' %>
|
||||
<div class="fl comment_item_one ml10">
|
||||
<p class="clearfix">
|
||||
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %>
|
||||
<span class="fl color-grey font-12 mt3 mr20"><%= time_from_now dis.created_at %></span>
|
||||
<% if dis.try(:challenge_id).present? %>
|
||||
<span class="fl color-light-green font-12 mt3">[第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]</span>
|
||||
<% end %>
|
||||
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
|
||||
<div class="comment_content clearfix" >
|
||||
<div class="color-grey3"><%= comment.content.html_safe %></div>
|
||||
<span class="fr color-grey font-12 color_Purple_grey" id="dis_praise_<%= dis.id %>">
|
||||
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %>
|
||||
</span>
|
||||
<span class="fr none mt5 mr10" id="discuss_opr_<%= dis.id %>">
|
||||
<% if User.current.manager_of_shixun?(@shixun) && dis.children.count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="reply_to_dis('<%= dis.id %>', '<%= dis.user.show_name %>')" class="fr ml10 font-12 link-color-green" id = "reversion">回复</a>
|
||||
<% end %>
|
||||
<% if (User.current.manager_of_shixun?(@shixun) || User.current == dis.user) && dis.children.count == 0 %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= discuss_path(dis, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<% end %>
|
||||
</span>
|
||||
|
||||
<div class="J_Comment_Info clearfix">
|
||||
<div class="t_info fl">
|
||||
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
|
||||
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
|
||||
</div>
|
||||
<p class="fr mr10 orig_reply">
|
||||
<% if comment.creator_user == User.current || User.current.admin? || User.current.manager_of_shixun?(comment.dis_id) %>
|
||||
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=@game_challenge.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= discuss_path(comment, :challenge_id => @game_challenge) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
|
||||
<% end %>
|
||||
<span class="ml5 mr5 color-grey">|</span>
|
||||
<%= link_to(
|
||||
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
|
||||
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => @game_challenge.class.to_s, :user_activity_id => @game_challenge.id},
|
||||
:remote => true,
|
||||
:method => 'get',
|
||||
:title => l(:button_reply),:class => "color-grey"
|
||||
) %>
|
||||
<span class="ml5 mr5 color-grey">|</span>
|
||||
<span class="reply_praise_count_<%= comment.id %>">
|
||||
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
|
||||
</span>
|
||||
</p>
|
||||
<p class="mb10"><%= dis.content %></p>
|
||||
|
||||
<div class="cl"></div>
|
||||
<% dis.children.each do |child| %>
|
||||
<div class="comments_return comment_item_top">
|
||||
<p class="clearfix comment_item_left_green return_item pl5">
|
||||
<span class="fl color-grey mr20">老师回复</span>
|
||||
<span class="fl color-grey font-12"><%= time_from_now child.created_at %></span>
|
||||
<span class="fr color-grey font-12 color_Purple_grey" id="dis_praise_<%= child.id %>">
|
||||
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => child} %>
|
||||
</span>
|
||||
<span class="fr pl8 none mr10 mt5" id="child_discuss_opr_<%= dis.id %>">
|
||||
<% if User.current.manager_of_shixun?(@shixun) || (User.current == dis.user && dis.children.count == 0) %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= discuss_path(dis) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<% end %>
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<div class="">
|
||||
<p class="pl8 mb10"><%= child.content %></p>
|
||||
<!--<p class="fl pl8">
|
||||
<span class="fl color-grey"><%#= time_from_now child.created_at %></span>
|
||||
</p>
|
||||
<p class="fr pl8 none" id="child_discuss_opr_<%#= dis.id %>">
|
||||
<%# if User.current.manager_of_shixun?(@shixun) || (User.current == dis.user && dis.children.count == 0) %>
|
||||
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%#= discuss_path(dis) %>', '确定要删除该条回复吗?')" class="fr font-12 link-color-green">删除</a>
|
||||
<%# end %>
|
||||
</p>-->
|
||||
<div class="cl"></div>
|
||||
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
|
||||
</div>
|
||||
</div>
|
||||
<!--回复end-->
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div style="text-align:center;" class="new_expand">
|
||||
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
|
||||
<ul id="homework_pository_ref_pages">
|
||||
<%= pagination_links_full @discusses_pages, @discusses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--评论区域的分页-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function ThumbUp(item){
|
||||
$(item).toggleClass("orange-btn");
|
||||
$(item).toggleClass("orange-bg-btn");
|
||||
if($(item).attr("attr-thumb")=="0"){
|
||||
$(item).find("span").html(parseInt($(item).find("span").html())+1);
|
||||
$(item).attr("attr-thumb","1");
|
||||
}else{
|
||||
$(item).find("span").html(parseInt($(item).find("span").html())-1);
|
||||
$(item).attr("attr-thumb","0");
|
||||
}
|
||||
}
|
||||
|
||||
//二次回复的提示结构
|
||||
var $points = $("<div class = \"points-data-tip-top\">"+
|
||||
"<div class = \"data-tip-top\">请在此输入回复</div>"+
|
||||
"<div class = \"data-tip-top1 \">请在此输入回复</div>"+
|
||||
"</div>").appendTo("#bottom_points");
|
||||
$("#reversion").click(function(){
|
||||
$points.show();
|
||||
});
|
||||
$("#comment_news").blur(function(){
|
||||
$points.hide();
|
||||
$("#comment_news").bind("input propertychange",function(){
|
||||
if($("#comment_news").val() != ''){
|
||||
$points.hide();
|
||||
}
|
||||
});
|
||||
function shixun_editor_focus(id, dis_id){
|
||||
window.scrollTo(0,document.body.scrollHeight);
|
||||
$("textarea[nhname='new_message_textarea_"+id+"']").focus();
|
||||
$("#dis_reply_id").val(dis_id);
|
||||
}
|
||||
</script>
|
||||
|
|
@ -17,10 +17,10 @@
|
|||
// 选择题
|
||||
<% if params[:choose] == "true" %>
|
||||
<% if @had_done == 0 %>
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-orange mr15 mt8' id='next_step' data-remote='true'>下一关</a>");
|
||||
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a>");
|
||||
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>";
|
||||
<% else %>
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-orange mt8 mr15' >退出实训</a>");
|
||||
$("#code_estimate").html("<a href='<%= shixun_path(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
|
||||
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game => @game, :myshixun => @myshixun, :had_done => 1}) %>";
|
||||
<% end %>
|
||||
// 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
<iframe src='<%= @url %>' style='width:100%;border:0;' scrolling='no' class='game_webssh'>
|
||||
</iframe>
|
||||
|
|
@ -7,9 +7,9 @@
|
|||
</div>
|
||||
<div class="panel-bg-grey clearfix color-grey font-12">
|
||||
<p class="fl ml15">共 <span class="color-orange"><%= @hw_count %></span>个搜索结果</p>
|
||||
<%= link_to '引用次数排序', homework_bank_index_path(:type => @type, :order => "quotes", :search => @search, :sort => @r_sort, :property=>@property), :class => "fr mr15 #{@order == 'quotes' ? 'color-orange03' : ''}", :remote => true %>
|
||||
<%= link_to '引用次数排序', homework_bank_index_path(:type => @type, :order => "quotes", :search => @search, :sort => @r_sort, :property=>@property), :class => "fr mr15 #{@order == 'quotes' ? 'color-blue' : ''}", :remote => true %>
|
||||
<span class="mr5 ml5 fr">|</span>
|
||||
<%= link_to '更新时间排序', homework_bank_index_path(:type => @type, :order => "updated_at", :search => @search, :sort => @r_sort, :property=>@property), :class => "fr #{@order == 'updated_at' ? 'color-orange03' : ''}", :remote => true %>
|
||||
<%= link_to '更新时间排序', homework_bank_index_path(:type => @type, :order => "updated_at", :search => @search, :sort => @r_sort, :property=>@property), :class => "fr #{@order == 'updated_at' ? 'color-blue' : ''}", :remote => true %>
|
||||
</div>
|
||||
<div class="user_bg_shadow">
|
||||
<div class="edu-con-top clearfix">
|
||||
|
|
@ -21,10 +21,9 @@
|
|||
<%= link_to '实训', homework_bank_index_path(:type => @type, :property => 4), :class => 'edu-filter-cir-grey mr5 font-12 fl', :id => 'homework_bank_pro_4', :remote => true %>
|
||||
<%#= link_to '试卷', homework_bank_path(:type => @type, :property => 5), :class => 'edu-filter-cir-grey mr5', :remote => true %>
|
||||
</p>
|
||||
<a href="javascript:void(0)" onclick="alert_choose_homework_bank_type()" class="task-btn task-btn-orange fr mr15 mt5">新建</a>
|
||||
<a href="javascript:void(0)" onclick="alert_choose_homework_bank_type()" class="task-btn task-btn-blue fr mr15 mt5">新建</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
||||
<div style="min-height: 380px;">
|
||||
<% if @hw_count != 0 %>
|
||||
<%= form_tag(choose_user_course_homework_bank_index_path(), :id => 'hb_search_course_h_form', :remote => true, :method => 'post') do %>
|
||||
|
|
@ -74,12 +73,6 @@
|
|||
<%= render :partial => 'welcome/no_data' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if false %>
|
||||
<div class="identity_con" style="text-align: center;padding:180px 0px;">
|
||||
<p class="font-16 mb30">已经过职业认证的教师才能访问公共题库</p>
|
||||
<p><a href="javascript:void(0)" class="white-btn orange-btn">立即认证</a></p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<ul class="sy_classlist clearfix" style="border: none;height:64px;">
|
||||
<input class="magic-checkbox" type="checkbox" name="layout" id="homework_bank_all_select" class="fl">
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<div class="edu-con-top user_bg_shadow bor-grey-e">
|
||||
<p class="ml15 color-grey3"><%= edit_mode ? '编辑' : '新建' %>普通作业</p>
|
||||
<div class="edu-con-top user_bg_shadow">
|
||||
<p class="ml15 color-grey"><%= edit_mode ? '编辑' : '新建' %>普通作业</p>
|
||||
</div>
|
||||
<div class="alert alert-red mt15 none" id="new_homework_notice">
|
||||
<button class="task-close fr" type="button" id="close_button">×</button>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" style="padding:30px 0;">
|
||||
<div class="edu-con-bg01 mt15 user_bg_shadow" style="padding:30px 0;">
|
||||
<div class="ml30 mr30">
|
||||
<div class="">
|
||||
<ul>
|
||||
|
|
@ -61,7 +61,7 @@
|
|||
%>
|
||||
</li>
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(1);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(1);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', homework_bank_path(@homework), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@
|
|||
%>
|
||||
</li>
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(3, true);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(3, true);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', homework_bank_path(@homework), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@
|
|||
%>
|
||||
</li>
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(2);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(2);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', homework_bank_path(@homework), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
<div class="mh440">
|
||||
<table class="edu-pop-table color-grey edu-txt-center table-pa5" cellspacing="0" cellpadding="0">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -22,10 +21,10 @@
|
|||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="clearfix">
|
||||
<div class="clearfix fr mt15">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="new_shixun_homework_bank();">选择</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="new_shixun_homework_bank();">选择</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr pop_close mr10" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
<div class="fl pages_right_min mt10">
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<% end %>
|
||||
<div>
|
||||
<span class="color-red undis fl" id="search_course_notice_h"></span>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="submit_send_hb_to_course();">确定</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="submit_send_hb_to_course();">确定</a>
|
||||
<a href="javascript:void(0);" class="pop_close task-btn fr mr10">取消</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -21,11 +21,6 @@
|
|||
<% allow_late = homework_common.allow_late ? '已开启补交' : '未开启补交' %>
|
||||
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
|
||||
<% end %>
|
||||
|
||||
<% if !@is_teacher && User.current.member_of_course?(@course) && homework_common.student_works.where("user_id = #{User.current.id} and work_status > 0").blank? %>
|
||||
<span class="btn-top btn-cir-orange ml10 fl mt5">未提交</span>
|
||||
<% end %>
|
||||
|
||||
<div class="cl"></div>
|
||||
<p class="color-grey font-12 mt20">
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<!--<%#= render :partial => 'homework_common/reference_answers_attachments', :locals => {:container => @ref_answer} %>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix mt10 pl30 pr30">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(1);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(1);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', student_work_index_path(:homework => @homework.id), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
<!--</a>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(3, true);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(3, true);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', student_work_index_path(:homework => @homework.id), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@
|
|||
<!--</a>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix mt10">
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(2);" class="task-btn task-btn-orange fr">保存</a>
|
||||
<a href="javascript:void(0);" onclick="submit_new_common_homework(2);" class="task-btn task-btn-blue fr">保存</a>
|
||||
<% if edit_mode %>
|
||||
<%= link_to '取消', student_work_index_path(:homework => @homework.id), :class => 'task-btn fr mr10' %>
|
||||
<% else %>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
</div>
|
||||
<div class="clearfix">
|
||||
<div class="clearfix fr mt15">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-orange fr" onclick="new_shixun_homework();">选择</a>
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="new_shixun_homework();">选择</a>
|
||||
<a href="javascript:void(0);" class="task-btn fr pop_close mr10" onclick="hideModal();">取消</a>
|
||||
</div>
|
||||
<div class="fl pages_right_min mt10">
|
||||
|
|
|
|||
|
|
@ -1,58 +1,58 @@
|
|||
<div>
|
||||
<span id="ref_attachments_fields_ref_file" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'ref_attachments[dummy][file]',
|
||||
:id => 'ref_file',
|
||||
:class => ie8? ? '' : 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => ie8? ? '' : 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js',:project =>nil),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#ref_file').click();" data-tip-down="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<div>
|
||||
<span id="ref_attachments_fields_ref_file" class="attachments_fields">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>">
|
||||
<%= text_field_tag("ref_attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("ref_attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
|
||||
<%= check_box_tag("ref_attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%= hidden_field_tag "ref_attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
</span>
|
||||
<div class="cl"></div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</span>
|
||||
<%= file_field_tag 'ref_attachments[dummy][file]',
|
||||
:id => 'ref_file',
|
||||
:class => ie8? ? '' : 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => 'addInputFiles(this);',
|
||||
:style => ie8? ? '' : 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js',:project =>nil),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all)
|
||||
} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="fl" onclick="$('#ref_file').click();" title="请选择文件上传">
|
||||
<i class="fa fa-upload mr5"></i>
|
||||
<span>上传附件</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="clearfix mt15 mb15 mr15 pl30 pr30 <%= edit_mode ? '' : 'none' %>" id="homework_setting_submit_block">
|
||||
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-orange fr">确定</a>
|
||||
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">确定</a>
|
||||
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_work_index_path(:homework => @homework.id) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue