Merge branch 'develop' into huang_k8s

This commit is contained in:
huang 2017-08-01 09:40:47 +08:00
commit 4e0dfe4952
189 changed files with 6805 additions and 4432 deletions

78
.gitignore vendored
View File

@ -1,39 +1,39 @@
*.swp
/.project
/.idea
/.bundle
*.swp
/config/database.yml
/config/configuration.yml
/config/additional_environment.rb
/config/oneapm.yml
/config/environments/production.rb
/files/*
/log/*
/public/tmp/*
/tmp/*
/public/cache/*
/config/newrelic.yml
/public/images/avatars/*
/db/schema.rb
/Gemfile.lock
/lib/plugins/acts_as_versioned/test/debug.log
.rbenv-gemsets
.DS_Store
public/api_doc/
/.metadata
vendor/cache
/files
/public/images/avatars
/public/files
/tags
/config/initializers/gitlab_config.rb
1234567
public/javascripts/wechat/node_modules/
.ruby-version
.access_token
tmux*.log
config/wechat.yml
config/oneapm.yml
*.swp
/.project
/.idea/*
/.bundle
*.swp
/config/database.yml
/config/configuration.yml
/config/additional_environment.rb
/config/oneapm.yml
/config/environments/production.rb
/files/*
/log/*
/public/tmp/*
/tmp/*
/public/cache/*
/config/newrelic.yml
/public/images/avatars/*
/db/schema.rb
/Gemfile.lock
/lib/plugins/acts_as_versioned/test/debug.log
.rbenv-gemsets
.DS_Store
public/api_doc/
/.metadata
vendor/cache
/files
/public/images/avatars
/public/files
/tags
/config/initializers/gitlab_config.rb
1234567
public/javascripts/wechat/node_modules/
.ruby-version
.access_token
tmux*.log
config/wechat.yml
config/oneapm.yml

View File

@ -21,7 +21,7 @@ class BoardsController < ApplicationController
before_filter :find_project_by_project_id, :find_board_if_available, :except => [:join_to_org_subfields]
before_filter :authorize, :except => [:new, :show, :create, :index, :join_to_org_subfields, :update_position, :update_name, :update_boards_position, :update_boards_name]
accept_rss_auth :index, :show
helper :sort
include SortHelper
@ -146,7 +146,7 @@ class BoardsController < ApplicationController
if (@board)
@topic_count = @board.topics.count();
@topic_pages = 0 #(params[:page] ? params[:page].to_i + 1 : 0) *10
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) #{sort_type}").offset(@topic_pages).includes(:last_reply).preload(:author, {:last_reply => :author}).all();
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.updated_on) #{sort_type}").offset(@topic_pages).includes(:last_reply).preload(:author, {:last_reply => :author}).all();
else
@board = @contest.boards.build
@board.name = " #{l(:label_board_contest) }"#self.name
@ -156,7 +156,7 @@ class BoardsController < ApplicationController
if @board.save
@topic_count = @board.topics.count();
@topic_pages = 0 #(params[:page] ? params[:page].to_i + 1 : 0) *10
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on) #{sort_type}").offset(@topic_pages).includes(:last_reply).preload(:author, {:last_reply => :author}).all();
@topics = @board.topics.reorder("#{Message.table_name}.sticky DESC, COALESCE(last_replies_messages.created_on, #{Message.table_name}.updated_on) #{sort_type}").offset(@topic_pages).includes(:last_reply).preload(:author, {:last_reply => :author}).all();
else
@topics = []
end
@ -183,7 +183,7 @@ class BoardsController < ApplicationController
end
#分页
@limit = 1
@limit = 10
@is_remote = true
@atta_count = @topics.count
@atta_pages = Paginator.new @atta_count, @limit, params['page'] || 1
@ -370,16 +370,16 @@ class BoardsController < ApplicationController
end
def update_boards_name
@board.update_attribute("name", params[:name])
@board.update_attribute("description", params[:name])
@board.update_attribute("name", params[:name])
@board.update_attribute("description", params[:name])
@course_board = @course.boards.where("parent_id is NULL").first
@board = @course_board.children.order("position asc")
@board_count = @board.count
@course_board = @course.boards.where("parent_id is NULL").first
@board = @course_board.children.order("position asc")
@board_count = @board.count
respond_to do |format|
format.js
end
respond_to do |format|
format.js
end
end
def join_to_org_subfields
@ -392,7 +392,7 @@ class BoardsController < ApplicationController
end
end
private
private
def redirect_to_settings_in_projects
redirect_to settings_project_url(@project, :tab => 'boards')
end

View File

@ -14,7 +14,7 @@ class ChallengesController < ApplicationController
def new
# 顶部导航
@st = params[:st]
@st = params[:st].to_i
@project_menu_type = 11
respond_to do |format|
format.html { render :action => 'new', :layout => 'base_shixun' }
@ -29,17 +29,20 @@ class ChallengesController < ApplicationController
@challenge.position = challenge_count + 1
@challenge.shixun = @shixun
@challenge.user = User.current
# @challenge.st = params[:st]
@challenge.st = params[:st].to_i
if @challenge.save!
# 创建选项
# params[:question].each do |test|
# ChallengeQuestion.where(:option_name => option_name,:challenges => challenge_id, :positon => 1, :right_key => true)
# end
if params[:st].to_i != 0
#创建选项
params[:question][:cnt].each_with_index do |test, index|
answer = params[:choice][:answer][index] == "0" ? false : true
ChallengeQuestion.create(:option_name => test, :challenge_id => @challenge.id, :position => index, :right_key => answer)
end
end
end
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)
rescue Exception => e
flash[:error] = "#{e.message}"
redirect_to new_shixun_challenge_path(:shixun_id => @shixun)
redirect_to new_shixun_challenge_path(:shixun_id => @shixun, :st => params[:st].to_i)
raise ActiveRecord::Rollback
end
end
@ -103,6 +106,7 @@ class ChallengesController < ApplicationController
end
def edit
@st = @challenge.st
challenge_num = Challenge.where(:shixun_id => @shixun).count
challenge_pos = @challenge.position
if challenge_pos < challenge_num
@ -120,39 +124,25 @@ class ChallengesController < ApplicationController
end
def update
@challenge.update_attributes(params[:challenge])
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
=begin
respond_to do |format|
ActiveRecord::Base.transaction do
@challenge.update_attributes(params[:challenge])
begin
@test_sets.delete_all unless @test_sets.blank?
@challenge_tags.delete_all unless @challenge_tags.blank?
if params[:test_set][:hidden].length > 0
params[:test_set][:input].each_with_index do |input, index|
unless (input[index] == params[:test_set][:output][index] && input[index].nil?)
params[:test_set][:hidden][index].to_i == 0 ? open = 1 : open = 0
TestSet.create(:challenge_id => @challenge.id, :input => input, :output => params[:test_set][:output][index], :is_public => open, :position => (index + 1))
end
if (params[:tab] == "1" || params[:tab].nil?) && @challenge.st != 0
begin
@challenge.challenge_questions.delete_all
params[:question][:cnt].each_with_index do |test, index|
answer = params[:choice][:answer][index] == "0" ? false : true
ChallengeQuestion.create(:option_name => test, :challenge_id => @challenge.id, :position => index, :right_key => answer)
end
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
rescue Exception => e
flash[:error] = "#{e.message}"
format.html{redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)}
raise ActiveRecord::Rollback
end
unless params[:knowledge].blank?
params[:knowledge][:input].each do |input|
ChallengeTag.create(:name => input, :challenge_id => @challenge.id)
end
end
# 向jenkins端发送请求构建公共测试用例
add_shixun_modify_status(@shixun, 1)
format.html {redirect_to shixun_challenge_path(@challenge, :shixun_id => @shixun), notice: '更新成功!'}
rescue Exception => e
flash[:error] = "#{e.message}"
format.html{redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)}
raise ActiveRecord::Rollback
else
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
end
end
end
=end
end
def update_evaluation

View File

@ -1328,7 +1328,7 @@ class CoursesController < ApplicationController
# course_request_messages = CourseMessage.where("user_id =? and course_id =? and course_message_type =? and viewed =?", User.current.id, @course.id, 'CourseRequestDealResult', false)
# course_request_messages.update_all(:viewed => true)
course_activities = @course.course_activities.where("course_act_type in ('HomeworkCommon', 'Attachment', 'Course')")
course_activities = @course.course_activities.where("course_act_type in ('HomeworkCommon', 'Attachment', 'Course', 'Message')")
@canShowRealName = User.current.member_of_course? @course
@page = params[:page] ? params[:page].to_i + 1 : 0
if params[:type].present?

View File

@ -4,7 +4,7 @@ class GamesController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:file_update]
before_filter :find_myshixun, :only => [:index]
before_filter :find_game, :only => [:show, :game_build, :entry,:next_step, :outputs_show, :file_edit, :file_update,
:game_status, :change_status, :answer, :minus_score, :refresh_game_list, :reset_original_code, :reset_new_code]
:game_status, :change_status, :answer, :minus_score, :refresh_game_list, :reset_original_code, :reset_new_code, :evaluating_choice]
before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update, :reset_original_code, :reset_new_code]
before_filter :allowd_manager
before_filter :allowd_view, :only => [:show]
@ -26,6 +26,7 @@ class GamesController < ApplicationController
# @praise 判断是否点赞
# @tread 判断是否踩
# git_repository_url @myshixun, "Myshixun"
# @st 0 实践任务 1 多选任务 2 单选任务
def show
# 展示全部实训
if @game.status == 1
@ -38,12 +39,15 @@ class GamesController < ApplicationController
@shixun = @myshixun.shixun
# @games_count = @games.count
@game_challenge = @game.challenge
@st = @game_challenge.st
@had_done = @game.had_done
@praise = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?", @game_challenge.id, @game_challenge.class.to_s, User.current.id).first
@tread = PraiseTread.where("praise_tread_object_id=? and praise_tread_object_type=? and user_id=?", @game_challenge.id, "ChallengeTread", User.current.id).first
@rev = @rev.nil? ? "master" : @rev
@type = params[:type]
challenge_path = @game_challenge.path
# 用户选项
@user_answer = @game.outputs.first.actual_output.split("") unless @st == 0 || @game.outputs.blank?
# 默认打开文件
logger.info("repository id is #{@repository.try(:id)}, repository's shixun_id =#{@repository.try(:myshixun_id)} shixun_id =#{@repository.try(:shixun_id)}, project_id => #{@repository.try(:project_id)}")
# 验证challenge文件名的合法性
@ -262,6 +266,36 @@ class GamesController < ApplicationController
had_done: had_done}
end
# 选择题评测(选择题不需要重新评测)
def evaluating_choice
@game_challenge = @game.challenge
user_answer = params[:answer]
correct = true
if !user_answer.blank?
if user_answer.split("").count != @game_challenge.challenge_questions.where(:right_key => true).count
correct = false
else
user_answer.split("").each do |answer|
question = @game_challenge.challenge_questions.where(:position => answer.to_i).first
unless question.right_key
correct = false
break
end
end
end
else
correct = false
end
@game.update_attributes(:status => 2, :end_time => Time.now)
had_done = @game.had_done
User.current.update_attributes(:grade => (User.current.grade + @game.challenge.score), :experience => (User.current.experience + @game.challenge.score)) if correct
if @game.outputs.blank?
Output.create(:game_id => @game.id, :actual_output => user_answer, :result => correct)
end
render :json => {correct: correct, had_done: had_done, :grade => User.current.grade}
end
def change_status
@game.update_attribute(:status, 0)
outputs = @game.outputs

File diff suppressed because it is too large Load Diff

View File

@ -20,10 +20,10 @@ class MessagesController < ApplicationController
before_filter :authorize1, :only => [:show]
menu_item :boards
default_search_scope :messages
before_filter :find_board, :only => [:new, :preview,:edit]
before_filter :find_board, :only => [:new, :create, :preview, :edit, :update, :sticky_topic]
before_filter :find_attachments, :only => [:preview]
before_filter :find_message, :except => [:new, :preview, :join_org_subfield, :get_subfield_on_click_org, :join_org_subfields]
before_filter :authorize, :except => [:preview, :edit, :destroy, :new,:join_org_subfield, :get_subfield_on_click_org, :join_org_subfields]
before_filter :find_message, :except => [:new, :create, :preview, :join_org_subfield, :get_subfield_on_click_org, :join_org_subfields]
before_filter :authorize, :except => [:preview, :edit, :update, :destroy, :message_replies, :new, :create, :join_org_subfield, :get_subfield_on_click_org, :join_org_subfields, :sticky_topic]
helper :boards
helper :watchers
@ -39,7 +39,7 @@ class MessagesController < ApplicationController
def show
# 顶部导航
@project_menu_type = 3
@topic.update_column('visits', @topic.visits + 1)
@isReply = true
# page = params[:page]
# # Find the page of the requested reply
@ -51,31 +51,32 @@ class MessagesController < ApplicationController
@replies = Message.where("root_id = #{@topic.id}").reorder("created_on desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
@limit_count = @replies.count
@page = params[:page] ? params[:page].to_i + 1 : 0
@limit = 10
@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new(:subject => "RE: #{@message.subject}")
#@limit_count = @replies.count
#@page = params[:page] ? params[:page].to_i + 1 : 0
#@limit = 10
#@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new
if @course
#帖子消息状态更新
course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_message_id =? and course_id =? and viewed =?", User.current.id, 'Message', @topic.id, @course.id, 0)
course_messages.update_all(:viewed => true)
#@replies = @topic.children.
#includes(:author, :attachments, :praise_tread_cache, {:board => :project}).
#reorder("#{Message.table_name}.created_on DESC").
#limit(@reply_pages.per_page).
#offset(@reply_pages.offset).
#all
#includes(:author, :attachments, :praise_tread_cache, {:board => :project}).
#reorder("#{Message.table_name}.created_on DESC").
#limit(@reply_pages.per_page).
#offset(@reply_pages.offset).
#all
#@replies = paginateHelper messages_replies,10
# 班级帖子回复消息设为已读
@replies.each do |comment|
course_message = CourseMessage.where(:course_message_type => 'Message', :course_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
course_message.update_all(:viewed => 1)
course_message = CourseMessage.where(:course_message_type => 'Message', :course_message_id => comment.id, :user_id => User.current.id, :viewed => 0)
course_message.update_all(:viewed => 1)
end
@left_nav_type = 2
respond_to do |format|
format.js
format.html {render :layout => 'base_courses'}
format.html {render :layout => 'base_edu'}
end
#render :action => "show", :layout => "base_courses"#by young
elsif @project
@ -133,11 +134,19 @@ class MessagesController < ApplicationController
# Create a new topic
def new
@message = Message.new
respond_to do |format|
format.html { render :layout => 'base_edu' }
end
end
def create
if User.current.logged?
@message = Message.new
@message.author = User.current
@message.board = @board
@message.safe_attributes = params[:message]
@message.sticky = params[:message][:sticky] ? 1 : 0
if request.post?
if @project
is_public = @project.is_public
@ -157,16 +166,18 @@ class MessagesController < ApplicationController
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
render_attachment_warning_if_needed(@message)
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course, :board_id => @board.id)
elsif @contest
redirect_to contest_boards_path(@contest, :board_id => @board.id)
end
else
if @course
redirect_to board_message_url(@board, @message)
else
if params[:is_board]
if @project
redirect_to project_boards_path(@project)
elsif @contest
redirect_to contest_boards_path(@contest, :board_id => @board.id)
end
else
redirect_to board_message_url(@board, @message)
end
end
else
if params[:is_board]
@ -178,7 +189,7 @@ class MessagesController < ApplicationController
redirect_to contest_boards_path(@contest, :board_id => @board.id, :flag => true)
end
else
layout_file = @project ? 'base_projects' : (@course ? 'base_courses' : 'base_contests')
layout_file = @project ? 'base_projects' : (@course ? 'base_edu' : 'base_contests')
render :action => 'new', :layout => layout_file
end
@ -187,7 +198,7 @@ class MessagesController < ApplicationController
@left_nav_type = 2
respond_to do |format|
format.html {
layout_file = @project ? 'base_projects' : (@course ? 'base_courses' : 'base_contests')
layout_file = @project ? 'base_projects' : (@course ? 'base_edu' : 'base_contests')
render :layout => layout_file
}
end
@ -201,7 +212,7 @@ class MessagesController < ApplicationController
def reply
if params[:parent_id]
parent = Message.find params[:parent_id]
@topic = params[:activity_id].nil? ? parent : Message.find(params[:activity_id].to_i)
@topic = params[:activity_id].blank? ? parent : Message.find(params[:activity_id].to_i)
@reply = Message.new
@reply.author = User.current
@reply.board = parent.board
@ -232,37 +243,53 @@ class MessagesController < ApplicationController
update_forge_activity(@topic.class,@topic.id)
update_org_activity(@topic.class,@topic.id)
redirect_to message_replies_board_message_path(@topic, :board_id => @board.id, :user_activity_id => params[:user_activity_id])
#@topic.update_attribute(:updated_on, Time.now)
if !@reply.new_record?
if params[:asset_id]
ids = params[:asset_id].split(',')
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
end
# if !@reply.new_record?
# if params[:asset_id]
# ids = params[:asset_id].split(',')
# update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
# end
#
# call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
# attachments = Attachment.attach_files(@reply, params[:attachments])
# render_attachment_warning_if_needed(@reply)
# else
# #render file: 'messages#show', layout: 'base_courses'
# end
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
attachments = Attachment.attach_files(@reply, params[:attachments])
render_attachment_warning_if_needed(@reply)
else
#render file: 'messages#show', layout: 'base_courses'
end
if params[:user_activity_id]
@user_activity_id = params[:user_activity_id]
@is_course = params[:is_course] if params[:is_course]
@is_board = params[:is_board] if params[:is_board]
respond_to do |format|
format.js
end
return
else
redirect_to board_message_url(@board, @topic)
return
end
# if params[:user_activity_id]
# @user_activity_id = params[:user_activity_id]
# @is_course = params[:is_course] if params[:is_course]
# @is_board = params[:is_board] if params[:is_board]
# respond_to do |format|
# format.js
# end
# return
# else
# redirect_to board_message_url(@board, @topic)
# return
# end
end
def message_replies
@replies = Message.where("root_id = #{@topic.id}").reorder("created_on desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
#@limit_count = @replies.count
#@page = params[:page] ? params[:page].to_i + 1 : 0
#@limit = 10
#@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new()
@user_activity_id = params[:user_activity_id].blank? ? @topic.id : params[:user_activity_id].to_i
respond_to do |format|
format.js
end
end
# Edit a message
def edit
@isReply = false
if @project
(render_403; return false) unless @message.editable_by?(User.current)
elsif @course
@ -273,55 +300,34 @@ class MessagesController < ApplicationController
(render_403; return false) unless @message.org_subfield_editable_by?(User.current)
end
respond_to do |format|
format.html {
if @project
layout_file = 'base_projects'
elsif @course
@left_nav_type = 2
layout_file = 'base_edu'
elsif @contest
@left_nav_type = 4
layout_file = 'base_contests'
elsif @org_subfield
@organization = @org_subfield.organization
layout_file = 'base_org'
end
render :layout => layout_file
}
end
end
def update
@message.safe_attributes = params[:message]
if request.post? && @message.save
@message.sticky = params[:message][:sticky] ? 1 : 0
if @message.save
attachments = Attachment.attach_files(@message, params[:attachments])
render_attachment_warning_if_needed(@message)
#flash[:notice] = l(:notice_successful_update)
@message.reload
if params[:is_course] && params[:is_course].to_i == 0
redirect_to user_activities_path(User.current.id)
elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 0
if @project
redirect_to project_path(@project)
elsif @course
redirect_to course_activity_path(@course)
elsif @contest
redirect_to contest_path(@contest)
end
elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 1
if @project
redirect_to project_boards_path(@project)
elsif @course
redirect_to course_boards_path(@course)
elsif @contest
redirect_to contest_boards_path(@contest)
end
else
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end
elsif request.get? || request.post?
if params[:is_course] && params[:is_board]
@is_course = params[:is_course]
@is_board = params[:is_board]
end
respond_to do |format|
format.html {
if @project
layout_file = 'base_projects'
elsif @course
@left_nav_type = 2
layout_file = 'base_courses'
elsif @contest
@left_nav_type = 4
layout_file = 'base_contests'
elsif @org_subfield
@organization = @org_subfield.organization
layout_file = 'base_org'
end
render :layout => layout_file
}
end
redirect_to board_message_url(@message.board, @message.root, :r => (@message.parent_id && @message.id))
end
end
@ -333,9 +339,7 @@ class MessagesController < ApplicationController
@user_activity_id = params[:user_activity_id]
@is_course = params[:is_course] if params[:is_course]
@is_board = params[:is_board] if params[:is_board]
respond_to do |format|
format.js
end
redirect_to message_replies_board_message_path(@topic, :board_id => @board.id, :user_activity_id => params[:user_activity_id])
return
end
if @project
@ -399,6 +403,12 @@ class MessagesController < ApplicationController
end
end
def sticky_topic
(render_403; return false) unless (User.current.admin? || User.current.allowed_to?(:as_teacher, @course))
@topic.update_attributes(:sticky => @topic.sticky == 1 ? 0 : 1)
redirect_to board_message_path(@topic.board_id, @topic)
end
def quote
# @subject = @message.subject
# @subject = "RE: #{@subject}" unless @subject.starts_with?('RE:')
@ -437,8 +447,8 @@ class MessagesController < ApplicationController
:created_on => Time.now, :updated_on => Time.now, :locked => @message.locked, :sticky => @message.sticky)
@message.attachments.each do |attach|
mes.attachments << Attachment.new(:filename => attach.filename, :disk_filename => attach.disk_filename, :filesize => attach.filesize, :content_type => attach.content_type, :digest => attach.digest,
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
:is_public => attach.is_public, :quotes => 0)
:downloads => 0, :author_id => User.current.id, :created_on => Time.now, :description => attach.description, :disk_directory => attach.disk_directory, :attachtype => attach.attachtype,
:is_public => attach.is_public, :quotes => 0)
end
# OrgSubfieldMessage.create(:org_subfield_id => field_id.to_i, :message_id => mes.id, :message_type => type)
# org_acts = OrgActivity.where("container_type='OrgSubfield' and container_id=? and org_act_type='Message' and org_act_id=?", field_id.to_i, @message.id)

View File

@ -27,7 +27,7 @@ class MyshixunsController < ApplicationController
jenkins_shixuns = Redmine::Configuration['jenkins_shixuns']
uri = URI("#{jenkins_shixuns}/jenkins-exec/webssh/getConnectInfo")
user_id = User.current.id
params = {gameID:@myshixun.id}
params = {gameID:@myshixun.id, operationEnvironment:@myshixun.shixun.try(:language)}
res = uri_exec uri, params
if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级92")

View File

@ -1,285 +1,286 @@
class SchoolController < ApplicationController
layout 'course_base'
before_filter :require_admin, :only => :upload_logo
def upload
uploaded_io = params[:logo]
school_id ||= params[:id]
s1 = School.find(school_id)
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
end
s1.name = params[:name] unless params[:name].blank?
s1.province = params[:province] unless params[:province].blank?
s1.save
redirect_to admin_schools_url(:school_name => params[:school_name])
end
def upload_logo
@school = School.find params[:id]
@school_name = params[:school_name]
end
#获取制定学校开设的课程数
def course_count school_id
School.find(school_id).courses.count
end
def index
end
def get_province
@provinces = School.find_by_sql("select distinct province from schools")
options = ""
@provinces.each do |p|
options << "<option value = '#{p.province}' >#{p.province}</option>"
end
# 取id取学校名
# 连接子表: 查询已添加用户的学校
school = School.select("id, name").
joins("RIGHT JOIN (
SELECT DISTINCT school_id
FROM #{UserExtensions.table_name}
WHERE school_id IS NOT NULL) AS sids ON schools.id = sids.school_id").
where("#{School.table_name}.id IS NOT NULL")
options_s = ""
school.each do |s|
options_s << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
res = Hash.new
res[:text] = options
res[:text_s] = options_s
render :json => res
end
def get_options
@school = School.where("province = ?", params[:province])
p = params[:province]
##@school = School.all
options = ""
@school.each do |s|
#options << "<option value=#{s.id}>#{s.name}</option>"
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
render :text => options
end
def get_schoollist
@school = School.where("province = ?", params[:province])
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
render :text => options
end
def search_school
q = "%#{params[:key_word].strip}%"
@school = School.where("name LIKE ?", q)
@school = @school.where("province = ?", params[:province]) if (params[:province] != '0' )
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'> <a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
options = "<div class='flash error' id='flash_error'>#{l(:label_school_not_fount)}</div>" if options.blank?
render :text => options
end
#根据学校名字或者拼音来查询
def on_search
condition = "#{params[:name].strip}".gsub(" ","")
#将条件截断为汉字和拼音(全汉字 或者 全拼音 或者 汉字和拼音),
#获取拼音的第一次出现的位置
chinese = []
pinyin = []
condition.scan(/./).each_with_index do |char,index|
if char =~ /[a-zA-Z0-9]/
pinyin << char
elsif char =~ /\'/
else
chinese << char
end
end
if(condition == '')
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.count
else
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
end
result = []
# @school.each do |sc|
# result << {:value=>sc.name,:data=>sc.id}
# end
render :json =>{ :schools => @school,:count=>@school_count}.to_json
end
#添加学校
def add_school
@school = School.new
@school.name = params[:name].strip
@school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
@school.save
respond_to do |format|
format.js
end
end
#申请高校(单位) name:名称 province:省 city:市 address:地址 remarks:备注
def apply_add_school
data = {result:0,name:params[:name],school_id:0}
#0 成功 1参数错误 2名称已存在 3.失败
data[:result] = 0
#检验参数
if params[:name] == "" || params[:province] == "" || params[:city] == "" || params[:address] == ""
data[:result] = 1
else
school = School.where("name = '#{params[:name]}'").first
if school
data[:result] = 2
else
school = School.new
school.name = params[:name].strip
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
school.province = params[:province]
#status 0未处理 1通过 2拒绝
applyschool = ApplyAddSchools.new
#用belongs_to 可以一起存数据库
applyschool.school = school
applyschool.name = school.name
applyschool.province = params[:province]
applyschool.city = params[:city]
applyschool.address = params[:address]
applyschool.remarks = params[:remarks]
applyschool.user_id = User.current.id
if applyschool.save
data[:school_id] = school.id
user_extention= User.current.extensions
user_extention.school_id = school.id
user_extention.save!
# 向管理员发送信息
users = User.where(:admin => 1)
users.each do |user|
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => 0, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
end
else
data[:result] = 3
end
end
end
render :json =>data
end
def search_repeat_schoolname
status = 0 #没有重复的
name = params[:name]
if name
school = School.where("name = '#{name}'").first
if school
status = 1 #有重复的
end
end
render :json =>status
end
def edit_apply_name
name = params[:name] || ""
status = -1
if name != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.name = name.strip
if applyschool.school
applyschool.school.name = name
applyschool.school.pinyin = Pinyin.t(name.strip, splitter: '')
applyschool.school.save!
end
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:name=>name}
end
def edit_apply_address
address = params[:address] || ""
status = -1
if address != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.address = address
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:address=>address}
end
def edit_apply_province
province = params[:province] || ""
city = params[:city] || ""
status = -1
if(province != "") &&(city != "")
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.province = province
applyschool.city = city
if applyschool.school
applyschool.school.province = province
applyschool.school.save!
end
applyschool.save!
if applyschool.user_id && applyschool.user_id != 0
user = User.find(applyschool.user_id)
user_extention= user.extensions
user_extention.location = province
user_extention.location_city = city
user_extention.save!
end
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city}
end
end
class SchoolController < ApplicationController
layout 'course_base'
before_filter :require_admin, :only => :upload_logo
def upload
uploaded_io = params[:logo]
school_id ||= params[:id]
s1 = School.find(school_id)
unless uploaded_io.nil?
File.open(Rails.root.join('public', 'images', 'school', school_id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
s1.logo_link = '/images/school/'+school_id.to_s+'.png'
end
s1.name = params[:name] unless params[:name].blank?
s1.province = params[:province] unless params[:province].blank?
s1.save
redirect_to departments_part_managements_path
end
def upload_logo
@school = School.find params[:id]
@school_name = params[:school_name]
render :layout => "base_management"
end
#获取制定学校开设的课程数
def course_count school_id
School.find(school_id).courses.count
end
def index
end
def get_province
@provinces = School.find_by_sql("select distinct province from schools")
options = ""
@provinces.each do |p|
options << "<option value = '#{p.province}' >#{p.province}</option>"
end
# 取id取学校名
# 连接子表: 查询已添加用户的学校
school = School.select("id, name").
joins("RIGHT JOIN (
SELECT DISTINCT school_id
FROM #{UserExtensions.table_name}
WHERE school_id IS NOT NULL) AS sids ON schools.id = sids.school_id").
where("#{School.table_name}.id IS NOT NULL")
options_s = ""
school.each do |s|
options_s << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
res = Hash.new
res[:text] = options
res[:text_s] = options_s
render :json => res
end
def get_options
@school = School.where("province = ?", params[:province])
p = params[:province]
##@school = School.all
options = ""
@school.each do |s|
#options << "<option value=#{s.id}>#{s.name}</option>"
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id, this.text)'>#{s.name}</a></li>"
end
render :text => options
end
def get_schoollist
@school = School.where("province = ?", params[:province])
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'><a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
render :text => options
end
def search_school
q = "%#{params[:key_word].strip}%"
@school = School.where("name LIKE ?", q)
@school = @school.where("province = ?", params[:province]) if (params[:province] != '0' )
options = ""
@school.each do |s|
options << "<li style = 'width: 33%; float: left'> <a style='cursor: pointer;' id=#{s.id} onclick='test(this.id)'>#{s.name}</a></li>"
end
options = "<div class='flash error' id='flash_error'>#{l(:label_school_not_fount)}</div>" if options.blank?
render :text => options
end
#根据学校名字或者拼音来查询
def on_search
condition = "#{params[:name].strip}".gsub(" ","")
#将条件截断为汉字和拼音(全汉字 或者 全拼音 或者 汉字和拼音),
#获取拼音的第一次出现的位置
chinese = []
pinyin = []
condition.scan(/./).each_with_index do |char,index|
if char =~ /[a-zA-Z0-9]/
pinyin << char
elsif char =~ /\'/
else
chinese << char
end
end
if(condition == '')
@school = School.reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.count
else
@school = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").reorder('pinyin').page((params[:page].to_i || 1) - 1).per(100)
@school_count = School.where("name like '%#{chinese.join("")}%' and pinyin like '%#{pinyin.join("")}%'").count
end
result = []
# @school.each do |sc|
# result << {:value=>sc.name,:data=>sc.id}
# end
render :json =>{ :schools => @school,:count=>@school_count}.to_json
end
#添加学校
def add_school
@school = School.new
@school.name = params[:name].strip
@school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
@school.save
respond_to do |format|
format.js
end
end
#申请高校(单位) name:名称 province:省 city:市 address:地址 remarks:备注
def apply_add_school
data = {result:0,name:params[:name],school_id:0}
#0 成功 1参数错误 2名称已存在 3.失败
data[:result] = 0
#检验参数
if params[:name] == "" || params[:province] == "" || params[:city] == "" || params[:address] == ""
data[:result] = 1
else
school = School.where("name = '#{params[:name]}'").first
if school
data[:result] = 2
else
school = School.new
school.name = params[:name].strip
school.pinyin = Pinyin.t(params[:name].strip, splitter: '')
school.province = params[:province]
#status 0未处理 1通过 2拒绝
applyschool = ApplyAddSchools.new
#用belongs_to 可以一起存数据库
applyschool.school = school
applyschool.name = school.name
applyschool.province = params[:province]
applyschool.city = params[:city]
applyschool.address = params[:address]
applyschool.remarks = params[:remarks]
applyschool.user_id = User.current.id
if applyschool.save
data[:school_id] = school.id
user_extention= User.current.extensions
user_extention.school_id = school.id
user_extention.save!
# 向管理员发送信息
users = User.where(:admin => 1)
users.each do |user|
AppliedMessage.create(:user_id => user.id, :status => 0, :applied_user_id => User.current.id, :viewed => 0, :applied_id => school.id, :applied_type => "ApplyAddSchools", :name => school.name )
end
else
data[:result] = 3
end
end
end
render :json =>data
end
def search_repeat_schoolname
status = 0 #没有重复的
name = params[:name]
if name
school = School.where("name = '#{name}'").first
if school
status = 1 #有重复的
end
end
render :json =>status
end
def edit_apply_name
name = params[:name] || ""
status = -1
if name != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.name = name.strip
if applyschool.school
applyschool.school.name = name
applyschool.school.pinyin = Pinyin.t(name.strip, splitter: '')
applyschool.school.save!
end
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:name=>name}
end
def edit_apply_address
address = params[:address] || ""
status = -1
if address != ""
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.address = address
applyschool.save!
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:address=>address}
end
def edit_apply_province
province = params[:province] || ""
city = params[:city] || ""
status = -1
if(province != "") &&(city != "")
applyschool = ApplyAddSchools.where("id=?",params[:id]).first
applyschool.province = province
applyschool.city = city
if applyschool.school
applyschool.school.province = province
applyschool.school.save!
end
applyschool.save!
if applyschool.user_id && applyschool.user_id != 0
user = User.find(applyschool.user_id)
user_extention= user.extensions
user_extention.location = province
user_extention.location_city = city
user_extention.save!
end
status = 0
end
render :json=>{:status=>status,:id=>params[:id],:province=>province,:city=>city}
end
end

View File

@ -116,10 +116,6 @@ class ShixunsController < ApplicationController
@collaborators = @shixun.collaborators
end
def new_disscuss
render :layout => 'base_edu'
end
def collaborators_delete
user_id = params[:c_id]
shixun_member = ShixunMember.where(:user_id => user_id, :shixun_id => @shixun.id, :role => 2).first

View File

@ -5,14 +5,15 @@ class StagesController < ApplicationController
include ApplicationHelper
def create
if params[:stage_name] && params[:shixun_id]
if params[:stage_name]
stage = Stage.new
stage.name = params[:stage_name]
stage.description = params[:stage_des]
stage.subject_id = @subject.id
stage.user_id = User.current.id
stage.position = @subject.stages.count + 1
ActiveRecord::Base.transaction do
if stage.save
if stage.save && params[:shixun_id]
begin
params[:shixun_id].each do |shixun_id|
shixun = Shixun.find shixun_id
@ -34,10 +35,11 @@ class StagesController < ApplicationController
end
def update
if params[:stage_name] && params[:shixun_id]
if params[:stage_name]
@stage.name = params[:stage_name]
@stage.description = params[:stage_des]
ActiveRecord::Base.transaction do
if @stage.save
if @stage.save && params[:shixun_id]
begin
@stage.stage_shixuns.destroy_all
params[:shixun_id].each do |shixun_id|

View File

@ -3,7 +3,7 @@ class SubjectsController < ApplicationController
layout 'base_subject'
before_filter :require_login
before_filter :check_authentication
before_filter :find_subject, :except => [:index, :create_subject, :new_subject, :append_to_stage]
before_filter :find_subject, :except => [:index, :new, :create, :create_subject, :new_subject, :append_to_stage]
include ApplicationHelper
@ -30,6 +30,37 @@ class SubjectsController < ApplicationController
@stages = @subject.stages
end
def new
@subject = Subject.new
render :layout => "base_edu"
end
def create
if params[:subject]
subject = Subject.create(:name => params[:subject][:name], :description => params[:subject][:description], :user_id => User.current.id, :visits => 0, :status => 0)
end
redirect_to subject_path(subject)
end
def edit
render :layout => "base_edu"
end
def update
if params[:subject]
subject = @subject.update_attributes(:name => params[:subject][:name], :description => params[:subject][:description])
end
redirect_to subject_path(@subject)
end
def update_attr
if params[:name]
@subject.update_attributes(:name => params[:name])
elsif params[:description]
@subject.update_attributes(:description => params[:description])
end
end
def new_subject
if Course.where(:tea_id => User.current.id).count > 0
@status = 1
@ -53,8 +84,9 @@ class SubjectsController < ApplicationController
end
def choose_subject_shixun
course_list = @subject.course_list
@shixuns = Shixun.where(:user_id => User.current.id, :status => [0, 1, 2], :id => course_list.shixun_major_courses.map(&:shixun_id))
#course_list = @subject.course_list
@shixuns = User.current.shixuns.where(:status => [0, 1, 2]).reorder("created_at desc")
#@shixuns = Shixun.where(:user_id => User.current.id, :status => [0, 1, 2], :id => course_list.shixun_major_courses.map(&:shixun_id))
@shixuns_count = @shixuns.count
@limit = 8
@shixuns_pages = Paginator.new @shixuns_count, @limit, params['page'] || 1
@ -67,15 +99,19 @@ class SubjectsController < ApplicationController
end
def publish
@subject.update_attributes(:status => 1)
apply = ApplyAction.where(:container_type => "ApplySubject", :container_id => @subject.id).order("created_at desc").first
if apply && apply.status == 0
@status = 0
else
ApplyAction.create(:container_type => "ApplySubject", :container_id => @subject.id, :user_id => User.current.id, :status => 0)
notes = User.current.show_name.to_s + " 申请发布课程实训:<a href='#{subject_path(@subject)}'>#{@subject.name}</a>"
JournalsForMessage.create(:jour_id => 1, :jour_type => 'Principal', :user_id => User.current.id, :notes => notes, :private => 1, :reply_id => 0)
@status = 1
if Shixun.where(:id => @subject.stage_shixuns.map(&:shixun_id), :status => [0, 1]).count > 0
@status = 2
else
@subject.update_attributes(:status => 1)
ApplyAction.create(:container_type => "ApplySubject", :container_id => @subject.id, :user_id => User.current.id, :status => 0)
notes = User.current.show_name.to_s + " 申请发布课程实训:<a href='#{subject_path(@subject)}'>#{@subject.name}</a>"
JournalsForMessage.create(:jour_id => 1, :jour_type => 'Principal', :user_id => User.current.id, :notes => notes, :private => 1, :reply_id => 0)
@status = 1
end
end
end
@ -83,11 +119,21 @@ class SubjectsController < ApplicationController
apply = ApplyAction.where(:container_type => "ApplySubject", :container_id => @subject.id).order("created_at desc").first
if apply && apply.status == 0
apply.update_attributes(:status => 3)
@subject.update_column('status', 0)
end
@subject.update_attributes(:status => 0)
redirect_to subject_path(@subject)
end
def destroy
if @subject
ApplyAction.where(:container_type => "ApplySubject", :container_id => @subject.id).destroy_all
@subject.destroy
respond_to do |format|
format.js
end
end
end
private
# Find subject of id params[:id]
def find_subject

View File

@ -164,7 +164,7 @@ module ApplicationHelper
# 实训语言的种类
def shixun_language
["Java", "C", "C++", "Python", "MySQL/Java","JFinal","Docker","Ethoernet","Dynamips"]
["Java", "C", "C++", "Python2.7", "Python3.6", "MySQL/Java","JFinal","Docker","Ethereum","Dynamips"]
end
# 实训试用专业
@ -225,11 +225,27 @@ module ApplicationHelper
myshixun = Myshixun.where(:shixun_id => shixun.id, :user_id => user.id).first
if myshixun.nil?
0
elsif !myshixun.nil? && myshixun.games.select{|game| game.status == 2}.count == 0
-1
elsif myshixun.games.select{|game| game.status == 0}.count > 0
[myshixun.games.select{|game| game.status == 0}.count + 1]
else
myshixun.games.select{|game| game.status == 2}.count
end
end
# TPI状态 :已通关、未通关、未开启
def my_shixun_status shixun, user
status = ""
myshixun = Myshixun.where(:shixun_id => shixun.id, :user_id => user.id).first
if myshixun.nil?
status = "未开启"
else
status = myshixun.status == 1 ? "已通关" : "未通关"
end
status
end
# 定义实训相关方法
def sum_final_score
Game.find_by_sql("SELECT sum(final_score) as total_score FROM `games` where user_id=#{User.current.id}").first.try(:total_score)
@ -1918,23 +1934,25 @@ module ApplicationHelper
elsif @welcome
title << "创新源于实践"
elsif @course
title << (@course.name.nil? ? "实训课堂" : @course.name)
title << (@course.name.nil? ? "在线课堂" : @course.name)
elsif params[:controller] == "homework_bank"
title << ("题库")
elsif params[:controller] == "managements"
title << ("后台管理")
elsif params[:controller] == "courses" && params[:action] == "index"
title << ("实训课堂")
title << ("在线课堂")
elsif @contest
title << (@contest.name.nil? ? "创新源于实践" : @contest.name)
elsif @shixun
title << (@shixun.name.nil? ? "实训分类" : @shixun.name)
title << (@shixun.name.nil? ? "全部实训" : @shixun.name)
elsif @my_shixun
title << ("我的实训")
elsif params[:controller] == "shixuns" && params[:action] == "index"
title << ("实训分类")
title << ("全部实训")
elsif @subject
title << (@subject.name.nil? ? "课程实训" : @subject.name)
title << (@subject.name.nil? ? "实训套件" : @subject.name)
elsif params[:controller] == "subjects" && params[:action] == "index"
title << ("课程实训")
title << ("实训套件")
elsif @organization
title << (@organization.name.nil? ? "创新源于实践" : @organization.name)
elsif @forum || params[:controller] == "forums"
@ -1945,7 +1963,7 @@ module ApplicationHelper
if !@project_community.blank? || !@user_projectlist.blank?
title << "项目"
elsif !@course_community.blank? || !@user_courselist.blank?
title << "实训课堂"
title << "在线课堂"
elsif !@contest_community.blank?
title << @contest_community
elsif !@manage_issues.blank?
@ -1960,8 +1978,7 @@ module ApplicationHelper
title << @user.show_name
end
elsif @syllabus
title << (@syllabus.title.nil? ? "实训课堂" : @syllabus.title)
else
title << (@syllabus.title.nil? ? "在线课堂" : @syllabus.title) else
title << (User.current.id == 2 ? "未登录" : User.current.try(:realname))
end
# if first_page.nil? || first_page.web_title.nil?
@ -5179,3 +5196,69 @@ def quote_homework_bank homework, course
end
end
def major_level_option
content = []
option0 = []
option0 << "选择课程所属专业层级"
option0 << 0
option1 = []
option1 << "专科"
option1 << 3
option2 = []
option2 << "本科"
option2 << 2
option3 = []
option3 << "研究生"
option3 << 1
content << option0
content << option1
content << option2
content << option3
content
end
def discipline_category_option major_level = 3
content = []
option0 = []
option0 << "选择课程所属学科门类"
option0 << 0
content << option0
DisciplineCategory.where(:major_level => major_level).each do |dis|
option = []
option << dis.name.to_s
option << dis.id
content << option
end
content
end
def first_level_discipline_option disc_ca = 27
content = []
option0 = []
option0 << "选择课程所属一级学科"
option0 << 0
content << option0
FirstLevelDiscipline.where(:discipline_category_id => disc_ca).each do |fir_dis|
option = []
option << fir_dis.name.to_s
option << fir_dis.id
content << option
end
content
end
def syllabus_major_option fir_dis = 213
content = []
option0 = []
option0 << "选择课程所属专业"
option0 << 0
content << option0
Major.where(:first_level_discipline_id => fir_dis).each do |major|
option = []
option << major.name.to_s
option << major.id
content << option
end
content
end

View File

@ -51,72 +51,6 @@ module SyllabusesHelper
count
end
def major_level_option
content = []
option0 = []
option0 << "选择课程所属专业层级"
option0 << 0
option1 = []
option1 << "专科"
option1 << 3
option2 = []
option2 << "本科"
option2 << 2
option3 = []
option3 << "研究生"
option3 << 1
content << option0
content << option1
content << option2
content << option3
content
end
def discipline_category_option major_level = 3
content = []
option0 = []
option0 << "选择课程所属学科门类"
option0 << 0
content << option0
DisciplineCategory.where(:major_level => major_level).each do |dis|
option = []
option << dis.name.to_s
option << dis.id
content << option
end
content
end
def first_level_discipline_option disc_ca = 27
content = []
option0 = []
option0 << "选择课程所属一级学科"
option0 << 0
content << option0
FirstLevelDiscipline.where(:discipline_category_id => disc_ca).each do |fir_dis|
option = []
option << fir_dis.name.to_s
option << fir_dis.id
content << option
end
content
end
def syllabus_major_option fir_dis = 213
content = []
option0 = []
option0 << "选择课程所属专业"
option0 << 0
content << option0
Major.where(:first_level_discipline_id => fir_dis).each do |major|
option = []
option << major.name.to_s
option << major.id
content << option
end
content
end
def syllabus_type_option
content = []
option0 = []

View File

@ -1,5 +1,5 @@
#coding=utf-8
# st 0编程任务1多选任务2单选任务
# st 0实践任务1多选任务2单选任务
class Challenge < ActiveRecord::Base
default_scope :order => 'position'
belongs_to :shixun,:touch=> true
@ -8,6 +8,7 @@ class Challenge < ActiveRecord::Base
has_many :test_sets, :dependent => :destroy
has_many :challenge_tags, :dependent => :destroy
has_many :games, :dependent => :destroy
has_many :challenge_questions, :dependent => :destroy
validates_presence_of :subject
# validates_presence_of :score
@ -43,4 +44,15 @@ class Challenge < ActiveRecord::Base
myshixun = Myshixun.where(:shixun_id => self.shixun.id, :user_id => User.current.id).first
game = Game.where(:myshixun_id => myshixun.id, :challenge_id => self.id).first
end
# 正确答案
def right_answers
answer = ""
self.challenge_questions.each do |ans|
if ans.right_key
answer << (ans.position + 65).chr
end
end
return answer
end
end

View File

@ -1,3 +1,4 @@
class ChallengeQuestion < ActiveRecord::Base
attr_accessible :challenge_id, :option, :position, :right_key
belongs_to :challenge
attr_accessible :challenge_id, :option_name, :position, :right_key
end

File diff suppressed because it is too large Load Diff

View File

@ -98,7 +98,7 @@ class Message < ActiveRecord::Base
}
safe_attributes 'subject', 'content', 'reply_id', 'root_id'
safe_attributes 'subject', 'content', 'reply_id', 'root_id', 'visits'
safe_attributes 'board_id','locked', 'sticky',
:if => lambda {|message, user|
if message.project

View File

@ -1,5 +1,6 @@
class Output < ActiveRecord::Base
# attr_accessible :title, :body
# actual_output 编程题:实际输出, 选择题: 用户提交的答案(如: 014 对应用户选择为A B E
default_scope :order => 'test_set_position desc'
belongs_to :game
end

View File

@ -1,10 +1,10 @@
class School < ActiveRecord::Base
attr_accessible :name, :province,:pinyin
has_many :courses
has_many :departments, :dependent => :destroy
def to_s
self.name.to_s
end
end
class School < ActiveRecord::Base
default_scope :order => 'created_at desc'
attr_accessible :name, :province,:pinyin
has_many :courses
has_many :departments, :dependent => :destroy
def to_s
self.name.to_s
end
end

View File

@ -1,161 +1,165 @@
# encoding: utf-8
class Syllabus < ActiveRecord::Base
include Redmine::SafeAttributes
include ApplicationHelper
#elasticsearch
include Elasticsearch::Model
#elasticsearch kaminari init
Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
settings index: { number_of_shards: 5 } do
mappings dynamic: 'false' do
indexes :title, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
indexes :updated_at, index:"not_analyzed", type:'date'
end
end
acts_as_taggable
acts_as_attachable
has_many_kindeditor_assets :assets, :dependent => :destroy
belongs_to :user
has_many :courses
has_many :homework_banks
has_many :reference_materials, :dependent => :destroy
has_many :syllabus_update_records, :dependent => :destroy
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :syllabus_members, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
belongs_to :discipline_category
belongs_to :first_level_discipline
belongs_to :major
attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course, :major_level, :discipline_category_id, :first_level_discipline_id, :major_id
safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course', 'major_level', 'discipline_category_id', "first_level_discipline_id"
validates :title, :user_id, presence: true
after_update :update_syllabus_ealasticsearch_index
after_create :create_syllabus_ealasticsearch_index
before_destroy :delete_syllabus_ealasticsearch_index
scope :indexable,lambda { where(nil) }#用于elastic建索引的scope
scope :like, lambda {|arg|
if arg.blank?
where(nil)
else
pattern = "%#{arg.to_s.strip.downcase}%"
where(" LOWER(title) LIKE :p ", :p => pattern)
end
}
def delete_kindeditor_assets
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
end
def syllabus_major_level
type = ""
case self.major_level
when 1
type = "研究生"
when 2
type = "本科"
when 3
type = "专科"
end
type
end
def syllabus_type_str
type = ""
case self.syllabus_type
when 1
type = "公共必修课"
when 2
type = "学科必修课"
when 3
type = "专业选修课"
when 4
type = "实践必修课"
when 5
type = "实践选修课"
end
type
end
def syllabus_discipline_category
self.discipline_category ? self.discipline_category.name : ''
end
def syllabus_first_level_discipline
self.first_level_discipline ? self.first_level_discipline.name : ''
end
def syllabus_major
self.major ? self.major.name : ''
end
###添加回复
def self.add_syllabus_jour(user, notes, id, root_id, options = {})
syllabus = Syllabus.find(id)
if options.count == 0
jfm = syllabus.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0, :root_id => root_id)
else
jfm = syllabus.journals_for_messages.build(options)
end
jfm.save
jfm
end
def create_syllabus_ealasticsearch_index
return if Rails.env.development?
self.__elasticsearch__.index_document
end
def update_syllabus_ealasticsearch_index
return if Rails.env.development?
begin
self.__elasticsearch__.update_document
rescue => e
self.__elasticsearch__.index_document
end
end
def delete_syllabus_ealasticsearch_index
return if Rails.env.development?
begin
self.__elasticsearch__.delete_document
rescue => e
end
end
def self.search(query)
__elasticsearch__.search(
{
query: {
multi_match: {
query: query,
type:"most_fields",
operator: "or",
fields: ['title']
}
},
sort: {
_score:{order: "desc" },
updated_at:{order:"desc"}
},
highlight: {
pre_tags: ['<span class="c_red">'],
post_tags: ['</span>'],
fields: {
title: {},
description: {}
}
}
}
)
end
end
# encoding: utf-8
class Syllabus < ActiveRecord::Base
include Redmine::SafeAttributes
include ApplicationHelper
#elasticsearch
include Elasticsearch::Model
#elasticsearch kaminari init
Kaminari::Hooks.init
Elasticsearch::Model::Response::Response.__send__ :include, Elasticsearch::Model::Response::Pagination::Kaminari
settings index: { number_of_shards: 5 } do
mappings dynamic: 'false' do
indexes :title, analyzer: 'smartcn',index_options: 'offsets'
indexes :description, analyzer: 'smartcn',index_options: 'offsets'
indexes :updated_at, index:"not_analyzed", type:'date'
end
end
acts_as_taggable
acts_as_attachable
has_many_kindeditor_assets :assets, :dependent => :destroy
belongs_to :user
has_many :courses
has_many :homework_banks
has_many :reference_materials, :dependent => :destroy
has_many :syllabus_update_records, :dependent => :destroy
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :syllabus_members, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
has_one :praise_tread_cache, as: :object, dependent: :destroy
belongs_to :discipline_category
belongs_to :first_level_discipline
belongs_to :major
attr_accessible :description, :user_id, :title, :eng_name, :syllabus_type, :credit, :hours, :theory_hours, :practice_hours, :applicable_major, :pre_course, :major_level, :discipline_category_id, :first_level_discipline_id, :major_id
safe_attributes 'title','user', 'description', 'eng_name', 'syllabus_type', 'credit', 'hours', 'theory_hours', 'practice_hours', 'credit', 'applicable_major', 'pre_course', 'major_level', 'discipline_category_id', "first_level_discipline_id"
validates :title, :user_id, presence: true
after_update :update_syllabus_ealasticsearch_index
after_create :create_syllabus_ealasticsearch_index
before_destroy :delete_syllabus_ealasticsearch_index
scope :indexable,lambda { where(nil) }#用于elastic建索引的scope
scope :like, lambda {|arg|
if arg.blank?
where(nil)
else
pattern = "%#{arg.to_s.strip.downcase}%"
where(" LOWER(title) LIKE :p ", :p => pattern)
end
}
def delete_kindeditor_assets
delete_kindeditor_assets_from_disk self.id,OwnerTypeHelper::SYLLABUS
end
# 课程层级
def syllabus_major_level
type = ""
case self.major_level
when 1
type = "研究生"
when 2
type = "本科"
when 3
type = "专科"
end
type
end
def syllabus_type_str
type = ""
case self.syllabus_type
when 1
type = "公共必修课"
when 2
type = "学科必修课"
when 3
type = "专业选修课"
when 4
type = "实践必修课"
when 5
type = "实践选修课"
end
type
end
# 课程的学科门类
def syllabus_discipline_category
self.discipline_category ? self.discipline_category.name : ''
end
# 课程的一级学科
def syllabus_first_level_discipline
self.first_level_discipline ? self.first_level_discipline.name : ''
end
# 课程的专业
def syllabus_major
self.major ? self.major.name : ''
end
###添加回复
def self.add_syllabus_jour(user, notes, id, root_id, options = {})
syllabus = Syllabus.find(id)
if options.count == 0
jfm = syllabus.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0, :root_id => root_id)
else
jfm = syllabus.journals_for_messages.build(options)
end
jfm.save
jfm
end
def create_syllabus_ealasticsearch_index
return if Rails.env.development?
self.__elasticsearch__.index_document
end
def update_syllabus_ealasticsearch_index
return if Rails.env.development?
begin
self.__elasticsearch__.update_document
rescue => e
self.__elasticsearch__.index_document
end
end
def delete_syllabus_ealasticsearch_index
return if Rails.env.development?
begin
self.__elasticsearch__.delete_document
rescue => e
end
end
def self.search(query)
__elasticsearch__.search(
{
query: {
multi_match: {
query: query,
type:"most_fields",
operator: "or",
fields: ['title']
}
},
sort: {
_score:{order: "desc" },
updated_at:{order:"desc"}
},
highlight: {
pre_tags: ['<span class="c_red">'],
post_tags: ['</span>'],
fields: {
title: {},
description: {}
}
}
}
)
end
end

View File

@ -1,92 +1,92 @@
<div class="contextual">
<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
</div>
<h3>
<%=l(:label_project_plural)%>
</h3>
<%= form_tag({}, :method => :get) do %>
<fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend>
<label for='status'>
<%= l(:field_status) %> :
</label>
<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<label for='name'>
<%= l(:label_project) %>:
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入项目名称进行搜索' %>
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'projects'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 30px;">
序号
</th>
<th style="width: 120px;">
<%=l(:label_project)%>
</th>
<th style="width: 20px;">
<%=l(:field_is_public)%>
</th>
<th style="width: 30px;">
<%=l(:field_created_on)%>
</th>
<th style="width: 70px;"></th>
</tr>
</thead>
<tbody>
<% @projects.each do |project| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= project.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=project.name%>'>
<span>
<%= link_to_project_settings(project, {}) %>
</span>
</td>
<td align="center">
<%= checked_image project.is_public? %>
</td>
<td align="center">
<%= format_date(project.created_on) %>
</td>
<td class="buttons">
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
<% html_title(l(:label_project_plural)) -%>
<div class="fr">项目代码/提交数统计:
<%= link_to "最近一周", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_week" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_month" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %><a style="color: #7f7f7f;">|</a>
<%= link_to "所有", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_all" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %>
</div>
<script>
function delcfm() {
if (!confirm("删除项目会一并删除项目的关联信息,确认要删除吗?")) {
window.event.returnValue = false;
}
}
<div class="contextual">
<%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
</div>
<h3>
<%=l(:label_project_plural)%>
</h3>
<%= form_tag({}, :method => :get) do %>
<fieldset>
<legend>
<%= l(:label_filter_plural) %>
</legend>
<label for='status'>
<%= l(:field_status) %> :
</label>
<%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
<label for='name'>
<%= l(:label_project) %>:
</label>
<%= text_field_tag 'name', params[:name], :size => 30, :placeholder => '输入项目名称进行搜索' %>
<%= submit_tag l(:button_apply), :class => "small", :name => nil %>
<%= link_to l(:button_clear), {:controller => 'admin', :action => 'projects'}, :class => 'icon icon-reload' %>
</fieldset>
<% end %>
&nbsp;
<div class="autoscroll">
<table class="list" style="width: 100%;table-layout: fixed">
<thead>
<tr>
<th style="width: 30px;">
序号
</th>
<th style="width: 120px;">
<%=l(:label_project)%>
</th>
<th style="width: 20px;">
<%=l(:field_is_public)%>
</th>
<th style="width: 30px;">
<%=l(:field_created_on)%>
</th>
<th style="width: 70px;"></th>
</tr>
</thead>
<tbody>
<% @projects.each do |project| %>
<tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center;">
<%= project.id %>
</td>
<td style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="name" title='<%=project.name%>'>
<span>
<%= link_to_project_settings(project, {}) %>
</span>
</td>
<td align="center">
<%= checked_image project.is_public? %>
</td>
<td align="center">
<%= format_date(project.created_on) %>
</td>
<td class="buttons">
<%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => 'icon icon-lock') unless project.archived? %>
<%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if project.archived? && (project.parent.nil? || !project.parent.archived?) %>
<%= link_to(l(:button_delete), project_path(project), :method => :delete, :class => 'icon icon-del', :onClick=>"delcfm()" ) %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="pagination">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false %>
</div>
<% html_title(l(:label_project_plural)) -%>
<div class="fr">项目代码/提交数统计:
<%= link_to "最近一周", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_week" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_month" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %><a style="color: #7f7f7f;">|</a>
<%= link_to "所有", {:controller => 'admin', :action => 'export_rep_static_users', :format => 'xls', :cycle => "admin_all" }, :confirm => l(:label_rep_admin_export_tip), :class => "linkBlue2" %>
</div>
<script>
function delcfm() {
if (!confirm("删除项目会一并删除项目的关联信息,确认要删除吗?")) {
window.event.returnValue = false;
}
}
</script>

View File

@ -1,6 +1,6 @@
<% if activity.attachments.any? %>
<% activity.attachments.each do |attachment| %>
<li class="ml10 color-grey">
<li class="color-grey">
<a href="javascript:void(0)" class="link-color-grey">
<i class="fa fa-folder" aria-hidden="true"></i>
<%= link_to_short_attachment attachment,:length=> 58, :class => 'link-color-grey', :download => true %>

View File

@ -1,60 +1,60 @@
<% if false %>
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
function reset_topic(){
$("#message_subject").val("");
$("#subjectmsg").text("");
if(document.getElementById("message_sticky") && document.getElementById("message_locked")){
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
function reset_topic(){
$("#message_subject").val("");
$("#subjectmsg").text("");
if(document.getElementById("message_sticky") && document.getElementById("message_locked")){
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
}
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
message_content_editor.html("");
$("#topic_editor").toggle();
}
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
message_content_editor.html("");
$("#topic_editor").toggle();
}
<% if @is_new%>
$(function(){
$("#message_subject").focus();
});
<%end%>
</script>
<% if @is_new%>
$(function(){
$("#message_subject").focus();
});
<%end%>
</script>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName break_word" style="width: 600px;">
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner">
<div class="NewsBannerName break_word" style="width: 600px;">
<%= @board.parent_id.nil? ? "班级讨论区" : "#{@board.name}" %>
</div>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@board.course)) %>
<% if is_teacher %>
<%= link_to "添加子栏目", settings_course_path(@board.course.id,'boards'), :class => "link-blue fr mt5" %>
<% end %>
</div>
<div nhname="topic_form">
<% if User.current.logged? %>
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %>
<% end %>
</div>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
</div>
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@board.course)) %>
<% if is_teacher %>
<%= link_to "添加子栏目", settings_course_path(@board.course.id,'boards'), :class => "link-blue fr mt5" %>
<% end %>
</div>
<div nhname="topic_form">
<% if User.current.logged? %>
<%= labelled_form_for @message, :url =>{:controller=>'messages',:action => 'new', :board_id => @board.id, :is_board => 'true'},
:html => {:nhname=>'form',:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'course_new', :locals => {:f => f, :topic => @message, :edit_mode => false, :course => @board.course} %>
<% end %>
<% end %>
</div>
<%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
</div>
<% end %>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner user_bg_shadow clearfix">
<p class="color-grey fl font-16">全部帖子</p><span class="btn-cir btn-cir-grey ml5 mt5 fl"><%= @topics.count %></span>
<a href="<%= new_disscuss_shixuns_path %>" class=" task-btn task-btn-green fr">我要发布</a>
</div>
<div id="course-boardlist_new">
<%= render :partial => "course_show_detail", :locals => {:topics => @topics, :page => 0} %>
<div class="with85 fl">
<div class="ml15 user_bg_shadow">
<div class="homepageRightBanner user_bg_shadow clearfix">
<p class="color-grey fl font-16">全部帖子</p><span class="btn-cir btn-cir-grey ml5 mt5 fl"><%= @topics.count %></span>
<% if User.current.logged? %>
<a href="<%= new_board_message_path(@board.id) %>" class=" task-btn task-btn-green fr">+ 我要发布</a>
<% end %>
</div>
<div id="course-boardlist_new">
<%= render :partial => "course_show_detail", :locals => {:topics => @topics, :page => 0} %>
</div>
</div>
</div>

View File

@ -3,8 +3,8 @@
<%= javascript_include_tag "create_kindeditor" %>
<% end %>
<% if @topics %>
<%= render :partial => 'users/course_boardlist', :locals => {:topics => @topics ? @topics: topics , :is_course => 1, :is_board=>1} %>
<% if @topics.count > 0 %>
<%= render :partial => 'users/course_boardlist', :locals => {:topics => @topics, :is_course => 1, :is_board=>1} %>
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>

View File

@ -47,7 +47,7 @@
saveHTMLToTextarea : true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity : 0.6,
placeholder: "请输入完成当前任务依赖的知识点或者其它相关信息",
placeholder: "<%= @st == 0 ? '' : "请输入各个选项的具体解析或其他相关信息" %>",
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

View File

@ -5,18 +5,29 @@
<span class="btn-cir btn-cir-grey ml10 mt12 fl"><%= @challenges.count %></span>
<% end %>
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
<!--<a href="<%#= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">单选任务</a>-->
<!--<a href="<%#= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">多选任务</a>-->
<!--<a href="<%#= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">编程任务</a>-->
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">新建阶段</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mt5">+实践任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+多选任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mr10 mt5">+单选任务</a>
<!--<a href="<%#= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr5" style="margin: 5px 0;">新建阶段</a>-->
<% end %> </div>
<div class="panel-list shixun-panel-list">
<% @challenges.each_with_index do |challenge, index| -%>
<div class="clearfix shixun-panel-inner" id="shixun_index_<%= index %>">
<h4 class="fl panel-inner-title"><i class="fa fa-dot-circle-o font-18 color-green mr10"></i><span class="color-black mr10">第<%= challenge.position %>关</span>
<h4 class="fl panel-inner-title">
<span class="panel-inner-icon mr10 fl mt5">
<% if challenge.st == 0 %>
<i class="fa fa-code font-16 color_white" title="实践任务"></i>
<% elsif challenge.st == 1 %>
<i class="fa fa-th-list color_white" title="多选任务"></i>
<% elsif challenge.st == 2 %>
<img src="/images/bigdata/singel.png" style="margin-bottom: 3px" title="单选任务">
<% end%>
</span>
<!-- <i class="fa fa-dot-circle-o font-18 color-green mr10"></i>-->
<span class="color-black mr10">第<%= challenge.position %>关</span>
<%#= link_to challenge.subject, shixun_challenge_path(@shixun.id, challenge), :target => "_blank" %>
<% if User.current.manager_of_shixun?(@shixun) %>
<%= link_to challenge.subject, shixun_challenge_path(@shixun, challenge), :target => "_blank" %>
<%= link_to challenge.subject, edit_shixun_challenge_path(challenge, :shixun_id => @shixun), :target => "_blank" %>
<% else %>
<% if allow_to_view_challenge(challenge, @shixun) %>
<%= link_to challenge.subject, myshixun_game_path(challenge.current_user_game, :myshixun_id => challenge.current_user_game.try(:myshixun)), :target => "_blank" %>

View File

@ -3,7 +3,7 @@
<div id="edit_answer_show">
<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="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3, :editor => 3) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
<% end %>
</p>

View File

@ -0,0 +1,44 @@
<div class="panel-form">
<% if @editor.blank? && !@challenge.ready_knowledge.blank? %>
<div id="edit_answer_show">
<div class="clearfix mb20">
<p class="fr">
<% if User.current.manager_of_shixun?(@shixun) %>
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6, :editor => 6) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
<% end %>
</p>
</div>
<ul>
<li class="clearfix">
<label class=" panel-form-label fl"> 预备知识:</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li" id="challenge_editorMd_propaedeutics" style="width: 90%">
<textarea style="display:none;"><%= @challenge.ready_knowledge.blank? ? "无" : (@challenge.ready_knowledge) %></textarea>
</div>
<!-- <div class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li" id="tpm_answer_show" style="width: 90%">
<textarea style="display:none;"><%#= @challenge.answer.blank? ? "无" : (@challenge.answer) %></textarea>
</div>-->
</li>
</ul>
</div>
<% end %>
<% if @challenge.ready_knowledge.blank? || !@editor.blank? %>
<ul class="" id="answer_edit">
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6), :html => {:id => "challenge_shixun_propaedeutics"} do |f| %>
<%= render :partial => "propaedeutics_form", :locals => {:f => f} %>
<% end %>
</ul>
<% end %>
</div>
<script>
$(document).ready(function() {
editormd.loadKaTeX(function() {
var answerMD = editormd.markdownToHTML("challenge_editorMd_propaedeutics", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
});
});
</script>

View File

@ -3,7 +3,7 @@
<div id="scroe_show" class="<%= @challenge.score.blank? ? "undis" : "" %>">
<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" id="edit_score">编辑</a>
<% end %>
</p>

View File

@ -2,7 +2,7 @@
<div id="edit_skill_show" class="<%= @challenge_tags.blank? ? "undis" : "" %>">
<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" id="edit_skill">编辑</a>
<% end %>
</p>

View File

@ -3,7 +3,7 @@
<div id="task_pass_show">
<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="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :editor => 1) %>" class="shixun-task-btn task-btn-green fr">编辑</a>
<% end %>
</p>
@ -23,6 +23,31 @@
</li>
</ul>
</div>
<% if @challenge.st == 1 %>
<ul id="select_more">
<% @challenge.challenge_questions.each_with_index do |question, index| %>
<li class="clearfix mb10">
<label class="panel-form-label fl"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 <%= question.right_key ? 'background-blue color_white' : 'task-bg-grey' %>">
<!--<input type="checkbox" name="select_more[]" value="" class="ml-3 mr5 magic-checkbox" >-->
<label><%= question.option_name %></label>
</div>
</li>
<% end %>
</ul>
<% elsif @challenge.st == 2 %>
<ul id="select_single">
<% @challenge.challenge_questions.each_with_index do |question, index| %>
<li class="clearfix mb10">
<label class="panel-form-label fl"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 <%= question.right_key ? 'background-blue color_white' : 'task-bg-grey' %>">
<!--<input name="select_single[]" value="" type="radio" class="ml-3 mr5 magic-radio" >-->
<label><%= question.option_name %></label>
</div>
</li>
<% end %>
</ul>
<% end %>
<% end %>
<% if @challenge.subject.blank? || !@editor.blank? %>
<ul class="" id="task_pass_edit">
@ -32,9 +57,8 @@
</ul>
<% end %>
</div>
<%# if @challenge.st == 1 %>
<!--需要添加新代码的地方-->
<%# if @challenge.st == 1 %>
<%# end %>
<script>

View File

@ -0,0 +1,79 @@
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
<%= javascript_include_tag '/editormd/editormd.min.js','/editormd/examples/js/jquery.min.js' %>
<style>
.CodeMirror-scroll{
overflow: auto !important;
margin-bottom: -30px;
margin-right: -30px;
padding-bottom: 30px;
height: 100%;
outline: none;
position: relative;
}
</style>
<div id="shixun_form">
<li class="clearfix" style="line-height:1.9;">
<label class="panel-form-label fl"> 预备知识:</label>
<div id="shixuns_propaedeutics" class="new_li fl" style="margin-bottom: 0px">
<textarea name="challenge[ready_knowledge]"><%= @challenge.ready_knowledge %></textarea>
</div>
</li>
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="$('#challenge_shixun_propaedeutics').submit();">保存</a>
<% if@challenge.ready_knowledge %>
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="task-btn fr mr10" id="answer_cancel">取消</a>
<% end %>
</li>
</div>
<script>
propaedeutics_editormd = editormd("shixuns_propaedeutics", {
width : "89.6%",
height : 600,
syncScrolling : "single",
//你的lib目录的路径我这边用JSP做测试的
path : "/editormd/lib/",
tex : true,
autoFocus: false,
toolbarIcons : function() {
// Or return editormd.toolbarModes[name]; // full, simple, mini
// Using "||" set icons align right.
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
},
toolbarCustomIcons : {
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
},
//这个配置在simple.html中并没有但是为了能够提交表单使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中方便post提交表单。
saveHTMLToTextarea : true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity : 0.6,
placeholder: "请输入完成当前任务依赖的知识点或者其它相关信息",
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
});
window.onload = function(){
$("#shixuns_propaedeutics [type=\"latex\"]").bind("click", function(){
propaedeutics_editormd.cm.replaceSelection("```latex");
propaedeutics_editormd.cm.replaceSelection("\n");
propaedeutics_editormd.cm.replaceSelection("\n");
propaedeutics_editormd.cm.replaceSelection("```");
var __Cursor = propaedeutics_editormd.cm.getDoc().getCursor();
propaedeutics_editormd.cm.setCursor(__Cursor.line-1, 0);
});
$("#shixuns_propaedeutics [type=\"inline\"]").bind("click", function(){
propaedeutics_editormd.cm.replaceSelection("$$$$");
var __Cursor = propaedeutics_editormd.cm.getDoc().getCursor();
propaedeutics_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
propaedeutics_editormd.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式");
};
/* $("#answer_cancel").click(function(){
$("#answer_edit").hide();
$("#edit_answer_show").show();
})*/
</script>

View File

@ -29,8 +29,13 @@
<div class="prop-notice-info mb10 ml95">
<ol>
<li>如果学员查看了参考答案,则不能得到相应的经验值</li>
<li>如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+100经验值、+100金币</li>
<% if @st == 0 %>
<li>如果学员查看了参考答案,则不能得到相应的经验值</li>
<li>如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+100经验值、+100金币</li>
<% else %>
<li>如果学员答题错误,则不能得到相应的经验值</li>
<li>如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币</li>
<% end %>
</ol>
</div>
@ -44,40 +49,41 @@
<script type="text/javascript">
// 根据难易程度设置不同的奖励经验值(适用新建与编辑模式)
var list= $('input:radio[name="challenge[difficulty]"]:checked').val(); // 获取select的索引值
var list = $('input:radio[name="challenge[difficulty]"]:checked').val(); // 获取select的索引值
var index = parseInt(<%= @st == 0 ? 1 : 10 %>); // 单选 与 多选分数系数
if(list == 1){
$("#challenge_score").empty();
for(var i= 100; i <= 200; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
for(var i = 100; i <= 200; i += 100){
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
}else if(list == 2){
$("#challenge_score").empty();
for(var i= 300; i <= 600; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
for(var i = 300; i <= 600; i += 100){
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
}else if(list == 3){
$("#challenge_score").empty();
for(var i= 700; i <= 1000; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
}
$("#challenge_score").find("option[value='<%= @challenge.score %>']").attr("selected",true); // 设置option默认值
$("#challenge_difficulty_1").click(function(){
$("#challenge_score").empty();
for(var i= 100; i <= 200; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
for(var i = 100; i <= 200; i += 100){
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
});
$("#challenge_difficulty_2").click(function(){
$("#challenge_score").empty();
for(var i= 300; i <= 600; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
for(var i = 300; i <= 600; i += 100){
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
});
$("#challenge_difficulty_3").click(function(){
$("#challenge_score").empty();
for(var i= 700; i <= 1000; i += 100){
$("#challenge_score").append("<option value="+ i + ">"+ i +"</option>");
$("#challenge_score").append("<option value="+ i/index + ">"+ i/index +"</option>");
}
})
function challenge_score_update(){

View File

@ -21,7 +21,11 @@
<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>
<li>学员为参考答案通过了本阶段的评测时将获得技能,否则不能获得技能</li>
<% if @st == 0 %>
<li>学员为参考答案通过了本阶段的评测时将获得技能,否则不能获得技能</li>
<% else %>
<li>学员答题正确将获得技能,否则不能获得技能</li>
<% end %>
</ol>
</div>

View File

@ -11,7 +11,14 @@
position: relative;
}
</style>
<script id="t:set-option-list" type="text/html">
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">A</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
</script>
<div id="shixun_form">
<li class="clearfix">
<label class="panel-form-label fl"><span class="c_red mr5">*</span>名称:</label>
@ -25,13 +32,66 @@
</div>
<span style="display: none" class="c_red ml95" id="new_shixun_pass">过关任务不能为空</span>
</li>
<!--<li>-->
<!--/*****-->
<!--需要写选项的地方-->
<!--*****/-->
<!--</li>-->
<% if @st != 0 %>
<% if params[:action] == "edit" && @challenge.challenge_questions.count > 0 %>
<% @challenge.challenge_questions.each_with_index do |question, index| %>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice <%= question.right_key ? "check-option-bg" : "" %>" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案"><%= (question.position+ 65).chr %></span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"><%= question.option_name %></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<% end %>
<% elsif @st == 2 %>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">A</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">B</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<% else %>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">A</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">B</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">C</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @st %>);" name="option_span" title="点击设置答案">D</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="question[cnt][]" placeholder="请输入选项内容"></textarea>
<a title="移除" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<% end %>
<ul>
<li class="clearfix mb10" >
<label class="panel-form-label fl"><span class="add-option-item fr mr10 color-grey border-dash-orange" name="option_span"><%= params[:action] == "edit" ? (@challenge.challenge_questions.count + 65).chr : (@st == 1 ? "E" : "C") %></span></label>
<div class="fl panel-box-sizing add-option-input border-dash-orange"><a title="新增" class="option_icon_add">新增选项</a></div>
</li>
<span style="display: none" class="c_red ml95" id="choice_error_tip"></span>
<li class="clearfix" ><label class="fl" style="margin-left: 46px">温馨提示:点击选项,可以直接设置答案</label><label class="fr">标准答案:<span id="current-option" class="color-orange"><%= @challenge.right_answers.blank? ? "请点击正确选项" : @challenge.right_answers %></span></label></li>
</ul>
<% end %>
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_update()">保存</a>
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_update(<%= @st %>)">保存</a>
<% if params[:action] == "new" %>
<a href="<%= shixun_challenges_url(@shixun) %>" class="task-btn fr mr10" id="task_pass_cancel">取消</a>
<% else %>
@ -63,12 +123,121 @@
saveHTMLToTextarea : true,
// 用于增加自定义工具栏的功能可以直接插入HTML标签不使用默认的元素创建图标
dialogMaskOpacity : 0.6,
placeholder: "请输入完成当前任务依赖的知识点或者其它相关信息",
placeholder: "<%= @st == 0 ? "请输入完成当前任务依赖的知识点或者其它相关信息" : "请输入选择题的题干内容" %>",
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
});
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
$("#shixun_form").on('click', 'a.option_icon_add', function () {
var html = bt('t:set-option-list', null);
$(this).parent().parent('.clearfix').before(html);
var inputs = document.getElementsByName("question[cnt][]");
var inputs_spans = document.getElementsByName("option_span");
for (var j = 0; j < inputs_spans.length; j++) {
if(j >= 0 && j <= 26){
$(inputs_spans[j]).html(String.fromCharCode(65 + j));
}
}
for (var i = 0; i < inputs.length; i++) {
autoTextarea(inputs[i], 0, 140);
}
$(inputs[inputs.length - 1]).focus();
});
$("#shixun_form").on('click', 'a.option_icon_remove', function () {
$(this).parent('.clearfix').remove();
var inputs_spans = document.getElementsByName("option_span");
for (var j = 0; j < inputs_spans.length; j++) {
if(j >= 0 && j <= 26){
if(j >= 0 && j <= 26){
$(inputs_spans[j]).html(String.fromCharCode(65 + j));
}
}
}
$("#current-option").html("");
if($(".check-option-bg").length>0){
for(var i=0;i<$(".check-option-bg").length;i++){
$("#current-option").html($("#current-option").html()+$(".check-option-bg").eq(i).html());
}
}else{
$("#current-option").html("请点击正确选项");
}
});
});
//设置选项答案
function selectchoice(item, st){
//判断是否选中,如果选中,再次点击的时候取消选中
if($(item).hasClass('check-option-bg')){
$(item).removeClass('check-option-bg');
}else{
if(st == 2){
//单选
$(".select-choice").removeClass('check-option-bg');
$(item).addClass('check-option-bg');
}else{
//多选
$(item).addClass('check-option-bg');
}
}
$("#current-option").html("");
if($(".check-option-bg").length>0){
for(var i=0;i<$(".check-option-bg").length;i++){
$("#current-option").html($("#current-option").html()+$(".check-option-bg").eq(i).html());
}
}else{
$("#current-option").html("请点击正确选项");
}
}
// 判断选择题的答案
function set_choice_answer(){
var answer = document.getElementsByName("choice[answer][]");
var choice = document.getElementsByName("option_span");
for(var o = 0; o < choice.length; o++){
if($(choice[o]).hasClass("check-option-bg")){
$(answer[o]).val(String.fromCharCode(65 + o));
}else{
$(answer[o]).val(0);
}
}
}
// 判断选择题内容是否为空
function judge_choice_contents(){
var answer = document.getElementsByName("choice[answer][]");
var contents = document.getElementsByName("question[cnt][]");
var lens = contents.length;
for(var i = 0; i < lens; i++){
if($(contents[i]).val().trim() == ""){
return true;
}
}
return false;
}
// 判断选择题选择答案的个数
function judge_choice_answer(){
var answer = document.getElementsByName("choice[answer][]");
var lens = answer.length;
var num = 0;
for(var i= 0; i < lens; i++){
if($(answer[i]).val() != "0"){
num += 1;
}
}
return num;
}
// 选择题选项的个数
function choice_num(){
var answer = document.getElementsByName("choice[answer][]");
var lens = answer.length;
return lens;
}
window.onload = function(){
$("#challenge_task_pass [type=\"latex\"]").bind("click", function(){
taskpass_editormd.cm.replaceSelection("```latex");
@ -100,15 +269,41 @@
$("#task_pass_show").show();
$("#task_pass_edit").hide();
});
function challenge_update(){
function challenge_update(st){
set_choice_answer();
var error = $("#choice_error_tip");
if($('#challenge_subject').val().trim() == ""){
$("#challenge_subject").focus();
$("#new_shixun_name").show();
}else if($("#challenge_task_pass textarea").val().trim() == ""){
$("#challenge_task_pass textarea").focus();
$("#new_shixun_pass").show();
}else if(judge_choice_contents()){
error.html("选项不能为空").show();
}else{
$('#challenge_shixun_update').submit();
if(st == "2"){
if(judge_choice_contents()) {
error.html("选项内容不能为空").show();
}else if(choice_num() < 2){
error.html("单选题选项不能少于2个").show();
}else if(judge_choice_answer() == 0){
error.html("请设置答案").show();
}else{
$('#challenge_shixun_update').submit();
}
}else if(st == "1"){
if(judge_choice_contents()) {
error.html("选项内容不能为空").show();
}else if(choice_num() < 3){
error.html("多选题选项不能少于3个").show();
}else if(judge_choice_answer() < 2){
error.html("答案不能少于2个").show();
}else{
$('#challenge_shixun_update').submit();
}
}else{
$('#challenge_shixun_update').submit();
}
}
}

View File

@ -17,13 +17,29 @@
<div class="task-pm-content mb20">
<div class="task-pm-box mt20">
<div class="panel-header clearfix user_bg_shadow">
<div class="panel-header clearfix user_bg_shadow" style="height: 40px;border-bottom:0px;padding:10px 15px 0px 15px;">
<% if @st == 0 %>
<span class="panel-inner-icon mr10 fl mt5">
<i class="fa fa-code font-16 color_white" title="实践任务"></i>
</span>
<% elsif @st == 1 %>
<span class="panel-inner-icon mr10 fl mt5">
<i class="fa fa-th-list color_white" title="多选任务"></i>
</span>
<% elsif @st == 2%>
<span class="panel-inner-icon mr10 fl mt5">
<img src="/images/bigdata/singel.png" style="margin-bottom: 3px" title="单选任务">
</span>
<% end %>
<h3 class="fl mt3">阶段详情(第<%= @challenge.position %>关)</h3>
<% 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 %>
<% 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) %>" 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>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10">+多选任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr mr10">+单选任务</a>
<% end %>
</div>
</div>
@ -31,14 +47,17 @@
<li class="fl <%= @tab == 1 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 1) %>" class="color-black">本关任务</a>
</li>
<%# if @challenge.st == 0 %>
<% if @challenge.st == 0 %>
<li class="fl <%= @tab == 2 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 2) %>" class="color-black">评测设置</a>
</li>
<%# end %>
<% end %>
<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 == 4 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
</li>
@ -57,6 +76,8 @@
<%= render :partial => "edit_scoring" %>
<% elsif @tab == 5 %>
<%= render :partial => "edit_skill" %>
<% elsif @tab == 6 %>
<%= render :partial => "edit_propaedeutics" %>
<% end %>
</div>
</div>

View File

@ -25,7 +25,10 @@
<a href="<%= shixun_challenge_path(@shixun, @next_challenge) %>" 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) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>-->
<a href="<%= new_shixun_challenge_path(@shixun, :st => 2) %>" class="shixun-task-btn task-btn-green fr">+单选任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10">+多选任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr mr10">+实践任务</a>
<% end %>
</div>
<div class="panel-form ">

View File

@ -27,14 +27,14 @@
<% end %>
</ul>
</div>
<div class="right fl">
<div class="right fl user_bg_shadow bc-white">
<div class="banner clearfix mb20 font-16 user_bg_shadow">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr">
<%= link_to '返回', course_path(@course), :class => 'font-14 color-grey' %>
</span>
</div>
<div class="person user_bg_shadow pb5">
<div class="person pb5">
<!--------------学生--------------->
<div class="student">
<p class="clearfix pl20 pr20 color-grey">
@ -44,39 +44,44 @@
<span class="fr right mt10" style=" height: 36px; line-height:36px;width:205px; margin-top:11px;"><input class="mr15 pl5 color-grey" style="width:160px;" type="text" value="<%= @search %>" id="all_student_list_search" placeholder="输入姓名、学号进行搜索"/><i class="fa fa-search font-16 mt8 mr10 color-grey" onclick="submit_member_all_student_list_search('<%= @course.id %>');"></i></span>
</p>
<!--------------全部学生-------------------->
<ul class="all pl20 pr20 color-grey">
<li class="clearfix">
<span class="span1">序号</span>
<span class="span2">姓名</span>
<span>用户ID</span>
<span>学号</span>
<span>分班</span>
<span class="span6">操作</span>
</li>
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>用户ID</th>
<th>学号</th>
<th>分班</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<% unless @members.blank? %>
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<li class="clearfix" id="setting_member_<%= member.id %>">
<span class="span1"><%= index + 1 + (@page - 1) * 20 %></span>
<span class="span2"><%= link_to user.show_real_name, user_path(user), :target => '_blank' %></span>
<span><%= user.login %></span>
<span><%= user.user_extensions ? user.user_extensions.student_id : '' %></span>
<span><%= member.course_group_id == 0 ? '未分班' : member.course_group.name %></span>
<span class="span6">
<tr id="setting_member_<%= member.id %>">
<td><%= index + 1 + (@page - 1) * 20 %></td>
<td><%= link_to user.show_real_name, user_path(user), :class => 'edu-txt-w140 task-hide mt5', :target => '_blank' %></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.login %></span></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span></td>
<td><%= member.course_group_id == 0 ? '未分班' : member.course_group.name %></td>
<td>
<% if user == User.current %>
<a href="javascript:void(0);" class="delete" onclick="delete_confirm_box_3('<%=join_path(:object_id => @course.id) %>', '确定退出班级吗?')">删除</a>
<a href="javascript:void(0);" class="span5 delete" onclick="delete_confirm_box_3('<%=join_path(:object_id => @course.id) %>', '确定退出班级吗?')">删除</a>
<% else %>
--
<% end %>
</span>
</li>
</td>
</tr>
<% end %>
<% end %>
</ul>
</tbody>
</table>
</div>
<div class="cl"></div>
<div class="fr pages_right_min mt10">
<div class="fr pages_right_min mt10 mb10">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>

View File

@ -31,14 +31,14 @@
<% end %>
</ul>
</div>
<div class="right fl">
<div class="banner clearfix mb20 font-16 user_bg_shadow">
<div class="right fl user_bg_shadow bc-white">
<div class="banner clearfix mb20 font-16">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr">
<%= link_to '返回', course_path(@course), :class => 'font-14 color-grey' %>
</span>
</div>
<div class="person user_bg_shadow pb5">
<div class="person pb5">
<!--------------学生--------------->
<div class="student">
<p class="clearfix pl20 pr20 color-grey">
@ -48,41 +48,41 @@
<span class="fr right mt10"><input class="pr15 pl5 color-grey" type="text" value="<%= @search %>" id="has_group_student_list_search" placeholder="输入姓名、学号进行搜索"/><i class="fa fa-search font-16 mt8 mr10" onclick="submit_member_has_group_student_search('<%= @course.id %>', '<%= @group.id %>');"></i></span>
</p>
<!------------------已分班学生--------------------->
<ul class="oldstudent pl20 pr20 color-grey">
<li class="clearfix">
<span class="span1">序号</span>
<span class="span2">姓名</span>
<span>用户ID</span>
<span>学号</span>
<span class="span6">操作</span>
</li>
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>用户ID</th>
<th>学号</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<% unless @members.blank? %>
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<li class="clearfix" id="setting_member_<%= member.id %>">
<span class="span1 open-select">
<%= index + 1 + (@page -1) * 20 %>
</span>
<span class="span2"><%= link_to user.show_real_name, user_path(user), :target => '_blank' %></span>
<span><%= user.login %></span>
<span><%= user.user_extensions ? user.user_extensions.student_id : '' %></span>
<span class="span6">
<tr id="setting_member_<%= member.id %>">
<td><%= index + 1 + (@page -1) * 20 %></td>
<td><%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.login %></span></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span></td>
<td>
<% if user == User.current %>
<a href="javascript:void(0);" class="delete" onclick="delete_confirm_box('<%=unjoin_group_courses_path(:member => member.id, :group_id => @group.id) %>', '确定要移除吗?<br/>移除后,需要重新选分班。')">移除</a>
<a href="javascript:void(0);" class="span5 delete" onclick="delete_confirm_box('<%=unjoin_group_courses_path(:member => member.id, :group_id => @group.id) %>', '确定要移除吗?<br/>移除后,需要重新选分班。')">移除</a>
<% else %>
--
<% end %>
</span>
</li>
</td>
</tr>
<% end %>
<% end %>
</ul>
</tbody>
</table>
</div>
<div class="cl"></div>
<div class="fr pages_right_min mt10">
<div class="fr pages_right_min mt10 mb10">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>

View File

@ -27,14 +27,14 @@
<% end %>
</ul>
</div>
<div class="right fl">
<div class="right fl user_bg_shadow bc-white">
<div class="banner clearfix mb20 font-16 user_bg_shadow">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr">
<%= link_to '返回', course_path(@course), :class => 'font-14 color-grey' %>
</span>
</div>
<div class="person user_bg_shadow pb5">
<div class="person pb5">
<!--------------学生--------------->
<div class="student">
<p class="clearfix pl20 pr20 color-grey">
@ -44,41 +44,44 @@
<span class="fr right mt10"><input class="pr15 pl5 color-grey" type="text" value="<%= @search %>" id="no_group_student_list_search" placeholder="输入姓名、学号进行搜索"/><i class="fa fa-search font-16 mt8 mr10" onclick="submit_member_no_group_student_search('<%= @course.id %>');" style="color:#666;cursor: pointer"></i></span>
</p>
<!--------------学生-------------------->
<ul class="newstudent pl20 pr20 color-grey">
<li class="clearfix">
<span class="span1">序号</span>
<span class="span2">姓名</span>
<span>用户ID</span>
<span>学号</span>
<span class="span6">操作</span>
</li>
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>用户ID</th>
<th>学号</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<% unless @members.blank? %>
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<li class="clearfix" id="setting_member_<%= member.id %>">
<span class="span1"><%= index + 1 + (@page - 1) * 20 %></span>
<span class="span2"><%= link_to user.show_real_name, user_path(user), :target => '_blank' %></span>
<span><%= user.login %></span>
<span><%= user.user_extensions ? user.user_extensions.student_id : '' %></span>
<span class="span6">
<tr id="setting_member_<%= member.id %>">
<td><%= index + 1 + (@page -1) * 20 %></td>
<td><%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.login %></span></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span></td>
<td>
<% if user == User.current %>
<a href="javascript:void(0);" class="delete" onclick="delete_confirm_box_3('<%= join_path(:object_id => @course.id) %>', '确定退出班级吗?')">删除</a>
<a href="javascript:void(0);" class="span5 delete" onclick="delete_confirm_box_3('<%= join_path(:object_id => @course.id) %>', '确定退出班级吗?')">删除</a>
<% if @course.choose_group_allow %>
<a href="javascript:void(0);" class="delete" onclick="student_choose_group('<%= @course.id %>', '<%= member.id %>')">加入分班</a>
<a href="javascript:void(0);" class="span5 delete" onclick="student_choose_group('<%= @course.id %>', '<%= member.id %>')">加入分班</a>
<% end %>
<% else %>
--
<% end %>
</span>
</li>
</td>
</tr>
<% end %>
<% end %>
</ul>
</tbody>
</table>
</div>
<div class="cl"></div>
<div class="fr pages_right_min mt10">
<div class="fr pages_right_min mt10 mb10">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>

View File

@ -35,27 +35,33 @@
<div class="person">
<!-------------教师----------------->
<div class="teacher">
<p>
<span class="span1" style="text-indent:10px;">序号</span>
<span class="pl20">姓名</span>
<span>用户ID</span>
<span class="span5 mr20">角色</span>
</p>
<ul class="pl20 pr20 color-grey">
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<li class="clearfix" id="setting_member_<%= member.id %>">
<span class="span1"><%= index + 1 + (@page-1) * 20 %></span>
<%= link_to user.show_real_name, user_path(user), :class => '', :target => '_blank' %>
<span><%= user.login %></span>
<span><%= zh_course_role(h member.roles.where("name != 'Student'").first.name) %></span>
</li>
<table class="edu-pop-table color-grey edu-txt-center table-pa5" style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>用户ID</th>
<th>角色</th>
</tr>
</thead>
<tbody>
<% @members.each_with_index do |teacher, index| %>
<% user = teacher.user %>
<tr id="setting_member_<%= teacher.id %>">
<td><%= index + 1 + (@page-1) * 20 %></td>
<td>
<%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %>
</td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.try(:login) %></span></td>
<td><%= zh_course_role(h teacher.roles.where("name != 'Student'").first.name) %></td>
</tr>
<% end %>
</ul>
</tbody>
</table>
</div>
<div class="cl"></div>
<div class="fr pages_right_min mt10">
<div class="fr pages_right_min mt10 mb10">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>

View File

@ -2,7 +2,8 @@
<div class="task-index-head mt20 mb20">
<div class="task-index-head-top-course">
<h2 class="fl task-inde-head-title">在线课堂</h2>
<%= link_to "<span class='font-22'>+</span>&nbsp;创建课堂".html_safe, new_course_path, :class => "fr color_white font-20" %>
<%= link_to "+&nbsp;新建".html_safe, new_course_path, :class => "task-btn task-btn-green fr mt6" %>
<%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => "task-btn task-btn-green fr mt6 mr10" %>
<div class="cl"></div>
</div>
<ul class="task-index-head-info clearfix">
@ -31,7 +32,7 @@
<div class="input-holder">
<input type="hidden" name="select" id="input_select_val" value="<%= @select %>">
<input type="hidden" name="is_end" id="input_select_text" value="<%= @is_end %>">
<input type="text" class="search-input" name="search" placeholder="输入课关键字进行搜索" />
<input type="text" class="search-input" name="search" placeholder="输入课堂名称的关键字进行搜索" />
<button class="search-icon" onclick="searchToggle(this, event);"><i class="fa fa-search font-16 mt5"></i></button>
</div>
<span class="close" onclick="searchToggle(this, event);"><i class="fa fa-times font-16 mt5"></i></span>

View File

@ -9,9 +9,7 @@ $("#courses_index_syllabuses_3").attr('href', '<%= courses_path(:select => "join
$("#courses_index_syllabuses_4").show();
$("#courses_index_syllabuses_5").hide();
<% end %>
<% if @select == "end" %>
$("#all_syllabuses").html("<%= @syllabuses_num %>");
$("#my_syllabuses").html("<%= @join_syllabuses_count + @create_syllabuses_count %>");
<% end %>
$("#all_syllabuses").html("<%= @syllabuses_num %>");
$("#my_syllabuses").html("<%= @join_syllabuses_count + @create_syllabuses_count %>");
$("#input_select_val").val('<%= @select %>');
$("#input_select_text").val('<%= @is_end %>');

View File

@ -78,7 +78,7 @@
</tbody>
</table>
</div>
<div class="fr pages_right_min mt10">
<div class="fr pages_right_min mt10 mb10">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true%>
</ul>

View File

@ -20,7 +20,7 @@
<li><%= link_to "作业动态", {:controller => "courses", :action => "show", :type => "homework"}, :class => "homepagePostTypeAssignment postTypeGrey"%></li>
<!--<li><%#= link_to "通知动态", {:controller => "courses", :action => "show", :type => "news"}, :class => "homepagePostTypeNotice postTypeGrey"%></li>-->
<li><%= link_to "资源库动态", {:controller => "courses", :action => "show", :type => "attachment"}, :class => "homepagePostTypeResource resourcesGrey"%></li>
<!--<li><%#= link_to "论坛动态", {:controller => "courses", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>-->
<li><%= link_to "论坛动态", {:controller => "courses", :action => "show", :type => "message"}, :class => "homepagePostTypeForum postTypeGrey"%></li>
<!--<li><%#= link_to "留言动态", {:controller => "courses", :action => "show", :type => "journalsForMessage"}, :class => "homepagePostTypeMessage postTypeGrey"%></li>-->
<!--<li><%#= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%></li>-->
</ul>

View File

@ -0,0 +1,44 @@
<div class="-layout -stretch -fit -vertical centerH">
<div class="split-panel--second -layout -vertical -flex -relative -bg-black" id="answer">
<ul id="blacktab_nav">
<li id="codetab_nav_1" class="blacktab_hover" onclick="HoverLi_new(1);">
<a href="javascript:void(0);" class="tab_type tab_color" >答题选项</a>
</li>
</ul>
<div class="cl"></div>
<div id="codotab_con_1" style="overflow-y: auto;">
<div class="panel-header clearfix" id="top_repository" style="border-bottom:0;padding:15px;">
<p class="mb10 color-light-green font-16 <%= @game.outputs.blank? || !@game.outputs.first.result ? "undis" : "" %>" id="correct_tip">
<i class="fa fa-check-circle font-16"></i> 正确
</p>
<p class="mb10 color-red font-16 <%= @game.outputs.blank? || @game.outputs.first.result ? "undis" : "" %>" id="error_tip">
<i class="fa fa-exclamation-circle font-16"></i> 错误
</p>
<% @game_challenge.challenge_questions.each_with_index do |question, i| %>
<div class="card quiz-task-options -elevation-1 mb20 color_white <%= (@user_answer.nil? || @user_answer.index(i.to_s).nil?) ? "" : "card-check" %>" onclick="choice_answer('<%= @st %>', this)">
<input type="hidden" name="answer" value="<%= question.position %>">
<div class="-layout-h -center">
<span class="mr10"><%= (question.position + 65).chr %>.</span>
<div class="markdown">
<p><code class="font-16"><%= question.option_name %></code></p>
</div>
</div>
</div>
<% end %>
<h3 id="save_status" class="ml15 fl" style="font-weight: normal"></h3>
</div>
</div>
</div>
</div>
<script>
function choice_answer(st, nThis){
if(st == "1"){
//$(nThis).hasClass("card-check") ? $(nThis).removeClass("card-check") : $(nThis).addClass("card-check");
$(nThis).toggleClass("card-check");
} else if (st == "2"){
var choice = $(".color_white");
choice.removeClass("card-check");
$(nThis).addClass("card-check");
}
}
</script>

View File

@ -1,9 +1,15 @@
<span class="mt10 -flex c_grey ml15" id="time-consuming"></span>
<% if @st == 0 %>
<div id="reset_code_to_bengin" class="<%= @game.status == 2 ? "" : "undis" %>">
<a href="javascript:void(0)" class="shixun-task-btn task-btn-green mr15 mt8" onclick="delete_confirm_box('<%= reset_new_code_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>', '你在本关中修改的内容将丢失<br />是否确定重新加载上次通过的代码');">加载上次通过的代码</a>
<a href="javascript:void(0)" class="shixun-task-btn task-btn-green mr15 mt8" onclick="delete_confirm_box('<%= reset_new_code_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>', '你在本关中修改的内容将丢失<br />是否确定重新加载上次通过的代码');">加载上次通过的代码</a>
</div>
<% end %>
<div id="code_test">
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="training_task_submmit();">评测</a>
<% if @st == 0 %>
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="training_task_submmit();">评测</a>
<% elsif @game.status != 2 %>
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="choice_submmit();">评测</a>
<% end %>
</div>
<div id="code_estimate">
<% if @game.status == 1 %>
@ -11,11 +17,11 @@
<% elsif @game.status == 2 %>
<% if @had_done == 0 %>
<%= link_to "下一关 ", {:controller => 'games',
:action => "next_step", :id => @game,
:myshixun_id => @myshixun},
:class => "shixun-task-btn task-btn-blue mr15 mt8",
:id => "next_step",
:remote => true %>
:action => "next_step", :id => @game,
:myshixun_id => @myshixun},
:class => "shixun-task-btn task-btn-blue mr15 mt8",
:id => "next_step",
:remote => true %>
<!--<a href="javascript:void(0);" onclick="shixun_next_step();" class="task-btn task-btn-blue mr15 mt8">下 一 步</a>-->
<% else %>
<a href="<%= shixun_path(@shixun) %>" class="shixun-task-btn task-btn-blue mt8 mr15">退出实训</a>
@ -23,13 +29,13 @@
<% end %>
</div>
<script>
/* -------------- 点击加载上次通过的代码----------------*/
$("#task_popup_confirm").live("click", function(){
$("#coding_area").hide();
$("#coding_ajax_loading").css("display", "flex");
});
/* -------------- 点击加载上次通过的代码----------------*/
$("#task_popup_confirm").live("click", function(){
$("#coding_area").hide();
$("#coding_ajax_loading").css("display", "flex");
});
/* ------------------耗时------------------------- */
/* ------------------耗时------------------------- */
var cTime = 1; // 时间累加参数
var cm = setInterval(setTime, 1000);
function setTime(){
@ -37,14 +43,14 @@
var endTime = 0; // 结束时间
var consumeTime = 0; // 耗时
<% if @game.status == 2 %>
startTime = (new Date("<%= consume_time(@game.open_time) %>")).getTime();
endTime = (new Date("<%= consume_time(@game.end_time) %>")).getTime();
consumeTime = parseInt(endTime - startTime);
startTime = (new Date("<%= consume_time(@game.open_time) %>")).getTime();
endTime = (new Date("<%= consume_time(@game.end_time) %>")).getTime();
consumeTime = parseInt(endTime - startTime);
<% else %>
startTime = (new Date("<%= consume_time(@game.open_time) %>")).getTime();
endTime = (new Date("<%= consume_time(Time.now) %>")).getTime();
consumeTime = parseInt(endTime - startTime) + cTime * 1000;
cTime++;
startTime = (new Date("<%= consume_time(@game.open_time) %>")).getTime();
endTime = (new Date("<%= consume_time(Time.now) %>")).getTime();
consumeTime = parseInt(endTime - startTime) + cTime * 1000;
cTime++;
<% end %>
formatDuring(consumeTime);
}
@ -57,14 +63,66 @@
$("#time-consuming").html("耗时:" + days + " 天 " + hours + " 小时 " + minutes + " 分钟 " + seconds + " 秒 ");
}
/* -----------------下一关增加loading效果--------------------- */
/* -----------------下一关增加loading效果--------------------- */
$("#next_step").live("click", function(){
nNext = $("#code_estimate");
html = "<a href='javascript:void(0);' class='task-btn mr15 mt8'>下一关<img src='/images/bigdata/loading2.svg' style='width:25px;float:left;margin-top: 3px' /></a>";
nNext.html(html);
});
/* ----------------- 评测 -------------------- */
// 选择题提交评测
// answer 选择的答案
function choice_submmit(){
var answer = "";
var nBtn = $(".card-check");
var choice = nBtn.find("input[name='answer']");
for(var i = 0; i < choice.length; i++){
answer += $(choice[i]).val();
}
if(answer == ""){
notice_sure_box("答案不能为空!");
return;
}
$("#code_test").html("<a class='task-btn mt8 mr15'>评测中..</a>");
$.ajax({
type: "post",
url: '<%= evaluating_choice_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
data: {answer: answer},
dataType: "json",
success: function(data){
console.log(data);
$("#code_test").remove();
if(data.correct){
$("#correct_tip").show();
$("#user_grade").html(data.grade);
if( data.had_done == 0 ) {
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a>");
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>";
}else{
$("#code_estimate").html("<a href='<%= shixun_path(@shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game => @game, :myshixun => @myshixun, :had_done => 1}) %>";
}
// 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕
pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight);
}else{
$("#error_tip").show();
if(0 == data.had_done){
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-blue mr15 mt8' id='next_step' data-remote='true'>下一关</a>");
}else if(1 == data.had_done ){
$("#code_estimate").html("<a href='<%= shixun_path(@shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
}
}
},
error: function(){
alert("错了");
}
})
}
/* ----------------- 评测 -------------------- */
function training_task_submmit(){
// 加载页面
nEvalContent = $("#evaluating_contents");

View File

@ -2,10 +2,10 @@
<%= javascript_include_tag 'baiduTemplate', 'jquery.datetimepicker.js' %>
<% end %>
<ul id="blacktab_nav">
<li id="blacktab_nav_1" class="blacktab_hover" onclick="HoverLi(1);">
<li class="blacktab_con blacktab_hover" onclick="check_tab('blacktab_con','blacktab_hover',this);">
<a href="javascript:void(0);" class="tab_type tab_color">测试结果</a>
</li>
<li id="blacktab_nav_2" onclick="HoverLi(2);">
<li class="blacktab_con" onclick="check_tab('blacktab_con','blacktab_hover',this);">
<a href="javascript:void(0);" class="tab_type tab_color" >评测信息</a>
</li>
<a href="javascript:void(0);" onclick="valuation_extend_and_zoom();" id="valuation_extend_and_zoom"><i class="fa fa-expand font-16 color-grey fr mt10 mr15" ></i></a>
@ -97,6 +97,7 @@
</div>
</div>
</div>
</script>
<script>
@ -141,11 +142,26 @@
}
function g_new(o){return document.getElementById(o);}
function HoverLi(n){
for(var i=1;i<=2;i++){
for(var i=1;i<=3;i++){
g_new('blacktab_nav_'+i).className='blacktab_nomal';
g_new('blacktab_con_'+i).className='undis';
}
g_new('blacktab_con_'+n).className='dis';
g_new('blacktab_nav_'+n).className='blacktab_hover';
}
/*allClassName---------------同一块tab共有的类名同时对应的显示块ID要等于类名加上"_"在加上块的位置)
* addClassName---------------点击tab需要添加的样式类
* item-----------------------点击的当前tab元素
* */
function check_tab(allClassName,addClassName,item){
//点击tab添加样式
$("."+allClassName).removeClass(addClassName);
$(item).addClass(addClassName);
//获取当前点击的tab的索引位置
var index=$(item).index()+1;
//显示或隐藏对应的内容块
$("#"+allClassName+"_"+index).siblings().addClass("undis");
$("#"+allClassName+"_"+index).removeClass("undis");
}
</script>

View File

@ -19,9 +19,11 @@
<li id="tab_nav_2" onclick="HoverLi1(2);">
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">预备知识</a>
</li>
<li id="tab_nav_3">
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">参考答案</a>
</li>
<% unless @game_challenge.answer.blank? %>
<li id="tab_nav_3">
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">参考答案</a>
</li>
<% end %>
<li id="tab_nav_4">
<%= link_to '评论', shixun_discuss_shixun_path(@shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
</li>
@ -42,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;"><%= @shixun.propaedeutics %></textarea>
<textarea style="display:none;"><%= @game_challenge.ready_knowledge %></textarea>
</div>
</div>
</div>
@ -61,8 +63,8 @@
</div>
</div>
</div>
<div class="-layout-h -center -padding-h-16 -horizontal -footer-left">
<ul class="-layout -task-ml80 pr">
<div class="-layout-h -center -padding-h-16 -horizontal -footer-left pr">
<ul class="-layout -task-ml80">
<%= render :partial => "games/shixun_comment_block" %>
<li class="comment_position" style="right: 70px"><a href="javascript:void(0);" onclick="send_dis_to_shixun()" class="course-bth-blue color_white">发送</a></li>
<li title="<%= @praise.nil? ? "点赞" : "取消点赞" %>" onclick="game_praise()" id="game_praise_tread" class="comment_position pt5" style="right: 40px">
@ -85,17 +87,25 @@
<div class="-layout-v -flex">
<div class="-flex -relative">
<div class="split-panel -fit -vertical">
<div class="-layout -stretch -fit -vertical centerH">
<div class="-layout -vertical -flex -relative -bg-black -flex-basic60" id="games_repository_contents" style="overflow:hidden;">
<%= render :partial => 'games/repository' %>
</div>
<!--拖拽增加结构---------------------------------------->
<div class="h-center"></div>
<!------------------------------------------------------>
<div class="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic40" id="games_valuation_contents">
<%= render :partial => 'games/game_results' %>
</div>
</div>
<% if @st != 0 %>
<!-- 单选多选题 -->
<%= render :partial => "games/choice_question" %>
<% else %>
<!-- 编程题 -->
<div class="-layout -stretch -fit -vertical centerH">
<div class="-layout -vertical -flex -relative -bg-black -flex-basic70" id="games_repository_contents" style="overflow:hidden;">
<%= render :partial => 'games/repository' %>
</div>
<!--拖拽增加结构---------------------------------------->
<div class="h-center">
<div class="-changebg -bg-black" id="-bg-change-color"></div>
</div>
<!------------------------------------------------------>
<div class="split-panel--second -layout -vertical -flex -relative -bg-black -flex-basic60" id="games_valuation_contents">
<%= render :partial => 'games/game_results' %>
</div>
</div>
<% end %>
</div>
</div>
<!--按钮的操作-->
@ -110,7 +120,6 @@
<script>
//拖拽增加js
$(function(){
var doc = $(document);
var lab = $(".b-label");
var cen = $(".h-center");
@ -119,7 +128,6 @@ $(function(){
var flag = false;
var wrapWidth;
var wrapHeight;
// var a = $(window.frames["game-webssh"].document);
lab.bind('mousedown',function(){
dragging = true;
leftOffset = $(".labelN").offset().left;
@ -135,7 +143,7 @@ $(function(){
}
);
doc.bind('mousemove',function(e){
// console.log(dragging);
$(".-brother").show();// 代码行的遮罩显示
if(dragging) {
clickX = e.pageX;
@ -158,39 +166,16 @@ $(function(){
cen.prev().height( clickY-topOffset + 'px');
nextW1 = clickY-topOffset;
cen.next().height( wrapHeight - nextW1 + 'px');
var h = $("#games_repository_contents").height() - $("#top_repository").height() - 50;
$("#game_webssh").css("min-height", h);
$("#file_entry_content").find(".CodeMirror-scroll").css("min-height", h);
$("#file_entry_content").find(".CodeMirror-scroll").css("max-height", h);
} else {
cen.css('top', '0px');
}
}
});
// a.bind('mousemove',function(e){
// // console.log(dragging);
// if(dragging) {
// clickX = e.pageX;
//
// if(clickX > leftOffset + 300&&clickX<leftOffset+1500) {
// console.log(1);
// lab.css('left', clickX - 7 - leftOffset + 'px');
// lab.prev().width( clickX-leftOffset + 'px');
// nextW2 = clickX-leftOffset;
// lab.next().width( wrapWidth - nextW2 + 'px');
// console.log(lab.next().width());
// } else {
// lab.css('left', '0px');
// }
// }
// if(flag){
// clickY = e.pageY;
// if(clickY > topOffset) {
// cen.css('top', clickY - 7 - topOffset + 'px');
// cen.prev().height( clickY-topOffset + 'px');
// nextW1 = clickY-topOffset;
// cen.next().height( wrapHeight - nextW1 + 'px');
// } else {
// cen.css('top', '0px');
// }
// }
// });
doc.mouseup(function(e) {
flag = false;
dragging = false;

View File

@ -8,7 +8,7 @@
</li>
<% end %>
<div class="fr mt5 -horizontal">
<% if @path == @game.challenge.path.strip %>
<% if @path == @game.challenge.path.try(:strip) %>
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= reset_original_code_myshixun_game_path(@game, :myshixun_id => @myshixun, :path => @path) %>', '你在本文件中修改的内容将丢失<br />是否确定重新加载初始代码');" title="恢复初始代码"><i class="fa fa-rotate-left font-18 mr5"></i></a>
<% end %>
<a href="javascript:void(0);" onclick="repository_extend_and_zoom();" id="extend_and_zoom"><i class="fa fa-arrows-alt font-16"></i></a>
@ -71,8 +71,13 @@
g_l('codotab_con_'+i).className='undis';
}
n == 2 ? $("#games_repository_contents").removeClass("-bg-black").addClass("-bg-weightblack")
: $("#games_repository_contents").removeClass("-bg-weightblack").addClass("-bg-black");
if(n==2){
$("#games_repository_contents").removeClass("-bg-black ").addClass("-bg-weightblack ");
$("#-bg-change-color").removeClass("-bg-black").addClass("-bg-weightblack");
}else{
$("#games_repository_contents").removeClass("-bg-weightblack ").addClass("-bg-black ");
$("#-bg-change-color").removeClass("-bg-weightblack").addClass("-bg-black");
}
g_l('codotab_con_'+n).className='dis -relative';
g_l('codetab_nav_'+n).className='blacktab_hover';

View File

@ -7,19 +7,19 @@
<% else %>
<% @discusses.each do |dis| %>
<div class="comments_item_content comment_item_bottom clearfix mt5" onmouseover="$('#discuss_opr_<%= dis.id %>').show();$('#child_discuss_opr_<%= dis.id %>').show();" onmouseout="$('#discuss_opr_<%= dis.id %>').hide();$('#child_discuss_opr_<%= dis.id %>').hide();">
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像"), user_path(dis.user), :target => '_blank' %>
<div class="fr comment_item_one">
<p class="clearfix pl8">
<%= link_to image_tag(url_to_avatar(dis.user), :alt => "头像", :width => 60, :height => 60), user_path(dis.user),:class => "fl mt5", :target => '_blank' %>
<div class="fl comment_item_one ml10">
<p class="clearfix">
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey" %>
<span class="fr color-grey font-12 color_Purple_grey" style="padding-top: 2px;" id="dis_praise_<%= dis.id %>">
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %>
</span>
</p>
<p class="pl8"><%= dis.content %></p>
<p class="pl8 fl">
<p><%= dis.content %></p>
<p class="fl">
<span class="fl color-grey"><%= time_from_now dis.created_at %></span>
</p>
<p class="pl8 fr none" id="discuss_opr_<%= dis.id %>">
<p class="fr none" id="discuss_opr_<%= dis.id %>">
<% if User.current.manager_of_shixun?(@shixun) && dis.children.count == 0 %>
<a href="javascript:void(0);" onclick="reply_to_dis('<%= dis.id %>', '<%= dis.user.show_name %>')" class="fr ml10 font-12 link-color-green">回复</a>
<% end %>

View File

@ -26,6 +26,7 @@
var nRIcon = $("#extend_and_zoom").children("i"); // 版本库放大缩小按钮
var nCode = $("#file_entry_content").find(".CodeMirror-scroll"); // 版本库代码区域
var nVIcon = $("#valuation_extend_and_zoom").children("i"); // 评测放大缩小
var nMove =$(".h-center");
/* --------------------------------版本库的放大与缩小---------------------------------------------*/
function repository_extend_and_zoom(){
@ -34,12 +35,14 @@
nGameEva.addClass("-flex-basic0");
nRIcon.addClass("fa-compress");
nRIcon.removeClass("fa-arrows-alt");
nMove.hide();
control = 1;
}else if(control == 1){
nGameRes.removeClass("-flex-basic100");
nGameEva.removeClass("-flex-basic0");
nRIcon.removeClass("fa-compress");
nRIcon.addClass("fa-arrows-alt");
nMove.show();
control = 0;
}
editor_CodeMirror.setSize("auto", "auto");
@ -54,12 +57,14 @@
nGameEva.addClass("-flex-basic100");
nVIcon.removeClass("fa-expand");
nVIcon.addClass("fa-compress");
nMove.hide();
control_1 = 1;
}else if(control_1 == 1){
nGameRes.removeClass("-flex-basic0");
nGameEva.removeClass("-flex-basic100");
nVIcon.addClass("fa-expand");
nVIcon.removeClass("fa-compress");
nMove.show();
control_1 = 0;
}
}

View File

@ -11,11 +11,11 @@
</div>
<div class="edu-con-top clearfix">
<p class="fl task-form-50 ml15">
<%= link_to '全部', homework_bank_index_path(:type => @type), :class => 'edu-filter-cir-grey mr5 active', :id => 'homework_bank_pro_0', :remote => true %>
<%= link_to '编程', homework_bank_index_path(:type => @type, :property => 2), :class => 'edu-filter-cir-grey mr5', :id => 'homework_bank_pro_2', :remote => true %>
<%= link_to '普通', homework_bank_index_path(:type => @type, :property => 1), :class => 'edu-filter-cir-grey mr5', :id => 'homework_bank_pro_1', :remote => true %>
<%= link_to '分组', homework_bank_index_path(:type => @type, :property => 3), :class => 'edu-filter-cir-grey mr5', :id => 'homework_bank_pro_3', :remote => true %>
<%= link_to '实训', homework_bank_index_path(:type => @type, :property => 4), :class => 'edu-filter-cir-grey mr5', :id => 'homework_bank_pro_4', :remote => true %>
<%= link_to '全部', homework_bank_index_path(:type => @type), :class => 'edu-filter-cir-grey mr5 active font-12 fl', :id => 'homework_bank_pro_0', :remote => true %>
<%= link_to '编程', homework_bank_index_path(:type => @type, :property => 2), :class => 'edu-filter-cir-grey mr5 font-12 fl', :id => 'homework_bank_pro_2', :remote => true %>
<%= link_to '普通', homework_bank_index_path(:type => @type, :property => 1), :class => 'edu-filter-cir-grey mr5 font-12 fl', :id => 'homework_bank_pro_1', :remote => true %>
<%= link_to '分组', homework_bank_index_path(:type => @type, :property => 3), :class => 'edu-filter-cir-grey mr5 font-12 fl', :id => 'homework_bank_pro_3', :remote => true %>
<%= link_to '实训', homework_bank_index_path(:type => @type, :property => 4), :class => 'edu-filter-cir-grey mr5 font-12 fl', :id => 'homework_bank_pro_4', :remote => true %>
<%#= link_to '试卷', homework_bank_path(:type => @type, :property => 5), :class => 'edu-filter-cir-grey mr5', :remote => true %>
</p>
<a href="javascript:void(0)" onclick="alert_choose_homework_bank_type('<%= %>')" class="task-btn task-btn-blue fr mr15 mt5">新建</a>

View File

@ -1,6 +1,6 @@
<% not_allow_select = edit_mode && @homework.student_works.has_committed.count != 0 %>
<div class="edu-con-top">
<div class="edu-con-top user_bg_shadow">
<p class="ml15 color-grey"><%= edit_mode ? '编辑' : '新建' %>分组作业</p>
</div>
<div class="alert alert-red mt15 none" id="new_homework_notice">

View File

@ -1,4 +1,4 @@
<div class="edu-con-top">
<div class="edu-con-top user_bg_shadow">
<p class="ml15 color-grey"><%= edit_mode ? '编辑' : '新建' %>编程作业</p>
</div>
<div class="alert alert-red mt15 none" id="new_homework_notice">

View File

@ -1,10 +1,9 @@
<script>
function g(o){return document.getElementById(o);}
function HoverLi(n, url){
for(var i=1;i<=3;i++){
$('#edu-tab-nav-'+i).removeClass('edu-new-tab-hover');
}
$('#edu-tab-nav-'+n).addClass('edu-new-tab-hover');
$(".new-tab-nav").removeClass('background-orange');
$(n).addClass('background-orange');
$.get(url, {}, function(data){});
}
</script>
@ -14,11 +13,11 @@
<div class="edu-con-bg01 mt15">
<div class="">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav">
<li id="edu-tab-nav-1" class="<%= @type == '1' ? 'edu-new-tab-hover' : '' %>" onclick="HoverLi(1, '<%= homework_bank_index_path() %>');">
<ul id="edu-tab-nav" class="border-bottom-orange">
<li id="edu-tab-nav-1" class="new-tab-nav <%= @type == '1' ? 'background-orange' : '' %>" onclick="HoverLi(this, '<%= homework_bank_index_path() %>');">
<a href="javascript:void(0);" class="tab_type">我的题库</a>
</li>
<li id="edu-tab-nav-2" class="<%= @type == '2' ? 'edu-new-tab-hover' : '' %>" onclick="HoverLi(2, '<%= homework_bank_index_path(:type => 2) %>');">
<li id="edu-tab-nav-2" class="new-tab-nav <%= @type == '2' ? 'background-orange' : '' %>" onclick="HoverLi(this, '<%= homework_bank_index_path(:type => 2) %>');">
<a href="javascript:void(0);" class="tab_type">公共题库</a>
</li>
</ul>

View File

@ -15,6 +15,6 @@ $(".edu-filter-cir-grey").removeClass("active");
<% end %>
<% end %>
if(<%= params[:type] == '2' %>){
$("#edu-tab-nav-1").removeClass("edu-new-tab-hover");
$("#edu-tab-nav-2").addClass("edu-new-tab-hover");
$("#edu-tab-nav-1").removeClass("background-orange");
$("#edu-tab-nav-2").addClass("background-orange");
}

View File

@ -7,11 +7,11 @@
<script type="text/javascript">
function HoverLi(n){
for(var i=1;i<=2;i++){
$('#edu-tab-nav-'+i).removeClass('edu-new-tab-hover');
$('#edu-tab-nav-'+i).removeClass('background-orange');
$('#edu-tab-con-'+i).addClass('undis');
}
$('#edu-tab-con-'+n).removeClass('undis');
$('#edu-tab-nav-'+n).addClass('edu-new-tab-hover');
$('#edu-tab-nav-'+n).addClass('background-orange');
}
</script>
@ -31,12 +31,12 @@
<div class="edu-con-bg01 mt15">
<div class="">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav">
<li id="edu-tab-nav-1" class="edu-new-tab-hover" onclick="HoverLi(1);">
<ul id="edu-tab-nav" class="border-bottom-orange">
<li id="edu-tab-nav-1" class="new-tab-nav background-orange" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="tab_type">详情</a>
</li>
<% if @is_admin %>
<li id="edu-tab-nav-2" onclick="HoverLi(2);">
<li id="edu-tab-nav-2" class="new-tab-nav" onclick="HoverLi(2);">
<a href="javascript:void(0);" class="tab_type">参考答案</a>
</li>
<% end %>

View File

@ -1,7 +1,12 @@
<% if homework_commons.count != 0 %>
<% homework_commons.each_with_index do |homework_common, index|%>
<div class="clearfix edu-class-con-list">
<div class="fl ml15 task-form-90 ">
<div class="clearfix edu-class-con-list pr">
<% unless homework_common.is_public %>
<div id="homework_public_<%= homework_common.id %>" >
<i class="fa fa-lock color-grey" style="position: absolute;left: 15px;top:23px"></i>
</div>
<% end %>
<div class="fl ml25 task-form-90 ">
<% homework_curr_status = homework_curr_time(homework_common) %>
<%= link_to homework_common.name.to_s, student_work_index_path(:homework => homework_common.id,:host=> Setting.host_course), :class => "edu-class-inner-list fl"%>
<% if homework_curr_status[:status] != "" %>

View File

@ -1,9 +1,9 @@
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type) %>" class="<%= @order.nil? ? "active" : "" %> edu-filter-cir-grey mr5 " data-remote="true">全部</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type) %>" class="<%= @order.nil? ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">全部</a>
<% if @is_teacher %>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 0, :search => @search) %>" class="<%= @order == "0" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">挂起</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 0, :search => @search) %>" class="<%= @order == "0" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">挂起</a>
<% end %>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 1, :search => @search) %>" class="<%= @order == "1" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">提交中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 3, :search => @search) %>" class="<%= @order == "3" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">匿评中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 4, :search => @search) %>" class="<%= @order == "4" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">申诉中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 5, :search => @search) %>" class="<%= @order == "5" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">评阅中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 6, :search => @search) %>" class="<%= @order == "6" ? "active" : "" %> edu-filter-cir-grey mr5" data-remote="true">已结束</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 1, :search => @search) %>" class="<%= @order == "1" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">提交中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 3, :search => @search) %>" class="<%= @order == "3" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">匿评中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 4, :search => @search) %>" class="<%= @order == "4" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">申诉中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 5, :search => @search) %>" class="<%= @order == "5" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">评阅中</a>
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => @homework_type, :order => 6, :search => @search) %>" class="<%= @order == "6" ? "active" : "" %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">已结束</a>

View File

@ -1,4 +1,4 @@
<div class="edu-con-top">
<div class="edu-con-top user_bg_shadow">
<p class="ml15 color-grey"><%= edit_mode ? '编辑' : '新建' %>普通作业</p>
</div>
<div class="alert alert-red mt15 none" id="new_homework_notice">
@ -7,7 +7,7 @@
<ul>
</ul>
</div>
<div class="edu-con-bg01 mt15" style="padding:30px 0;">
<div class="edu-con-bg01 mt15 user_bg_shadow" style="padding:30px 0;">
<div class="ml30 mr30">
<div class="">
<ul>

View File

@ -21,7 +21,7 @@
<%= render :partial => 'homework_search_form', :locals => {:course => @course} %>
</div>
</div>
<div id="homework_index_list">
<div id="homework_index_list" class="mh400">
<%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>
</div>
</div>

View File

@ -1,2 +1,3 @@
hideModal();
$("#set_homework_public_<%= @homework.id %>").remove();
$("#set_homework_public_<%= @homework.id %>").remove();
$("#homework_public_<%= @homework.id %>").remove();

View File

@ -41,13 +41,7 @@
<!--<li><%#= link_to '我的主页', user_path(User.current) %></li>-->
<li><%= link_to '我的课堂', syllabuses_path() %></li>
<li><%= link_to '我的实训', shixuns_user_path(User.current) %></li>
<li class="pr">
<%= link_to '我的留言', feedback_path(User.current, :host=> Setting.host_user) %>
<% onclick_time = User.current.onclick_time.onclick_time %>
<% if User.current.journals_for_messages.where("created_on > '#{onclick_time}'").count > 0 %>
<span class="inner-nav-cir ml5 mt5" style="position: absolute; font-style: italic;">new</span>
<% end %>
</li>
<li class="pr"><%= link_to '我的留言', feedback_path(User.current, :host=> Setting.host_user) %></li>
<span class="task-line"></span>
<li><%= link_to '修改资料', my_account_path %></li>
<li><%= link_to '退出', logout_url_without_domain %></li>

View File

@ -5,7 +5,7 @@
</div>
<div class="sidebar-con">
<div class="list">
<i class="fa fa-plus-circle color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>教学</span>
<i class="fa fa-plus-circle color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>教学</span>
<ul class="color-grey">
<li><a href="<%= syllabuses_path() %>" target="_blank" >我的课堂</a></li>
<li><a href="<%= new_course_path(:host=> Setting.host_course) %>" target="_blank" >新建班级</a></li>
@ -20,14 +20,14 @@
</ul>
</div>-->
<div class="list">
<i class="fa fa-map color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>题库</span>
<i class="fa fa-map color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>题库</span>
<ul class="color-grey">
<li><%= link_to "我的题库", homework_bank_index_path(), :target => "_blank" %></li>
<li><%= link_to "公共题库", homework_bank_index_path(:type => 2), :target => "_blank" %></li>
</ul>
</div>
<div class="list">
<i class="fa fa-gamepad color-light-green font-20 pl20 pr10 pt5" aria-hidden="true"></i><span>实训</span>
<i class="fa fa-gamepad color-light-green font-20 pl15 pr10 pt5" aria-hidden="true"></i><span>实训</span>
<ul class="color-grey">
<li><%= link_to "我的实训", shixuns_user_path(User.current), :target => "_blank" %></li>
<li><%= link_to "新建实训", new_shixun_path, :target => "_blank" %></li>
@ -46,7 +46,7 @@
$(function() {
$(".sidebar").hover(function() {
$(this).css({
width:'60px'
width:'50px'
}).stop().animate({
width:'120px'
}, 400);
@ -60,7 +60,7 @@
$(this).css({
width:'120px'
}).stop().animate({
width:'60px'
width:'50px'
}, 400);
$(".sidebar-con .list ul li").css({
paddingTop:'15px'
@ -74,7 +74,7 @@
//页面缩放时调整整个页面和左侧导航栏的距离
$(window).resize(function() {
if($(window).width()<1300){
$(".newContainer").css("padding-left","60px");
$(".newContainer").css("padding-left","50px");
}else{
$(".newContainer").css("padding-left","0px");
}

View File

@ -110,7 +110,7 @@
<li class="clearfix" id="sy_02">
<a href="<%= course_boards_path(@course) %>" class="fl ml15 ">讨论</a>
<span class="edu-cir-grey fl ml10 mt15"><%= count %></span>
<%= link_to( "+", course_boards_path(@course, :flag => true, :is_new => 1), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_message_new)}") if User.current.logged? %>
<%= link_to( "+", new_board_message_path(:board_id => course_board.id), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_message_new)}") if User.current.logged? %>
</li>
<%# course_modules = @course.create_course_modules.where(:hidden => 0).order("position asc") %>

View File

@ -1,70 +1,122 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="高校智能课堂与综合实训平台" />
<meta name="keywords" content="智能课堂,实训项目" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin" %>
<%= javascript_include_tag "edu/application",'edu/base_edu', 'baiduTemplate', 'jquery.datetimepicker.js', "edu/management" %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
</head>
<body onload="prettyPrint();">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %>
</div>
<div class="newMain clearfix"> <!-- 主题部分 -->
<div class="edu-class-container" >
<ul class="edu-admin-nav clearfix ">
<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"><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 == 3 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">实训</a>
<%#= link_to "实训+", shixuns_managements_path, :class => "edu-admin-nav-a" %>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "实训列表", shixuns_managements_path %></li>
<li><%= link_to "已发布的实训", publish_shixuns_managements_path %></li>
<li><%= link_to "已关闭的实训", close_shixuns_managements_path %></li>
</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"><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 == 6 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">用户</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "用户列表", users_managements_path %></li>
<li><%= link_to "试用授权列表", users_trial_managements_path %></li>
</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"><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 == 9 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">审批</a>
<ul class="edu-admin-nav-inner">
<li><%= link_to "身份认证", :controller => "managements", :action => "identity_authentication" %></li>
<li><%= link_to "试用授权", :controller => "managements", :action => "trial_authorization" %></li>
<li><%= link_to '实训发布', shixun_authorization_managements_path %></li>
</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"><a href="javascript:void(0);" class="edu-admin-nav-a" style="border-right:none;">其它</a></li>
</ul>
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
<div class="cl"></div>
</div>
</div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
</div>
<div id="ajax-indicator" style="display:none;">
<span>载入中...</span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title><%= h html_title %></title>
<meta name="description" content="高校智能课堂与综合实训平台" />
<meta name="keywords" content="智能课堂,实训项目" />
<%= csrf_meta_tag %>
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'css/edu-common', 'css/edu-public', 'css/font-awesome', 'css/edu-popup', 'css/magic-check', "css/edu-admin" %>
<%= javascript_include_tag "edu/application",'edu/base_edu', 'baiduTemplate', 'jquery.datetimepicker.js', "edu/management" %>
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
</head>
<body onload="prettyPrint();">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %>
</div>
<div class="newMain clearfix"> <!-- 主题部分 -->
<div class="edu-class-container" >
<p class="mb10 ml25"><i class="fa fa-map-marker mr5 color-grey"></i>
<%= link_to User.current.show_real_name, user_path(User.current) %> &gt;
<span class="color-dark-grey">
<% case @menu_type %>
<% when 2 %>
<%= @sub_type == 1 ? "课程列表" : "班级列表" %>
<% when 3 %>
<%= @sub_type == 1 ? "实训列表" :(@sub_type == 2? "已发布的实训":"已关闭的实训") %>
<% when 4 %>
<%= @sub_type == 1 ? "实训套件" : "已发布实训套件" %>
<% when 5 %>
竞赛
<% when 6 %>
<%= @sub_type == 1 ? "单位列表" :"单位部门列表" %>
<% when 7 %>
<%= @sub_type == 1 ? "用户列表" :"适用授权列表" %>
<% when 8 %>
消息
<% when 9 %>
留言
<% when 10 %>
<%= @sub_type == 1 ? "身份认证":(@sub_type == 2? "适用授权":(@sub_type == 3?"部门审批":(@sub_type == 4?"单位审批":(@sub_type == 5?"项目实训发布":"课程实训发布"))))%>
<% when 11 %>
工程认证+
<% when 12 %>
其他
<% end %>
</span>
</p>
<ul class="edu-admin-nav clearfix ">
<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 == 2 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">课堂+</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "课程列表", classroom_managements_path %></li>
<li><%= link_to "班级列表", classroom_classment_managements_path %></li>
</ul>
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 3 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">项目实训+</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "实训列表", shixuns_managements_path %></li>
<li><%= link_to "已发布的实训", publish_shixuns_managements_path %></li>
<li><%= link_to "已关闭的实训", close_shixuns_managements_path %></li>
</ul>
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 4 %>" style="width: 100px"><a href="javascript:void(0);" class="edu-admin-nav-a" >实训套件+</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li style="width: 100px"><%= link_to "实训套件列表", class_shixuns_managements_path %></li>
<li style="width: 100px"><%= link_to "已发布实训套件", class_publish_shixuns_managements_path %></li>
</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"><a href="javascript:void(0);" class="edu-admin-nav-a">单位</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "单位列表", departments_part_managements_path, :class => "edu-admin-nav-a" %></li>
<li><%= link_to "单位部门列表", departments_managements_path%></li>
</ul>
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 7 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">用户</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "用户列表", users_managements_path %></li>
<li><%= link_to "试用授权列表", users_trial_managements_path %></li>
</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"><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 == 10 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">审批</a>
<ul class="edu-admin-nav-inner">
<li><%= link_to "身份认证", :controller => "managements", :action => "identity_authentication" %></li>
<li><%= link_to "试用授权", :controller => "managements", :action => "trial_authorization" %></li>
<li><%= link_to "部门审批", depart_managements_path %></li>
<li><%= link_to '单位审批', unit_managements_path %></li>
<li><%= link_to '项目实训发布', shixun_authorization_managements_path %></li>
<li><%= link_to '课程实训发布', subject_authorization_managements_path %></li>
</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>
<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>
</ul>
</li>
</ul>
<%= render_flash_messages %>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>
<div class="cl"></div>
</div>
</div>
<%= render :partial => 'layouts/footer' %>
<div class="cl"></div>
</div>
<div id="ajax-indicator" style="display:none;">
<span>载入中...</span>
</div>
<div id="ajax-modal" style="display:none;"></div>
</body>
</html>

View File

@ -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),

View File

@ -16,7 +16,7 @@
</head>
<!--add by huang-->
<body onload="prettyPrint();">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newContainer edu-bg"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %>
</div>

View File

@ -0,0 +1,23 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<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>操作</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>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,23 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<th width="8%">ID</th>
<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>
</tr>
</thead>
<tbody>
<% @c_shixuns.each_with_index do |c_shixun, index| %>
<tr>
<td><%= index + 1 %></td>
<td class="edu-txt-left"><%= link_to c_shixun.name, subject_path(c_shixun) %></td>
<td class="edu-txt-left"><%= c_shixun.user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : c_shixun.user.try(:user_extensions).try(:school) %></td>
<td><%= c_shixun.user.show_real_name %></td>
<td><%= format_time c_shixun.created_at %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,37 @@
<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="6%">阶段</th>
<th width="6%">实训</th>
<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>操作</th>
</tr>
</thead>
<tbody>
<% @c_shixuns.each_with_index do |c_shixun, index| %>
<tr id="subject_shixun_<%= c_shixun.id %>">
<td><%= index + 1 %></td>
<td class="edu-txt-left"><%= link_to c_shixun.name, subject_path(c_shixun) %></td>
<td><%= c_shixun.stages.count %></td>
<td><%= c_shixun.stage_shixuns.count %></td>
<td><%= c_shixun.status == 0 ? "编辑中" : (c_shixun.status == 1 ? "审核中" : "发布") %></td>
<td class="edu-txt-left"><%= c_shixun.user.try(:user_extensions).try(:school).try(:name).blank? ? "--" : c_shixun.user.try(:user_extensions).try(:school) %></td>
<td><%= c_shixun.user.show_real_name %></td>
<td><%= format_time c_shixun.created_at %></td>
<td class="class_shixun_delete">
<% if c_shixun.status == 0 %>
<a href="javascript:void(0);" onclick="delete_confirm_box_2('<%= subject_path(c_shixun) %>', '确定要删除该实训套件吗?')">删除</a>
<% else %>
--
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@ -0,0 +1,60 @@
<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>
</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 @courses_pages, @courses_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<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";
$.ajax({
url:"<%= classroom_classment_managements_path %>",
data: {sx_order:sx_order},
dateType: "script"
});
});
</script>

View File

@ -0,0 +1,42 @@
<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="10%">层级</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>
</tr>
</thead>
<tbody>
<% @syllabus.each_with_index do |syllabus,index| %>
<tr>
<td><%= index + 1 %></td>
<td><%= syllabus.syllabus_major_level == '' ? "--" : syllabus.syllabus_major_level %></td>
<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><%= 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>
</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 @syllabus_pages, @syllabus_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,44 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<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>
</tr>
</thead>
<tbody>
<% @apply_status.each do |apply| %>
<tr>
<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 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") %>
<%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true, :class => "application-default-link" %>
</td>
</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 @apply_status_pages, @apply_status_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</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");
}
}
</script>

View File

@ -0,0 +1,42 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<th width="9%">序号</th>
<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></th>
</tr>
</thead>
<tbody>
<% @department.each do |department| %>
<tr>
<td><%=department.id %></td>
<td class="edu-txt-left"><%= department.name %></td>
<td><%= UserExtensions.where(:department_id => department.id).count %></td>
<td>3</td>
<td><%= format_time department.created_at %></td>
<td><a href="javascript:void(0);"><i class="fa fa-edit font-16"></i> 修改</a></td>
</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 @department_pages, @department_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</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");
}
}
</script>

View File

@ -0,0 +1,60 @@
<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="6%">LOGO</th>
<th width="18%" class="edu-txt-left">单位名称</th>
<th width="10%">地区</th>
<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></th>
</tr>
</thead>
<tbody>
<% @schools.each do |schools| %>
<tr>
<td><%= schools.id %></td>
<td>
<%= image_tag(schools.logo_link,width:40,height:40) %>
</td>
<td class="edu-txt-left">
<span>
<%= link_to schools.name,"http://#{Setting.host_name}/?schools_id=#{schools.id}" %>
</span>
</td>
<td><%= schools.province %></td>
<td class="edu-txt-left"><%= schools.address == nil ? "--" :schools.address %></td>
<td><%= UserExtensions.where(:school_id => schools.id).count %></td>
<td><%= schools.departments.count %></td>
<td><%= format_time schools.created_at %></td>
<td>
<i class="fa fa-edit font-16"></i>
<%= link_to("修改", upload_logo_school_path(schools.id,:schools_name => @schools_name), :class => 'icon icon-copy') %>
</td>
</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 @schools_pages, @schools_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</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");
}
}
</script>

View File

@ -0,0 +1,39 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<th width="9%">序号</th>
<th width="12%">层级</th>
<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>操作</th>
</tr>
</thead>
<tbody>
<% @syllabus.each do |syllabus| %>
<tr>
<td><%= syllabus.id %></td>
<td><%= syllabus.syllabus_major_level == '' ? "--" : syllabus.syllabus_major_level %></td>
<td class="edu-txt-left"><%= syllabus.syllabus_discipline_category == '' ? "--" : syllabus.syllabus_discipline_category %></td>
<td class="edu-txt-left"><%= syllabus.syllabus_first_level_discipline == "" ? "--" : syllabus.syllabus_first_level_discipline %></td>
<td class="edu-txt-left"><%= syllabus.syllabus_major == "" ? "--" : syllabus.syllabus_major %></td>
<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>
</span></td>
</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 @syllabus_pages, @syllabus_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>

View File

@ -0,0 +1,48 @@
<% @authorizations.each do |authorization| %>
<div class="admin-con-box clearfix">
<% user = authorization.user %>
<% subject = Subject.find authorization.container_id %>
<a href="<%= user_path(user) %>" target="_blank" class="fl with10 edu-ad-user">
<%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %>
</a>
<div class="fl with90">
<ul>
<li class="clearfix mb5">
<%= link_to user.show_real_name, user_path(user), :class => "fl" %>
<a href="javascript:void(0);" class="fr color-orange" onclick="reject_subject_authentication_reason(this);">拒绝</a>
<a href="javascript:void(0);" class="fr mr15 color-orange" data-remote="true" onclick="subject_agree_authorization('<%= authorization.id %>');">同意</a>
</li>
<li class="clearfix mb10">
<b><%=link_to subject.name, subject_path(subject), :target => "_blank" %></b>
</li>
<li class="clearfix mb10">
<span><%= subject.stages.count %> 阶段</span><span class="ml30"><%= subject.stage_shixuns.count %> 实训</span><span class="ml30"><%= subject.subject_challenges %> 关卡</span>
</li>
<div class="undis">
<li class="clearfix edu-form-border mb10">
<label class="edu-form-label fl">原因:</label>
<input type="text" class="task-form-90 task-height-40 panel-box-sizing fl edu-form-noborder" placeholder="我得说点儿什么最多200个字符">
</li>
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="subject_submit_reject_reason('<%= authorization.id %>', this);" >确定</a>
<a href="javascript:void(0);" class="task-btn fr mr10" onclick="subject_hide_reject_reason(this);" >取消</a>
</li>
</div>
</ul>
</div>
</div>
<% end %>
<script type="text/javascript">
function subject_agree_authorization(id){
$.ajax({
url: '<%= deal_subject_authorization_managements_path %>',
data: {apply_id:id, type:1},
success: function(){
}
})
}
</script>

View File

@ -0,0 +1,40 @@
<% unless @authorizations.blank? %>
<% @authorizations.each do |authorization| %>
<% user = authorization.user %>
<% subject = Subject.find authorization.container_id %>
<div class="admin-con-box clearfix">
<a href="<%= user_path(user) %>" target="_blank" class="fl with10 edu-ad-user">
<%= image_tag(url_to_avatar(user), :class => "fl with10 edu-ad-user", :alt => "头像", :width => "50", :height => "50" ) %>
</a>
<div class="fl with90">
<ul>
<li class="clearfix mb5">
<a href="<%= user_path(user) %>" class="fl"><%= user.try(:show_name) %></a>
<span class="fl ml30 font-12 color-grey"><%= time_from_now(authorization.created_at) %></span>
<a class=" task-btn <%= authorization.status == 1 ? 'task-btn-green' : '' %> fr "><%= authorization.status == 1 ? "已同意" : "已拒绝" %></a>
</li>
<li class="clearfix mb10">
课程实训名称:<%= link_to subject.name, subject_path(subject), :target => "_blank" %>
</li>
<li class="clearfix mb10">
<span><%= subject.stages.count %> 阶段</span><span class="ml30"><%= subject.stage_shixuns.count %> 实训</span><span class="ml30"><%= subject.subject_challenges %> 关卡</span>
</li>
<% if authorization.status == 2 %>
<li>原因:<span class="color-orange"><%= authorization.reason.blank? ? "空" : authorization.reason %></span></li>
<% end %>
</ul>
</div>
</div>
<% end %>
<!--<div style="text-align:center;">-->
<!--<div class="pages_right_min" style="width:auto; display:inline-block;">-->
<!--<ul id="homework_pository_ref_pages">-->
<!--<%#= pagination_links_full @authorizations_pages, @authorizations_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>-->
<!--</ul>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<!--</div>-->
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>

View File

@ -0,0 +1,103 @@
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0" style="table-layout: fixed">
<thead>
<tr>
<th width="9%">序号</th>
<th width="20%" class="edu-txt-left">单位名称</th>
<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%"></th>
</tr>
</thead>
<tbody>
<% @apply_status.each do |apply| %>
<tr>
<td> <%= apply.id %></td>
<td class="edu-txt-left"><%= link_to apply.name,school_index_path(apply.id)%></td>
<td>
<span ondblclick = "show_edit_school_province('<%= apply.id %>');" id="apply_province_<%= apply.id %>">
<%= (apply.province.nil? ? "" : apply.province) + (apply.city.nil? ? "" : apply.city) %>
</span>
<select onchange="showcity(this.value, document.getElementById('schoolCity_<%=apply.id%>'));edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="province" id="school_province_edit_<%=apply.id%>" class="fl" style="width:55px; height:20px; display: none">
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="广东">广东</option>
<option value="江苏">江苏</option>
<option value="浙江">浙江</option>
<option value="重庆">重庆</option>
<option value="安徽">安徽</option>
<option value="福建">福建</option>
<option value="甘肃">甘肃</option>
<option value="广西">广西</option>
<option value="贵州">贵州</option>
<option value="海南">海南</option>
<option value="河北">河北</option>
<option value="黑龙江">黑龙江</option>
<option value="河南">河南</option>
<option value="湖北">湖北</option>
<option value="湖南">湖南</option>
<option value="江西">江西</option>
<option value="吉林">吉林</option>
<option value="辽宁">辽宁</option>
<option value="内蒙古">内蒙古</option>
<option value="宁夏">宁夏</option>
<option value="青海">青海</option>
<option value="山东">山东</option>
<option value="山西">山西</option>
<option value="陕西">陕西</option>
<option value="四川">四川</option>
<option value="天津">天津</option>
<option value="新疆">新疆</option>
<option value="西藏">西藏</option>
<option value="云南">云南</option>
<option value="香港">香港特别行政区</option>
<option value="澳门">澳门特别行政区</option>
<option value="台湾">台湾</option>
<option value="海外">海外</option>
</select>
<select onchange="edit_school_province('<%= edit_apply_province_school_path(apply.id)%>','<%= apply.id %>');" name="city" id="schoolCity_<%=apply.id%>" class="fl ml5" style="width:55px; height:20px; display: none"></select>
</td>
<td class="edu-txt-left">
<span title="双击可编辑" ondblclick = "show_edit_school_address('<%= apply.id %>');" id="apply_address_<%= apply.id %>"><%= apply.address %></span>
<textarea style="display: none; width:100px; height:16px; border:1px solid #ddd; outline:none; padding:0 0 0 5px; resize:none; overflow:hidden;" placeholder="请编辑单位地址" id="school_address_edit_<%=apply.id%>" onblur="edit_school_address('<%= edit_apply_address_school_path(apply.id)%>','<%= apply.id %>');"><%= apply.address %></textarea>
</td>
<td>
<% user = User.where("id=?", apply.user_id).first %>
<% unless user.nil? %>
<%=link_to user.show_name, user_path(user),:target => '_blank', :class => "application-default-link" %>
<% end %>
</td>
<td>
<%= format_date(apply.created_at) %>
</td>
<td>
<%= link_to( l(:label_approve), { :controller => 'admin', :action => 'approve_applied_schools', :id => apply.id }, :class => "application-default-link" ) %>
<%= link_to( l(:button_delete), { :controller => 'admin', :action => 'delete_applied_schools', :id => apply.id, :tip => 'unapplied' },:method => :delete, :confirm => l(:text_are_you_sure), :class => "application-default-link") %>
<%=link_to '更改', admin_all_schools_path(:school_id =>apply.id), :remote => true, :class => "application-default-link" %>
</td>
</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 @apply_status_pages, @apply_status_count, :per_page_links => false, :remote => false, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</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");
// }
// }
</script>

View File

@ -0,0 +1,17 @@
<%= form_tag(url_for(applicable_course_managements_path),:id=>"classroom",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix xmt10">
<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>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="classroom_list">
<%= render :partial => "managements/applicable_course_list" %>
</div>
<script>
function clearSearchCondition(){
$("#Look_name").val("");
$.get('<%= classroom_managements_path() %>');
}
</script>

View File

@ -0,0 +1,29 @@
<%= form_tag(url_for(class_publish_shixuns_managements_path), :id => "class_publish_shixuns_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix xmt10">
<select class="fl task-height-30" style="margin:0px 30px 0px 25px;padding: 5px;width: 25%" id="cla_sx_part" name="school_id" >
<option value="0" selected="selected">选择单位</option>
<% @schools.each do |school| %>
<option value="<%= school.id %>"><%= school.name %></option>
<% end %>
</select>
<select class="fl task-form-15 task-height-30" style="margin:0px 0px 10px 25px;width: 11%" id="cla_sx_condition_status" form="class_publish_shixuns_search" name="keyword">
<option value="u_name">创建者姓名搜索</option>
<option value="cla_name">实训套件名称搜索</option>
</select>
<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_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">
<%= render :partial => "managements/class_publish_shixuns_list" %>
</div>
<script>
//清除查询条件
function clearSearchCondition(){
$("#cla_sx_part").val("");
$("#cla_sx_condition_status").val("u_name");
$("#cla_sx_Look_name").val("");
$.get('<%= class_publish_shixuns_managements_path() %>');
}
</script>

View File

@ -0,0 +1 @@
$("#management_class_shixun_list").html("<%= j(render :partial => "managements/class_publish_shixuns_list") %>");

View File

@ -0,0 +1,36 @@
<%= form_tag(url_for(class_shixuns_managements_path), :id => "class_shixuns_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix xmt10">
<select class="fl task-form-10 task-height-30" style="margin:0px 10px 0px 25px;" form="class_shixuns_search" name="status" id="status" >
<option value="" selected="selected">全部状态</option>
<option value="0">编辑中(<%= @edit_class_sx_num %>)</option>
<option value="1">审核中(<%= @audit_class_sx_num %>)</option>
<option value="2">已发布(<%= @publish_class_sx_num %>)</option>
</select>
<select class="fl task-height-30" style="margin:0px 30px 0px 25px;padding: 5px;width: 25%" name="school_id" id="cla_sx_part">
<option value="0" selected="selected">选择单位</option>
<% @schools.each do |school| %>
<option value="<%= school.id %>"><%= school.name %></option>
<% end %>
</select>
<select class="fl task-form-15 task-height-30" style="margin:0px 0px 10px 25px;width: 11%" name="keyword" id="cla_sx_condition_status">
<option value="u_name">创建者姓名搜索</option>
<option value="cla_name">实训套件名称搜索</option>
</select>
<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>
</div>
<div class="edu-con-bg01 mt15" id="managements_class_shixuns_list">
<%= render :partial => "managements/class_shixuns_list" %>
</div>
<% end%>
<script>
//清除查询条件
function clearSearchCondition(){
$("#cla_sx_part").val("");
$("#cla_sx_condition_status").val("u_name");
$("#cla_sx_Look_name").val("");
$("#status").val("")
$.get('<%= class_shixuns_managements_path() %>');
}
</script>

View File

@ -0,0 +1 @@
$("#managements_class_shixuns_list").html("<%= j(render :partial => "managements/class_shixuns_list") %>");

View File

@ -0,0 +1,41 @@
<%= form_tag(url_for(classroom_managements_path),:id=>"classroom",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix xmt10">
<%= select_tag :major_level,options_for_select(major_level_option, 0), {:id=>"major_level", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 10px 0px 25px;"} %>
<%= 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>
<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>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="classroom_list">
<%= render :partial => "managements/classroom_list" %>
</div>
<script>
function clearSearchCondition(){
$("#part").val("");
$("#condition").val("u_name");
$("#Look_name").val("");
$("#major_level").val("");
$("#discipline_category_id").val("");
$("#major_id").val("0");
$("#first_level_discipline_id").val("");
$.get('<%= classroom_managements_path() %>');
}
</script>

View File

@ -0,0 +1 @@
$("#classroom_list").html("<%= j(render :partial => "managements/classroom_list") %>")

View File

@ -0,0 +1,38 @@
<%= form_tag(url_for(classroom_classment_managements_path), :id => "class_publish_shixuns_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix xmt10">
<select class="fl task-form-10 task-height-30" style="margin:0px 10px 0px 25px;" id="status" name="status">
<option value="" selected="selected">全部状态</option>
<option value="0">正在进行(<%= @timing %>)</option>
<option value="1">已结束(<%= @end %>)</option>
</select>
<select class="fl task-height-30" style="margin:0px 30px 0px 25px;padding: 5px;width: 25%" name="school_id" id="part">
<option value="0" selected="selected">选择创建者单位</option>
<% @schools.each do |school|%>
<option value="<%= school.id %>"><%= school.name%></option>
<% end %>
</select>
<select class="fl task-form-15 task-height-30" style="margin:0px 0px 10px 25px;width: 11%" name="keyword" id="condition_status">
<option value="u_name">创建者姓名搜索</option>
<option value="cla_name">班级名称搜索</option>
</select>
<input class="fl task-form-20 task-height-30" 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="$('#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>
</div>
<% end%>
<div class="edu-con-bg01 mt15" id="managements_classroom_classment">
<%= render :partial => "managements/classroom_classment_list" %>
</div>
<script>
function clearSearchCondition(){
$("#status").val("");
$("#part").val("");
$("#condition_status").val("uname")
$("#Look_name").val("");
$.get('<%=classroom_classment_managements_path() %>')
}
</script>

View File

@ -0,0 +1 @@
$("#managements_classroom_classment").html("<%= j(render :partial => "managements/classroom_classment_list") %>");

View File

@ -0,0 +1 @@
$("#subject_authentication_list").html("<%= j( render :partial => "managements/subject_authorization_list" ) %>");

View File

@ -0,0 +1,16 @@
<%= form_tag(url_for(depart_managements_path), :id => "depart_search", :method => "post", :remote => true ) do %>
<div class="edu-con-top clearfix mb20 xmt10">
<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>
</div>
<% end%>
<div class="edu-con-bg01 mt15" id="managements_user_list">
<%= render :partial => "managements/depart_list" %>
</div>
<script>
function clearSearchCondition(){
$("#shixun_Look_name").val("");
$.get('<%=depart_managements_path() %>')
}
</script>

View File

@ -0,0 +1 @@
$("#managements_user_list").html("<%= j( render :partial => "managements/depart_list" ) %>");

View File

@ -0,0 +1,17 @@
<%= form_tag(url_for(departments_managements_path),:id=>"department_search",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix mb20 xmt10">
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;" onkeyup="myFunction()">
<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>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="managements_departments_list">
<%= render :partial => "managements/departments_list" %>
</div>
<script>
function clearSearchCondition(){
$("#shixun_Look_name").val("")
$.get('<%= departments_managements_path() %>')
}
</script>

View File

@ -0,0 +1 @@
$("#managements_departments_list").html("<%= j( render :partial => "managements/departments_list" ) %>")

View File

@ -0,0 +1,17 @@
<%= form_tag(url_for(departments_part_managements_path),:id=>"department_part_search",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix mb20 xmt10">
<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="$('#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>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="managements_department_part_list">
<%= render :partial => "managements/departments_part_list" %>
</div>
<script>
function clearSearchCondition() {
$("#shixun_Look_name").val("");
$.get('<%= departments_part_managements_path() %>')
}
</script>

View File

@ -0,0 +1 @@
$("#managements_department_part_list").html("<%= j( render :partial => "managements/departments_part_list" ) %>")

View File

@ -1,133 +1,198 @@
<div class="edu-class-container mb15">
<div class="edu-con-top clearfix">
<p class="ml15 fl color-grey">身份认证</p>
</div>
<div class="edu-con-bg01 mt15">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav">
<li id="edu-tab-nav-1" class="edu-new-tab-hover new-tab-nav" onclick="HoverLi(1);">
<%= link_to "待审批", {:controller => "managements", :action => "identity_authentication", :type => 0}, :class => "tab_type", :remote => true %>
</li>
<li id="edu-tab-nav-2" onclick="HoverLi(2);">
<%= link_to "已审批", {:controller => "managements", :action => "identity_authentication", :type => [1,2]}, :class => "tab_type", :remote => true %>
</li>
</ul>
<div class="cl"></div>
<div id="edu-tab-con-1">
<div class="mt10">
<div class="edu-position fr task-form-30 mb10 mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text" id="search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="authentication_list">
<%= render :partial => "admin/authentication_list" %>
</div>
</div>
</div>
<div id="edu-tab-con-2" class="undis">
<div class="mt10">
<p class="fl task-form-60 mt8 ml15">
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 active" id="audit_all_authentication">全部</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5" id="audit_agree_authentication">同意</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5" id="audit_reject_authentication" >拒绝</a>
</p>
<div class="edu-position fr task-form-30 mb10 fr mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text" id="audit_search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt15" id="audit_search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="audit_authentication_list">
</div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<script>
/* -------------------------- 拒绝 ------------------------------------ */
function reject_authentication_reason(nThis){
var reason = $(nThis).parent().parent().find('div');
reason.find("input").val("");
reason.toggle();
}
/* -------------------------- 取消 ------------------------------------ */
function hide_reject_reason(nThis){
var reason = $(nThis).parent().parent();
reason.find("input").val("");
reason.hide();
}
/* ------------------------- 提交拒绝原因 --------------------------------- */
function submit_reject_reason(id, nThis){
var nReason = $(nThis).parent().parent();
var reason = nReason.find("input").val();
$.ajax({
url: '<%= admin_reject_authentication_path %>',
data: {apply_id: id, reject_reason: reason },
success: function(data){
if(data.success){
location.reload();
}
}
});
}
/* -------------------------- 按名字进行收缩(未审批) ----------------------------- */
$("#search").live("click", function(){
var iName = $("#search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path %>" +".js",
data: { name: iName }
});
});
/* ----------------------- 已审批(全部) ------------------------- */
$("#audit_all_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" + ".js",
data: { name: iName, type: [1, 2] }
});
});
/* ----------------------- 已审批(同意) ------------------------- */
$("#audit_agree_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" +".js",
data: { name: iName, type: 1 }
});
});
/* ----------------------- 已审批(拒绝) ------------------------- */
$("#audit_reject_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" +".js",
data: { name: iName, type: 2 }
});
});
/* ------------------- 按名字进行搜索(已审批)-------------------- */
$("#audit_search").live("click", function(){
var iName = $("#audit_search_name").val();
var id = $("#audit_all_authentication").parent().find(".active").attr("id");
var type = 0;
if(id = "audit_all_authentication"){
type = [1, 2];
}else if(id="audit_agree_authentication"){
type = 1;
}else{
type = 2;
}
$.ajax({
url: "<%= admin_identity_authentication_path %>" +".js",
data: { name: iName, type: type}
});
});
<div class="edu-class-container mb15">
<!--<div class="edu-con-top clearfix">-->
<!--<p class="ml15 fl color-grey"><span><a href="">身份认证</a></span><span style="margin: 0 40px">|</span><span><a href="">职业认证</a></span></p>-->
<!--<ul id="edu-tab-nav-auth">-->
<!--<li class="edu-new-tab-hover new-tab-nav">-->
<!--<%#= link_to "身份认证", {:controller => "managements", :action => "", :type => 0}, :class => "tab_type", :remote => true %>-->
<!--</li>-->
<!--<li class="new-tab-nav">-->
<!--<%#= link_to "职业认证", {:controller => "managements", :action => "", :type => 0}, :class => "tab_type", :remote => true %>-->
<!--</li>-->
<!--</ul>-->
<!--<div class="cl"></div>-->
<!--</div>-->
<div>
<!--身份认证-->
<div class="edu-con-bg01 mt15 authentization">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav">
<li id="edu-tab-nav-1" class="edu-new-tab-hover new-tab-nav" onclick="HoverLi(1);">
<%= link_to "待审批", {:controller => "managements", :action => "identity_authentication", :type => 0}, :class => "tab_type", :remote => true %>
</li>
<li id="edu-tab-nav-2" onclick="HoverLi(2);">
<%= link_to "已审批", {:controller => "managements", :action => "identity_authentication", :type => [1,2]}, :class => "tab_type", :remote => true %>
</li>
</ul>
<div class="cl"></div>
<div id="edu-tab-con-1">
<div class="mt10">
<div class="edu-position fr task-form-30 mb10 mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text" id="search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="authentication_list">
<%= render :partial => "admin/authentication_list" %>
</div>
</div>
</div>
<div id="edu-tab-con-2" class="undis">
<div class="mt10">
<p class="fl task-form-60 mt8 ml15">
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 active" id="audit_all_authentication">全部</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5" id="audit_agree_authentication">同意</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5" id="audit_reject_authentication" >拒绝</a>
</p>
<div class="edu-position fr task-form-30 mb10 fr mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text" id="audit_search_name">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt15" id="audit_search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="audit_authentication_list">
</div>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<!--职业认证-->
<div class="edu-con-bg01 mt15 undis authentization">
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav">
<li id="edu-tab-nav-1" class="edu-new-tab-hover new-tab-nav" onclick="HoverLi(1);">
<%= link_to "待审批" %>N
</li>
<li id="edu-tab-nav-2" onclick="HoverLi(2);">
<%= link_to "已审批" %>
</li>
</ul>
<div class="cl"></div>
<div id="edu-tab-con-1">
<div class="mt10">
<div class="edu-position fr task-form-30 mb10 mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt10" id="search"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<div id="authentication_list">
</div>
</div>
</div>
<div id="edu-tab-con-2" class="undis">
<div class="mt10">
<p class="fl task-form-60 mt8 ml15">
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5 active">全部</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5">同意</a>
<a href="javascript:void(0);" class="edu-filter-cir-grey mr5">拒绝</a>
</p>
<div class="edu-position fr task-form-30 mb10 fr mr15">
<input class="task-form-100 panel-box-sizing" placeholder="输入真实姓名进行检索" type="text">
<a href="javascript:void(0);" class="edu-btn-search font-16 color-grey mt15"><i class="fa fa-search"></i></a>
</div>
<div class="cl"></div>
<!--<div id="audit_authentication_list">-->
<!--</div>-->
</div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
</div>
<script>
/* -------------------------- 拒绝 ------------------------------------ */
function reject_authentication_reason(nThis){
var reason = $(nThis).parent().parent().find('div');
reason.find("input").val("");
reason.toggle();
}
/* -------------------------- 取消 ------------------------------------ */
function hide_reject_reason(nThis){
var reason = $(nThis).parent().parent();
reason.find("input").val("");
reason.hide();
}
/* ------------------------- 提交拒绝原因 --------------------------------- */
function submit_reject_reason(id, nThis){
var nReason = $(nThis).parent().parent();
var reason = nReason.find("input").val();
$.ajax({
url: '<%= admin_reject_authentication_path %>',
data: {apply_id: id, reject_reason: reason },
success: function(data){
if(data.success){
location.reload();
}
}
});
}
/* -------------------------- 按名字进行收缩(未审批) ----------------------------- */
$("#search").live("click", function(){
var iName = $("#search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path %>" +".js",
data: { name: iName }
});
});
/* ----------------------- 已审批(全部) ------------------------- */
$("#audit_all_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" + ".js",
data: { name: iName, type: [1, 2] }
});
});
/* ----------------------- 已审批(同意) ------------------------- */
$("#audit_agree_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" +".js",
data: { name: iName, type: 1 }
});
});
/* ----------------------- 已审批(拒绝) ------------------------- */
$("#audit_reject_authentication").live("click", function(){
var iName = $("#audit_search_name").val();
$.ajax({
url: "<%= admin_identity_authentication_path() %>" +".js",
data: { name: iName, type: 2 }
});
});
/* ------------------- 按名字进行搜索(已审批)-------------------- */
$("#audit_search").live("click", function(){
var iName = $("#audit_search_name").val();
var id = $("#audit_all_authentication").parent().find(".active").attr("id");
var type = 0;
if(id = "audit_all_authentication"){
type = [1, 2];
}else if(id="audit_agree_authentication"){
type = 1;
}else{
type = 2;
}
$.ajax({
url: "<%= admin_identity_authentication_path %>" +".js",
data: { name: iName, type: type}
});
});
// 身份认证和职业认证
$("#edu-tab-nav-auth li").click(function(){
var index=$(this).index();
$("#edu-tab-nav-auth li").eq(index).addClass("edu-new-tab-hover").siblings().removeClass("edu-new-tab-hover");
$(".authentization").eq(index).removeClass("undis").siblings().addClass("undis");
})
</script>

View File

@ -0,0 +1,26 @@
<%= form_tag(url_for(profession_managements_path),:id=>"profession",:method => "post",:remote=>true) do %>
<div class="edu-con-top clearfix xmt10">
<%= select_tag :major_level,options_for_select(major_level_option, 0), {:id=>"major_level", :class=>"fl task-form-15 task-height-30", :style => "margin:0px 10px 0px 25px;"} %>
<%= 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;"} %>
<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>
</div>
<span class="shixun_webssh">
<input type="checkbox" class="mr5 magic-checkbox" id="join_course_role_0">
<label style="margin-left:35px;" for="join_course_role_0"><span class="only_view">只看支撑实训</span></label>
</span>
<% end %>
<div class="edu-con-bg01 mt15" id="classroom_list">
<%= render :partial => "managements/profession_list" %>
</div>
<script>
function clearSearchCondition(){
$("#major_level").val("");
$("#discipline_category_id").val("");
$("#first_level_discipline_id").val("");
$.get('<%= profession_managements_path() %>');
}
</script>

Some files were not shown because too many files have changed in this diff Show More