Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
This commit is contained in:
commit
cae49e2075
|
|
@ -109,8 +109,9 @@ class ChallengesController < ApplicationController
|
|||
challenge_num = Challenge.where(:shixun_id => @shixun).count
|
||||
challenge_pos = @challenge.position
|
||||
if challenge_pos < challenge_num
|
||||
@next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first
|
||||
@next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos + 1).first
|
||||
end
|
||||
@prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if challenge_pos - 1 > 0
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
|
|
@ -124,6 +125,7 @@ class ChallengesController < ApplicationController
|
|||
if challenge_pos < challenge_num
|
||||
@next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first
|
||||
end
|
||||
@prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if challenge_pos - 1 > 0
|
||||
@tab = params[:tab].blank? ? 1 : params[:tab].to_i
|
||||
@editor = params[:editor] # 编辑模式
|
||||
end
|
||||
|
|
@ -173,6 +175,8 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
# 向jenkins端发送请求,构建公共测试用例
|
||||
add_shixun_modify_status(@shixun, 1)
|
||||
elsif params[:tab].to_i == 5
|
||||
@challenge_tags.delete_all unless @challenge_tags.blank?
|
||||
unless params[:knowledge].blank?
|
||||
|
|
@ -181,8 +185,7 @@ class ChallengesController < ApplicationController
|
|||
end
|
||||
end
|
||||
end
|
||||
# 向jenkins端发送请求,构建公共测试用例
|
||||
add_shixun_modify_status(@shixun, 1)
|
||||
|
||||
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
|
||||
rescue Exception => e
|
||||
flash[:error] = "#{e.message}"
|
||||
|
|
|
|||
|
|
@ -9,47 +9,70 @@ class ManagementsController < ApplicationController
|
|||
# 专业列表
|
||||
def profession
|
||||
@syllabus=Syllabus.where("0=0")
|
||||
@menu_type=11
|
||||
@sub_type=1
|
||||
major_level_option=params[:major_level_option]
|
||||
discipline_category_option=params[:discipline_category_option]
|
||||
first_level_discipline_option=params[:first_level_discipline_option]
|
||||
if major_level_option!='0'
|
||||
@syllabus=@syllabus.where(:major_level=>major_level_option)
|
||||
else
|
||||
@syllabus=@syllabus
|
||||
@menu_type = 12
|
||||
@sub_type = 1
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
major_level_option = params[:major_level] if params[:major_level]
|
||||
discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id]
|
||||
first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id]
|
||||
if major_level_option && major_level_option != '0'
|
||||
@syllabus = @syllabus.where(:major_level=>major_level_option)
|
||||
end
|
||||
|
||||
if discipline_category_option !=nil
|
||||
if discipline_category_option && discipline_category_option != '0'
|
||||
@syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option)
|
||||
end
|
||||
|
||||
if first_level_discipline_option!=nil
|
||||
if first_level_discipline_option && first_level_discipline_option != '0'
|
||||
@syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option)
|
||||
end
|
||||
@syllabus = @syllabus.order("created_at #{@sx_order}")
|
||||
@syllabus_count = @syllabus.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1
|
||||
@offset ||= @syllabus_pages.offset
|
||||
@syllabus = paginateHelper @syllabus, limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# 实训适用课程
|
||||
def applicable_course
|
||||
@majorcourse=MajorCourse.where("0=0")
|
||||
@menu_type = 12
|
||||
@sub_type = 2
|
||||
@courselist = CourseList.where("0=0")
|
||||
search=params[:search]
|
||||
unless search.blank?
|
||||
@courselist = @courselist.where("name like '%#{search}%'")
|
||||
end
|
||||
@courselist = @courselist.reorder("created_at desc")
|
||||
@courselist_count = @courselist.count
|
||||
@limit = 4
|
||||
@is_remote = true
|
||||
@page = params['page'] ? params['page'].to_i : 1
|
||||
@courselist_pages = Paginator.new @courselist_count, @limit, @page
|
||||
@offset ||=@courselist_pages.offset
|
||||
@courselist = paginateHelper @courselist, @limit
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
# 增加课程
|
||||
def add_course
|
||||
courselist= CourseList.create(:name => params[:course])
|
||||
redirect_to applicable_course_managements_path
|
||||
end
|
||||
def add_major
|
||||
@major = Major.where("0=0")
|
||||
end
|
||||
# 单位部门列表
|
||||
def departments
|
||||
@menu_type = 6
|
||||
@sub_type = 2
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
@department =Department.where("0=0")
|
||||
search=params[:search]
|
||||
if search.blank?
|
||||
|
|
@ -57,6 +80,7 @@ class ManagementsController < ApplicationController
|
|||
else
|
||||
@department = @department.where("name like '%#{search}%'")
|
||||
end
|
||||
@department = @department.reorder("created_at #{@sx_order}")
|
||||
@department_count =@department.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -67,26 +91,27 @@ class ManagementsController < ApplicationController
|
|||
format.js
|
||||
format.html
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# 单位列表
|
||||
def departments_part
|
||||
@menu_type = 6
|
||||
@sub_type = 1
|
||||
@schools = School.where("0=0")
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
search=params[:search]
|
||||
if search.blank?
|
||||
@schools = @schools
|
||||
else
|
||||
@schools = @schools.where("name like '%#{search}%'")
|
||||
end
|
||||
@schools = @schools.reorder("created_at #{@sx_order}")
|
||||
@schools_count = @schools.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@schools_pages = Paginator.new @schools_count, limit, params['page'] || 1
|
||||
@offset ||= @schools_pages.offset
|
||||
@schools= paginateHelper @schools, limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
|
@ -99,11 +124,13 @@ class ManagementsController < ApplicationController
|
|||
@sub_type = 3
|
||||
search = params[:search]
|
||||
@apply_status = ApplyAddDepartment.where("0=0")
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
if search.blank?
|
||||
@apply_status = @apply_status.where("0=0")
|
||||
else
|
||||
@apply_status= @apply_status.where("name like '%#{search}%'")
|
||||
end
|
||||
@apply_status = @apply_status.order("created_at #{@sx_order}")
|
||||
@apply_status_count = @apply_status.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -121,19 +148,20 @@ class ManagementsController < ApplicationController
|
|||
@menu_type = 10
|
||||
@sub_type = 4
|
||||
search = params[:search]
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
@apply_status = ApplyAddSchools.where("0=0")
|
||||
if search.blank?
|
||||
@apply_status = @apply_status.where("0=0")
|
||||
else
|
||||
@apply_status= @apply_status.where("name like '%#{search}%'")
|
||||
end
|
||||
@apply_status = @apply_status.order("created_at #{@sx_order}")
|
||||
@apply_status_count = @apply_status.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@apply_status_pages = Paginator.new @apply_status_count, limit, params['page'] || 1
|
||||
@offset ||= @apply_status_pages.offset
|
||||
@apply_status = paginateHelper @apply_status, limit
|
||||
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
|
@ -145,41 +173,32 @@ class ManagementsController < ApplicationController
|
|||
@menu_type = 2
|
||||
@sub_type = 1
|
||||
@syllabus = Syllabus.where("0=0")
|
||||
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
unless params[:school_id] || params[:search] || params[:keyword] || params[:status]
|
||||
user_exs=UserExtensions.where(:user_id=> @syllabus.map(&:user_id))
|
||||
@schools = School.where(:id =>user_exs.map(&:school_id))
|
||||
major_level_option = params[:major_level] if params[:major_level]
|
||||
discipline_category_option = params[:discipline_category_id] if params[:discipline_category_id]
|
||||
first_level_discipline_option = params[:first_level_discipline_id] if params[:first_level_discipline_id]
|
||||
syllabus_major_option = params[:major_id] if params[:major_id]
|
||||
keyword = params[:keyword]
|
||||
search = params[:search]
|
||||
|
||||
if major_level_option && major_level_option != '0'
|
||||
@syllabus = @syllabus.where(:major_level=>major_level_option)
|
||||
end
|
||||
|
||||
major_level_option=params[:major_level_option]
|
||||
discipline_category_option=params[:discipline_category_option]
|
||||
first_level_discipline_option=params[:first_level_discipline_option]
|
||||
syllabus_major_option=params[:syllabus_major_option]
|
||||
keyword=params[:keyword]
|
||||
search=params[:search]
|
||||
if major_level_option!='0'
|
||||
@syllabus=@syllabus.where(:major_level=>major_level_option)
|
||||
else
|
||||
@syllabus=@syllabus
|
||||
end
|
||||
|
||||
if discipline_category_option !=nil
|
||||
if discipline_category_option && discipline_category_option != '0'
|
||||
@syllabus=@syllabus.where(:discipline_category_id=>discipline_category_option)
|
||||
end
|
||||
|
||||
if first_level_discipline_option!=nil
|
||||
if first_level_discipline_option && first_level_discipline_option != '0'
|
||||
@syllabus=@syllabus.where(:first_level_discipline_id=>first_level_discipline_option)
|
||||
end
|
||||
|
||||
if syllabus_major_option!=nil
|
||||
if syllabus_major_option && syllabus_major_option != '0'
|
||||
@syllabus=@syllabus.where(:major_id=>syllabus_major_option)
|
||||
end
|
||||
|
||||
if params[:school_id] && params[:school_id] != '0'
|
||||
@syllabus = Syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}")
|
||||
else
|
||||
@syllabus = @syllabus.where("0=0")
|
||||
if params[:school_id] && params[:school_id] != ''
|
||||
@syllabus = @syllabus.includes(:user => {:user_extensions => []}).where("user_extensions.school_id = #{params[:school_id]}")
|
||||
end
|
||||
|
||||
if search.blank?
|
||||
|
|
@ -189,18 +208,20 @@ class ManagementsController < ApplicationController
|
|||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@syllabus = @syllabus.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
else
|
||||
@syllabus= @syllabus.where("user_id like '%#{search}%'")
|
||||
@syllabus= @syllabus.where("title like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
@syllabus_count = @syllabus.count
|
||||
|
||||
@syllabus = @syllabus.order("syllabuses.created_at #{@sx_order}")
|
||||
@syllabus_count = @syllabus.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
@syllabus_pages = Paginator.new @syllabus_count, limit, params['page'] || 1
|
||||
@offset ||= @syllabus_pages.offset
|
||||
@syllabus = paginateHelper @syllabus, limit
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
format.html
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -210,35 +231,40 @@ class ManagementsController < ApplicationController
|
|||
@sub_type = 2
|
||||
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
|
||||
@courses = Course.where("0=0")
|
||||
# @courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").order("updatetime desc")
|
||||
@timing=Course.where(:is_end=>false).count
|
||||
@end=Course.where(:is_end=>true).count
|
||||
unless params[:school_id] || params[:search] || params[:keyword] || params[:status]
|
||||
user_exs=UserExtensions.where(:school_id=> @courses.map(&:school_id))
|
||||
@schools = School.where(:id =>user_exs.map(&:school_id))
|
||||
end
|
||||
search = params[:search] # 搜索字
|
||||
keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
|
||||
@search = params[:search] # 搜索字
|
||||
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
|
||||
status = params[:status].to_i
|
||||
|
||||
if params[:school_id] && params[:school_id] != '0'
|
||||
@courses =Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}").order("created_at #{@sx_order}")
|
||||
else
|
||||
@courses = Course.where("0=0").order("created_at #{@sx_order}")
|
||||
@school_id = params[:school_id]
|
||||
@courses =Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}")
|
||||
end
|
||||
|
||||
if params[:homepage_show]
|
||||
@courses = @courses.where(:homepage_show => params[:homepage_show].to_i)
|
||||
end
|
||||
|
||||
if params[:status] && params[:status]!=''
|
||||
@courses =@courses.where(:is_end =>status).order("created_at #{@sx_order}")
|
||||
@status = params[:status]
|
||||
@courses =@courses.where(:is_end =>status)
|
||||
end
|
||||
if "u_name" == keyword
|
||||
if search.blank?
|
||||
@courses = @courses.order("created_at #{@sx_order}")
|
||||
if "u_name" == @keyword
|
||||
if @search.blank?
|
||||
@courses = @courses
|
||||
else
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{search}%'").order("created_at #{@sx_order}")
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{@search}%'")
|
||||
@courses = @courses.joins("join users u on courses.tea_id = u.id").where("concat(u.lastname, u.firstname) like '%#{@search}%'")
|
||||
end
|
||||
else
|
||||
@courses= @courses.where("name like '%#{search}%'").order("created_at #{@sx_order}")
|
||||
@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 desc")
|
||||
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime #{@sx_order}")
|
||||
@courses_count = @courses.count
|
||||
limit = 20
|
||||
@is_remote = true
|
||||
|
|
@ -251,6 +277,14 @@ class ManagementsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# 班级首页显示
|
||||
def course_homepage_show
|
||||
if params[:course_id]
|
||||
course = Course.find params[:course_id]
|
||||
course.update_attributes(:homepage_show => !course.homepage_show)
|
||||
end
|
||||
end
|
||||
|
||||
# 课程实训
|
||||
def class_shixuns
|
||||
@menu_type = 4
|
||||
|
|
@ -273,13 +307,12 @@ class ManagementsController < ApplicationController
|
|||
@c_shixuns = @c_shixuns
|
||||
else
|
||||
if "u_name" == keyword
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
# user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@c_shixuns = @c_shixuns.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
else
|
||||
@c_shixuns= @c_shixuns.where("name like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
@c_shixuns = @c_shixuns.reorder("created_at desc")
|
||||
unless params[:school_id] || params[:search] || params[:keyword] || params[:status]
|
||||
user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id))
|
||||
@schools = School.where(:id => user_exs.map(&:school_id))
|
||||
|
|
@ -307,20 +340,19 @@ class ManagementsController < ApplicationController
|
|||
@c_shixuns = Subject.where(:status => 2)
|
||||
end
|
||||
if search.blank?
|
||||
@c_shixuns = @c_shixuns
|
||||
else
|
||||
if "u_name" == keyword
|
||||
|
||||
elsif "u_name" == keyword
|
||||
# 如果用户搜索为空,不用遍历user表,直接查找所有实训, 有搜索时才查找user
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
user_id = User.where("concat(lastname, firstname) like '%#{search}%'")
|
||||
@c_shixuns = @c_shixuns.includes(:user).where("concat(users.lastname, users.firstname) like '%#{search}%'")
|
||||
else
|
||||
@c_shixuns= @c_shixuns.where("name like '%#{search}%'")
|
||||
end
|
||||
end
|
||||
unless params[:school_id] || params[:search] || params[:keyword]
|
||||
user_exs = UserExtensions.where(:user_id => @c_shixuns.map(&:user_id))
|
||||
@schools = School.where(:id => user_exs.map(&:school_id))
|
||||
end
|
||||
@c_shixuns = @c_shixuns.order("created_at desc")
|
||||
respond_to do |format|
|
||||
format.js
|
||||
format.html
|
||||
|
|
@ -420,6 +452,9 @@ class ManagementsController < ApplicationController
|
|||
else
|
||||
@shixuns = Shixun.where("name like '%#{search}%'").where(:status => 2).order("created_at #{@sx_order}")
|
||||
end
|
||||
if params[:homepage_show]
|
||||
@shixuns = @shixuns.where(:homepage_show => params[:homepage_show].to_i)
|
||||
end
|
||||
@shixuns_count = @shixuns.count
|
||||
limit = 20
|
||||
@shixuns_pages = Paginator.new @shixuns_count, limit, params['page'] || 1
|
||||
|
|
@ -430,6 +465,13 @@ class ManagementsController < ApplicationController
|
|||
format.html
|
||||
end
|
||||
end
|
||||
# 实训首页显示
|
||||
def shixun_homepage_show
|
||||
if params[:shixun_id]
|
||||
shixun = Shixun.find params[:shixun_id]
|
||||
shixun.update_attributes(:homepage_show => !shixun.homepage_show)
|
||||
end
|
||||
end
|
||||
|
||||
# 已关闭的实训
|
||||
def close_shixuns
|
||||
|
|
@ -722,7 +764,7 @@ class ManagementsController < ApplicationController
|
|||
|
||||
def shixun_authorization
|
||||
@menu_type = 10
|
||||
@sub_type == 5
|
||||
@sub_type == 5
|
||||
@type = trial_authorization_status params[:type]
|
||||
@authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type).order("created_at desc")
|
||||
search = params[:search]
|
||||
|
|
|
|||
|
|
@ -82,8 +82,9 @@ class ShixunsController < ApplicationController
|
|||
@sort = "asc"
|
||||
search = params[:search]
|
||||
@shixun_all_count = Shixun.all.count
|
||||
#@shixuns = Shixun.find_by_sql("select * from shixuns where id in (SELECT distinct(shixun_id) FROM `challenges`) and name like '%#{search}%' order by created_at desc")
|
||||
@shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%").reorder("created_at desc")
|
||||
#@shixuns = Shixun.find_by_sql("select * from shixuns where id in (SELECT distinct(shixun_id) FROM `challenges`) and name like '%#{search}%' order by updated_at desc")
|
||||
#@shixuns = Shixun.where("name like ?", "%#{search}%")
|
||||
@shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%")
|
||||
# @shixun_my_score = Game.find_by_sql("select sum(final_score) as score from games where myshixun_id in (select id from myshixuns where status =1
|
||||
# and user_id=#{User.current.id} and shixun_id in (SELECT id FROM `shixuns` where status > 1))").first.try(:score).to_i
|
||||
@shixuns.each do |shixun|
|
||||
|
|
@ -161,8 +162,8 @@ class ShixunsController < ApplicationController
|
|||
@order = params[:order] || "myshixun_count"
|
||||
bsort = params[:sort] || "desc"
|
||||
@sort = bsort == "desc" ? "asc" : "desc"
|
||||
if @order == "created_at"
|
||||
order_str = "#{Shixun.table_name}.created_at #{bsort}"
|
||||
if @order == "updated_at"
|
||||
order_str = "#{Shixun.table_name}.updated_at #{bsort}"
|
||||
else
|
||||
order_str = "myshixun_count #{bsort}, #{Shixun.table_name}.updated_at #{bsort}"
|
||||
end
|
||||
|
|
@ -410,7 +411,6 @@ class ShixunsController < ApplicationController
|
|||
|
||||
def new
|
||||
@shixun = Shixun.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html{render :layout => 'base_edu'}
|
||||
format.json
|
||||
|
|
@ -482,7 +482,7 @@ class ShixunsController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
if @shixun.status == 0
|
||||
#if @shixun.status == 0
|
||||
language = @shixun.language
|
||||
@shixun.attributes = params[:shixun]
|
||||
@shixun.language = params[:language]
|
||||
|
|
@ -501,9 +501,9 @@ class ShixunsController < ApplicationController
|
|||
add_shixun_modify_status(@shixun, 1)
|
||||
end
|
||||
end
|
||||
else
|
||||
@error = "该实训已申请发布了,暂不能编辑"
|
||||
end
|
||||
#else
|
||||
# @error = "该实训已申请发布了,暂不能编辑"
|
||||
#end
|
||||
respond_to do |format|
|
||||
format.html{redirect_to settings_shixun_url(@shixun)}
|
||||
format.js
|
||||
|
|
|
|||
|
|
@ -1,20 +1,33 @@
|
|||
module ManagementsHelper
|
||||
|
||||
def trial_authorization_status status
|
||||
case status
|
||||
when "0", nil
|
||||
0
|
||||
when "1"
|
||||
1
|
||||
when "2"
|
||||
2
|
||||
else
|
||||
[1,2]
|
||||
end
|
||||
end
|
||||
|
||||
def query_user_status_num status
|
||||
user = (status == 0) ? user = User.all : User.where(:status => status)
|
||||
return user.count
|
||||
end
|
||||
end
|
||||
module ManagementsHelper
|
||||
|
||||
def trial_authorization_status status
|
||||
case status
|
||||
when "0", nil
|
||||
0
|
||||
when "1"
|
||||
1
|
||||
when "2"
|
||||
2
|
||||
else
|
||||
[1,2]
|
||||
end
|
||||
end
|
||||
|
||||
def query_user_status_num status
|
||||
user = (status == 0) ? user = User.all : User.where(:status => status)
|
||||
return user.count
|
||||
end
|
||||
|
||||
def course_list_major_time id
|
||||
Major.where(:id => id).first.try(:name)
|
||||
end
|
||||
|
||||
# params[:id]: course_list_id
|
||||
def get_course_list_major id
|
||||
Major.where(:id => MajorCourse.where(:course_list_id => id).map(&:major_id))
|
||||
end
|
||||
|
||||
def course_list_count id
|
||||
Major.where(:id => id).first.try(:name)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class Course < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term, :choose_group_allow, :is_end
|
||||
attr_accessible :code, :extra, :name, :state, :tea_id, :time , :location, :state, :term, :password,:is_public,:description,:class_period, :open_student, :enterprise_name, :is_delete, :syllabus_id, :end_time, :end_term, :choose_group_allow, :is_end, :homepage_show
|
||||
#belongs_to :project, :class_name => 'Course', :foreign_key => :extra, primary_key: :identifier
|
||||
belongs_to :teacher, :class_name => 'User', :foreign_key => :tea_id, :dependent => :destroy # 定义一个方法teacher,该方法通过tea_id来调用User表
|
||||
belongs_to :school, :class_name => 'School', :foreign_key => :school_id #定义一个方法school,该方法通过school_id来调用School表
|
||||
|
|
@ -105,7 +105,8 @@ class Course < ActiveRecord::Base
|
|||
'end_term',
|
||||
'os_allow',
|
||||
'choose_group_allow',
|
||||
'credit'
|
||||
'credit',
|
||||
'homepage_show'
|
||||
|
||||
acts_as_customizable
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#
|
||||
class Shixun < ActiveRecord::Base
|
||||
attr_accessible :description, :is_public, :name, :changeset_num, :status, :user_id, :gpid, :language, :identifier, :authentication,
|
||||
:myshixun_count, :propaedeutics, :trainee, :major_id
|
||||
:myshixun_count, :propaedeutics, :trainee, :major_id, :homepage_show
|
||||
|
||||
has_many :users, :through => :shixun_members
|
||||
has_many :shixun_members, :dependent => :destroy
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
class ShixunMajorCourse < ActiveRecord::Base
|
||||
belongs_to :shixun
|
||||
belongs_to :major
|
||||
belongs_to :course_list
|
||||
#attr_accessible :course_list
|
||||
end
|
||||
class ShixunMajorCourse < ActiveRecord::Base
|
||||
belongs_to :shixun
|
||||
belongs_to :major
|
||||
belongs_to :course_list
|
||||
#attr_accessible :course_list
|
||||
end
|
||||
|
|
|
|||
|
|
@ -36,24 +36,26 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
</h4>
|
||||
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
|
||||
<% if User.current.manager_of_shixun?(@shixun) %>
|
||||
<p class="fr" id="shixun_icon_<%= index %>">
|
||||
<a href="javascript:void(0);" class="mr5" onclick="delete_confirm_box_2('<%= shixun_challenge_path(challenge, :shixun_id => @shixun) %>', '确定要删除该任务吗?')" data-tip-down="删除" ><i class="fa fa-trash-o color-grey font-16" ></i></a>
|
||||
<% unless challenge.position < 2 %>
|
||||
<a href="<%= index_up_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="上移" data-remote="true" class="mr5"><i class="fa fa-long-arrow-up color-grey font-16"></i></a>
|
||||
<% if @shixun.status == 0 %>
|
||||
<a href="javascript:void(0);" class="mr5" onclick="delete_confirm_box_2('<%= shixun_challenge_path(challenge, :shixun_id => @shixun) %>', '确定要删除该任务吗?')" data-tip-down="删除" ><i class="fa fa-trash-o color-grey font-16" ></i></a>
|
||||
<% unless challenge.position < 2 %>
|
||||
<a href="<%= index_up_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="上移" data-remote="true"><i class="fa fa-long-arrow-up color-grey font-16 mr5" ></i></a>
|
||||
<% end %>
|
||||
<% if @shixun.challenges.count != challenge.position %>
|
||||
<a href="<%= index_down_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="下移" data-remote="true"><i class="fa fa-long-arrow-down color-grey font-16 mr5" ></i></a>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if @shixun.challenges.count != challenge.position %>
|
||||
<a href="<%= index_down_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="下移" data-remote="true" class="mr5"><i class="fa fa-long-arrow-down color-grey font-16"></i></a>
|
||||
<% end %>
|
||||
<a href="<%= edit_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" data-tip-down="编辑" class="mr5"><i class="fa fa-pencil-square-o color-grey font-16"></i></a>
|
||||
<a href="<%= edit_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="编辑" ><i class="fa fa-pencil-square-o color-grey font-16 mr5" ></i></a>
|
||||
<!-- <a href="#" title="删除" ><i class="fa fa-trash-o color-grey font-16 mr5" ></i></a>-->
|
||||
<!--<a href="#" title="排名" ><i class="fa fa-signal color-grey font-16 mr5 " ></i></a>-->
|
||||
</p>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<p class="ml25 color-grey challenge_details">
|
||||
<span class="mr100 itoblock_w150"><%= shixun_done(@shixun, challenge.position).to_i %>人 完成挑战</span>
|
||||
<span class="mr100 itoblock_w150"><%= shixun_running(@shixun, challenge.position).to_i %>人 正在挑战</span>
|
||||
<span class="mr100 itoblock_w150"><%= shixun_done(@shixun, challenge.position).to_i %>人 完成挑战</span>
|
||||
<span class="mr100 w150 g_frame"><%= challenge.score %>经验值</span>
|
||||
<span class="mr400 fr"><%= find_game_status challenge.id %></span>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<a href="javascript:void(0);" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge" style="color: #627bfd;float: left;margin-top: 5px">+添加</a>
|
||||
</div>
|
||||
</li>
|
||||
<p class="color-red ml95" style="height: 25px;"><span id="stage_name_notice" style="display: none;"><i class="fa fa-exclamation-circle color-red mr5"></i>知识/技能点不能为空</span></p>
|
||||
<p class="color-red ml95" style="height: 25px;"><span id="stage_name_notice" style="display: none;"><i class="fa fa-exclamation-circle color-red mr5"></i>技能标签不能为空</span></p>
|
||||
<div class="prop-notice-info mb10 ml95">
|
||||
<ol>
|
||||
<% if @st == 0 %>
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@
|
|||
<% unless @next_challenge.blank? %>
|
||||
<a href="<%= edit_shixun_challenge_path(@next_challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr ml10">下一阶段</a>
|
||||
<% end %>
|
||||
<% unless @prev_challenge.blank? %>
|
||||
<a href="<%= edit_shixun_challenge_path(@prev_challenge, :shixun_id => @shixun) %>" class="shixun-task-btn task-btn-green fr ml10">上一阶段</a>
|
||||
<% end %>
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<!-- <a href="<%#= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>-->
|
||||
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr">+实践任务</a>
|
||||
|
|
@ -55,9 +58,9 @@
|
|||
<li class="fl <%= @tab == 3 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3) %>" class="color-black">参考答案</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 6 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="color-black">预备知识</a>
|
||||
</li>
|
||||
<!-- <li class="fl <%#= @tab == 6 ? "check_nav" : "" %>">
|
||||
<a href="<%#= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="color-black">预备知识</a>
|
||||
</li>-->
|
||||
<li class="fl <%= @tab == 4 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
|
||||
</li>
|
||||
|
|
@ -76,8 +79,8 @@
|
|||
<%= render :partial => "edit_scoring" %>
|
||||
<% elsif @tab == 5 %>
|
||||
<%= render :partial => "edit_skill" %>
|
||||
<% elsif @tab == 6 %>
|
||||
<%= render :partial => "edit_propaedeutics" %>
|
||||
<%# elsif @tab == 6 %>
|
||||
<%#= render :partial => "edit_propaedeutics" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">过关任务</a>
|
||||
</li>
|
||||
<li id="tab_nav_2" onclick="HoverLi1(2);">
|
||||
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">预备知识</a>
|
||||
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">背景知识</a>
|
||||
</li>
|
||||
<% unless @game_challenge.answer.blank? %>
|
||||
<li id="tab_nav_3">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
<div class="fit -scroll">
|
||||
<div class="-layout-v -fit">
|
||||
<div class="-flex -scroll task-padding16 panel-box-sizing new_li read_only" unselectable="on" id="game_ready_knowledge">
|
||||
<textarea style="display:none;"><%= @game_challenge.ready_knowledge %></textarea>
|
||||
<textarea style="display:none;"><%= @shixun.propaedeutics %></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,19 @@
|
|||
<a class="fr" title="未解锁"><i class="fa fa-lock fr font-18 mt5 color-grey w20_center" ></i></a>
|
||||
<% end %>
|
||||
<div class="cl"></div>
|
||||
<div style="text-align: right;display: flex">
|
||||
<% if game.try(:status) == 0 || game.try(:status) == 1 || game.try(:status) == 3 %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="mr5" style="position: absolute;right: 50px"><%= challenge.score %></span>经验值</span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="mr5" style="position: absolute;right: 40px"><%= challenge.score %></span>金币</span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="mr5" style="position: absolute;right: 63px"><%= challenge.challenge_tags.count %></span>技能标签</span>
|
||||
<% elsif game.try(:status) == 2 %>
|
||||
<% final_score = (game.answer_open? || @shixun.status <= 1) ? 0 : game.final_score.to_i %>
|
||||
<% gold_score = @shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="color-light-green mr5" style="position: absolute;right: 50px">+<%= final_score %></span>经验值</span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> mr5" style="position: absolute;right: 40px"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span>金币</span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly"><span class="color-light-green mr5" style="position: absolute;right: 63px">+<%= (game.answer_open? || @shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span>技能标签</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
</li>
|
||||
|
||||
<li class="clearfix" id="sy_010">
|
||||
<a href="<%=course_statistics_course_path(@course) %>" class="fl ml15 ">统计</a>
|
||||
<a href="<%= course_statistics_course_path(@course) %>" class="fl ml15 ">统计</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<% when 6 %>
|
||||
<%= @sub_type == 1 ? "单位列表" :"单位部门列表" %>
|
||||
<% when 7 %>
|
||||
<%= @sub_type == 1 ? "用户列表" :"适用授权列表" %>
|
||||
<%= @sub_type == 1 ? "用户列表" :"试用授权列表" %>
|
||||
<% when 8 %>
|
||||
消息
|
||||
<% when 9 %>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<% when 11 %>
|
||||
工程认证+
|
||||
<% when 12 %>
|
||||
其他
|
||||
<%= @sub_type == 1 ?"专业列表" : "实训适用课程列表" %>
|
||||
<% end %>
|
||||
</span>
|
||||
</p>
|
||||
|
|
@ -98,7 +98,7 @@
|
|||
</ul>
|
||||
</li>
|
||||
<li class="fl edu-admin-nav-li "><a href="javascript:void(0);" class="edu-admin-nav-a">工程认证+</a></li>
|
||||
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 11 %>" style="width: 120px"><a href="javascript:void(0);" class="edu-admin-nav-a" style="border-right:none;">其它</a>
|
||||
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 12 %>" style="width: 120px"><a href="javascript:void(0);" class="edu-admin-nav-a" style="border-right:none;">其它</a>
|
||||
<ul class="edu-admin-nav-inner">
|
||||
<li style="width: 120px"><%= link_to "专业列表",profession_managements_path %></li>
|
||||
<li style="width: 120px"><%= link_to "实训适用课程列表", applicable_course_managements_path %></li>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<div class="task-header-nav">
|
||||
<ul class="task-header-navs clearfix">
|
||||
<li><a href="<%= shixun_challenges_url(@shixun) %>" class="<%= params[:action] == "index" ? "active" : "" %>" >实训</a></li>
|
||||
<!--<li><a href="<%#= propaedeutics_shixun_path(@shixun) %>" class="<%#= params[:action] == "propaedeutics" ? "active" : "" %>" >预备知识</a></li>-->
|
||||
<li><a href="<%= propaedeutics_shixun_path(@shixun) %>" class="<%= params[:action] == "propaedeutics" ? "active" : "" %>" >背景知识</a></li>
|
||||
<% if User.current.manager_of_shixun?(@shixun) %>
|
||||
<li>
|
||||
<%= link_to l(:project_module_repository),
|
||||
|
|
|
|||
|
|
@ -4,20 +4,73 @@
|
|||
<th width="9%">序号</th>
|
||||
<th width="30%" class="edu-txt-left">课程名称</th>
|
||||
<th width="30%" class="edu-txt-left">专业名称</th>
|
||||
<th width="15%"class="eud-pointer">创建时间<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="15%" class="eud-pointer">创建时间<i class="fa fa-long-arrow-down %> color-light-green ml5"></i></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @majorcourse.each_with_index do |majorcourse,index|%>
|
||||
<tr>
|
||||
<td><%= majorcourse.course_list_id%></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<% count = 0 %>
|
||||
<% @courselist.each_with_index do |courselist,index|%>
|
||||
<tr>
|
||||
<td>
|
||||
<% count = ((@page - 1) * @limit) + index + 1 %>
|
||||
<%= count %>
|
||||
</td>
|
||||
<td class="edu-txt-left">
|
||||
<%= courselist.name %>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
<td>
|
||||
<%= format_time courselist.created_at %>
|
||||
</td>
|
||||
<td><a href="javascript:void(0)">添加专业</a></td>
|
||||
</tr>
|
||||
<% get_course_list_major(courselist.id).each_with_index do |smc, j| %>
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td class="edu-txt-left">
|
||||
</td>
|
||||
<td class="edu-txt-left">
|
||||
<%= smc.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= format_time courselist.created_at %>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<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 @courselist_pages, @courselist_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function add_major(){
|
||||
var htmlvalue ='<%#= form_tag(url_for(add_major_managements_path),:id=>"add_major",:method => "post",:remote=>true) do %>'+
|
||||
'<div style="width:300px" class="task-popup">'+
|
||||
'<b class="ml10 mt20 mb 20">适用课程添加所属专业</b>'+
|
||||
'<select class="fl task-height-30">' +
|
||||
'<option value="0" selected="selected">请选择支撑实训的专业名称</option>'+
|
||||
// '<%# get_course_list_major(@courselist.id).each_with_index do |smc, j| %>'+
|
||||
// '<option value="<%#= smc.id %>"><%#= smc.name %>'+
|
||||
// '</option>'+
|
||||
// '<%# end %>'+
|
||||
'</select>' +
|
||||
'</div>'
|
||||
'<%# end %>';
|
||||
pop_box_new(htmlvalue, 300, 400)
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<th width="40%" class="edu-txt-left">实训套件名称</th>
|
||||
<th width="20%" class="edu-txt-left">单位</th>
|
||||
<th width="15%">创建者</th>
|
||||
<th >发布时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title="功能完善中,敬请期待"></i></th>
|
||||
<th class="eud-pointer">发布时间<i class="fa fa-long-arrow-down color-light-green ml5"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -19,5 +19,4 @@
|
|||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<th width="8%">状态</th>
|
||||
<th width="20%" class="edu-txt-left">单位</th>
|
||||
<th width="8%">创建者</th>
|
||||
<th width="11%">创建时间<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="11%" class="eud-pointer">创建时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -38,11 +38,21 @@
|
|||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= class_shixuns_managements_path %>",
|
||||
data: $("#class_shixuns_search").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
|
||||
$(function(){
|
||||
$(".subject_hidden").on("click", 'input', function(ev){
|
||||
var id = $(ev.target).parent().find("div").html();
|
||||
$.ajax({
|
||||
|
|
@ -52,4 +62,4 @@
|
|||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,44 +1,45 @@
|
|||
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="9%">ID</th>
|
||||
<th width="20%" class="edu-txt-left">班级名称</th>
|
||||
<th width="4%">成员</th>
|
||||
<th width="4%">资源</th>
|
||||
<th width="4%">作业</th>
|
||||
<th width="4%">试卷</th>
|
||||
<th width="4%">私有</th>
|
||||
<th width="4%">模版</th>
|
||||
<th width="8%">状态</th>
|
||||
<th width="13%" class="edu-txt-left">创建者单位</th>
|
||||
<th width="11%">创建者</th>
|
||||
<th class="eud-pointer" width="11%">创建时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title="功能完善中,敬请期待"></i></th>
|
||||
<th>首页显示</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr>
|
||||
<td><%= course.id %></td>
|
||||
<td class="edu-txt-left"><a href=""><%= link_to course.name, school_on_search_path(course.name) %></a></td>
|
||||
<td><%= course.members.count %></td>
|
||||
<td><%= course.attachments.count %></td>
|
||||
<td><%= course.homework_commons.count%></td>
|
||||
<td><%= course.exercises.count %></td>
|
||||
<td><%= course.is_public.to_i == 1 ? '--' : '√' %></td>
|
||||
<td></td>
|
||||
<td><%= course.is_end ? "已结束" : "正在进行" %></td>
|
||||
<td class="edu-txt-left"><%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %></td>
|
||||
<td> <%= link_to course.teacher.show_name, user_path(course.teacher) %></td>
|
||||
<td> <%= format_time(course.updatetime) %></td>
|
||||
<td class="operate"><span class="fr shixun_webssh">
|
||||
<input type="checkbox" value="0" class="ml-3 mr5 magic-checkbox" id="join_course_role_24">
|
||||
<label style="top:-14px;padding-left: 35px;" for="join_course_role_24"></label></span>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="9%">ID</th>
|
||||
<th width="20%" class="edu-txt-left">班级名称</th>
|
||||
<th width="4%">成员</th>
|
||||
<th width="4%">资源</th>
|
||||
<th width="4%">作业</th>
|
||||
<th width="4%">试卷</th>
|
||||
<th width="4%">私有</th>
|
||||
<th width="4%">模版</th>
|
||||
<th width="8%">状态</th>
|
||||
<th width="13%" class="edu-txt-left">创建者单位</th>
|
||||
<th width="11%">创建者</th>
|
||||
<th class="eud-pointer" width="11%">动态时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title="功能完善中,敬请期待"></i></th>
|
||||
<th>首页显示</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @courses.each do |course| %>
|
||||
<tr>
|
||||
<td><%= course.id %></td>
|
||||
<td class="edu-txt-left"><%= link_to course.name, course_path(course.id) %></a></td>
|
||||
<td><%= course.members.count %></td>
|
||||
<td><%= course.attachments.count %></td>
|
||||
<td><%= course.homework_commons.count%></td>
|
||||
<td><%= course.exercises.count %></td>
|
||||
<td><%= course.is_public.to_i == 1 ? '--' : '√' %></td>
|
||||
<td></td>
|
||||
<td><%= course.is_end ? "已结束" : "正在进行" %></td>
|
||||
<td class="edu-txt-left"><%= course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.try(:user_extensions).try(:school) %></td>
|
||||
<td> <%= link_to course.teacher.show_name, user_path(course.teacher) %></td>
|
||||
<td> <%= format_time(course.updatetime) %></td>
|
||||
<td>
|
||||
<input type="checkbox" name="homepage_show" value="<%= course.id %>" <%= course.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= course.id %>">
|
||||
<label style="top:-14px;padding-left: 35px;float:right;" for="join_course_role_<%= course.id %>"></label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="cl"></div>
|
||||
<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">
|
||||
|
|
@ -51,10 +52,20 @@
|
|||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= classroom_classment_managements_path %>",
|
||||
data: {sx_order:sx_order},
|
||||
data: $("#class_publish_shixuns_search").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
$("input[name='homepage_show']").click(function(){
|
||||
var homepage_show_val = $(this).val();
|
||||
$.ajax({
|
||||
url:"<%= course_homepage_show_managements_path %>",
|
||||
data: {course_id: homepage_show_val},
|
||||
type: 'post',
|
||||
dateType: "script"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -3,13 +3,12 @@
|
|||
<tr>
|
||||
<th width="9%">ID</th>
|
||||
<th width="10%">层级</th>
|
||||
<th width="12%" class="edu-txt-left">学科门类</th>
|
||||
<th width="12%" class="edu-txt-left">学科门类</th>
|
||||
<th width="12%">一级学科</th>
|
||||
<th width="12%">专业名称</th>
|
||||
<th width="15%" class="edu-txt-left">课程名称</th>
|
||||
<th width="12%">创建者</th>
|
||||
<th width="10%" class="edu-pointer">创建时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th>课堂模版</th>
|
||||
<th class="eud-pointer">创建时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -20,13 +19,11 @@
|
|||
<td class="edu-txt-left"><%= syllabus.syllabus_discipline_category == '' ? "--" : syllabus.syllabus_discipline_category %></td>
|
||||
<td><%= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %></td>
|
||||
<td><%= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %></td>
|
||||
<td class="edu-txt-left"> <%= render :partial => 'admin/rename_syllabus_title', :locals => {:syllabus => syllabus} %></td>
|
||||
<td class="edu-txt-left"> <%#= render :partial => 'admin/rename_syllabus_title', :locals => {:syllabus => syllabus} %>
|
||||
<%= link_to syllabus.title,syllabus_path(syllabus.id) %>
|
||||
</td>
|
||||
<td><%= link_to syllabus.user.show_name, user_path(syllabus.user) %></td>
|
||||
<td><%= format_time syllabus.created_at %></td>
|
||||
<td class="operate"><span class="fr shixun_webssh">
|
||||
<input type="checkbox" value="0" class="ml-3 mr5 magic-checkbox" id="join_course_role_24">
|
||||
<label style="top:-14px;padding-left: 45px;" for="join_course_role_24"></label>
|
||||
</span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
@ -39,4 +36,16 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= classroom_managements_path %>",
|
||||
data: $("#classroom").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
<th width="9%">序号</th>
|
||||
<th width="25%" class="edu-txt-left">部门名称</th>
|
||||
<th width="30%" class="edu-txt-left">单位名称</th>
|
||||
<th width="15%"class="eud-pointer">创建于<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width=""></th>
|
||||
<th width="15%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<td><%= apply.id %></td>
|
||||
<td class="edu-txt-left"> <%= apply.name %></td>
|
||||
<td class="edu-txt-left"> <%= apply.school.name %></td>
|
||||
<td > <%= format_date(apply.created_at) %></td>
|
||||
<td><%= format_time apply.created_at %></td>
|
||||
<td class="center">
|
||||
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_departments', :id => apply.id }, :class => "application-default-link" ) %>
|
||||
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_departments', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure), :class => "application-default-link") %>
|
||||
|
|
@ -33,12 +33,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// var find=$("#shixun_Look_name").val();
|
||||
function myFunction(){
|
||||
if($("#shixun_Look_name").val()==""){
|
||||
$(".d-none").css("display","none");
|
||||
}else{
|
||||
$(".d-none").css("display","block");
|
||||
}
|
||||
}
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= depart_managements_path %>",
|
||||
data: $("#depart_search").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<th width="30%" class="edu-txt-left">部门名称</th>
|
||||
<th width="15%">用户数</th>
|
||||
<th width="15%">已认证职业</th>
|
||||
<th width="20%">创建于<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="20%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title=""></i></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -39,4 +39,15 @@
|
|||
$(".d-none").css("display","block");
|
||||
}
|
||||
}
|
||||
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= departments_managements_path %>",
|
||||
data: $("#department_search").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<th width="19%" class="edu-txt-left">详细地址</th>
|
||||
<th style="width: 6%;" >用户数</th>
|
||||
<th width="6%">部门数</th>
|
||||
<th width="15%"class="eud-pointer">创建于<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="15%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -18,7 +18,6 @@
|
|||
<td><%= schools.id %></td>
|
||||
<td>
|
||||
<%= image_tag(schools.logo_link,width:40,height:40) %>
|
||||
|
||||
</td>
|
||||
<td class="edu-txt-left">
|
||||
<span>
|
||||
|
|
@ -49,12 +48,14 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
// var find=$("#shixun_Look_name").val();
|
||||
function myFunction(){
|
||||
if($("#shixun_Look_name").val()==""){
|
||||
$(".d-none").css("display","none");
|
||||
}else{
|
||||
$(".d-none").css("display","block");
|
||||
}
|
||||
}
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= departments_part_managements_path %>",
|
||||
data: $("#department_part_search").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<th width="12%" class="edu-txt-left">学科门类</th>
|
||||
<th width="12%" class="edu-txt-left">一级学科</th>
|
||||
<th width="28%" class="edu-txt-left">专业名称</th>
|
||||
<th width="15%"class="eud-pointer">创建时间<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="15%"class="eud-pointer">创建时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" ></i></th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<td> <%= format_time syllabus.created_at %></td>
|
||||
<td class="operate edu-txt-left"><span class="fr shixun_webssh">
|
||||
<input type="checkbox" value="0" class="magic-checkbox" id="join_course_role_<%= syllabus.id%>">
|
||||
<label style="top:-3px;padding-left: 25px;" for="join_course_role_<%= syllabus.id%>">支撑实训</label>
|
||||
<label style="top:-3px;padding-left: 25px;" for="join_course_role_<%= syllabus.id %>">支撑实训</label>
|
||||
</span></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
|
@ -36,4 +36,15 @@
|
|||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(".eud-pointer").on("click",function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= profession_managements_path %>",
|
||||
data: $("#profession").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
<table class="edu-pop-table edu-txt-center" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
|
||||
<thead>
|
||||
<th width="10%">ID</th>
|
||||
<th class="table_Name_text" width="30%">实训名称</th>
|
||||
<th width="9%">ID</th>
|
||||
<th class="table_Name_text" >实训名称</th>
|
||||
<th width="8%">顶</th>
|
||||
<th width="8%">踩</th>
|
||||
<th width="8%">已通关</th>
|
||||
<th width="8%">已开启</th>
|
||||
<th width="8%">创建者</th>
|
||||
<th width="9%">已开启</th>
|
||||
<th width="9%">创建者</th>
|
||||
<th class="eud-pointer" width="11%">发布时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title="功能完善中,敬请期待"></i></th>
|
||||
<th width="9%">操作</th>
|
||||
<th>首页显示</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @shixuns.each do |shixun| %>
|
||||
|
|
@ -28,6 +29,10 @@
|
|||
<td class="operate">
|
||||
<%= link_to "关闭", publish_shixuns_managements_path(:close => shixun.id), :class => "", :remote => true %>
|
||||
</td>
|
||||
<td>
|
||||
<input type="checkbox" name="homepage_show" value="<%= shixun.id %>" <%= shixun.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= shixun.id %>">
|
||||
<label style="top:-14px;" class="ml75" for="join_course_role_<%= shixun.id %>"></label>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
|
@ -50,5 +55,14 @@
|
|||
data: {sx_order:sx_order},
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
$("input[name='homepage_show']").click(function(){
|
||||
var homepage_show_val = $(this).val();
|
||||
$.ajax({
|
||||
url:"<%= shixun_homepage_show_managements_path %>",
|
||||
data: {shixun_id: homepage_show_val},
|
||||
type: 'post',
|
||||
dateType: "script"
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
<th width="15%">地区</th>
|
||||
<th width="20%" class="edu-txt-left">详细地址</th>
|
||||
<th width="10%">申请者</th>
|
||||
<th width="10%">创建于<i class="fa fa-long-arrow-down color-light-green ml5" title=""></i></th>
|
||||
<th width="10%" class="eud-pointer">创建于<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5"></i></th>
|
||||
<th width="10%"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<%= format_date(apply.created_at) %>
|
||||
<%= format_time(apply.created_at) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %>
|
||||
|
|
@ -91,13 +91,14 @@
|
|||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// var find=$("#shixun_Look_name").val();
|
||||
// function myFunction(){
|
||||
// if($("#shixun_Look_name").val()==""){
|
||||
// $(".d-none").css("display","none");
|
||||
// }else{
|
||||
// $(".d-none").css("display","block");
|
||||
// }
|
||||
// }
|
||||
|
||||
$(".eud-pointer").on("click", function(ev){
|
||||
var nArrow = $(this).find("i");
|
||||
var sx_order = nArrow.hasClass("fa-long-arrow-down") ? "asc" : "desc";
|
||||
$("input[name='sx_order']").val(sx_order);
|
||||
$.ajax({
|
||||
url:"<%= unit_managements_path %>",
|
||||
data: $("#unit").serialize(),
|
||||
dateType: "script"
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
<thead>
|
||||
<tr>
|
||||
<th > </th>
|
||||
<th>ID</th>
|
||||
<th>真实姓名</th>
|
||||
<th>职业</th>
|
||||
<th><a href="javascript:void(0);">学号</a></th>
|
||||
|
|
@ -13,13 +14,16 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @users.each do |user| %>
|
||||
<% @users.each_with_index do |user,index| %>
|
||||
<% authorization = ApplyAction.where(:user_id => user, :container_type => "TrialAuthorization").last %>
|
||||
<tr>
|
||||
<td style="padding-left:15px;">
|
||||
<input id="authorization_<%= user.id %>" type="checkbox" class="magic-checkbox" name="member_ids[]" value="<%= user.id %>">
|
||||
<label for="authorization_<%= user.id %>"> </label>
|
||||
</td>
|
||||
<td>
|
||||
<%= user.id %>
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to user.try(:show_real_name), user_path(user), :class => "edu-txt-w100 task-hide2" %>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<input class="fl task-form-20 task-height-30 ml35 " name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 " onclick="$('#classroom').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 " id="clear_contents">清除</a>
|
||||
<a href="#" class="task-btn task-btn-green fr mr30" >新增实训适用课程</a>
|
||||
<a href="javascript:void(0)" class="task-btn task-btn-green fr mr30" onclick="alert_new_major_type('<%= %>')">新增实训适用课程</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="classroom_list">
|
||||
|
|
@ -12,6 +12,35 @@
|
|||
<script>
|
||||
function clearSearchCondition(){
|
||||
$("#Look_name").val("");
|
||||
$.get('<%= classroom_managements_path() %>');
|
||||
$.get('<%= applicable_course_managements_path() %>');
|
||||
}
|
||||
|
||||
function alert_new_major_type(){
|
||||
var htmlvalue ='<%= form_tag(url_for(add_course_managements_path),:id=>"add_course",:method => "post") do %>'+
|
||||
'<div style="width:400px" class="task-popup"><div class="task-popup-title clearfix"><h3 class="fl color-grey">新增实训适用课程</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>'+
|
||||
'<div class="mt10 ml10 mb10">' +
|
||||
'<span class="ml40">请输入课程名称:</span><input type="text" id="new_course_name" name="course" class="ml25" >' +
|
||||
'</div>' +
|
||||
'<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_course_name_notice">'+
|
||||
'<i class="fa fa-exclamation-circle mr5" ></i>'+
|
||||
'请输入名称</span>'+
|
||||
'<div class="cl"></div>' +
|
||||
'<div class="task-popup-submit clearfix ml25">' +
|
||||
'<a href="javascript:void(0);" class="task-btn fl pop_close mr10">取消</a>' +
|
||||
'<a href="javascript:void(0);" onclick="submit_new_course();" class="task-btn task-btn-blue fr" >确定</a>' +
|
||||
'</div>' +
|
||||
'</div>'+
|
||||
'<% end %>';
|
||||
pop_box_new(htmlvalue, 400, 145);
|
||||
}
|
||||
|
||||
function submit_new_course(){
|
||||
var insert_data = $("#new_course_name").val()
|
||||
if($("#new_course_name").val().trim() == ""){
|
||||
$("#new_course_name_notice").show();
|
||||
} else{
|
||||
$("#new_course_name_notice").hide();
|
||||
$("#add_course").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1 @@
|
|||
$("#classroom_list").html("<%= j(render :partial => "managements/applicable_course_list") %>");
|
||||
|
|
@ -14,10 +14,10 @@
|
|||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5" onclick="$('#class_publish_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2 ">清除</a>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="management_class_shixun_list">
|
||||
<div class="edu-con-bg01 mt15" id="class_shixun_list">
|
||||
<%= render :partial => "managements/class_publish_shixuns_list" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script>
|
||||
//清除查询条件
|
||||
function clearSearchCondition(){
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
$("#management_class_shixun_list").html("<%= j(render :partial => "managements/class_publish_shixuns_list") %>");
|
||||
$("#class_shixun_list").html("<%= j(render :partial => "managements/class_publish_shixuns_list") %>");
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
<input class="fl task-form-20 task-height-30" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="cla_sx_Look_name" >
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5" onclick="$('#class_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 ">清除</a>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt15" id="managements_class_shixuns_list">
|
||||
<%= render :partial => "managements/class_shixuns_list" %>
|
||||
|
|
|
|||
|
|
@ -4,29 +4,27 @@
|
|||
<%= select_tag :discipline_category_id,options_for_select(discipline_category_option, nil), {:id=>"discipline_category_id", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 30px 0px 50px;"} %>
|
||||
<%= select_tag :first_level_discipline_id,options_for_select(first_level_discipline_option, nil), {:id=>"first_level_discipline_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %>
|
||||
<%= select_tag :major_id,options_for_select(syllabus_major_option, nil), {:id=>"major_id", :class=>"fl task-form-20 task-height-30", :style => "margin:0px 30px 0px 25px;"} %>
|
||||
<select class="fl task-form-30 task-height-30" style="margin:20px 30px 10px 25px;" name="school_id" id="part">
|
||||
<option value="0" selected="selected">选择创建单位</option>
|
||||
<%= @schools.each do |school|%>
|
||||
<option value="<%= school.id %>"><%= school.name%></option>
|
||||
<% end%>
|
||||
</select>
|
||||
<li class="clearfix mb10 ml35 mt15 fl" style="display: inline-block">
|
||||
<input nhname="tag" autocomplete="off" maxlength="36" nh_tag_0="true" nh_tag_1="true" nh_tag_3="true" id="province" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请选择学校" style="width: 330px" />
|
||||
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text"/> <!-- 单位名称的test框选中下拉列表框的id -->
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<div id="search_school_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
|
||||
</div>
|
||||
<!--</select>-->
|
||||
<select class="fl task-form-15 task-height-30" style="margin:20px 0px 10px 25px;width: 11%" name="keyword" id="condition">
|
||||
<option value="u_name">创建者姓名搜索</option>
|
||||
<option value="cla_name">课程名称搜索</option>
|
||||
</select>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox"class="mr5 magic-checkbox" id="join_course_role_1">
|
||||
<label style="top:-30px;padding-left:23px;" for="join_course_role_1"><span class="only_view">只看模板</span></label>
|
||||
</span>
|
||||
<input class="fl task-form-20 task-height-30 mt20" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" id="Look_name">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt20" onclick="$('#classroom').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 mt20" id="clear_contents">清除</a>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="classroom_list">
|
||||
<%= render :partial => "managements/classroom_list" %>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function clearSearchCondition(){
|
||||
$("#part").val("");
|
||||
|
|
@ -38,4 +36,55 @@
|
|||
$("#first_level_discipline_id").val("");
|
||||
$.get('<%= classroom_managements_path() %>');
|
||||
}
|
||||
</script>
|
||||
$("input[name='school']").on('input', function (e) {
|
||||
throttle(department_search_fn, window, e);
|
||||
});
|
||||
|
||||
var d_lastSearchCondition = '';
|
||||
var d_page = 1; //唯一控制页码 变量
|
||||
var d_count = 0; //查询结果的总量
|
||||
var d_maxPage = 0;//最大页面值
|
||||
function department_search_fn(e) {
|
||||
if($(e.target).val().trim() == ''){
|
||||
$("#search_school_result_list").hide();
|
||||
$("input[name='school_id']").val("");
|
||||
return;
|
||||
}
|
||||
if ($(e.target).val().trim() == d_lastSearchCondition && $(e.target).val().trim() != '') {//如果输入框没有改变或者输入框为空就返回
|
||||
return;
|
||||
}
|
||||
d_lastSearchCondition = $(e.target).val().trim();
|
||||
page = 1; //有新的搜索,页面重置为1
|
||||
$.ajax({
|
||||
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page,
|
||||
type: 'post',
|
||||
success: function (data) {
|
||||
d_schoolsResult = data.schools;
|
||||
count = data.count;
|
||||
maxPage = Math.ceil(count / 100); //最大页码值
|
||||
if (d_schoolsResult.length != undefined && d_schoolsResult.length != 0) {
|
||||
var i = 0;
|
||||
$("#search_school_result_list").html('');
|
||||
for (; i < d_schoolsResult.length; i++) {
|
||||
link = '<a onclick="window.changeSchoolValue(\'' + d_schoolsResult[i].school.name.replace(/\s/g, " ") + '\',\'' + d_schoolsResult[i].school.id + '\')" href="javascript:void(0)">' + d_schoolsResult[i].school.name + '</a><br/>';
|
||||
$("#search_school_result_list").append(link);
|
||||
}
|
||||
$("#search_school_result_list").css('left', $(e.target).offset().left);
|
||||
$("#search_school_result_list").css('top', $(e.target).offset().top + 40);
|
||||
$("#search_school_result_list").css("position", "absolute");
|
||||
$("#search_school_result_list").show();
|
||||
} else {
|
||||
$("#search_school_result_list").html('你的学校不在列表中?请确认后输入');
|
||||
$("#search_school_result_list").show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
//修改部门
|
||||
function changeSchoolValue(value, data) {
|
||||
console.log(value+","+data)
|
||||
$("input[name='school']").val(value);
|
||||
$("input[name='school_id']").val(data);
|
||||
$("#search_school_result_list").hide();
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -19,11 +19,12 @@
|
|||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5" onclick="$('#class_publish_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2 " id="clear_contents">清除</a>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox"class="mr5 magic-checkbox" id="join_course_role_1">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_1"><span class="only_view">只看首页显示</span></label>
|
||||
</span>
|
||||
<input type="checkbox" class="mr5 magic-checkbox" name="homepage_show" value="1" id="join_course_role_0">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view">只看首页显示</span></label>
|
||||
</span>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<% end%>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="managements_classroom_classment">
|
||||
<%= render :partial => "managements/classroom_classment_list" %>
|
||||
</div>
|
||||
|
|
@ -33,6 +34,11 @@
|
|||
$("#part").val("");
|
||||
$("#condition_status").val("uname")
|
||||
$("#Look_name").val("");
|
||||
$.get('<%=classroom_classment_managements_path() %>')
|
||||
}
|
||||
$.get('<%= classroom_classment_managements_path() %>')
|
||||
};
|
||||
|
||||
$("#join_course_role_0").on('click', function(){
|
||||
$('#class_publish_shixuns_search').submit();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -3,11 +3,12 @@
|
|||
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" >
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#depart_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
|
||||
<input name="sx_order" type="hidden" />
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="edu-con-bg01 mt15" id="managements_user_list">
|
||||
<%= render :partial => "managements/depart_list" %>
|
||||
</div>
|
||||
<% end %>
|
||||
<script>
|
||||
function clearSearchCondition(){
|
||||
$("#shixun_Look_name").val("");
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#department_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
|
||||
<a href="#" class="task-btn task-btn-green fr mt6 mr30" >创建</a>
|
||||
<input name="sx_order" type="hidden"/>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="managements_departments_list">
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#department_part_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
|
||||
<a href="#" class="task-btn task-btn-green fr mt6 mr30" >新建单位</a>
|
||||
<input name="sx_order" type="hidden">
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="edu-con-bg01 mt15" id="managements_department_part_list">
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 " onclick="$('#profession').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition()" class="fl task-btn ml5 mt2 " id="clear_contents">清除</a>
|
||||
<a href="#" class="task-btn task-btn-green fr mr30" >新增</a>
|
||||
<input type="hidden" name="sx_order"/>
|
||||
</div>
|
||||
<span class="shixun_webssh">
|
||||
<input type="checkbox" class="mr5 magic-checkbox" id="join_course_role_0">
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@
|
|||
<a href="javascript:void(0)" class="task-btn task-btn-blue" onclick="$('#publish_shixuns_search').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="task-btn mr10">清除</a>
|
||||
</li>
|
||||
<span class="fr shixun_webssh">
|
||||
<input type="checkbox" class="mr5 magic-checkbox" name="homepage_show" value="1" id="join_course_role_0">
|
||||
<label style="top:2px;padding-left:23px;" for="join_course_role_0"><span class="only_view">只看首页显示</span></label>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="ex_container" id="management_shixun_list">
|
||||
|
|
@ -41,5 +45,7 @@
|
|||
$("#sx_condition_status").val("u_name");
|
||||
$("#sx_status").val("");
|
||||
}
|
||||
|
||||
$("#join_course_role_0").on("click",function(){
|
||||
$('#publish_shixuns_search').submit();
|
||||
})
|
||||
</script>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt-2" onclick="$('#unit').submit();">搜索</a>
|
||||
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
|
||||
<input type="hidden" name="sx_order"/>
|
||||
</div>
|
||||
<% end%>
|
||||
<div class="edu-con-bg01 mt15" id="managements_unit_list">
|
||||
|
|
|
|||
|
|
@ -11,18 +11,18 @@ function showPreview(source) {
|
|||
}
|
||||
</script>
|
||||
|
||||
<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true,:id => "school_form") do %>
|
||||
<%= form_tag(upload_school_path(@school.id),method: "post", multipart: true,:id => "school_form",:class=>"mt50 ml35") do %>
|
||||
<%#= text_field_tag 'school'%>
|
||||
<div style="padding:15px; border: 1px solid #dddddd;">
|
||||
<input type="hidden" value="<%= @school_name%>" name="school_name">
|
||||
<%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar")%>
|
||||
<a type="button" onclick="$('#file').click();" style="margin: 86px 0 0 15px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 55px;">上传图片</a>
|
||||
<div>
|
||||
<input type="hidden" value="<%= @school_name%>" name="school_name" class="w150">
|
||||
<%= image_tag(@school.logo_link, id: "avatar_image", :class=>"school_avatar ml25")%>
|
||||
<a type="button" onclick="$('#file').click();" style="margin: 86px 0 0 0px;float: left;padding: 2px 5px;border: 1px solid #eaeaea;cursor: pointer;text-decoration: none;width: 70px;" class="task-btn task-btn-blue ">上传图片</a>
|
||||
<%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
|
||||
<div style="clear: both;"></div>
|
||||
<div class="mt15">学校名称:<input type="text" name="name" placeholder="现在对应的学校名称" value="<%= @school.name%>" class="schoolName ml4"/></div>
|
||||
<div class="mt15">学校名称:<input type="text" name="name" placeholder="现在对应的学校名称" value="<%= @school.name%>" class="schoolName ml10"/></div>
|
||||
<div class="mt10">学校省份:
|
||||
<select class="provinceSelect" name="province">
|
||||
<option value="">--请选择省份--</option>
|
||||
<select class="provinceSelect ml10" name="province">
|
||||
<option value="" class="">--请选择省份--</option>
|
||||
<option value="北京市" <%= @school.province == '北京市' ? 'selected':'' %>>北京</option>
|
||||
<option value="上海市" <%= @school.province == '上海市' ? 'selected':'' %>>上海</option>
|
||||
<option value="广东省" <%= @school.province == '广东省' ? 'selected':'' %>>广东</option>
|
||||
|
|
@ -43,7 +43,7 @@ function showPreview(source) {
|
|||
<option value="江西省" <%= @school.province == '江西省' ? 'selected':'' %>>江西</option>
|
||||
<option value="吉林省" <%= @school.province == '吉林省' ? 'selected':'' %>>吉林</option>
|
||||
<option value="辽宁省" <%= @school.province == '辽宁省' ? 'selected':'' %>>辽宁</option>
|
||||
<option value=" 内蒙古自治区" <%= @school.province == ' 内蒙古自治区' ? 'selected':'' %>>内蒙古</option>
|
||||
<option value="内蒙古自治区" <%= @school.province == ' 内蒙古自治区' ? 'selected':'' %>>内蒙古</option>
|
||||
<option value="宁夏回族自治区" <%= @school.province == '宁夏回族自治区' ? 'selected':'' %>>宁夏</option>
|
||||
<option value="青海省" <%= @school.province == '青海省' ? 'selected':'' %>>青海</option>
|
||||
<option value="山东省" <%= @school.province == '山东省' ? 'selected':'' %>>山东</option>
|
||||
|
|
@ -60,9 +60,9 @@ function showPreview(source) {
|
|||
<option value="海外" <%= @school.province == '海外' ? 'selected':'' %>>海外</option>
|
||||
</select>
|
||||
</div>
|
||||
<div style="margin-top: 10px;">
|
||||
<input type="button" value="提交" onclick="submit_edit_school($(this));" class="fl task-btn task-btn-blue ml5 mt2" />
|
||||
<input type="button" value="取消" onclick="history.go(-1);" class="fl task-btn ml5 mt2" />
|
||||
<div style="margin-top: 20px;">
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue" onclick="submit_edit_school($(this));">提交</a>
|
||||
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml30" onclick="history.go(-1);">取消</a>
|
||||
<%#= submit_tag('提交',:class=>'mr5') %>
|
||||
<%#= submit_tag('取消') %>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@
|
|||
<p id="e_tip_in" style="margin-left: 10%" class="c_grey"></p>
|
||||
<p id="e_tips_in" style="margin-left: 10%" class="c_grey"></p>
|
||||
</li>
|
||||
<!-- <li class="clearfix mb15">
|
||||
<label class="panel-form-label fl">预备知识 </label>
|
||||
<li class="clearfix mb15">
|
||||
<label class="panel-form-label fl">背景知识 </label>
|
||||
<div id="shixun_propaedeutics" class="new_li fl" style="margin-left: 0px;">
|
||||
<textarea name="shixun[propaedeutics]"><%#= @shixun.propaedeutics %></textarea>
|
||||
<textarea name="shixun[propaedeutics]"><%= @shixun.propaedeutics %></textarea>
|
||||
</div>
|
||||
<p id="e_tip_pr" style="margin-left: 10%" class="c_grey"></p>
|
||||
<p id="e_tips_pr" style="margin-left: 10%" class="c_grey"></p>
|
||||
<div class="cl"></div>
|
||||
</li>-->
|
||||
</li>
|
||||
<li class="clearfix mb15">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>适用专业 </label>
|
||||
<%= select_tag :major_id, options_for_select(shixun_major_option, 0), :id => 'shixun_major', :class => "fl task-form-30 task-height-40"%>
|
||||
|
|
@ -187,8 +187,8 @@
|
|||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>" //url
|
||||
});
|
||||
|
||||
/* --------------------------------- 预备知识 -------------------------------------- */
|
||||
/* var shixun_propaedeutics = editormd("shixun_propaedeutics", {
|
||||
/* --------------------------------- 背景知识 -------------------------------------- */
|
||||
var shixun_propaedeutics = editormd("shixun_propaedeutics", {
|
||||
width : "89.7%",
|
||||
height : 300,
|
||||
syncScrolling : "single",
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%#= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>" //url
|
||||
});*/
|
||||
});
|
||||
//////////////////////////////////////////////////////////////
|
||||
//提交新建项目
|
||||
function submit_new_project()
|
||||
|
|
|
|||
|
|
@ -43,7 +43,12 @@
|
|||
</li>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>技术平台:</label>
|
||||
<%= select_tag :language, options_for_select(shixun_language, @shixun.language), :id => 'shixun[language]', :class => "fl task-form-10 task-height-40" %>
|
||||
<% if @shixun.status != 0 %>
|
||||
<%= select_tag :language_disable, options_for_select(shixun_language, @shixun.language), :class => "fl task-form-10 task-height-40", :disabled => true %>
|
||||
<%= select_tag :language, options_for_select(shixun_language, @shixun.language), :id => 'shixun[language]', :class => "fl task-form-10 task-height-40 undis" %>
|
||||
<% else %>
|
||||
<%= select_tag :language, options_for_select(shixun_language, @shixun.language), :id => 'shixun[language]', :class => "fl task-form-10 task-height-40" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<!-- <li class="clearfix">
|
||||
<label class="panel-form-label fl">公开:</label>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<div class="panel-form">
|
||||
<div class="clearfix mb20">
|
||||
<p class="fr">
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<% if User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="JavaScript:void(0);" class="shixun-task-btn task-btn-green fr" onclick="edit_shixun();">编辑</a>
|
||||
<% end %>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/css/edu-admin.cssn" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/css/edu-admin.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
<link href="../../../public/stylesheets/bootstrap/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
|
||||
<script src="../../../public/javascripts/application.js" type="text/javascript" charset="utf-8"></script>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<div class="task-pm-content mb20" >
|
||||
<div class="task-pm-box mt20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="shixun_title fl mt5">预备知识</h3>
|
||||
<h3 class="shixun_title fl mt5">背景知识</h3>
|
||||
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
|
||||
<a href="JavaScript:void(0);" class="shixun-task-btn task-btn-green fr" id="edit_propaedeutics" style="margin: 5px 0;">编辑</a>
|
||||
<% end %>
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
<ul>
|
||||
<%= form_tag update_propaedeutics_shixun_path(@shixun), :method =>"post", :id => "update_propaedeutics" do |f| %>
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">预备知识:</label>
|
||||
<label class="panel-form-label fl">背景知识:</label>
|
||||
<div id="shixuns_propaedeutics" class="new_li fl" style="margin-bottom: 0px">
|
||||
<textarea name="shixun[propaedeutics]"><%= @shixun.propaedeutics %></textarea>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@
|
|||
</script>
|
||||
<!--新版阶段列表-->
|
||||
<div class="lesson-saved-list mb20">
|
||||
<% count = 0 %>
|
||||
<% @stages.each do |stage| %>
|
||||
<div class="lesson-saved-list-item user_bg_shadow pt20 mb20" id="stage_div_<%= stage.id %>">
|
||||
<p class="clearfix">
|
||||
|
|
@ -60,7 +61,7 @@
|
|||
<% shixun = stage_shixun.shixun %>
|
||||
<div class="clearfix pt10 pb10 pl20 stage-info-line pr20" id="stage_shixun_<%= shixun.id %>" style="cursor: pointer;" onclick="shixun_link('<%= shixun.identifier %>')">
|
||||
<li class="fl li-width63">
|
||||
<span class="panel-inner-icon18 fl mr10 mt5 color_white font-12"><%= index + 1 %></span>
|
||||
<span class="panel-inner-icon18 fl mr10 mt5 color_white font-12"><%= count = count + 1 %></span>
|
||||
<!--<i class="fa fa-gamepad color-light-green font-20"></i>-->
|
||||
<span class="color-grey3"><%= shixun.name %></span>
|
||||
</li>
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
<div class="-task-con-per clearfix pt10 pb10 shadow_border">
|
||||
<p class="fl font-16 font-bd color-grey ml10 mt3">你好~<%= @user.show_name %>,欢迎来到个人成长记录中心</p>
|
||||
<p class="p3 fr font-14 mr10">
|
||||
<span class="fl mr10 color-grey-6 mr25 mt5"><i class="fa fa-flag-checkered color-red mr5 font-16 mr10" title="技能勋章"></i>技能标签<span class="ml5 user_filtrate_span1_bg"><%= @user.challenge_tags.count %></span></span>
|
||||
<span class="fl mr10 color-grey-6 mr25 mt5"><i class="fa fa-viacoin color-light-green mr5 font-16 mr10" title="经验值"></i>经验值<span class="ml5 user_filtrate_span1_bg"><%= @user.experience %></span></span>
|
||||
<span class="fl color-grey-6 mr25 mt5"><img src="/images/task/coin.png" class="fl mr10 mt5" width="15"><span class="fl">金币<span class="ml5 user_filtrate_span1_bg"><%= @user.grade %></span></span></span>
|
||||
<span class="fl mr10 color-grey-8 mr25 mt5"><i class="fa fa-flag-checkered color-red mr5 font-16 mr10" title="技能勋章"></i>技能标签<span class="ml5 user_filtrate_span1_bg"><%= @user.challenge_tags.count %></span></span>
|
||||
<span class="fl mr10 color-grey-8 mr25 mt5"><i class="fa fa-viacoin color-light-green mr5 font-16 mr10" title="经验值"></i>经验值<span class="ml5 user_filtrate_span1_bg"><%= @user.experience %></span></span>
|
||||
<span class="fl color-grey-8 mr25 mt5"><img src="/images/task/coin.png" class="fl mr10 mt5" width="15"><span class="fl">金币<span class="ml5 user_filtrate_span1_bg"><%= @user.grade %></span></span></span>
|
||||
</p>
|
||||
</div>
|
||||
<ul id="edu-user-tab-nav" class="mt20 edu-bg">
|
||||
|
|
|
|||
|
|
@ -114,9 +114,9 @@
|
|||
<% if new_message_count > 0 %>
|
||||
<a href="<%= feedback_path(User.current) %>" class="fl mr10 link-color-grey">新留言<span style="margin-top: 5px;" class="user_filtrate_span2 user_filtrate_span2_bg ml10"><%= new_message_count %></span></a>
|
||||
<% end %>
|
||||
<span class="fl mr10 color-grey-6">技能标签<%= link_to @user.challenge_tags.count, growth_record_user_path(@user), :class => "ml5 color-orange03" %></span>
|
||||
<span class="fl mr10 color-grey-6">经验值<%= link_to @user.experience, growth_record_user_path(@user, :tab => 2), :class => "ml5 color-orange03" %></span>
|
||||
<span class="fl color-grey-6">金币<%= link_to @user.grade, growth_record_user_path(@user, :tab => 3), :class => "ml5 color-orange03" %></span>
|
||||
<span class="fl mr10 color-grey-8">技能标签<%= link_to @user.challenge_tags.count, growth_record_user_path(@user), :class => "ml5 color-orange03" %></span>
|
||||
<span class="fl mr10 color-grey-8">经验值<%= link_to @user.experience, growth_record_user_path(@user, :tab => 2), :class => "ml5 color-orange03" %></span>
|
||||
<span class="fl color-grey-8">金币<%= link_to @user.grade, growth_record_user_path(@user, :tab => 3), :class => "ml5 color-orange03" %></span>
|
||||
</p>
|
||||
<!-- <p class="p3">帐户安全:
|
||||
<a class="<%#= @user.phone.blank? ? 'color-grey' : 'color-green' %>" href="<%#= security_settings_path %>">
|
||||
|
|
|
|||
|
|
@ -192,6 +192,10 @@ RedmineApp::Application.routes.draw do
|
|||
post 'reject_authentication_pro'
|
||||
get 'update_shixun_hidden'
|
||||
get 'update_subject_hidden'
|
||||
post 'course_homepage_show'
|
||||
post 'shixun_homepage_show'
|
||||
post 'add_course'
|
||||
get 'add_major'
|
||||
end
|
||||
end
|
||||
# Enable Grack support
|
||||
|
|
@ -391,6 +395,7 @@ RedmineApp::Application.routes.draw do
|
|||
collection do
|
||||
get 'apply_add_school'
|
||||
get 'search_repeat_schoolname'
|
||||
get 'upload_logo'
|
||||
end
|
||||
|
||||
member do
|
||||
|
|
@ -1813,7 +1818,9 @@ RedmineApp::Application.routes.draw do
|
|||
#######confusing########
|
||||
get 'welcome/search', to: 'welcome#search'
|
||||
get 'school/index', to: 'school#index'
|
||||
get 'school/:school_id', to: 'welcome#course', :as => 'school_course_list'
|
||||
get 'school/:school_id', to:
|
||||
|
||||
'welcome#course', :as => 'school_course_list'
|
||||
post 'school/get_options/:province', :to => 'school#get_options'
|
||||
get 'school/get_options/:province', :to => 'school#get_options'
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
class AddTimeToCourseList < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :course_lists, :created_at, :timestamp
|
||||
add_column :course_lists, :updated_at, :timestamp
|
||||
|
||||
CourseList.where("0=0").update_all(:created_at => Time.now, :updated_at => Time.now)
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
class AddHomepageShowToCourses < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :courses, :homepage_show, :boolean, :default => 0
|
||||
add_column :shixuns, :homepage_show, :boolean, :default => 0
|
||||
end
|
||||
end
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,351 +1,350 @@
|
|||
$(function(){
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
var tested = false;
|
||||
var valid_form = function() {
|
||||
var src = $('#program-src').val();
|
||||
|
||||
if (!src) {
|
||||
long_notice_box("请输入正确的代码!");
|
||||
return false;
|
||||
}
|
||||
// if ($("textarea[name='late_reason']").length > 0 && $("textarea[name='late_reason']").val().trim() == "") {
|
||||
// var htmlvalue = "</br><div style='width:550px;text-align:center'>请输入标题!</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||
// long_notice_box("迟交原因不能为空");
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
$('#test-program-btn').hide();
|
||||
$('#commit-program-work-btn').hide();
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||
var src = $('#program-src').val();
|
||||
var is_test = $('input[name=is_test]').val();
|
||||
|
||||
if(!valid_form()){
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
//先测试一次并返回测试集个数及结果再判断是否需要继续进行测试
|
||||
var test_post = function(i, testid){
|
||||
$.post(
|
||||
'/student_work/program_test_ex',
|
||||
{homework: homework_id, student_work_id: student_work_id,
|
||||
src: src, is_test: is_test,tIndex:i,
|
||||
testid: testid},
|
||||
function(data,status){
|
||||
if (data.status==-4 || data.status==-5 ){
|
||||
//弹框
|
||||
var root_path = getRootPath();
|
||||
var forums_1_path = root_path + "/forums/1";
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
else if (data.status==-3){
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
var tSeq = data.tseq;
|
||||
var tCount = data.tcount;
|
||||
console.log("tSeq="+tSeq);
|
||||
console.log("tCount="+tCount);
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultList').length+1;
|
||||
}
|
||||
|
||||
var html=bt('t:result-list',data);
|
||||
$("#new_student_work_tests").show();
|
||||
if(i==1){
|
||||
$('.edu-tab-con-box').prepend('<div class="mb10 ProResultList"><span class="font-bd mb5">第'+($('.ProResultList').length+1)+'次</span><div class="edu-ces-box"></div></div>');
|
||||
}
|
||||
$('.ProResultList:first-child').find(".edu-ces-box").prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
if (typeof cb == 'function') {cb(data);return;}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
//2 超时 -2 编译错误 测试结束
|
||||
if (data.status == 2 || data.status == -2 || tSeq >= tCount ){
|
||||
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show();$('#commit-program-work-btn').show(); return;}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
test_post(i+1, data.testid);
|
||||
}
|
||||
).fail(function(xhr, status){
|
||||
if(status == 'timeout'){
|
||||
long_notice_box("您的答案超时了, 请检查代码是否存在死循环的错误!");
|
||||
} else {
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
test_post(1, 0);
|
||||
};
|
||||
|
||||
$('#test-program-btn').on('click', test_program);
|
||||
|
||||
|
||||
$('#commit-program-work-btn').on('click', function(){
|
||||
if(!valid_form()){
|
||||
return;
|
||||
} else{
|
||||
if ($("textarea[name='late_reason']").length > 0 && $("textarea[name='late_reason']").val().trim() == "") {
|
||||
var htmlvalue = "</br><div style='width:550px;text-align:center'>请输入标题!</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||
long_notice_box("迟交原因不能为空");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$('#commit-program-work-btn').hide();
|
||||
if($('.edu-tab-con-box .ProResultList').length<=0){
|
||||
var htmlvalue = '<div class="task-popup" style="width:575px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</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>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">测试后才能提交,是否立刻测试?</p></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-blue fr" id="code-test-button">确定</a></div></div>';
|
||||
pop_box_new(htmlvalue,575,140);
|
||||
$("#code-test-button").on('click',function(){
|
||||
test_program();
|
||||
hideModal();
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(tested);
|
||||
if (!tested) {
|
||||
test_program(function(data){
|
||||
if (data.status!=0) {
|
||||
tested = false;
|
||||
console.log(tested);
|
||||
var htmlvalue = '<div class="task-popup" style="width:575px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</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>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">测试不通过,是否强制提交?</p></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-blue fr" onclick="submit_code();">确定</a></div></div><script>function submit_code(){$("#commit-program-work-btn").hide();$("#student_work_form").submit();hideModal();}</script>';
|
||||
pop_box_new(htmlvalue,575,140);
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
|
||||
};
|
||||
$('#commit-program-work-btn').hide();
|
||||
$('#test-program-btn').hide();
|
||||
$("#student_work_form").submit();
|
||||
});
|
||||
return;
|
||||
}
|
||||
$('#commit-program-work-btn').hide();
|
||||
$('#test-program-btn').hide();
|
||||
$("#student_work_form").submit();
|
||||
});
|
||||
|
||||
//代码编辑器
|
||||
if (typeof CodeMirror != "undefined") {
|
||||
var program_name = "text/x-csrc";
|
||||
var language = $('#data-language').attr('data-language');
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
if ($('#program-src').val().length<=0) {
|
||||
var src = '';
|
||||
if(language==4){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
import java.io.*;\n\
|
||||
import java.util.*;\n\
|
||||
\n\
|
||||
//请一定不要修改类名\n\
|
||||
class Main\n\
|
||||
{\n\
|
||||
public static void main (String args[])\n\
|
||||
{\n\
|
||||
//获取参数方式\n\
|
||||
//Scanner in = new Scanner(System.in);\n\
|
||||
//int a = in.nextInt();\n\
|
||||
//int b = in.nextInt();\n\
|
||||
\n\
|
||||
//您的代码\n\
|
||||
}\n\
|
||||
}\n\
|
||||
';
|
||||
}
|
||||
else if(language==1){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
#include <stdio.h>\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 scanf\n\
|
||||
//int x =0;\n\
|
||||
//int y = 0;\n\
|
||||
//scanf("%d", &x);\n\
|
||||
\n\
|
||||
//结果输出使用prinf\n\
|
||||
//printf("%d",x);\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==2){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
#include <iostream>\n\
|
||||
using namespace std;\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 cin\n\
|
||||
//int x =0;\n\
|
||||
//cin >> x;\n\
|
||||
\n\
|
||||
//结果输出使用 cout\n\
|
||||
//cout<<"1";\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==3){
|
||||
src = '\
|
||||
#-*-coding:utf-8-*-\n\
|
||||
#注意\n\
|
||||
#1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
#2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
#3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),空格用□表示\n\
|
||||
import sys \n\
|
||||
\n\
|
||||
#获取参数方式,使用raw_input\n\
|
||||
#input = raw_input()\n\
|
||||
#a, b = input.split()\n\
|
||||
\n\
|
||||
#结果输出使用 print \n\
|
||||
#print (str(int(a)+int(b)))\n\
|
||||
';
|
||||
}
|
||||
|
||||
$('#program-src').val(src);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#program-src').val(cMirror.getValue());
|
||||
});
|
||||
}
|
||||
});
|
||||
function alert_choose_homework_type(id){
|
||||
var htmlvalue = '<div class="task-popup" style="width:300px;">' +
|
||||
'<div class="task-popup-title clearfix task-popup-bggrey">' +
|
||||
'<h3 class="fl">选择作业类别</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>' +
|
||||
'<div class="task_popup_con">' +
|
||||
'<div class="newupload_conbox">' +
|
||||
'<div class="clearfix mb15">' +
|
||||
'<span class="fl mt5">作业类别:</span>' +
|
||||
'<ul class="fl">' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="1" id="homework_type_1" class="fl magic-radio">' +
|
||||
'<label for="homework_type_1" class="fl ml5 edu-class-pop-label edu-color-grey">' +
|
||||
'普通作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="3" id="homework_type_2" class="fl magic-radio">' +
|
||||
'<label for="homework_type_2" class="fl ml5 edu-class-pop-label edu-color-grey">' +
|
||||
'分组作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="2" id="homework_type_3" class="fl magic-radio edu-color-grey">' +
|
||||
'<label for="homework_type_3" class="fl ml5 edu-class-pop-label">' +
|
||||
'编程作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="4" id="homework_type_4" class="fl magic-radio edu-color-grey">' +
|
||||
'<label for="homework_type_4" class="fl ml5 edu-class-pop-label">' +
|
||||
'实训作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="cl"></div>' +
|
||||
'<div id="homework_type_notice" class="clearfix color-red none mt-10 ml75">请先选择作业类型</div>' +
|
||||
'<div class="task-popup-submit clearfix">' +
|
||||
'<a href="javascript:void(0);" class="task-btn fl pop_close">取消</a>' +
|
||||
'<a href="javascript:void(0);" onclick="new_homework_type('+id+');" class="task-btn task-btn-blue fr">确定</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
pop_box_new(htmlvalue, 300, 308);
|
||||
}
|
||||
|
||||
function new_homework_type(id){
|
||||
if($("input[name='homework_type']:checked").length == 0){
|
||||
$("#homework_type_notice").show();
|
||||
} else{
|
||||
var type=$("input[name='homework_type']:checked").val();
|
||||
console.log(type == 4);
|
||||
if(type == 4){
|
||||
$.ajax({
|
||||
url: '/homework_common/shixuns?course='+id,
|
||||
dataType: "script"
|
||||
});
|
||||
}else{
|
||||
window.location.href = '/homework_common/new?course='+id+'&homework_type=' + $("input[name='homework_type']:checked").val();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function new_shixun_homework(id){
|
||||
|
||||
if($("input[name='shixun_homework']:checked").length == 0){
|
||||
$("#homework_type_notice").show();
|
||||
} else{
|
||||
var type=$("input[name='shixun_homework']:checked").val();
|
||||
console.log(type);
|
||||
$("#shixun_homework_common_new").submit();
|
||||
}
|
||||
}
|
||||
$(function(){
|
||||
var bt=baidu.template;
|
||||
bt.LEFT_DELIMITER='<!';
|
||||
bt.RIGHT_DELIMITER='!>';
|
||||
|
||||
var tested = false;
|
||||
var valid_form = function() {
|
||||
var src = $('#program-src').val();
|
||||
|
||||
if (!src) {
|
||||
long_notice_box("请输入正确的代码!");
|
||||
return false;
|
||||
}
|
||||
// if ($("textarea[name='late_reason']").length > 0 && $("textarea[name='late_reason']").val().trim() == "") {
|
||||
// var htmlvalue = "</br><div style='width:550px;text-align:center'>请输入标题!</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||
// long_notice_box("迟交原因不能为空");
|
||||
// return false;
|
||||
// }
|
||||
return true;
|
||||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
$('#test-program-btn').hide();
|
||||
$('#commit-program-work-btn').hide();
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
var student_work_id = $('#test-program-btn').attr('data-student-work-id');
|
||||
var src = $('#program-src').val();
|
||||
var is_test = $('input[name=is_test]').val();
|
||||
|
||||
if(!valid_form()){
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
//先测试一次并返回测试集个数及结果再判断是否需要继续进行测试
|
||||
var test_post = function(i, testid){
|
||||
$.post(
|
||||
'/student_work/program_test_ex',
|
||||
{homework: homework_id, student_work_id: student_work_id,
|
||||
src: src, is_test: is_test,tIndex:i,
|
||||
testid: testid},
|
||||
function(data,status){
|
||||
if (data.status==-4 || data.status==-5 ){
|
||||
//弹框
|
||||
var root_path = getRootPath();
|
||||
var forums_1_path = root_path + "/forums/1";
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
else if (data.status==-3){
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
var tSeq = data.tseq;
|
||||
var tCount = data.tcount;
|
||||
console.log("tSeq="+tSeq);
|
||||
console.log("tCount="+tCount);
|
||||
tested = true;
|
||||
console.log(data);
|
||||
if(data.index <=0){
|
||||
data.index = $('.ProResultList').length+1;
|
||||
}
|
||||
|
||||
var html=bt('t:result-list',data);
|
||||
$("#new_student_work_tests").show();
|
||||
if(i==1){
|
||||
$('.edu-tab-con-box').prepend('<div class="mb10 ProResultList"><span class="font-bd mb5">第'+($('.ProResultList').length+1)+'次</span><div class="edu-ces-box"></div></div>');
|
||||
}
|
||||
$('.ProResultList:first-child').find(".edu-ces-box").prepend(html);
|
||||
|
||||
if (data.status==0 && is_test != 'true') {
|
||||
if (typeof cb == 'function') {cb(data);return;}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
//2 超时 -2 编译错误 测试结束
|
||||
if (data.status == 2 || data.status == -2 || tSeq >= tCount ){
|
||||
if (typeof cb == 'function') {cb(data);$('#test-program-btn').show();$('#commit-program-work-btn').show(); return;}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
}
|
||||
|
||||
test_post(i+1, data.testid);
|
||||
}
|
||||
).fail(function(xhr, status){
|
||||
if(status == 'timeout'){
|
||||
long_notice_box("您的答案超时了, 请检查代码是否存在死循环的错误!");
|
||||
} else {
|
||||
long_notice_box("由于目前大量用户正在测试,系统繁忙,请稍后再试。<br/>我们将尽快提升平台的处理能力,谢谢您的支持!");
|
||||
}
|
||||
$('#test-program-btn').show();
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
});
|
||||
};
|
||||
|
||||
test_post(1, 0);
|
||||
};
|
||||
|
||||
$('#test-program-btn').on('click', test_program);
|
||||
|
||||
|
||||
$('#commit-program-work-btn').on('click', function(){
|
||||
if(!valid_form()){
|
||||
return;
|
||||
} else{
|
||||
if ($("textarea[name='late_reason']").length > 0 && $("textarea[name='late_reason']").val().trim() == "") {
|
||||
var htmlvalue = "</br><div style='width:550px;text-align:center'>请输入标题!</div></br><div style='width:67px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn' onclick='hideModal()'>确定</a></div>";
|
||||
long_notice_box("迟交原因不能为空");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$('#commit-program-work-btn').hide();
|
||||
if($('.edu-tab-con-box .ProResultList').length<=0){
|
||||
var htmlvalue = '<div class="task-popup" style="width:575px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</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>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">测试后才能提交,是否立刻测试?</p></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-blue fr" id="code-test-button">确定</a></div></div>';
|
||||
pop_box_new(htmlvalue,575,140);
|
||||
$("#code-test-button").on('click',function(){
|
||||
test_program();
|
||||
hideModal();
|
||||
});
|
||||
return;
|
||||
}
|
||||
console.log(tested);
|
||||
if (!tested) {
|
||||
test_program(function(data){
|
||||
if (data.status!=0) {
|
||||
tested = false;
|
||||
console.log(tested);
|
||||
var htmlvalue = '<div class="task-popup" style="width:575px;"><div class="task-popup-title clearfix"><h3 class="fl color-grey">提示</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>'+
|
||||
'<div class="task-popup-content"><p class="task-popup-text-center font-16">测试不通过,是否强制提交?</p></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-blue fr" onclick="submit_code();">确定</a></div></div><script>function submit_code(){$("#commit-program-work-btn").hide();$("#student_work_form").submit();hideModal();}</script>';
|
||||
pop_box_new(htmlvalue,575,140);
|
||||
$('#commit-program-work-btn').show();
|
||||
return;
|
||||
|
||||
};
|
||||
$('#commit-program-work-btn').hide();
|
||||
$('#test-program-btn').hide();
|
||||
$("#student_work_form").submit();
|
||||
});
|
||||
return;
|
||||
}
|
||||
$('#commit-program-work-btn').hide();
|
||||
$('#test-program-btn').hide();
|
||||
$("#student_work_form").submit();
|
||||
});
|
||||
|
||||
//代码编辑器
|
||||
if (typeof CodeMirror != "undefined") {
|
||||
var program_name = "text/x-csrc";
|
||||
var language = $('#data-language').attr('data-language');
|
||||
if (language == 1) {
|
||||
program_name = 'text/x-csrc';
|
||||
} else if(language==2){
|
||||
program_name = 'text/x-c++src';
|
||||
}else if(language==3){
|
||||
program_name = 'text/x-cython';
|
||||
} else if(language==4){
|
||||
program_name = 'text/x-java';
|
||||
}
|
||||
|
||||
if ($('#program-src').val().length<=0) {
|
||||
var src = '';
|
||||
if(language==4){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
import java.io.*;\n\
|
||||
import java.util.*;\n\
|
||||
\n\
|
||||
//请一定不要修改类名\n\
|
||||
class Main\n\
|
||||
{\n\
|
||||
public static void main (String args[])\n\
|
||||
{\n\
|
||||
//获取参数方式\n\
|
||||
//Scanner in = new Scanner(System.in);\n\
|
||||
//int a = in.nextInt();\n\
|
||||
//int b = in.nextInt();\n\
|
||||
\n\
|
||||
//您的代码\n\
|
||||
}\n\
|
||||
}\n\
|
||||
';
|
||||
}
|
||||
else if(language==1){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
#include <stdio.h>\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 scanf\n\
|
||||
//int x =0;\n\
|
||||
//int y = 0;\n\
|
||||
//scanf("%d", &x);\n\
|
||||
\n\
|
||||
//结果输出使用prinf\n\
|
||||
//printf("%d",x);\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==2){
|
||||
src = '\
|
||||
//注意\n\
|
||||
//1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
//2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
//3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),每行末尾的所有空格用□表示\n\
|
||||
#include <iostream>\n\
|
||||
using namespace std;\n\
|
||||
\n\
|
||||
int main()\n\
|
||||
{\n\
|
||||
//获取参数方式 cin\n\
|
||||
//int x =0;\n\
|
||||
//cin >> x;\n\
|
||||
\n\
|
||||
//结果输出使用 cout\n\
|
||||
//cout<<"1";\n\
|
||||
\n\
|
||||
return 0;\n\
|
||||
}\n\
|
||||
';
|
||||
} else if(language==3){
|
||||
src = '\
|
||||
#-*-coding:utf-8-*-\n\
|
||||
#注意\n\
|
||||
#1:该程序每次运行的时间必须小于200毫秒,否则会超时,程序超时将不会测试剩余的测试集\n\
|
||||
#2:该程序每次运行使用的内存不能超过1M,否则会返回错误\n\
|
||||
#3:该程序每次运行输出的结果最多显示1000个字符(多余的不显示),空格用□表示\n\
|
||||
import sys \n\
|
||||
\n\
|
||||
#获取参数方式,使用raw_input\n\
|
||||
#input = raw_input()\n\
|
||||
#a, b = input.split()\n\
|
||||
\n\
|
||||
#结果输出使用 print \n\
|
||||
#print (str(int(a)+int(b)))\n\
|
||||
';
|
||||
}
|
||||
|
||||
$('#program-src').val(src);
|
||||
};
|
||||
|
||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||
mode: {name: program_name,
|
||||
version: 2,
|
||||
singleLineStringErrors: false},
|
||||
lineNumbers: true,
|
||||
indentUnit: 2,
|
||||
matchBrackets: true
|
||||
});
|
||||
|
||||
editor.on('change',function(cMirror){
|
||||
// get value right from instance
|
||||
$('#program-src').val(cMirror.getValue());
|
||||
});
|
||||
}
|
||||
});
|
||||
function alert_choose_homework_type(id){
|
||||
var htmlvalue = '<div class="task-popup" style="width:300px;">' +
|
||||
'<div class="task-popup-title clearfix task-popup-bggrey">' +
|
||||
'<h3 class="fl">选择作业类别</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>' +
|
||||
'<div class="task_popup_con">' +
|
||||
'<div class="newupload_conbox">' +
|
||||
'<div class="clearfix mb15">' +
|
||||
'<span class="fl mt5">作业类别:</span>' +
|
||||
'<ul class="fl">' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="1" id="homework_type_1" class="fl magic-radio">' +
|
||||
'<label for="homework_type_1" class="fl ml5 edu-class-pop-label edu-color-grey">' +
|
||||
'普通作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="3" id="homework_type_2" class="fl magic-radio">' +
|
||||
'<label for="homework_type_2" class="fl ml5 edu-class-pop-label edu-color-grey">' +
|
||||
'分组作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="2" id="homework_type_3" class="fl magic-radio edu-color-grey">' +
|
||||
'<label for="homework_type_3" class="fl ml5 edu-class-pop-label">' +
|
||||
'编程作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'<li class="clearfix">' +
|
||||
'<input type="radio" name="homework_type" value="4" id="homework_type_4" class="fl magic-radio edu-color-grey">' +
|
||||
'<label for="homework_type_4" class="fl ml5 edu-class-pop-label">' +
|
||||
'实训作业' +
|
||||
'</label>' +
|
||||
'</li>' +
|
||||
'</ul>' +
|
||||
'</div>' +
|
||||
'<div class="cl"></div>' +
|
||||
'<div id="homework_type_notice" class="clearfix color-red none mt-10 ml75">请先选择作业类型</div>' +
|
||||
'<div class="task-popup-submit clearfix">' +
|
||||
'<a href="javascript:void(0);" class="task-btn fl pop_close">取消</a>' +
|
||||
'<a href="javascript:void(0);" onclick="new_homework_type('+id+')" class="task-btn task-btn-blue fr">确定</a>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'</div>';
|
||||
pop_box_new(htmlvalue, 300, 308);
|
||||
}
|
||||
|
||||
function new_homework_type(id){
|
||||
if($("input[name='homework_type']:checked").length == 0){
|
||||
$("#homework_type_notice").show();
|
||||
} else{
|
||||
var type=$("input[name='homework_type']:checked").val();
|
||||
console.log(type == 4);
|
||||
if(type == 4){
|
||||
$.ajax({
|
||||
url: '/homework_common/shixuns?course='+id,
|
||||
dataType: "script"
|
||||
});
|
||||
}else{
|
||||
window.location.href = '/homework_common/new?course='+id+'&homework_type=' + $("input[name='homework_type']:checked").val();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function new_shixun_homework(id){
|
||||
if($("input[name='shixun_homework']:checked").length == 0){
|
||||
$("#homework_type_notice").show();
|
||||
} else{
|
||||
var type=$("input[name='shixun_homework']:checked").val();
|
||||
console.log(type);
|
||||
$("#shixun_homework_common_new").submit();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,8 +262,8 @@ img.edu-nodata-img{ width:200px; margin:50px auto 20px; display: block;}
|
|||
|
||||
/* new tab */
|
||||
.edu-tab{ width: 100%; background:#fff;}
|
||||
#edu-tab-nav,#edu-tab-nav-auth{height:47px;background: #fff;}
|
||||
#edu-tab-nav li.new-tab-nav,#edu-tab-nav-auth li.new-tab-nav {float:left; width: 150px; text-align:center;height:48px;line-height:48px; }
|
||||
#edu-tab-nav{height:47px;background: #fff;}
|
||||
#edu-tab-nav li.new-tab-nav {float:left; width: 150px; text-align:center;height:48px;line-height:48px; }
|
||||
#edu-tab-nav li a{font-size:14px; }
|
||||
#edu-user-tab-nav{height:40px;background: #f5f5f5; border-bottom:2px solid #FC7033;}
|
||||
#edu-user-tab-nav li.new-tab-nav {float:left; width: 120px; text-align:center;height:42px;line-height:42px; }
|
||||
|
|
@ -363,4 +363,4 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;}
|
|||
/*-----下拉框--------*/
|
||||
.down-select{display:none;position: absolute;z-index: 10;left: 0px;width: 100%;overflow-y: auto;background: #fff;max-height: 200px;}
|
||||
.down-select p{height: 35px;line-height: 35px;padding-left: 5px;}
|
||||
.down-select p:hover{background: #f3f4f6}
|
||||
.down-select p:hover{background: #f3f4f6}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ input.new_loggin_input_test{ -webkit-box-shadow: 0 0 0px 1000px white inset; ou
|
|||
.lector{display: block;width: auto;padding: 0px 8px;background: #5ECFBA;color: #ffffff;font-size: 14px;margin-right: 15px;border-radius: 4px;margin-top: 3px;}
|
||||
|
||||
.user-info-span{border-radius: 50%;float:left;background: #F3F5F7;text-align: center;width: 23px;height: 23px;line-height: 23px;margin-top: 3px;margin-right: 5px}
|
||||
.color-grey-6{color:#888888;}
|
||||
.color-grey-8{color:#888888;}
|
||||
|
||||
.account-info-span{border-radius: 50%;float:left;background: #FFF;text-align: center;width: 23px;height: 23px;line-height: 23px;margin-top:2px;margin-right: 5px}
|
||||
.account-auth-span{position: absolute; left: 140px;}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top:
|
|||
.history-fail{ width: 100%; height:40px; line-height: 40px; background:#fdebeb; color:#e53238; }
|
||||
.icon-fail{ display:inline-block; padding:0 8px; background:#e53238; color:#fff;}
|
||||
.icon-success{ display:inline-block; padding:0 8px; background:#252e38; color:#fff;}
|
||||
.info-partly{display: block;flex: 1;position: relative;padding-right: 15px}
|
||||
.content-output{width:37.5%; min-width:200px; }
|
||||
.content-submit{width:10%; min-width:135px; }
|
||||
.content-submitbox{ width:120px; margin: 15px auto; height:135px;}
|
||||
|
|
|
|||
Loading…
Reference in New Issue