Merge branch 'dev_cs' of https://bdgit.trustie.net/hushasha/bigdata into dev_cs

Conflicts:
	app/views/courses/settings/_all_student_list.html.erb
This commit is contained in:
huang 2017-09-15 10:55:32 +08:00
commit 3e07f18be5
151 changed files with 3596 additions and 2111 deletions

View File

@ -107,6 +107,8 @@ class BoardsController < ApplicationController
end
sort_name = "updated_on"
sort_type = @b_sort == 1 ? "asc" : "desc"
@q = params[:name]
q = "%#{@q}%"
# 讨论区消息状态更新(已读和未读)
if @project
@ -122,7 +124,7 @@ class BoardsController < ApplicationController
# 'replies' => "#{Message.table_name}.replies_count",
# 'updated_on' => "COALESCE(last_replies_messages.created_on, #{Message.table_name}.created_on)"
@is_new = params[:is_new]
# @is_new = params[:is_new]
@topic_count = @board ? @board.topics.count : 0
if @project
if @board
@ -138,7 +140,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.where("#{Message.table_name}.subject like '#{q}'").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();
else
@topics = [];
end

View File

@ -2,13 +2,16 @@
class ChallengesController < ApplicationController
layout "base_shixun"
before_filter :check_authentication
before_filter :find_shixun, :only => [:index, :new, :create, :destroy, :challenge_build, :update_evaluation]
before_filter :find_challenge, :only => [:show, :edit, :update, :challenge_build, :index_up, :index_down, :destroy, :update_evaluation]
before_filter :find_shixun, :only => [:index, :new, :create, :destroy, :challenge_build, :update_evaluation, :add_choose_question, :new_choose_question, :choose_type_show, :edit_choose_question, :update_choose_question, :destroy_challenge_choose]
before_filter :find_challenge, :only => [:show, :edit, :update, :challenge_build, :index_up, :index_down, :destroy, :update_evaluation, :add_choose_question, :new_choose_question, :choose_type_show, :edit_choose_question, :update_choose_question, :destroy_challenge_choose]
before_filter :build_challege_from_params, :only => [:new, :create]
before_filter :tpi_manager_allowed, :only => [:challenge_build, :destroy, :edit, :new, :create]
before_filter :allowed_view, :only => [:show]
before_filter :query_challeges, :only => [:show, :edit, :update, :update_evaluation]
before_filter :find_shixun_language, :only => [:show, :new, :edit]
#before_filter :default_format_js, only: :new_or_edit_choose_question
#skip_before_filter :verify_authenticity_token, :only => [:new_or_edit_choose_question]
include ApplicationHelper
@ -30,6 +33,8 @@ class ChallengesController < ApplicationController
@challenge.shixun = @shixun
@challenge.user = User.current
@challenge.st = params[:st].to_i
@challenge.save!
=begin
if @challenge.save!
if params[:st].to_i != 0
#创建选项
@ -39,6 +44,7 @@ class ChallengesController < ApplicationController
end
end
end
=end
# 实训是否需要重启
# 非实践任务创建第一个阶段时调用 publishGame, 避免不包含实践任务的实训进行模拟实战时报错
if @challenge.position == 1 && params[:st].to_i != 0
@ -91,9 +97,117 @@ class ChallengesController < ApplicationController
if challenge_pos < challenge_num
@next_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos+1).first
end
@prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if challenge_pos - 1 > 0
@prev_challenge = Challenge.where(:shixun_id => @shixun, :position => challenge_pos - 1).first if (challenge_pos - 1) > 0
@tab = params[:tab].blank? ? 1 : params[:tab].to_i
@editor = params[:editor] # 编辑模式
respond_to do |format|
format.html
format.js
end
end
def new_choose_question
ActiveRecord::Base.transaction do
begin
@challenge_choose = ChallengeChoose.new
@challenge_choose.challenge_id = @challenge.id
@challenge_choose.subject = params[:choose][:subject]
@challenge_choose.answer = params[:choose][:answer]
@challenge_choose.standard_answer = params[:standard_answer]
@challenge_choose.score = params[:challenge][:score].to_i
@challenge_choose.difficult = params[:challenge][:difficulty].to_i
@challenge_choose.position = params[:position].to_i
@challenge_choose.category = params[:category].to_i
if @challenge_choose.save!
# 创建选项
params[:question][:cnt].each_with_index do |test, index|
answer = params[:choice][:answer][index] == "0" ? false : true
ChallengeQuestion.create(:option_name => test, :challenge_choose_id => @challenge_choose.id, :position => index, :right_key => answer)
end
# 创建单选多选的技能标签
unless params[:knowledge].blank?
params[:knowledge][:input].each do |input|
ChallengeTag.create(:name => input, :challenge_choose_id => @challenge_choose.id, :challenge_id => @challenge.id)
end
end
end
@index = params[:position].to_i
respond_to do |format|
format.js
end
rescue Exception => e
flash[:error] = "#{e.message}"
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)
raise ActiveRecord::Rollback
end
end
end
def update_choose_question
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
ActiveRecord::Base.transaction do
@challenge_choose.update_attributes(:subject => params[:choose][:subject],
:answer => params[:choose][:answer],
:standard_answer => params[:standard_answer],
:score => params[:challenge][:score].to_i,
:difficult => params[:challenge][:difficulty].to_i)
begin
@challenge_choose.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_choose_id => @challenge_choose.id, :position => index, :right_key => answer)
end
@challenge_choose.challenge_tags.delete_all unless @challenge_choose.challenge_tags.blank?
unless params[:knowledge].blank?
params[:knowledge][:input].each do |input|
ChallengeTag.create(:name => input, :challenge_choose_id => @challenge_choose.id, :challenge_id => @challenge.id)
end
end
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
@index = params[:index].to_i
respond_to do |format|
format.js
end
rescue Exception => e
flash[:error] = "#{e.message}"
format.html{redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)}
raise ActiveRecord::Rollback
end
end
end
def edit_choose_question
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
@category = @challenge_choose.category
@position = @challenge_choose.position.to_i
@index = params[:index].to_i
respond_to do |format|
format.js
end
end
def choose_type_show
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
@index = params[:index].to_i
respond_to do |format|
format.js
end
end
def destroy_challenge_choose
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
@challenge_choose.destroy
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)
end
def add_choose_question
@category = params[:category].to_i
@position = params[:position]
#@challenge_choose = @challenge.challenge_chooses
respond_to do |format|
format.js
end
end
def destroy
@ -108,22 +222,22 @@ class ChallengesController < ApplicationController
def update
ActiveRecord::Base.transaction do
@challenge.update_attributes(params[:challenge])
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
else
#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
#else
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => params[:tab])
end
#end
end
end
@ -272,4 +386,8 @@ class ChallengesController < ApplicationController
@language = language_switch language
end
def default_format_js
response.headers['content--type'] = 'text/javascript'
request.format = 'js'
end
end

View File

@ -1388,8 +1388,12 @@ class CoursesController < ApplicationController
@page = params[:page] ? params[:page].to_i + 1 : 0
if params[:type].present?
case params[:type]
when "homework"
@course_activities = course_activities.where("course_act_type = 'HomeworkCommon'").order('updated_at desc')
when "common_homework"
homework_ids = @course.homework_commons.where(:homework_type => 1)
@course_activities = course_activities.where(:course_act_type => 'HomeworkCommon', :course_act_id => homework_ids.map(&:id)).order('updated_at desc')
when "shixun_homework"
homework_ids = @course.homework_commons.where(:homework_type => 4)
@course_activities = course_activities.where(:course_act_type => 'HomeworkCommon', :course_act_id => homework_ids.map(&:id)).order('updated_at desc')
when "news"
@course_activities = course_activities.where("course_act_type = 'News'").order('updated_at desc')
when "message"

View File

@ -74,21 +74,21 @@ class FilesController < ApplicationController
begin
q = "%#{params[:name].strip}%"
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
if params[:insite]
if q == "%%"
@result = []
# @searched_attach = paginateHelper @result,10
else
@result = find_public_attache q,sort
@result = visable_attachemnts_insite @result,@course
# @searched_attach = paginateHelper @result,10
end
else
# if params[:insite]
# if q == "%%"
# @result = []
# # @searched_attach = paginateHelper @result,10
# else
# @result = find_public_attache q,sort
# @result = visable_attachemnts_insite @result,@course
# # @searched_attach = paginateHelper @result,10
# end
# else
@result = find_course_attache q,@course,sort
@result = visable_attachemnts @result
# @searched_attach = paginateHelper @result,10
@tag_list = get_course_tag_list @course
end
#@tag_list = get_course_tag_list @course
#end
@all_attachments = @result
get_attachment_for_tip(@all_attachments)
@limit = 10
@ -223,9 +223,9 @@ class FilesController < ApplicationController
sort = "created_on DESC"
end
if keywords != "%%"
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND filename LIKE :like ", like: "%#{keywords}%").reorder(sort)
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' AND (filename LIKE '#{keywords}' or description LIKE '#{keywords}')").reorder(sort)
else
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' "). reorder(sort)
resultSet = Attachment.where("attachments.container_type = 'Course' And attachments.container_id = '#{course.id}' ").reorder(sort)
end
#resultSet = Attachment.find_by_sql("SELECT `attachments`.* FROM `attachments` LEFT OUTER JOIN `homework_attaches` ON `attachments`.container_type = 'HomeworkAttach' AND `attachments`.container_id = `homework_attaches`.id LEFT OUTER JOIN `homework_for_courses` ON `homework_attaches`.bid_id = `homework_for_courses`.bid_id LEFT OUTER JOIN `homework_for_courses` AS H_C ON `attachments`.container_type = 'Bid' AND `attachments`.container_id = H_C.bid_id WHERE (`homework_for_courses`.course_id = 117 OR H_C.course_id = 117 OR (`attachments`.container_type = 'Course' AND `attachments`.container_id = 117)) AND `attachments`.filename LIKE '%#{keywords}%'").reorder("created_on DESC")
end
@ -377,6 +377,8 @@ class FilesController < ApplicationController
end
end
else
@sort = "created_on"
@order = "desc"
sort = "#{Attachment.table_name}.created_on desc"
end
@ -385,7 +387,7 @@ class FilesController < ApplicationController
show_attachments @containers
get_attachment_for_tip(@all_attachments)
@tag_list = attachment_tag_list @all_attachments
#@tag_list = attachment_tag_list @all_attachments
@left_nav_type = 5
render :layout => 'base_courses'
@ -597,6 +599,7 @@ class FilesController < ApplicationController
attachment.publish_time = Time.now
end
attachment.description = params[:description]
attachment.is_public = params[:is_public] ? 1 : 0
attachment.save
resource_bank = ResourceBank.create(:course_id => @course.id, :attachment_id => attachment.id, :filename => attachment.filename, :disk_filename => attachment.disk_filename, :filesize => attachment.filesize, :digest => attachment.digest, :downloads => 0,
:user_id => attachment.author_id, :description => attachment.description, :disk_directory => attachment.disk_directory, :is_public => attachment.is_public, :copy_from => attachment.copy_from,
@ -939,7 +942,7 @@ class FilesController < ApplicationController
@tag_list = get_project_tag_list @project
@result_search_project = @result
else
@tag_list = get_course_tag_list @course
#@tag_list = get_course_tag_list @course
end
respond_to do |format|
format.js

View File

@ -49,7 +49,7 @@ class GamesController < ApplicationController
@type = params[:type]
challenge_path = @game_challenge.path
# 用户选项
@user_answer = @game.outputs.first.actual_output.split("") unless @st == 0 || @game.outputs.blank?
#@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文件名的合法性
@ -300,53 +300,42 @@ class GamesController < ApplicationController
end
# 选择题评测(选择题不需要重新评测)
# score 获得金币数 tag_count 技能数 right用户是否全对 answer_right全部选择题的正确性
def evaluating_choice
@game_challenge = @game.challenge
user_answer = params[:answer]
correct = true
@challenges = Challenge.where(:shixun_id => @myshixun.shixun_id)
@shixun = @myshixun.shixun
score = 0
tag_count = 0
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
@right = true
answer_right = []
@game_challenge.challenge_chooses.each_with_index do |choose, index|
correct = (params[:answer][index] == choose.standard_answer) ? true : false
if choose.choose_outputs.blank?
ChooseOutputs.create(:challenge_choose_id => choose.id, :user_id => User.current.id, :answer => params[:answer][index], :correct => correct)
end
else
correct = false
if @shixun.status > 1 && !@game.answer_open
if correct
score += choose.score
tag_count += choose.challenge_tags.count
end
elsif @shixun.status > 1 && @game.answer_open
score -= choose.score
end
unless correct
@right = false
end
answer_right << correct
end
@game.update_attributes(:status => 2, :end_time => Time.now)
had_done = @game.had_done
shixun = @myshixun.shixun
if shixun.status > 1 && !@game.answer_open
if correct
#User.current.update_attributes(:grade => (User.current.grade + @game.challenge.score), :experience => (User.current.experience + @game.challenge.score))
reward_grade(@game.user, @game.id, 'Game', @game_challenge.score)
reward_experience(@game.user, @game.id, 'Game', @game_challenge.score)
@game.update_attribute(:final_score, @game_challenge.score)
score = @game_challenge.score
tag_count = @game_challenge.challenge_tags.count
else
score = "+0"
tag_count = 0
end
elsif shixun.status > 1 && @game.answer_open
score = -@game_challenge.score.to_i
tag_count = 0
else
score = "+0"
tag_count = 0
@had_done = @game.had_done
reward_grade(@game.user, @game.id, 'Game', score)
reward_experience(@game.user, @game.id, 'Game', score)
@game.update_attribute(:final_score, score)
respond_to do |format|
format.js{redirect_to myshixun_game_path(@game, :myshixun_id => @myshixun, :choose => 1)}
end
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.where(:id => User.current.id).first.grade, score: score, tag_count: tag_count, position: @game_challenge.position}
end
@ -407,9 +396,19 @@ class GamesController < ApplicationController
def answer
challenge = @game.challenge
@challenge_score = challenge.score.to_i
@answer = ""
# 已经开启过
@score = User.current.grade.to_i - @challenge_score
@answer = challenge.answer
if(params[:choose] == "true")
challenge.challenge_chooses.each_with_index do |choose, index|
@answer += ""+ ((index + 1).to_s) +"题:<br />"
@answer += choose.answer
@answer += "<br /><br /><br />"
end
else
@answer = challenge.answer
end
if challenge.shixun.status < 2 || @game.answer_open
@viewed = 1
else

View File

@ -191,7 +191,7 @@ class HomeworkCommonController < ApplicationController
# homework_bank.save
# homework.update_attributes(:homework_bank_id => homework_bank.id)
# end
redirect_to setting_homework_common_path(homework, :is_new => 1)
redirect_to student_work_index_path(:homework => homework.id, :is_new => 1, :tab => 4)
end
end
end
@ -349,7 +349,7 @@ class HomeworkCommonController < ApplicationController
end
@homework.save
@homework_detail_manual.save
redirect_to student_work_index_path(:homework => @homework.id, :host=> Setting.host_course)
redirect_to student_work_index_path(:homework => @homework.id, :tab => 4)
end
def edit

View File

@ -370,7 +370,7 @@ class MessagesController < ApplicationController
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
redirect_to course_activity_path(@course)
redirect_to course_path(@course)
elsif params[:is_course] && params[:is_course].to_i == 1 && params[:is_board] && params[:is_board].to_i == 1
redirect_to course_boards_path(@course)
elsif @message.parent

View File

@ -786,6 +786,4 @@ class ShixunsController < ApplicationController
def validation_email
render_403 if User.current.mail.blank?
end
end

View File

@ -365,6 +365,7 @@ class StudentWorkController < ApplicationController
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
@is_evaluation = @homework.homework_detail_manual && (@homework.homework_detail_manual.comment_status == 3 || @homework.homework_detail_manual.comment_status == 4) && !@is_teacher #是不是匿评
@show_all = false
@is_new = params[:is_new].to_i if params[:is_new]
# 0表示没有分组的学生-1表示所有分组的学生
if @group

View File

@ -79,31 +79,31 @@ module CoursesHelper
#生成课程老师成员链接
def course_teacher_link teacher_num
if User.current.allowed_to?(:as_teacher, @course)
link_to "#{teacher_num}", settings_course_path(@course, :tab => 'member'), :class => 'mr5 link-color-blue', :id => 'teacher_number'
link_to teacher_num, settings_course_path(@course, :tab => 'member'), :class => 'mr5 color-orange03', :id => 'teacher_number'
elsif User.current.member_of_course?(@course)
link_to "#{teacher_num}", course_member_path(@course, :role => 't'), :class => 'mr5 link-color-blue', :id => 'teacher_number'
link_to teacher_num, course_member_path(@course, :role => 't'), :class => 'mr5 color-orange03', :id => 'teacher_number'
else
content_tag 'span',teacher_num, :class => 'mr5 color-blue'
content_tag 'span',teacher_num, :class => 'mr5 color-orange03'
end
end
#生成课程学生列表连接
def course_student_link student_num
if User.current.allowed_to?(:as_teacher, @course)
link_to "#{student_num}", settings_course_path(@course, :tab => 'member', :role => 'as'), :class => 'mr5 link-color-blue', :id => 'student_number'
link_to "#{student_num}", settings_course_path(@course, :tab => 'member', :role => 'as'), :class => 'mr5 color-orange03', :id => 'student_number'
elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course))
link_to "#{student_num}", course_member_path(@course, :role => 'as'), :class => 'mr5 link-color-blue', :id => "student_number"
link_to "#{student_num}", course_member_path(@course, :role => 'as'), :class => 'mr5 color-orange03', :id => "student_number"
else
content_tag 'span',student_num, :class => 'mr5 color-blue'
content_tag 'span',student_num, :class => 'mr5 color-orange03'
end
end
# 生成分班列表连接
def course_group_link group_num
if User.current.allowed_to?(:as_teacher, @course)
link_to "#{group_num}", settings_course_path(@course, :tab => 'member', :role => @course.course_groups.first.id), :class => 'mr5 link-color-blue', :id => 'group_number'
link_to "#{group_num}", settings_course_path(@course, :tab => 'member', :role => @course.course_groups.first.id), :class => 'mr5 color-orange03', :id => 'group_number'
elsif (User.current.logged? && @course.open_student == 1) || (User.current.member_of_course?(@course))
link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'mr5 link-color-blue', :id => "group_number"
link_to "#{group_num}", course_member_path(@course, :role => @course.course_groups.first.id), :class => 'mr5 color-orange03', :id => "group_number"
else
content_tag 'span',group_num, :class => 'sy_cblue'
end
@ -621,8 +621,10 @@ module CoursesHelper
# 获取动态列表名称
def get_acts_list_type type
case type
when "homework"
l(:label_homework_acts)
when "common_homework"
l(:label_common_homework_acts)
when "shixun_homework"
l(:label_shixun_homework_acts)
when "news"
l(:label_news_acts)
when "attachment"

View File

@ -99,32 +99,32 @@ module StudentWorkHelper
project = cur_user_projects_for_homework homework
if work.nil? && homework.end_time >= Time.now
if homework.homework_type == 4
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'task-btn task-btn-blue fr mr10 mt8',:remote => true
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
else
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'task-btn task-btn-blue fr mr10 mt8'
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'white-btn orange-btn fr mr10 mt8'
end
elsif work.nil? && homework.end_time < Time.now
if homework.allow_late && homework.homework_detail_manual.comment_status < 6
if homework.homework_type == 4
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'task-btn task-btn-blue fr mr10 mt8',:remote => true
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
else
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'task-btn task-btn-blue fr mr10 mt8'
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'white-btn orange-btn fr mr10 mt8'
end
end
elsif work
if homework.homework_type == 4
myshixun = Myshixun.find work.myshixun_id
link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "task-btn task-btn-blue fr mr10 mt8",:target => "_blank" if myshixun
link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "white-btn orange-btn fr mr10 mt8",:target => "_blank" if myshixun
else
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'task-btn task-btn-blue fr mr10 mt8', :title => "开启匿评后不可修改作品"
link_to "匿评作品", student_work_index_url_in_org(homework.id, 2), :class => 'white-btn orange-btn fr mr10 mt8', :title => "开启匿评后不可修改作品"
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status > 3
link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr mr10 mt8', :title => "匿评已结束"
link_to "查看作品", student_work_path(work), :class => 'white-btn orange-btn fr mr10 mt8', :title => "匿评已结束"
elsif homework.end_time >= Time.now && work.user_id == User.current.id
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'task-btn task-btn-blue fr mr10 mt8'
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'white-btn orange-btn fr mr10 mt8'
else
link_to "查看作品", student_work_path(work), :class => 'task-btn task-btn-blue fr mr10 mt8', :title => "作业截止后不可修改作品"
link_to "查看作品", student_work_path(work), :class => 'white-btn orange-btn fr mr10 mt8', :title => "作业截止后不可修改作品"
end
end
end

View File

@ -1,5 +1,5 @@
#coding=utf-8
# st 0实践任务1多选任务2单选任务
# st 0实践任务1选择题任务
class Challenge < ActiveRecord::Base
default_scope :order => 'position'
belongs_to :shixun,:touch=> true
@ -8,7 +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
has_many :challenge_chooses, :dependent => :destroy
validates_presence_of :subject
# validates_presence_of :score
@ -28,6 +28,35 @@ class Challenge < ActiveRecord::Base
str
end
def choose_correct_num
num = 0
self.challenge_chooses.each do |choose|
outputs = ChooseOutputs.where(:challenge_choose_id => choose.id).first
if outputs.nil?
num = nil
else
num += (outputs.correct ? 1 : 0)
end
end
return num
end
def choose_score
score = 0
self.challenge_chooses.each do |choose|
score += choose.score
end
return score
end
def choose_tags_num
num = 0
self.challenge_chooses.each do |choose|
num += choose.challenge_tags.count
end
return num
end
def next_challenge
challenge_count = Challenge.where(:shixun_id => self.shixun_id).count
render_404 if self.position ==challenge_count

View File

@ -0,0 +1,13 @@
class ChallengeChoose < ActiveRecord::Base
# attr_accessible :title, :body
# category 1 单选, 2多选
# standard_answer 正确答案 answer 答题的思路
default_scope :order => 'position'
belongs_to :challenge
has_many :challenge_tags, :dependent => :destroy
has_many :challenge_questions, :dependent => :destroy
has_one :choose_outputs, :dependent => :destroy
validates_presence_of :subject
end

View File

@ -1,4 +1,6 @@
class ChallengeQuestion < ActiveRecord::Base
belongs_to :challenge
attr_accessible :challenge_id, :option_name, :position, :right_key
# 选择题的选项内容
belongs_to :challenge_choose
# right_key 选项是否是答案, position 选项的位置
attr_accessible :challenge_choose_id, :option_name, :position, :right_key
end

View File

@ -1,4 +1,5 @@
class ChallengeTag < ActiveRecord::Base
attr_accessible :challenge_id, :name
attr_accessible :challenge_id, :name, :challenge_choose_id
belongs_to :challenge
belongs_to :challenge_choose
end

View File

@ -0,0 +1,5 @@
class ChooseOutputs < ActiveRecord::Base
# attr_accessible :title, :body
# user_id 与 challenge_choose_id 唯一确定用户此题的选项
belongs_to :challenge_choose
end

View File

@ -1,6 +1,6 @@
<div class="task-popup" style="width:820px;">
<div class="task-popup-title clearfix">
<h3 class="fl color-grey">更新资源版本</h3>
<h3 class="fl color-grey">资源设置</h3>
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
<div class="task-popup-content">

View File

@ -1,6 +1,6 @@
<div class="clear mb10">
<a class="sub_btn fl" name="button" onclick="_file.click()" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">文件浏览</a>
<p class="fl ml5 mt3 sy_cgrey" ><span id="upload_file_count" class="c_red">(未选择文件)</span> 您可以上传小于<span class="c_red">50MB</span>的文件</p>
<a class="white-btn orange-btn fl" name="button" onclick="_file.click()" onmouseover="" style="<%= ie8? ? 'display:none' : ''%>">更新版本</a>
<p class="fl ml5 mt3 sy_cgrey" ><span id="upload_file_count" class="c_red">(未选择文件)</span> 单个文件最大限制:<span class="c_red">50MB</span></p>
</div>

View File

@ -1,56 +1,9 @@
<% 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;
}
$("#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>
<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>
<% end %>
<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"><%= @all_count %></span>
<div class="ml15 user_bg_shadow bor-grey-e clearfix">
<div class="clearfix pt10 pb10 pl15 pr15 bor-bottom-greyE">
<p class="color-grey3 fl font-16">帖子列表</p><span class="btn-cir btn-cir-grey ml5 mt5 fl"><%= @all_count %></span>
<% if User.current.logged? %>
<a href="<%= new_board_message_path(@board.id) %>" class=" task-btn task-btn-green fr">+ 我要发布</a>
<a href="<%= new_board_message_path(@board.id) %>" class="white-btn orange-btn fr">+ 我要发布</a>
<% end %>
</div>
<div id="course-boardlist_new">

View File

@ -20,7 +20,7 @@
<p id="e_tip_in" style="margin-left: 10%" class="c_grey"></p>
<p id="e_tips_in" style="margin-left: 10%" class="c_grey"></p>
</li>
<li class="clearfix">
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="$('#challenge_shixun_answer_update').submit();">保存</a>
<% if @challenge.answer %>
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3) %>" class="task-btn fr mr10" id="answer_cancel">取消</a>
@ -30,7 +30,7 @@
<script>
answer_editormd = editormd("challenge_answer", {
width : "89.6%",
height : 600,
height : 400,
syncScrolling : "single",
//你的lib目录的路径我这边用JSP做测试的
path : "/editormd/lib/",

View File

@ -0,0 +1,10 @@
<li class="fl <%= @index.nil? ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="color-black">本关任务</a>
</li>
<% @challenge.challenge_chooses.each_with_index do |choose, index| %>
<li class="fl <%= @index == index ? "check_nav" : "" %>">
<a href="<%= choose_type_show_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => choose.id, :index => index) %>" class="color-black" data-remote="true">
<%= (index + 1).to_s + (choose.category == 1 ? ".单选题" : ".多选题") %>
</a>
</li>
<% end %>

View File

@ -0,0 +1,105 @@
<div class="stage-part-2 mt20" id="">
<ul class="nav_check_item border-bottom-orange clearfix">
<div id="challenge_choose_tab">
<%= render :partial => "challenges/choose_tab" %>
</div>
<a href="javascript:void(0)" class="fr white-btn green-btn white_bg addoption-btn">+&nbsp;多选题</a>
<a href="javascript:void(0)" class="fr mr10 white-btn green-btn white_bg addoption-btn">+&nbsp;单选题</a>
</ul>
<div id="task_content" class="task-pm-box mh550 user_bg_shadow">
<div class="panel-form" id="task_show_page">
<div id="task_pass_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) %>" class="shixun-task-btn task-btn-green fr" data-remote="true">编辑</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">
<%= @challenge.subject %>
</div>
</li>
<li class="clearfix">
<label class="panel-form-label fl"><span class="c_red mr5">*</span>过关任务:</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li" id="challenge_task_pass_show" style="width: 90%;background: #fff!important;">
<textarea style="display:none;"><%= @challenge.task_pass %></textarea>
</div>
</li>
</ul>
</div>
</div>
</div>
<div id="set_content" class="task-pm-box mh550 user_bg_shadow undis">
<%#= render :partial => "single_or_multiple_question" %>
</div>
<%#= render :partial => 'single_or_multiple_question_show'%>
</div>
<script>
editormd.loadKaTeX(function() {
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
});
//添加单选、多选tab
$(".addoption-btn").on("click",function(){
var length= $(".stage-part-2").find(".nav_check_item li").length;
if(length<11){
var title=$(this).html();
var category = title.indexOf("多选")>0 ? 2 : 1;
if(title.indexOf("多选")>0){//多选
title="多选题";
}else{
title="单选题";
}
var li_con=length+".<span>"+title+"</span>";
var html="<li class=\"fl check_nav\"><a href=\"javascript:void(0)\" class=\"color-black\">"+li_con+"</a></li>";
$(".stage-part-2").find(".nav_check_item li").removeClass("check_nav");
$(".stage-part-2").find(".nav_check_item li").eq(length-1).after(html);
$.ajax({
url: "<%= add_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>",
dateType: "script",
data: {category: category, position: length},
success: function(){
}
})
}
// editor_tigan();
});
//删除单选、多选tab
$(".deloption-btn").on("click",function(){
var index=0;
for(var i=1;i<$(".stage-part-2").find(".nav_check_item li").length;i++){
var length=$(".stage-part-2").find(".nav_check_item li").length;
var item=$(".stage-part-2").find(".nav_check_item li");
if(item.eq(i).hasClass("check_nav")){
if(length>1){
item.eq(0).addClass("check_nav");
item.eq(i).remove();
}
}
}
for(var i=1;i<$(".stage-part-2").find(".nav_check_item li").length;i++){
var item=$(".stage-part-2").find(".nav_check_item li");
item.eq(i).html(i+".<span>"+item.eq(i).find("span").html()+"</span>");
}
})
//第二个ul tab的切换事件
$(".stage-part-2").find(".nav_check_item li a").live("click",function(){
if($(".nav_check_item li").length>1){
$(".nav_check_item li").removeClass("check_nav");
$(this).parent().addClass("check_nav");
}
})
</script>

View File

@ -6,10 +6,11 @@
<% end %>
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
<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 => 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>
<% 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 %>">
@ -17,10 +18,8 @@
<span class="panel-inner-icon mr10 fl mt5">
<% if challenge.st == 0 %>
<i class="fa fa-code font-16 color_white" data-tip-down="实践任务"></i>
<% elsif challenge.st == 1 %>
<% else %>
<i class="fa fa-th-list color_white" data-tip-down="多选任务"></i>
<% elsif challenge.st == 2 %>
<img src="/images/bigdata/singel.png" style="margin-bottom: 3px" data-tip-down="单选任务">
<% end%>
</span>
<!-- <i class="fa fa-dot-circle-o font-18 color-green mr10"></i>-->

View File

@ -23,30 +23,32 @@
</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 <%= question.right_key ? 'color-orange03' : '' %>"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 task-bg-grey break_full_word">
<!--<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 <%= question.right_key ? 'color-orange03' : '' %>"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 task-bg-grey break_full_word">
<!--<input name="select_single[]" value="" type="radio" class="ml-3 mr5 magic-radio" >-->
<label><%= question.option_name %></label>
</div>
</li>
<% end %>
</ul>
<% if false%>
<% 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 <%= question.right_key ? 'color-orange03' : '' %>"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 task-bg-grey break_full_word">
<!--<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 <%= question.right_key ? 'color-orange03' : '' %>"><span class="mr10"><%= (question.position+ 65).chr %>.</span></label>
<div class="fl panel-box-sizing panel-form-width-690 task-bg-grey break_full_word">
<!--<input name="select_single[]" value="" type="radio" class="ml-3 mr5 magic-radio" >-->
<label><%= question.option_name %></label>
</div>
</li>
<% end %>
</ul>
<% end %>
<% end %>
<% end %>
<% if @challenge.subject.blank? || !@editor.blank? %>

View File

@ -27,7 +27,7 @@
<span style="display: none" class="c_red ml90" id="new_shixun_score">分值设定不能为空</span>
</li>
<div class="prop-notice-info mb10 ml95">
<div class="prop-notice-info mb10" style="margin-left: 10%">
<ol>
<% if @st == 0 %>
<li>如果学员查看了参考答案,则不能得到相应的经验值</li>

View File

@ -0,0 +1,510 @@
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
<%= javascript_include_tag '/editormd/editormd.min.js','/editormd/examples/js/jquery.min.js' %>
<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, <%= @category %>);" 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>
<%= form_for("", :url => "", :html => {:id => 'challenge_choose_update'}) do |f| %>
<%#= form_tag(url_for(new_or_edit_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :type => @type, :position => @position)), :remote => true, :id => 'challenge_choose_update') do |f| %>
<li class="clearfix pt30 pr30">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" >编辑</a>
<a href="javascript:void(0)" class="task-btn fr mr10 deloption-btn" id="skill_cancel">删除</a>
</li>
<div class="panel-form">
<div id="shixun_form">
<li class="clearfix">
<label class="panel-form-label fl"><span class="c_red mr5">*</span>题干:</label>
<div id="challenge_choose_subject" class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li">
<textarea name="choose[subject]"><%= @challenge_choose.try(:subject) %></textarea>
</div>
<span style="display: none;margin-left: 10%;" class="c_red" id="new_shixun_pass">题干不能为空</span>
</li>
<% if @challenge_choose.blank? %>
<li class="clearfix pr">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @category %>);" 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, <%= @category %>);" 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, <%= @category %>);" 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, <%= @category %>);" 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>
<% else%>
<% @challenge_choose.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, <%= @challenge_choose.category %>);" name="option_span" title="点击设置答案"><%= (question.try(: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.try(: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 %>
<% 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"><%= @challenge_choose.blank? ? "E" : (@challenge_choose.challenge_questions.count + 65).chr %></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: 10%">温馨提示:点击选项,可以直接设置答案</label><label class="fr">标准答案:<span id="current-option" class="color-orange"><%= @challenge_choose.blank? ? "请点击正确选项" : @challenge_choose.try(:standard_answer) %></span></label></li>
<input type="hidden" name="standard_answer" value="<%= @challenge_choose.try(:standard_answer) %>">
</ul>
</div>
</div>
<p class="bor-bottom-greyE"></p>
<!--参考答案-->
<li class="clearfix" style="line-height:1.9;">
<label class=" panel-form-label fl"> 参考答案:</label>
<div id="challenge_choose_answer" class="new_li">
<textarea name="choose[answer]"><%= @challenge_choose.try(:answer) %></textarea>
</div>
<p id="e_tip_in" style="margin-left: 10%" class="c_grey"></p>
<p id="e_tips_in" style="margin-left: 10%" class="c_grey"></p>
</li>
<p class="bor-bottom-greyE"></p>
<!--经验值设置-->
<div class="panel-form">
<div id="shixun_form">
<li class="clearfix">
<label class="panel-form-label fl"><span class="c_red mr5">*</span>难易度:</label>
<span class="fl mt3 mr10">
<input id="challenge_difficulty_1" class="magic-radio" name="challenge[difficulty]" type="radio" value="1" <%= ((@challenge_choose.try(:difficult) == 1 || @challenge_choose.nil?) ? "checked" : "")%> >
<label for="challenge_difficulty_1">简单</label>
</span>
<span class="fl mt3 mr10">
<input id="challenge_difficulty_2" class="magic-radio" name="challenge[difficulty]" type="radio" value="2" <%= (@challenge_choose.try(:difficult)== 2 ? "checked" : "")%> >
<label for="challenge_difficulty_2">中等</label>
</span>
<span class="fl mt3">
<input id="challenge_difficulty_3" class="magic-radio" name="challenge[difficulty]" type="radio" value="3" <%= (@challenge_choose.try(:difficult) == 3 ? "checked" : "")%> >
<label for="challenge_difficulty_3">困难</label>
</span>
</li>
<li class="clearfix">
<label class="panel-form-label fl"><span class="c_red mr5">*</span>奖励经验值:</label>
<%= select_tag :challenge_score, options_for_select([100, 200]), :name => 'challenge[score]', :class => " fl", :style => "height: 40px; width:170px;" %>
<div class="clear"></div>
<span style="display: none" class="c_red ml90" id="new_shixun_score">分值设定不能为空</span>
</li>
<div class="prop-notice-info mb10" style="margin-left: 10%">
<ol>
<li>如果学员答题错误,则不能得到相应的经验值</li>
<li>如果学员成功得到经验值,那么将同时获得等值的金币奖励,如:+10经验值、+10金币</li>
</ol>
</div>
</div>
</div>
<p class="bor-bottom-greyE"></p>
<!--技能标签-->
<div class="panel-form">
<div id="shixun_form">
<li class="clearfix" style="margin-bottom: 0;">
<label class=" panel-form-label fl"> 技能标签:</label>
<div class="fl task-bd-grey">
<% unless @challenge_choose.blank? %>
<% @challenge_choose.challenge_tags.each do |tag| %>
<div class="task-tag tag-grey mt5 mr10 fl">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="close_tag(this)">×</button>
<input class='knowledge_frame' name='knowledge[input][]' value="<%= tag.try(:name)%>" />
</div>
<% end %>
<% end %>
<div class="task-tag tag-grey mt5 mr10 fl <%= @challenge_choose.blank? ? "undis" : "" %>" id="add_shixun_skill">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
<input type="text" class="task-tag-input" onblur="add_tag();" id="shixun_skill_input" placeholder="请输入技能标签" />
</div>
<a href="javascript:void(0);" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge" style="color: #627bfd;float: left;margin-top: 5px">+添加</a>
</div>
</li>
<p class="color-red" style="height: 25px;margin-left: 10%"><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" style="margin-left: 10%">
<ol>
<li>学员答题正确将获得技能,否则不能获得技能</li>
</ol>
</div>
</div>
</div>
<li class="clearfix pr30 pb30">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_choose_update(<%= @category %>, '<%= @challenge_choose.blank? ? "new" : 'edit' %>')">保存</a>
<a href="javascript:void(0)" class="task-btn fr mr10" id="skill_cancel">取消</a>
</li>
<% end %>
<script>
subject_editormd = editormd("challenge_choose_subject", {
width : "89.6%",
height : 400,
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
});
choose_answer_editormd = editormd("challenge_choose_answer", {
width : "89.6%",
height : 400,
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
});
//技能标签
var SnSkill = $(".knowledge_frame").length;
function add_tag(){
var num = $(".task-bd-grey").children('div').length;
var val = $(".task-tag-input").val().trim();
if (val != ""){
testLength = $(".task-tag-input").val().trim().length;
$("#add_shixun_skill").before("<div class='task-tag tag-grey mt5 mr10 fl' id='knowledge_" + num + "'>" +
"<button data-dismiss='alert' class='close fr mt3 ml5' type='button' onclick='close_tag(this)'>×</button>" +
"<input style='width:"+ testLength*12 +"px' class='knowledge_frame' name='knowledge[input][]' value='" + val +"'>" +
" </div>");
$(".task-tag-input").attr("value","");
}
$("#shixun_skill_input").val("");
$("#add_shixun_skill").hide();
var nSkill = $(".knowledge_frame");
console.log(nSkill.length);
if (nSkill.length > 0){
//$("#challenge_skill_update").submit(); //当增加或者保存技能标签以后执行保存操作
}else{
$("#stage_name_notice").show();
}
}
function close_tag(thisObj){
// 获取父节点的id
var obj = $(thisObj).parent();
$(obj).remove();
//$("#challenge_skill_update").submit();
}
$(function(){
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
$(".option_icon_add").on('click', 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();
});
$(".option_icon_add").on('click', 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("请点击正确选项");
}
});
$("#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 == 1){
//单选
$(".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());
$("input[name='standard_answer']").val($("#current-option").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;
}
// 根据难易程度设置不同的奖励经验值(适用新建与编辑模式)
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/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/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/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/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/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/index + ">"+ i/index +"</option>");
}
});
/* function challenge_score_update(){
if($("#challenge_score").val().trim()==""){
$("#challenge_score").focus();
$("#new_shixun_score").show();
}else{
$('#challenge_score_update').submit();
}
}*/
$("#score_cancel").click(function(){
$("#scoring_edit").hide();
$("#scroe_show").show();
});
function challenge_choose_update(st, action){
set_choice_answer();
var error = $("#choice_error_tip");
if($('#challenge_choose_subject textarea').val().trim() == ""){
$("#challenge_choose_subject textarea").focus();
$("#new_shixun_name").show();
}else if($("#challenge_choose_answer textarea").val().trim() == ""){
$("#challenge_choose_answer textarea").focus();
$("#new_shixun_pass").show();
}else if(judge_choice_contents()){
error.html("选项不能为空").show();
}else{
if(st == "1"){
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{
if(action == "new"){
$.ajax({
url: "<%= new_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :category => @category, :position => @position) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}else{
$.ajax({
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position ) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}
}
}else if(st == "2"){
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{
if(action == "new"){
$.ajax({
url: "<%= new_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :category => @category, :position => @position) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}else{
$.ajax({
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}
}
}else{
if(action == "new"){
$.ajax({
url: "<%= new_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :category => @category, :position => @position) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}else{
$.ajax({
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position) %>",
data: $("#challenge_choose_update").serialize(),
type: 'POST',
dataType: "script",
success: function(){
}
});
}
}
}
}
</script>

View File

@ -0,0 +1,109 @@
<div class="white_bg">
<div class="panel-form">
<li class="clearfix pr30">
<a href="<%= edit_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.id, :index => @index) %>" data-remote="true" class="task-btn task-btn-green fr">编辑</a>
<a href="<%= destroy_challenge_choose_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.id) %>" data-method="delete" class="task-btn fr mr10 deloption-btn">删除</a>
</li>
<li class="clearfix">
<label class="panel-form-label fl">题干:&nbsp;&nbsp;</label>
<div class="fl panel-box-sizing panel-form-width-690 new_li white_bg bor-grey-e" id="challenge_choose_subject_show" style="width: 90%;">
<textarea name="choose[subject]"><%= @challenge_choose.subject %></textarea>
</div>
</li>
<% @challenge_choose.challenge_questions.each_with_index do |option, index| %>
<li class="clearfix">
<label class="panel-form-label fl <%= option.right_key ? 'color-orange03' : '' %>"><%= (option.position+ 65).chr %>&nbsp;&nbsp;</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 color-grey3">
<%= option.option_name %>
</div>
</li>
<% end %>
</div>
<p class="bor-bottom-greyE"></p>
<div class="panel-form">
<li class="clearfix">
<label class="panel-form-label fl">参考答案:&nbsp;&nbsp;</label>
<div class="fl panel-box-sizing panel-form-width-690 new_li white_bg bor-grey-e" id="choose_task_pass_show" style="width: 90%;">
<textarea name="choose[subject]"><%= @challenge_choose.answer %></textarea>
</div>
</li>
</div>
<p class="bor-bottom-greyE"></p>
<div class="panel-form">
<li class="clearfix">
<label class="panel-form-label fl">难易度:&nbsp;&nbsp;</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 color-grey3">
<%= difficulty_type @challenge_choose.difficult %>
</div>
</li>
<li class="clearfix">
<label class="panel-form-label fl">奖励经验值:&nbsp;&nbsp;</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 color-grey3">
<%= @challenge_choose.score.nil? ? 0 : @challenge_choose.score %>分
</div>
</li>
</div>
<p class="bor-bottom-greyE"></p>
<div class="panel-form">
<li class="clearfix">
<label class="panel-form-label fl">技能标签:&nbsp;&nbsp;</label>
<div class="fl task-inputs">
<% if @challenge_choose.challenge_tags.blank? %>
<% else %>
<% @challenge_choose.challenge_tags.each do |tag| %>
<div class="task-tag tag-grey mb10 mr10 fl">
<%= tag.name %>
</div>
<% end %>
<% end %>
</div>
</li>
</div>
</div>
<script>
$(document).ready(function() {
editormd.loadKaTeX(function() {
var taskPassMD = editormd.markdownToHTML("challenge_choose_subject_show", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
var taskPassMD = editormd.markdownToHTML("choose_task_pass_show", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
});
});
/* //技能标签
var SnSkill = $(".knowledge_frame").length;
function add_tag(){
var num = $(".task-inputs").children('div').length;
var val = $(".tags").val().trim();
if (val != ""){
testLength = $(".tags").val().trim().length;
$("#add_shixuns_skill").before("<div class='task-tag tag-grey mt5 mr10 fl' id='knowledge_" + num + "'>" +
"<button data-dismiss='alert' class='close fr mt3 ml5' type='button' onclick='close_tag(this)'>×</button>" +
"<input style='width:"+ testLength*12 +"px' class='knowledge_frame' name='knowledge[input][]' value='" + val +"'>" +
" </div>");
$(".tags").attr("value","");
}
$("#shixuns_skill_input").val("");
$("#add_shixuns_skill").hide();
var nSkill = $(".knowledge_frame");
console.log(nSkill.length);
}
function close_tag(thisObj){
// 获取父节点的id
var obj = $(thisObj).parent();
$(obj).remove();
}*/
</script>

View File

@ -11,15 +11,15 @@
<% end %>
<% end %>
<div class="task-tag tag-grey mt5 mr10 fl <%#= @challenge_tags.count > 0 ? "undis" : "" %>" id="add_shixun_skill">
<div class="task-tag tag-grey mt5 mr10 fl <%= @challenge_tags.count > 0 ? "undis" : "" %>" id="add_shixun_skill">
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
<input type="text" class="task-tag-input" onblur="add_tag();" id="shixun_skill_input" placeholder="请输入技能标签" />
</div>
<a href="javascript:void(0);" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge" style="color: #627bfd;float: left;margin-top: 5px">+添加</a>
</div>
</li>
<p class="color-red ml95" style="height: 25px;"><span id="stage_name_notice" style="display: none;"><i class="fa fa-exclamation-circle color-red mr5"></i>技能标签不能为空</span></p>
<div class="prop-notice-info mb10 ml40">
<p class="color-red" style="height: 25px;margin-left: 10%"><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" style="margin-left: 10%">
<ol>
<% if @st == 0 %>
<li>学员未参考答案通过了本阶段的评测时将获得技能,否则不能获得技能</li>
@ -29,10 +29,10 @@
</ol>
</div>
<!--<li class="clearfix">-->
<!--<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_skill_update();">保存</a>-->
<!--<a href="<%#= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="task-btn fr mr10" id="skill_cancel">取消</a>-->
<!--</li>-->
<li class="clearfix">
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_skill_update();">保存</a>
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="task-btn fr mr10" id="skill_cancel">取消</a>
</li>
</div>
<script type="text/javascript">

View File

@ -0,0 +1,5 @@
<ul class="" id="task_pass_edit">
<%= labelled_form_for @challenge, :url => shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 1), :html => {:id => "challenge_shixun_update"} do |f| %>
<%= render :partial => "task_pass_form", :locals => {:f => f} %>
<% end %>
</ul>

View File

@ -34,66 +34,8 @@
<p id="e_tips_in" style="margin-left: 10%" class="c_grey"></p>
<span style="display: none;margin-left: 10%;" class="c_red" id="new_shixun_pass">过关任务不能为空</span>
</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(<%= @st %>)">保存</a>
<a href="javascript:void(0);" class="task-btn task-btn-green fr" onclick="challenge_update()">保存</a>
<% if params[:action] == "new" %>
<a href="<%= shixun_challenges_url(@shixun) %>" class="task-btn fr mr10" id="task_pass_cancel">取消</a>
<% else %>
@ -128,7 +70,26 @@
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
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>",//url
onload: function(){
$("#challenge_task_pass [type=\"latex\"]").bind("click", function(){
taskpass_editormd.cm.replaceSelection("```latex");
taskpass_editormd.cm.replaceSelection("\n");
taskpass_editormd.cm.replaceSelection("\n");
taskpass_editormd.cm.replaceSelection("```");
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
taskpass_editormd.cm.setCursor(__Cursor.line-1, 0);
});
$("#challenge_task_pass [type=\"inline\"]").bind("click", function(){
taskpass_editormd.cm.replaceSelection("$$$$");
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
taskpass_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
taskpass_editormd.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式");
}
});
var bt = baidu.template;
@ -250,27 +211,6 @@
var lens = answer.length;
return lens;
}
window.onload = function(){
$("#challenge_task_pass [type=\"latex\"]").bind("click", function(){
taskpass_editormd.cm.replaceSelection("```latex");
taskpass_editormd.cm.replaceSelection("\n");
taskpass_editormd.cm.replaceSelection("\n");
taskpass_editormd.cm.replaceSelection("```");
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
taskpass_editormd.cm.setCursor(__Cursor.line-1, 0);
});
$("#challenge_task_pass [type=\"inline\"]").bind("click", function(){
taskpass_editormd.cm.replaceSelection("$$$$");
var __Cursor = taskpass_editormd.cm.getDoc().getCursor();
taskpass_editormd.cm.setCursor(__Cursor.line, __Cursor.ch-2);
taskpass_editormd.cm.focus();
});
$("[type=\"inline\"]").attr("title", "行内公式");
$("[type=\"latex\"]").attr("title", "多行公式");
};
$("#challenge_subject").keydown(function(){
$("#new_shixun_name").hide();
});
@ -282,7 +222,20 @@
$("#task_pass_show").show();
$("#task_pass_edit").hide();
});
function challenge_update(st){
function challenge_update(){
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{
$('#challenge_shixun_update').submit();
}
}
/* function challenge_update(st){
set_choice_answer();
var error = $("#choice_error_tip");
if($('#challenge_subject').val().trim() == ""){
@ -318,6 +271,6 @@
$('#challenge_shixun_update').submit();
}
}
}
}*/
</script>

View File

@ -0,0 +1 @@
$("#task_content").html("<%= j(render :partial => "single_or_multiple_question") %>");

View File

@ -0,0 +1,2 @@
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");

View File

@ -22,13 +22,9 @@
<span class="panel-inner-icon mr10 fl mt5">
<i class="fa fa-code font-16 color_white" data-tip-down="实践任务"></i>
</span>
<% elsif @st == 1 %>
<% else %>
<span class="panel-inner-icon mr10 fl mt5">
<i class="fa fa-th-list color_white" data-tip-down="多选任务"></i>
</span>
<% elsif @st == 2%>
<span class="panel-inner-icon mr10 fl mt5">
<img src="/images/bigdata/singel.png" style="margin-bottom: 3px" data-tip-down="单选任务">
<i class="fa fa-th-list color_white" data-tip-down="选择题任务"></i>
</span>
<% end %>
<h3 class="fl mt3">阶段详情(第<%= @challenge.position %>关)</h3>
@ -40,51 +36,55 @@
<% end %>
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<!-- <a href="<%#= new_shixun_challenge_path(@shixun) %>" class="shixun-task-btn task-btn-green fr">新建阶段</a>-->
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr">+实践任务</a>
<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>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 0) %>" class="shixun-task-btn task-btn-green fr" data-tip-down="新增代码编辑类型的任务">+实践任务</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>-->
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10" data-tip-down="新增选择题类型的任务">+选择题任务</a>
<% end %>
</div>
</div>
<ul class="nav_check_item clearfix mt30" style="margin-bottom: 0;">
<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 %>
<li class="fl <%= @tab == 2 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 2) %>" class="color-black">评测设置</a>
<% if @challenge.st == 0 %>
<div class="stage-part mt20">
<ul class="nav_check_item border-bottom-orange clearfix">
<li class="fl <%= @tab == 1 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 1) %>" class="color-black">本关任务</a>
</li>
<li class="fl <%= @tab == 2 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 2) %>" class="color-black">评测设置</a>
</li>
<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>
<% 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>
<% unless @challenge.ready_knowledge.blank? %>
<li class="fl <%= @tab == 6 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="color-black">背景知识</a>
</li>
<% end %>
<li class="fl <%= @tab == 4 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
</li>
<li class="fl <%= @tab == 5 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="color-black">技能标签</a>
</li>
</ul>
<div class="task-pm-box mh550 user_bg_shadow">
<% if @tab == 1 || @tab.blank? %>
<%= render :partial => "edit_task_pass" %>
<% elsif @tab == 2 %>
<%= render :partial => "edit_evaluating" %>
<% elsif @tab == 3 %>
<%= render :partial => "edit_answer" %>
<% elsif @tab == 4 %>
<%= render :partial => "edit_scoring" %>
<% elsif @tab == 5 %>
<%= render :partial => "edit_skill" %>
<% elsif @tab == 6 %>
<%= render :partial => "edit_propaedeutics" %>
<% end %>
</div>
<li class="fl <%= @tab == 4 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
</li>
<li class="fl <%= @tab == 5 ? "check_nav" : "" %>">
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 5) %>" class="color-black">技能标签</a>
</li>
</ul>
<div class="task-pm-box mh550 user_bg_shadow">
<% if @tab == 1 || @tab.blank? %>
<%= render :partial => "edit_task_pass" %>
<% elsif @tab == 2 %>
<%= render :partial => "edit_evaluating" %>
<% elsif @tab == 3 %>
<%= render :partial => "edit_answer" %>
<% elsif @tab == 4 %>
<%= render :partial => "edit_scoring" %>
<% elsif @tab == 5 %>
<%= render :partial => "edit_skill" %>
<% elsif @tab == 6 %>
<%= render :partial => "edit_propaedeutics" %>
<% end %>
</div>
</div>
<% else %>
<%= render :partial => "choose_type" %>
<% end %>
</div>
<div class="save-tip">
<div class="save-tip-content">已保存</div>

View File

@ -0,0 +1 @@
$("#task_show_page").html('<%= j(render :partial => "task_edit_page") %>');

View File

@ -0,0 +1,2 @@
$("#task_content").html("<%= j(render :partial => "single_or_multiple_question") %>");
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");

View File

@ -0,0 +1,2 @@
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");

View File

@ -0,0 +1 @@
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");

View File

@ -0,0 +1,2 @@
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");

View File

@ -7,49 +7,27 @@
$(document).ready(function(){
$("#relateProject,.relatePInfo").mouseover(function(){
$(".relatePInfo").css("display","block");
})
});
$("#relateProject,.relatePInfo").mouseout(function(){
$(".relatePInfo").css("display","none");
})
// $(".homepagePostPortrait").mouseover(function(){
// onImage = true;
// $(this).children(".userCard").css("display","block");
// })
// $(".homepagePostPortrait").mouseout(function(){
// var cur = $(this);
// onImage = false;
// setTimeout(function(){
// if (onUserCard == false && onImage == false){
// $(cur).children(".userCard").css("display", "none");
// }
// }, 500);
// })
// $(".userCard").mouseover(function(){
// onUserCard = true;
// $(this).css("display","block");
// })
// $(".userCard").mouseout(function(){
// onUserCard = false;
// $(this).css("display","none");
// });
});
$(".coursesLineGrey").mouseover(function(){
$(this).css("color","#ffffff");
})
});
$(".coursesLineGrey").mouseout(function(){
$(this).css("color","#808080");
})
});
$(".homepagePostSetting,.coursesLineGrey").mouseover(function(){
$(this).prev().css("color","#ffffff");
$(this).css("z-index", "9999");
})
});
$(".homepagePostSetting").mouseout(function(){
$(this).prev().css("color","#808080");
$(this).css("z-index", "1");
})
});
})
</script>
<style type="text/css">
</style>
<% course_activities.includes(:course_act).each do |activity| if course_activities %>
<script>
$(function () {
@ -79,13 +57,5 @@
<% end %>
<% if course_activities.count + page * 10 < @course_activities_count %>
<!--<div id="show_more_course_activities" class="loadMore mt10 f_grey">点击展开更多<%#= link_to "", course_activity_path(@course.id, :type => type, :page => page), :id => "more_course_activities_link", :remote => "true", :class => "none" %></div>-->
<%= link_to "点击展开更多",course_activity_path(@course.id, :type => type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<%= link_to "点击展开更多",course_path(@course, :type => @type, :page => page),:id => "show_more_course_activities",:remote => "true",:class => "loadMore mt10 f_grey"%>
<% end %>
<!--
<script type="text/javascript">
$("#show_more_course_activities").mouseover(function () {
$("#more_course_activities_link").click();
});
</script>-->

View File

@ -0,0 +1,15 @@
<div class="homepageRightBanner user_bg_shadow bor-grey-e" style="width:973px;" >
<div class="NewsBannerName">
<%= get_acts_list_type @type %>
</div>
<div class="fr mt3">
<%= link_to "全部", {:controller => "courses", :action => "show", :type => nil}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type.nil? ? 'active' : ''} fl"%>
<%= link_to "普通作业", {:controller => "courses", :action => "show", :type => "common_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'common_homework' ? 'active' : ''} fl"%>
<%= link_to "实训作业", {:controller => "courses", :action => "show", :type => "shixun_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'shixun_homework' ? 'active' : ''} fl"%>
<%= link_to "资源", {:controller => "courses", :action => "show", :type => "attachment"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'attachment' ? 'active' : ''} fl"%>
<%= link_to "讨论", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
</div>
</div>
<%= render :partial => 'courses/course_activity', :locals => {:course_activities => @course_activities,:page => 0,:type => @type} %>

View File

@ -41,13 +41,13 @@
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">总学时&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="period" id="new_class_period" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_class_period('new');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<input type="text" name="period" id="new_class_period" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_class_period('new');" placeholder="例如30" maxlength="6">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_class_period_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl color-dark-grey">学分&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="new_course_credit" name="credit" maxlength="4" onkeyup="regex_course_credit('new');" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_credit('new');" placeholder="例如&nbsp;&nbsp;4">
<input type="text" id="new_course_credit" name="credit" maxlength="4" onkeyup="regex_course_credit('new');" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_credit('new');" placeholder="例如4">
<div class="cl"></div>
<span class="color-orange fl none" id="new_course_credit_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数或保留一位小数的浮点数</span>
</li>
@ -80,7 +80,7 @@
</div>
</div>
</div>
<style>body{background: #ffffff}</style><!--后续要删除-->
<script>
$(function(){
var course_list_name = "";

View File

@ -1,12 +1,20 @@
<%= javascript_include_tag 'jquery.datetimepicker.js' %>
<div class="stud-class-set">
<div class="set-top mb15 clearfix user_bg_shadow">
<span class="fl pl20 font-16">设置</span>
<%= link_to '返回', course_path(@course), :class => 'fr mr15 link-color-grey' %>
<div class="set-top mb20 clearfix user_bg_shadow bor-grey-e">
<span class="fl pl20 font-16">成员管理</span>
<%= link_to '返回', course_path(@course), :class => 'fr mr20 color-orange05' %>
</div>
<div class="news">
<div class="nav clearfix user_bg_shadow">
<!--<ul id="edu-tab-nav" class="border-bottom-orange">
<li class="new-tab-nav background-orange">
<a href="javascript:void(0)" class="color-black">成员管理</a>
</li>
<li class="new-tab-nav">
<a href="javascript:void(0)" class="color-black">基本信息</a>
</li>
</ul>-->
<!--<div class="nav clearfix user_bg_shadow">
<p class="fl font-16 sheet" data-option="basic">
基本信息<i class="fa fa-caret-down color-blue font-12" aria-hidden="true"></i>
</p>
@ -16,15 +24,32 @@
<i class="fa fa-caret-down color-blue font-12" style="display:none;" aria-hidden="true"></i>
</p>
<!--<p class="fl font-16" data-option="module">-->
<p class="fl font-16" data-option="module">-->
<!--模块设置-->
<!--<i class="fa fa-caret-down color-blue font-12" style="display:none;z-index:100;" aria-hidden="true"></i>-->
<!--</p>-->
</div>
<!--</p>
</div>-->
<div class="container">
<!-----------------成员管理模块-------------------------------->
<div class="member for-content-0 for-content">
<!--<div class="top mb20 user_bg_shadow_notop bor-grey-e">
<p class="clearfix">
<a href="javascript:void(0);" id="constration" onclick="add_new_group(<%#= @course.id %>);" class="constration white-btn orange-btn"> 添加分班</a>
</p>
<%# if @course.course_groups.count > 0 %>
<input type="checkbox" id="choose_group_allow" class="check mt20 magic-checkbox" onclick="update_choose_group_allow(<%#= @course.id %>);" <%#= @course.choose_group_allow ? 'checked' : ''%> value="1"/>&nbsp;&nbsp;<label for="choose_group_allow" class="color-grey"><span class="color-dark-grey">允许选班</span>(选中后学生可以自己选择分班,否则只有教师和助教可以为学生选择分班)</label>
<%# end %>
</div>-->
<div id="setting_teacher_list">
<%= render :partial => 'courses/settings/members' %>
</div>
<div id="setting_student_list">
</div>
</div>
<!----------------基本信息模块----------------------->
<div class="basic user_bg_shadow_notop" style="min-height: 570px;">
<div class="basic user_bg_shadow_notop for-content-1 for-content bor-grey-e" style="display:none;" style="min-height: 570px;">
<%= labelled_form_for @course, :html => {:remote => true} do |f| %>
<div class="bottom">
<ul>
@ -33,7 +58,7 @@
<label class="panel-form-label label fl"><span class="color-orange mr5">*</span>课程名称&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<div class="pr fl with75">
<input type="text" name="course[course_list]" autocomplete="off" style="width: 100%;" id="edit_course_list" value="<%= @course.course_list_name %>" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如:数据结构">
<input type="text" name="course[course_list]" autocomplete="off" style="width: 100%;" id="edit_course_list" value="<%= @course.course_list_name %>" class="task task-height-40 panel-box-sizing fl color-dark-grey" maxlength="100" placeholder="例如:数据结构">
<ul class="course_list_ul">
</ul>
</div>
@ -43,7 +68,7 @@
<li class="pt20 clearfix mb40">
<label class="panel-form-label label fl"><span class="color-orange mr5">*</span>课堂名称&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<input type="text" name="course[name]" id="edit_course_name" value="<%= @course.name %>" class="task task-height-40 panel-box-sizing fl color-grey" maxlength="100" placeholder="例如数据结构2016秋季班级" onkeyup="regex_course_name('edit');">
<input type="text" name="course[name]" id="edit_course_name" value="<%= @course.name %>" class="task task-height-40 panel-box-sizing fl color-dark-grey" maxlength="100" placeholder="例如数据结构2016秋季班级" onkeyup="regex_course_name('edit');">
<div class="cl"></div>
<span class="color-orange fl none" id="edit_course_name_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>课堂名称不能为空且至少有两个字符</span>
<div class="cl"></div>
@ -64,19 +89,19 @@
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl">总学时&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="period" id="edit_class_period" value="<%= @course.class_period %>" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_class_period('edit');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<input type="text" name="period" id="edit_class_period" value="<%= @course.class_period %>" class="task task-height-40 panel-box-sizing fl color-dark-grey" onkeyup="regex_course_class_period('edit');" placeholder="例如&nbsp;&nbsp;30" maxlength="6">
<div class="cl"></div>
<span class="color-orange fl none" id="edit_course_class_period_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl">学分&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="edit_course_credit" value="<%= @course.credit %>" name="credit" maxlength="4" class="task task-height-40 panel-box-sizing fl color-grey" onkeyup="regex_course_credit('edit');" placeholder="例如&nbsp;&nbsp;4">
<input type="text" id="edit_course_credit" value="<%= @course.credit %>" name="credit" maxlength="4" class="task task-height-40 panel-box-sizing fl color-dark-grey" onkeyup="regex_course_credit('edit');" placeholder="例如&nbsp;&nbsp;4">
<div class="cl"></div>
<span class="color-orange fl none" id="edit_course_credit_notice" style="margin-left:25%;"><i class="fa fa-exclamation-circle mr5" ></i>请输入正整数或保留一位小数的浮点数</span>
</li>
<li class="pt20 clearfix">
<label class="panel-form-label label fl">结束时间&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" id="edit_course_end_date" value="<%= @course.end_date %>" class="task task-height-40 panel-box-sizing fl color-grey" name="end_date" placeholder="请选择结束日期">
<input type="text" id="edit_course_end_date" value="<%= @course.end_date %>" class="task task-height-40 panel-box-sizing fl color-dark-grey" name="end_date" placeholder="请选择结束日期">
<div class="cl"></div>
<div class="tusi"style="left:108% ">
<div class="entry">
@ -102,23 +127,7 @@
</div>
<% end %>
</div>
<!-----------------成员管理模块-------------------------------->
<div class="member" style="display:none;">
<div class="top mb20 user_bg_shadow_notop">
<p class="clearfix">
<a href="javascript:void(0);" id="constration" onclick="add_new_group(<%= @course.id %>);" class="task-btn constration task-btn-green"> 添加分班</a>
</p>
<% if @course.course_groups.count > 0 %>
<input type="checkbox" id="choose_group_allow" class="check mt20 magic-checkbox" onclick="update_choose_group_allow(<%= @course.id %>);" <%= @course.choose_group_allow ? 'checked' : ''%> value="1"/>&nbsp;&nbsp;<label for="choose_group_allow" class="color-grey">允许选班(选中后学生可以自己选择分班,否则只有教师和助教可以为学生选择分班)</label>
<% end %>
</div>
<div id="setting_teacher_list">
<%= render :partial => 'courses/settings/members' %>
</div>
<div id="setting_student_list">
</div>
</div>
<!--------------------模块设置-------------------->
<!--<div class="module" id="setting_moduels_list" style="display:none;">-->
<!--<%#= render :partial => 'courses/settings/moduels' %>-->
@ -126,7 +135,7 @@
</div>
</div>
</div>
<style>body{background: #ffffff}</style><!--后续要删除-->
<script>
var course_list_name = "";
$(function () {
@ -166,6 +175,14 @@
<%# elsif @select_tab == 'module'%>
// $(".stud-class-set .news .nav p[data-option='module']").click();
<% end %>
/*tab切换*/
/*$("#edu-tab-nav li").on("click",function(){
$("#edu-tab-nav li").removeClass("background-orange");
$(this).addClass("background-orange");
$(".for-content").hide();
$(".for-content-"+$(this).index()).show();
})*/
});
$('#edit_course_end_date').datetimepicker({

View File

@ -1,5 +1,5 @@
<div class="people clearfix">
<div class="left fl font-16 user_bg_shadow">
<div class="left fl font-16 user_bg_shadow bor-grey-e">
<ul>
<li data-option="teacher" data-course-id="<%= @course.id %>">
<p class="p1" style="border:none;"><span>教师</span><em class="setting_teacher_count"><%= @teacher_count %></em></p>
@ -16,9 +16,9 @@
<% @course.course_groups.each do |group| %>
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
<p class="p1">
<span><%= group.name %></span>
<span data-tip-left="<%= group.name %>"><%= group.name %></span>
<em><%= group.members.count %></em>
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
<p class="p2 color-grey">
@ -30,36 +30,63 @@
<% end %>
</ul>
</div>
<div class="right fl user_bg_shadow bc-white">
<div class="right fl user_bg_shadow bor-grey-e bc-white">
<div class="banner clearfix font-16 teacher_banner">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr color-blue font-14">
<a href="javascript:void(0);" onclick="import_students();" class="color-blue font-14">+批量导入学生</a>
<%= link_to '添加学生', search_not_students_course_path(@course), :remote => true, :class => 'color-blue' %>
<%= link_to "导出成绩", export_course_member_excel_course_path(@course, :group_id => 0, :name => @search, :format => 'xls'), :class => 'color-blue' %>
<span class="span1 fl ">成员列表(全部学生)</span>
<span class="span2 fr font-14">
<a href="javascript:void(0);" onclick="import_students();" class="color-blue font-14">+批量导入学生</a>
<%= link_to '添加学生', search_not_students_course_path(@course), :remote => true, :class => 'white-btn orange-btn' %>
<%= link_to "导出成绩", export_course_member_excel_course_path(@course, :group_id => 0, :name => @search, :format => 'xls'), :class => 'white-btn orange-btn' %>
</span>
</div>
<div class="edu-bg " style="min-height:500px;">
<div class="edu-con-top clearfix" >
<p class="fl task-form-60 mt3 ml15 font-14" >
<%= link_to '学号排序', all_student_list_course_path(@course, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-blue' : ''}", :remote => true %>
<span class="mr5 ml5 fl">|</span>
<%= link_to '姓名排序', all_student_list_course_path(@course, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-blue' : ''}", :remote => true %>
</p>
<div class="edu-position fr task-form-30 mr15">
<input type="text" placeholder="输入姓名、学号进行搜索" class="task-form-100 panel-box-sizing" value="<%= @search %>" id="all_student_list_search">
<a href="javascript:void(0);" onclick="submit_all_student_list_search('<%= @course.id %>');" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>
</div>
<div class="pl20 pr20 pt15 pb15 bor-bottom-greyE">
<%= render :partial => 'courses/settings/leading-in_info' %>
</div>
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<div class="pl20 pr15 pt15 pb15 bor-bottom-greyE">
<a href="javascript:void(0);" id="constration" onclick="add_new_group(<%= @course.id %>);" class="constration white-btn orange-btn mb5"> 新建分班</a>
<% if @course.course_groups.count > 0 %>
<input type="checkbox" id="choose_group_allow" class="check magic-checkbox" onclick="update_choose_group_allow(<%= @course.id %>);" <%= @course.choose_group_allow ? 'checked' : ''%> value="1"/>&nbsp;&nbsp;<label for="choose_group_allow" class="color-grey"><span class="color-dark-grey">允许选班</span>(选中后学生可以自己选择分班,否则只有教师和助教可以为学生选择分班)</label>
<% end %>
</div>
<div class="edu-con-top clearfix" >
<!--<p class="fl task-form-60 ml15 font-14" >
<%#= link_to '学号排序', all_student_list_course_path(@course, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-orange03' : ''}", :remote => true %>
<span class="mr5 ml5 fl">|</span>
<%#= link_to '姓名排序', all_student_list_course_path(@course, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-orange03' : ''}", :remote => true %>
</p>-->
<p class="fl task-form-60 ml15">
<a class="mr15 white-btn orange-btn">加入分班</a>
<a class="white-btn">删除</a>
</p>
<div class="edu-find fr mr40 with30 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" placeholder="输入姓名、学号进行搜索" value="<%= @search %>" id="all_student_list_search"/>
<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>
</div>
<a href="javascript:void(0);" onclick="submit_all_student_list_search('<%= @course.id %>');" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
</div>
</div>
<div class="mh550">
<table class="edu-pop-table color-grey edu-txt-center table-pa5 interval-td" style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>
<span class="selectjoin fl open-select ml15" id="allselect">
<input type="checkbox" class="magic-checkbox" id="all_member_select">
<label for="all_member_select" style="top:0px">序号</label>
</span>
</th>
<th>用户ID</th>
<th>姓名</th>
<th>学号</th>
<th>分班</th>
<th>操作</th>
<th>发布资源</th>
<th>发布帖子</th>
<th>回复评论</th>
<!--<th>操作</th>-->
</tr>
</thead>
<tbody>
@ -67,17 +94,26 @@
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<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 style="padding-left:20px;">
<span style="text-align:left; line-height:30px; margin-top:1px;">
<input id="no_group_member_<%= member.id %>" type="checkbox" class="check magic-checkbox" name="member_ids[]" value="<%= member.id %>"/>
<label for="no_group_member_<%= member.id %>"><%= index + 1 + (@page -1) * 20 %></label>
</span>
</td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.login %></span></td>
<td><%= link_to user.show_real_name, user_path(user), :class => 'edu-txt-w140 task-hide mt5 alink-name', :target => '_blank' %></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><a href="javascript:void(0);" class="span5" onclick="delete_confirm_box_2('<%=membership_path(member, :type => 2, :group_id => 0) %>', '确定要从学生列表中删除吗?')">删除</a></td>
<td></td>
<td></td>
<td></td>
<!--<td><a href="javascript:void(0);" class="span5 alink-operate" onclick="delete_confirm_box_2('<%#=membership_path(member, :type => 2, :group_id => 0) %>', '确定要从学生列表中删除吗?')">删除</a></td>-->
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="fr pages_right_min mt10 mb10">
<ul>
@ -88,8 +124,35 @@
</div>
</div>
</div>
<script type="javascript">
//资源库上传附件
<script>
function colse_searchbox(){
$("#all_student_list_search").val("");
$.get(
'/courses/<%= @course.id %>/all_student_list?search='+$("#all_student_list_search").val().trim()
)
}
$(function(){
$("#all_student_list_search").on("keydown", function(event){
var code;
if (!event) {
event = window.event; //针对ie浏览器
code = event.keyCode;
}
else {
code = event.keyCode;
}
if(code == 13) {
$.get(
'/courses/<%= @course.id %>/all_student_list?search='+$("#all_student_list_search").val().trim()
)
return false;
}
});
});
//资源库上传附件
function import_students(){
var htmlvalue = '<%= escape_javascript(render :partial => 'courses/settings/import_students', :locals => {:course => @course}) %>';
pop_box_new(htmlvalue, 440, 490);

View File

@ -12,10 +12,10 @@
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
<p class="p1">
<p class="p1" data-tip-left="<%= group.name %>">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
<p class="p2 color-grey">

View File

@ -1,5 +1,5 @@
<div class="people clearfix">
<div class="left fl font-16 user_bg_shadow">
<div class="left fl font-16 user_bg_shadow bor-grey-e">
<ul>
<li data-option="teacher" data-course-id="<%= @course.id %>">
<p class="p1" style="border:none;"><span>教师</span><em class="setting_teacher_count"><%= @teacher_count %></em></p>
@ -15,10 +15,10 @@
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
<li class="<%= @group.id == group.id ? 'sheet' : '' %>" data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
<p class="p1">
<p class="p1" data-tip-left="<%= group.name %>">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
<p class="p2 color-grey">
@ -30,33 +30,59 @@
<% end %>
</ul>
</div>
<div class="right fl user_bg_shadow bc-white">
<div class="right fl user_bg_shadow bor-grey-e bc-white">
<div class="banner clearfix font-16 teacher_banner">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr color-blue">
<%= link_to "导出成绩", export_course_member_excel_course_path(@course, :group_id => @group.id, :name => @search, :format => 'xls'), :class => 'color-blue font-14' %>
<span class="span2 fr">
<%= link_to "导出成绩", export_course_member_excel_course_path(@course, :group_id => @group.id, :name => @search, :format => 'xls'), :class => 'white-btn orange-btn font-14' %>
</span>
<span class="span2 fr mr10">
<a class="white-btn orange-btn">分班重命名</a>
</span>
<span class="span2 fr mr10">
<a class="white-btn orange-btn">删除分班</a>
</span>
</div>
<div class="edu-bg " style="min-height:500px;">
<div class="edu-con-top clearfix" >
<p class="fl task-form-60 mt3 ml15 font-14" >
<%= link_to '学号排序', has_group_student_list_course_path(@course, :group_id => @group.id, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-blue' : ''}", :remote => true %>
<!--<p class="fl task-form-60 mt3 ml15 font-14" >
<%#= link_to '学号排序', has_group_student_list_course_path(@course, :group_id => @group.id, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-orange03' : ''}", :remote => true %>
<span class="mr5 ml5 fl">|</span>
<%= link_to '姓名排序', has_group_student_list_course_path(@course, :group_id => @group.id, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-blue' : ''}", :remote => true %>
<%#= link_to '姓名排序', has_group_student_list_course_path(@course, :group_id => @group.id, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-orange03' : ''}", :remote => true %>
</p>-->
<p class="fl task-form-60 ml15">
<a class="mr15 white-btn orange-btn">移动到</a>
<a class="white-btn">删除</a>
</p>
<div class="edu-position fr task-form-30 mr15">
<input type="text" placeholder="输入姓名、学号进行搜索" class="task-form-100 panel-box-sizing" value="<%= @search %>" id="has_group_student_list_search">
<a href="javascript:void(0);" onclick="submit_has_group_student_search('<%= @course.id %>', '<%= @group.id %>');" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>
<div class="edu-find fr mr40 with30 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" placeholder="输入姓名、学号进行搜索" value="<%= @search %>" id="has_group_student_list_search"/>
<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>
</div>
<a href="javascript:void(0);" onclick="submit_has_group_student_search('<%= @course.id %>', '<%= @group.id %>');" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
</div>
<!--<div class="edu-position fr task-form-30 mr15">
<input type="text" placeholder="输入姓名、学号进行搜索" class="task-form-100 panel-box-sizing" value="<%#= @search %>" id="has_group_student_list_search">
<a href="javascript:void(0);" onclick="submit_has_group_student_search('<%#= @course.id %>', '<%#= @group.id %>');" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>
</div>-->
</div>
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<div class="mh550">
<table class="edu-pop-table color-grey edu-txt-center table-pa5 interval-td" style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>
<span class="selectjoin fl open-select ml15" id="allselect">
<input type="checkbox" class="magic-checkbox" id="all_member_select">
<label for="all_member_select" style="top:0px">序号</label>
</span>
</th>
<th>用户ID</th>
<th>姓名</th>
<th>学号</th>
<th>操作</th>
<th>发布资源</th>
<th>发布帖子</th>
<th>回复评论</th>
<!--<th>操作</th>-->
</tr>
</thead>
<tbody>
@ -64,16 +90,25 @@
<% @members.each_with_index do |member, index| %>
<% user = member.user %>
<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 style="padding-left:20px;">
<span style="text-align:left; line-height:30px; margin-top:1px;">
<input id="no_group_member_<%= member.id %>" type="checkbox" class="check magic-checkbox" name="member_ids[]" value="<%= member.id %>"/>
<label for="no_group_member_<%= member.id %>"><%= index + 1 + (@page -1) * 20 %></label>
</span>
</td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.login %></span></td>
<td><%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5 alink-name' %></td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span></td>
<td><a href="javascript:void(0);" class="span5" onclick="delete_confirm_box('<%=unjoin_group_courses_path(:member => member.id, :group_id => @group.id) %>', '确定要移除吗?<br/>移除后,该学生需要重新选分班。')">移除</a></td>
<td></td>
<td></td>
<td></td>
<!--<td><a href="javascript:void(0);" class="span5 alink-operate" onclick="delete_confirm_box('<%#=unjoin_group_courses_path(:member => member.id, :group_id => @group.id) %>', '确定要移除吗?<br/>移除后,该学生需要重新选分班。')">移除</a></td>-->
</tr>
<% end %>
<% end %>
</tbody>
</table>
</div>
</div>
<div class="fr pages_right_min mt10">
@ -84,4 +119,32 @@
</div>
</div>
</div>
</div>
</div>
<script>
function colse_searchbox(){
$("#has_group_student_list_search").val("");
$.get(
'/courses/<%= @course.id %>/has_group_student_list?group_id=<%= @group.id %>&search='+$("#has_group_student_list_search").val().trim()
)
}
$(function(){
$("#has_group_student_list_search").on("keydown", function(event){
var code;
if (!event) {
event = window.event; //针对ie浏览器
code = event.keyCode;
}
else {
code = event.keyCode;
}
if(code == 13) {
$.get(
'/courses/<%= @course.id %>/has_group_student_list?group_id=<%= @group.id %>&search='+$("#has_group_student_list_search").val().trim()
)
return false;
}
});
});
</script>

View File

@ -0,0 +1,10 @@
<div class="clearfix">
<p class="fl">
<!--<span class="mr15">学生信息</span>-->
<a class="white-btn orange-btn mr15">+&nbsp;导入学生信息</a>
<span>已导入<span class="color-orange05">1</span>个学生信息列表:<a class="color-orange05" style="cursor: pointer"><i class="fa fa-file-o mr5"></i>全部学生信息列表.xls</a></span>
</p>
<p class="fr">
<a class="white-btn orange-btn">同步成员</a>
</p>
</div>

View File

@ -1,18 +1,18 @@
<div class="people clearfix">
<div class="left fl font-16 user_bg_shadow">
<div class="left fl font-16 user_bg_shadow bor-grey-e">
<ul id="all_teacher_list_ul">
<%= render :partial => 'courses/settings/all_teacher_list_ul' %>
</ul>
</div>
<div class="right fl user_bg_shadow bc-white">
<div class="right fl user_bg_shadow bc-white bor-grey-e">
<div class="banner clearfix font-16 teacher_banner" style="border-bottom:1px solid #eee;">
<span class="span1 fl ">成员列表</span>
<span class="span2 fr color-blue">
<%= link_to '添加教师/助教', search_not_teachers_course_path(@course), :remote => true, :class => 'color-blue font-14' %>
<span class="span1 fl ">成员列表(教师)</span>
<span class="span2 fr color-light-green">
<%= link_to '+&nbsp;教师/助教'.html_safe, search_not_teachers_course_path(@course), :remote => true, :class => 'white-btn orange-btn font-14' %>
</span>
</div>
<div class="edu-bg" style="min-height:500px;">
<table class="edu-pop-table color-grey edu-txt-center table-pa5 " style="border:none;" cellspacing="0" cellpadding="0" >
<table class="edu-pop-table color-grey edu-txt-center table-pa5 interval-td" style="border:none;" cellspacing="0" cellpadding="0" >
<thead>
<tr>
<th>序号</th>
@ -28,15 +28,15 @@
<tr id="setting_member_<%= teacher.id %>">
<td><%= index + 1 %></td>
<td>
<%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %>
<%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5 alink-name' %>
</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>
<td>
<% if User.current == @course.teacher && user.id == @course.tea_id %>
<a href="javascript:void(0);" class="span5 changeadmin" onclick="change_manager();">更换管理员</a>
<a href="javascript:void(0);" class="span5 changeadmin alink-operate" onclick="change_manager();">更换管理员</a>
<% elsif user.id != @course.tea_id %>
<a href="javascript:void(0);" class="span5 delete" onclick="delete_confirm_box_2('<%=membership_path(teacher, :type => 1) %>', '确定要从教师列表中删除吗?')">删除</a>
<a href="javascript:void(0);" class="span5 delete alink-operate" onclick="delete_confirm_box_2('<%=membership_path(teacher, :type => 1) %>', '确定要从教师列表中删除吗?')">删除</a>
<% end %>
</td>
</tr>

View File

@ -1,5 +1,5 @@
<div class="people clearfix">
<div class="left fl font-16 user_bg_shadow">
<div class="left fl font-16 user_bg_shadow bor-grey-e">
<ul>
<li data-option="teacher" data-course-id="<%= @course.id %>">
<p class="p1" style="border:none;"><span>教师</span><em class="setting_teacher_count"><%= @teacher_count %></em>
@ -14,10 +14,10 @@
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
<li data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
<p class="p1">
<p class="p1" data-tip-left="<%= group.name %>">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<i class="fa fa-ellipsis-v" aria-hidden="true"></i>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
<p class="p2 color-grey">
@ -29,33 +29,52 @@
<% end %>
</ul>
</div>
<div class="right fl user_bg_shadow bc-white">
<div class="right fl user_bg_shadow bor-grey-e bc-white">
<div class="banner clearfix font-16 teacher_banner">
<span class="span1 fl ">成员列表</span>
<span class="span1 fl ">成员列表(未分班)</span>
</div>
<div class="edu-bg" style="min-height:500px;">
<div class="edu-con-top clearfix">
<p class="fl task-form-60 mt3 ml15 font-14">
<%= link_to '学号排序', no_group_student_list_course_path(@course, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-blue' : ''}", :remote => true %>
<!--<p class="fl task-form-60 mt3 ml15 font-14">
<%#= link_to '学号排序', no_group_student_list_course_path(@course, :order => "student_id", :sort => @sort), :class => "fl #{@order == 'student_id' ? 'color-orange03' : ''}", :remote => true %>
<span class="mr5 ml5 fl">|</span>
<%= link_to '姓名排序', no_group_student_list_course_path(@course, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-blue' : ''}", :remote => true %>
<%#= link_to '姓名排序', no_group_student_list_course_path(@course, :order => "lastname", :sort => @sort), :class => "fl #{@order == 'lastname' ? 'color-orange03' : ''}", :remote => true %>
</p>-->
<p class="fl task-form-60 ml15">
<a class="mr15 white-btn orange-btn">加入分班</a>
<a class="white-btn">删除</a>
</p>
<div class="edu-position fr task-form-30 mr15">
<input type="text" placeholder="输入姓名、学号进行搜索" class="task-form-100 panel-box-sizing" value="<%= @search %>" id="no_group_student_list_search">
<a href="javascript:void(0);" onclick="submit_no_group_student_search('<%= @course.id %>');" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>
<div class="edu-find fr mr40 with30 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" placeholder="输入姓名、学号进行搜索" value="<%= @search %>" id="no_group_student_list_search"/>
<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>
</div>
<a href="javascript:void(0);" onclick="submit_no_group_student_search('<%= @course.id %>');" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
</div>
<!--<div class="edu-position fr task-form-30 mr15">
<input type="text" placeholder="输入姓名、学号进行搜索" class="task-form-100 panel-box-sizing" value="<%#= @search %>" id="no_group_student_list_search">
<a href="javascript:void(0);" onclick="submit_no_group_student_search('<%#= @course.id %>');" class="edu-btn-search font-16 color-grey mt5"><i class="fa fa-search"></i></a>
</div>-->
</div>
<div class="mh550">
<%= form_tag(choose_course_group_course_path(@course), method: 'post', :remote => true, :class => "", :id => "choose_course_group_form") do %>
<table class="edu-pop-table color-grey edu-txt-center table-pa5" style="border:none;" cellspacing="0" cellpadding="0">
<table class="edu-pop-table color-grey edu-txt-center table-pa5 interval-td" style="border:none;" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>
<span class="selectjoin fl open-select ml15" id="allselect">
<input type="checkbox" class="magic-checkbox" id="all_member_select">
<label for="all_member_select" style="top:0px">序号</label>
</span>
</th>
<th>用户ID</th>
<th>姓名</th>
<th>学号</th>
<th>操作</th>
<th>发布资源</th>
<th>发布帖子</th>
<th>回复评论</th>
<!--<th>操作</th>-->
</tr>
</thead>
<tbody>
@ -69,29 +88,33 @@
<label for="no_group_member_<%= member.id %>"><%= index + 1 + (@page -1) * 20 %></label>
</span>
</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><%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5 alink-name' %></td>
<td>
<span class="edu-txt-w140 task-hide mt5"><%= user.user_extensions ? user.user_extensions.student_id : '' %></span>
</td>
<td>
<a href="javascript:void(0);" class="span5" onclick="delete_confirm_box_2('<%=membership_path(member, :type => 2, :group_id => -1) %>', '确定要从学生列表中删除吗?')">删除</a>
</td>
<td></td>
<td></td>
<td></td>
<!--<td>
<a href="javascript:void(0);" class="span5 alink-operate" onclick="delete_confirm_box_2('<%#=membership_path(member, :type => 2, :group_id => -1) %>', '确定要从学生列表中删除吗?')">删除</a>
</td>-->
</tr>
<% end %>
<% end %>
</tbody>
</table>
<% end %>
</div>
<div class="join clearfix color-grey mt20 ml20 pb20">
<span class="selectjoin fl open-select" id="allselect">
<!--<span class="selectjoin fl open-select" id="allselect">
<input type="checkbox" class="magic-checkbox" id="all_member_select">
<label for="all_member_select">全选</label>
</span>
<a href="javascript:void(0);" class="handle_no task-btn task-btn-grey fl ml20">加入分班</a>
<a href="javascript:void(0);" style="display: none;" class="handle task-btn task-btn-blue fl ml20">加入分班</a>
<a href="javascript:void(0);" class="handle_no white-btn orange-btn fl ml20">加入分班</a>
<a href="javascript:void(0);" style="display: none;" class="handle white-btn orange-btn fl ml20">加入分班</a>-->
<div class="fr pages_right_min">
<div class="pages_right_min">
<ul>
<%= pagination_links_full @member_pages, @member_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
@ -100,4 +123,32 @@
</div>
</div>
</div>
</div>
</div>
<script>
function colse_searchbox(){
$("#no_group_student_list_search").val("");
$.get(
'/courses/<%= @course.id %>/no_group_student_list?search='+$("#no_group_student_list_search").val().trim()
)
}
$(function(){
$("#no_group_student_list_search").on("keydown", function(event){
var code;
if (!event) {
event = window.event; //针对ie浏览器
code = event.keyCode;
}
else {
code = event.keyCode;
}
if(code == 13) {
$.get(
'/courses/<%= @course.id %>/no_group_student_list?search='+$("#no_group_student_list_search").val().trim()
)
return false;
}
});
});
</script>

View File

@ -8,26 +8,17 @@
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRight mt0 " style="width:85%; float:left;">
<div class="homepageRightBanner user_bg_shadow" style="width:973px;">
<div class="NewsBannerName">
<%= get_acts_list_type @type %></div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="homepagePostType" style="width:90px; left:-80px;">
<li>
<ul class="homepagePostTypeHomework fl">
<li><%= link_to "全部动态", {:controller => "courses", :action => "show", :type => nil}, :class =>"homepagePostTypeAll postTypeGrey"%></li>
<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 => "journalsForMessage"}, :class => "homepagePostTypeMessage postTypeGrey"%></li>-->
<!--<li><%#= link_to "问卷动态", {:controller => "courses", :action => "show", :type => "poll"}, :class => "homepagePostTypeQuiz postTypeGrey"%></li>-->
</ul>
</li>
</ul>
</li>
</ul>
</div>
<%= render :partial => 'courses/course_activity', :locals => {:course_activities => @course_activities,:page => 0,:type => @type} %>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<div class="homepageRightBanner user_bg_shadow bor-grey-e with100 mb10 clearfix df" style="width:973px;">
<%= link_to '成员管理', settings_course_path(@course, :tab => 'member'), :class => "fl white-btn orange-btn", :style => "flex: 1;text-align: center;" %>
<%= link_to '发布普通作业', new_homework_common_path(:course => @course.id, :homework_type => 1), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %>
<%= link_to '发布实训作业', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %>
<a class="fl white-btn orange-btn ml20" onclick="course_files_upload();" style="flex: 1;text-align: center;">发布资源</a>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<%= link_to '发布帖子', new_board_message_path(:board_id => course_board.id), :class => "fl white-btn orange-btn ml20", :style => "flex: 1;text-align: center;" %>
</div>
<% end %>
<div id="course_activities_content">
<%= render :partial => 'courses/course_activity_content', :locals => {:course_activities => @course_activities} %>
</div>
</div>

View File

@ -1 +1,5 @@
$("#show_more_course_activities").replaceWith("<%= escape_javascript( render :partial => 'courses/course_activity',:locals => {:course_activities => @course_activities, :page => @page,:type => @type} )%>");
<% if params[:page] %>
$("#show_more_course_activities").replaceWith("<%= escape_javascript( render :partial => 'courses/course_activity',:locals => {:course_activities => @course_activities, :page => @page,:type => @type} )%>");
<% else %>
$("#course_activities_content").html("<%= j(render :partial => 'courses/course_activity_content', :locals => {:course_activities => @course_activities, :page => 0}) %>");
<% end %>

View File

@ -1,9 +1,9 @@
<!-- sort: @sort,order:@order,current:"created_on" -->
<% if sort == current %>
<% if order =="asc" %>
<span class="color-orange05"></span>
<% elsif order == "desc" %>
<span class="color-orange05"></span>
<% else %>
<% end %>

View File

@ -42,15 +42,36 @@
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
</span>
</div>
<div class="clear mb10">
<div class="clear">
<input type="hidden" name="attachment_type" value="1">
<%= render :partial => 'attachments/upload_attachment_new_version' %>
<div class="cl"></div>
<!--<a href="javascript:void(0);" class=" fr grey_btn mr40" onclick="closeModal();"><%#= l(:button_cancel)%></a>-->
<!--<a id="submit_resource" href="javascript:void(0);" class="blue_btn fr" onclick="submit_resource();"><%#= l(:button_confirm)%></a>-->
</div>
<p class="clearfix mb10">
<label class="fl c_dark f14" style="margin-top: 4px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;公开:</label>
<span class="fl mr20 ml10">
<input type="checkbox" name="public[]" value="0" id="public_user" class="ml-3 mr5 magic-checkbox">
<label for="public_user">选中后所有用户可见,否则仅课堂成员可见</label>
</span>
</p>
<div class="mb10">
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
<div class="calendar_div fl ml10">
<input type="text" name="publish_time" id="datetimepicker_mask" placeholder="发布时间(可选)" style="width: 130px;" class="InputBox fl calendar_input" readonly="readonly">
</div>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_publish_time();">清空</a>
<div class="cl"></div>
<span class="c_red f12" style="margin-top: 4px;" id="publish_time_notice"></span>
<div class="cl"></div>
</div>
<div class="cl"></div>
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="mr15 mb10 muban_textarea" ><%= @attachment.description %></textarea>
<p>
<label class="fl c_dark f14">资源描述:</label>
<textarea style="resize:none" type="text" placeholder="请在此编辑资源描述" name="description" class="fl ml10 mb10 muban_textarea" ><%= @attachment.description %></textarea>
</p>
<div class="clearfix">
<a href="javascript:void(0);" onclick ="upload_attachment_version(event);" onfocus = 'this.blur()' id='upload_files_submit_btn' class="task-btn task-btn-blue fr">确定</a>
<a href="javascript:void(0);" onclick="attachment_fresh_for_destroy()" class="task-btn fr mr10">取消</a>

View File

@ -10,7 +10,7 @@
</thead>
<tbody>
<tr>
<td ><p class="popup_ziyuan_title"><%= @attachment.filename %><span class="muban_icons_blue ml5">当前版本</span></p></td>
<td ><p class="popup_ziyuan_title fl color-grey3"><%= @attachment.filename %></p><span class="muban_icons_blue ml5">当前版本</span></td>
<td class="text_c"><%= @attachment.downloads %></td>
<td class="text_c"><%= @attachment.try(:quotes).to_i %></td>
<td class="text_c"><%= format_time(@attachment.created_on) %></td>
@ -19,36 +19,35 @@
<% @attachment_histories.each do |history| %>
<tr>
<td ><p class="popup_ziyuan_title">
<td ><p class="popup_ziyuan_title color-grey3">
<%= link_to history.filename, download_history_attachment_path(history.id, history.filename), :title => history.filename+"\n"+history.description.to_s %></p>
</td>
<td class="text_c"><%= history.downloads %></td>
<td class="text_c"><%= history.try(:quotes).to_i %></td>
<td class="text_c"><%= format_time(history.created_on) %></td>
<td class="text_c">
<%= link_to( '删除资源', attachment_path(history.attachment, :history_id => history, :type => "history_delete"),
<%= link_to( '<i class="fa fa-trash color-grey"></i>'.html_safe, attachment_path(history.attachment, :history_id => history, :type => "history_delete"),
:remote => true,
:method => :delete,
:class => "postOptionLink",
:class => "btn") if allow_to_delete_attachment(history) %>
:method => :delete,:class => "mr5") if allow_to_delete_attachment(history) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<p class="color-orange">只删除资源的历史版本,请点击相应版本的删除按钮</p>
<div>
<% if @attachment.container_type == "Project" %>
<%#= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :method => :delete,:class => "fr fontGrey2 mb5 btn", :onclick =>"hideModal();") if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
<% if (is_project_manager?(User.current.id, @attachment.container_id) || User.current.id == @attachment.author_id || User.current.admin?) %>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= attachment_path(@attachment, :history_delete => true) %>', '本资源有多个版本,你确定要全部删除?')" class="fr fontGrey2 mb5 btn">删除所有资源</a>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= attachment_path(@attachment, :history_delete => true) %>', '本资源有多个版本,你确定要全部删除?')" class="fr mb5 white-btn orange-btn">删除所有资源</a>
<% end %>
<% elsif @attachment.container_type == "Course" %>
<%#= link_to( '删除所有资源', attachment_path(@attachment, :history_delete => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5 btn", :onclick =>"hideModal();") if (User.current.allowed_to?(:as_teacher, @attachment.container) || User.current.id == @attachment.author_id || User.current.admin?) %>
<% if (User.current.allowed_to?(:as_teacher, @attachment.container) || User.current.id == @attachment.author_id || User.current.admin?) %>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= attachment_path(@attachment, :history_delete => true) %>', '本资源有多个版本,你确定要全部删除?')" class="fr fontGrey2 mb5 btn">删除所有资源</a>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= attachment_path(@attachment, :history_delete => true) %>', '本资源有多个版本,你确定要全部删除?')" class="fr mb5 white-btn orange-btn">删除所有资源</a>
<% end %>
<% elsif @attachment.container_type == "OrgSubfield" %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr fontGrey2 mb5 btn", :onclick =>"hideModal();") if (User.current.id == @attachment.author_id || User.current.admin_of_org?(@attachment) || User.current.admin?) %>
<%= link_to( '删除所有资源', attachment_path(@attachment, :history => true), :data => {:confirm => @attachment_histories_count.to_i > 0 ? l(:text_history_are_you_sure) : l(:text_are_you_sure)}, :method => :delete,:class => "fr mb5 white-btn orange-btn", :onclick =>"hideModal();") if (User.current.id == @attachment.author_id || User.current.admin_of_org?(@attachment) || User.current.admin?) %>
<% end %>
</div>

View File

@ -68,23 +68,14 @@
$('#insite').attr("class", "re_schbtn b_lblue");
}
</script>
<div class="homepageRight mt0 ml10">
<div class="homepageRightBanner user_bg_shadow">
<div class="NewsBannerName">资源库</div>
<ul class="resourcesSelect">
<li class="resourcesSelected"><a href="javascript:void(0);" class="resourcesIcon"></a>
<ul class="resourcesType">
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','','<%= @q%>','<%= @course.id%>');" class="resourcesTypeAll resourcesGrey">全部</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','课件','<%= @q%>','<%= @course.id%>');" class="homepagePostTypeAssignment postTypeGrey">课件</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','软件','<%= @q%>','<%= @course.id%>');" class="softwareIcon postTypeGrey">软件</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','媒体','<%= @q%>','<%= @course.id%>');" class="mediaIcon resourcesGrey">媒体</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','代码','<%= @q%>','<%= @course.id%>');" class="codeIcon resourcesGrey">代码</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course)%>','论文','<%= @q%>','<%= @course.id%>');" class="thesisIcon resourcesGrey">论文</a></li>
<li><a href="javascript:void(0);" onclick="search_tag_attachment('<%= search_tag_attachment_course_files_path(@course,:other=>true)%>','其他','<%= @q%>','<%= @course.id%>');" class="othersIcon resourcesGrey">其它</a></li>
</ul>
</li>
</ul>
<div class="with85 fl">
<div class="homepageRight mt0 ml15 user_bg_shadow bor-grey-e">
<div class="homepageRightBanner">
<div class="NewsBannerName">资源列表</div>
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %>
<a href="javascript:void(0);" class="white-btn orange-btn fr mr5" onclick="course_files_upload();"><i class='fa fa-upload mr5'></i>上传资源</a>
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :course_id => @course.id), :class => "white-btn orange-btn fr mr5", :remote => true) %>
<% end %>
</div>
<div class="cl"></div>
<% unless User.current.logged? %>
@ -94,31 +85,20 @@
</p>
</div>
<% end %>
<div class="resources mt10 pr user_bg_shadow" style="padding-bottom:5px;">
<div class="reTop mb5">
<%= form_tag( search_course_files_path(@course), method: 'get',:class => "re_search",:remote=>true) do %>
<%= text_field_tag 'name', params[:name], name: "name", :class => 'researchBox fl',:style=>"padding: 0px"%>
<%= submit_tag "班内搜索", :class => "blueBtn mr5 fl",:name => "incourse",:id => "incourse" %>
<%#= submit_tag "全站搜索", :class => "blueBtn mr5 fl",:name => "insite",:id => "insite" %>
<% if is_course_teacher(User.current,@course) || (@course.publish_resource==1 && User.current.member_of_course?(@course) ) %>
<a href="javascript:void(0);" class="task-btn task-btn-blue fr mr5" onclick="course_files_upload();">上传资源</a>
<%= link_to("导入资源", import_resources_user_path(User.current, :type => 6, :course_id => @course.id), :class => "task-btn task-btn-blue fr mr5", :remote => true) %>
<% end %>
<% end %>
<!-- show_window('light','fade','20%','35%')-->
<!--<a href="javascript:void(0)" class="re_fabu f_r b_lblue" onclick="show_upload();">上传资源</a>-->
</div>
<div class="pr bor-bottom-greyE pt10 pb10 pl15 pr15">
<div>
<div class="fileTagWrap" id="files_tag">
<%= render :partial => "files/tag_yun", :locals => {:tag_list => @tag_list,:course => @course,:tag_name => @tag_name}%>
</div>
<div class="cl"></div>
<div class="re_con_top">
<p class="f_l fontBlue f_b f_14" id="tip_attachment_count">
<p class="fl fontBlue f_b f_14 mt5" id="tip_attachment_count">
<%= render :partial => "files/tip_attachment_count" %>
</p>
<p class="f_r" style="color: #808080" id="course_filter_order">
<div class="edu-find fr mr40 with30 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" name="search" placeholder="输入资源名称、描述的关键字进行搜索" value="<%= @q %>" id="all_resource_search"/>
<i class="fa fa-close mr5 color-grey edu-close" onclick="clear_search();"></i>
</div>
<a href="javascript:void(0);" onclick="submit_resource_search();" class="edu-open font-16 color-grey" style="right:-25px"><i class="fa fa-search"></i></a>
</div>
<p style="color: #808080" class="clearfix mt5" id="course_filter_order">
<%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %>
</p>
</div>
@ -138,4 +118,36 @@
<%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
</div>
</div>
<%# html_title(l(:label_attachment_plural)) -%>
</div>
<%# html_title(l(:label_attachment_plural)) -%>
<script>
function clear_search(){
if($('#all_resource_search').val().trim() != ""){
$('#all_resource_search').val('');
submit_resource_search();
}
}
function submit_resource_search(){
$.ajax({
url: "<%= search_course_files_path(@course) %>",
type: 'post',
dataType: 'script',
data: {name: $('#all_resource_search').val()},
success: function (data) {
}
});
}
$("input[name='search']").on("keydown", function(event){
var code;
if (!event) {
event = window.event; //针对ie浏览器
code = event.keyCode;
} else {
code = event.keyCode;
}
if(code == 13) {
submit_resource_search();
return false;
}
});
</script>

View File

@ -1,15 +1,15 @@
<% if @order == "asc" %>
按&nbsp;<%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey", :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey",:remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort => "quotes:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey", :remote => true %>
按&nbsp;<%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey #{@sort == 'created_on' ? 'color-orange05' : ''}", :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;|&nbsp;
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey #{@sort == 'downloads' ? 'color-orange05' : ''}",:remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;|&nbsp;
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort => "quotes:desc", :tag_name => @tag_name.nil? ? " " : @tag_name, :q => @q.nil? ? " " : @q), :class => "f_b c_grey #{@sort == 'quotes' ? 'color-orange05' : ''}", :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% else %>
按&nbsp;<%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey" , :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;/&nbsp;
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey", :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;/&nbsp;
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort =>"quotes:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q),:class => "f_b c_grey", :remote => true %>
按&nbsp;<%= link_to "时间", search_tag_attachment_course_files_path(@course, :sort => "created_on:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey #{@sort == 'created_on' ? 'color-orange05' : ''}" , :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"created_on"} %>&nbsp;|&nbsp;
<%= link_to "下载次数", search_tag_attachment_course_files_path(@course, :sort => "downloads:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q), :class => "f_b c_grey #{@sort == 'downloads' ? 'color-orange05' : ''}", :remote => true %>
<%= render partial: 'files/arrow_show',locals: { sort: @sort,order:@order,current:"downloads"} %>&nbsp;|&nbsp;
<%= link_to "引用次数", search_tag_attachment_course_files_path(@course, :sort =>"quotes:asc", :tag_name => @tag_name.nil? ? ' ' : @tag_name, :q => @q.nil? ? ' ' : @q),:class => "f_b c_grey #{@sort == 'quotes' ? 'color-orange05' : ''}", :remote => true %>
<%= render partial:'files/arrow_show',locals: { sort: @sort,order:@order,current:"quotes"} %>&nbsp;排序
<% end %>

View File

@ -17,4 +17,3 @@
<%= render :partial => "welcome/no_data" %>
</div>
<% end %>

View File

@ -1,5 +1,5 @@
<p ondblclick=show_edit_file_description('<%= file.id %>')>
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span><% else %><span id="file_description_tip_<%= file.id %>" style="cursor:pointer;" title="双击可编辑" class="break_word"><%= file.description %></span><% end %>
<p> <!--ondblclick=show_edit_file_description('<%#= file.id %>')-->
<span style="white-space:nowrap;">资源描述:</span><% if file.description.blank? %><!--<span style="color:#C5C5BE; cursor:pointer;" title="双击可编辑">双击添加描述</span>--><% else %><span id="file_description_tip_<%= file.id %>" style="cursor:default;" class="break_word"><%= file.description %></span><% end %>
<%#= file.description.blank? ? "该资源暂无描述" : file.description %>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);", :onclick => "show_edit_file_description("+file.id.to_s+");"%>
<%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), attachments_versions_path(file), :remote =>true %><!--, :onclick => "show_edit_file_description("+file.id.to_s+");"-->
</p>

View File

@ -1,6 +1,7 @@
<span class="add_attachment" data-containerid="<%= container.id %>">
<% checkBox = (@course.present? && @course.is_public?) ? 'public' : 'private'%>
<button name="button" class="sub_btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>" type="button" >文件浏览</button>
<a class="white-btn orange-btn" onclick="_file<%=container.id %>.click()" onmouseover="this.focus()" style="<%= ie8? ? 'display:none' : ''%>">文件浏览</a>
<!--<button name="button" class="sub_btn" onclick="_file<%#=container.id %>.click()" onmouseover="this.focus()" style="<%#= ie8? ? 'display:none' : ''%>" type="button" >文件浏览</button>-->
<%= file_field_tag 'attachments[dummy][file]',
:id => "_file#{container.id}",
:class => ie8? ? '':'file_selector',
@ -23,7 +24,7 @@
</span>
<!--<input type="submit" name="" value="上传文件" class="f_l ml10" style="width:80px; height:26px;">-->
<span class="fr c_blue" style="margin-right: <%= container.class.to_s == 'Course' ? 26 : 45 %>px;">单个文件最大限制:<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %></span>
<span class="fr color-grey" style="margin-right: <%= container.class.to_s == 'Course' ? 26 : 45 %>px;">单个文件最大限制:<span class="color-orange"><%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %></span></span>
<div class="cl"></div>
<div>
<span id="attachments_fields<%= container.id %>" data-containerid="<%= container.id %>" xmlns="http://www.w3.org/1999/html"></span>

View File

@ -1,8 +1,8 @@
<% delete_allowed = User.current.allowed_to?(:manage_files, @course) %>
<div class="resources mt10 user_bg_shadow"><!--资源库内容开始--->
<div class="resources sources-bg bor-bottom-greyE"><!--资源库内容开始--->
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50), user_path(file.author) %>
<%= link_to image_tag(url_to_avatar(file.author), :width => 50, :height => 50,:class => "bor-radius-all"), user_path(file.author) %>
</div>
<div class="homepagePostDes">
<div class="homepagePostTitle break_word">
@ -20,23 +20,16 @@
<%#= file_preview_eye(file, class: 'preview') %>
<span id="image_private_<%= file.id%>">
<% if file.is_public? == false%>
<span class="img_private ml5">私有</span>
<!--<span class="img_private ml5">私有</span>-->
<i class="fa fa-lock color-grey font-16"></i>
<%end %>
</span>
<% if file.is_publish == 0 %>
<span class="grey_homework_btn_cir ml5"><%= file.publish_time.nil? ? '挂起' : (format_time(file.publish_time) + "点发布") %></span>
<% end %>
</div>
<div class="mt5">
<span class="fontGrey2 mr15 fl">上传时间:<%= format_time(file.created_on)%></span>
<% if file.tag_list.length > 0%>
<span class="fontGrey2 fl mr15">上传类型:<%= file.tag_list[0] %></span>
<% end %>
<p class="f_l mb5 fontGrey2">文件大小:<%= number_to_human_size(file.filesize) %></p>
<p class="fl ml15 fontGrey2">下载<%= file.downloads%>&nbsp;&nbsp;|&nbsp;&nbsp;引用<%= file.quotes.nil? ? 0:file.quotes %> </p>
</div>
<%# unless file.description.blank? %>
<div class="cl"></div>
<% if User.current.admin? || ( User.current.logged? && ((is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file)) && ((delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course")) %>
<div>
<div id="file_description_show_<%= file.id %>" class="fontGrey2 mb4 break_word">
@ -54,21 +47,34 @@
<% end %>
<%# end %>
<div class="cl"></div>
<div class="tag_h">
<!-- container_type = 1 代表是课程里的资源 -->
<%= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<%= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<div class="mt5">
<span class="color-grey mr50"><%= file.author.show_real_name %></span>
<span class="color-grey mr50"><!--上传时间:--><%= format_time(file.created_on)%></span>
<%# if file.tag_list.length > 0%>
<!--<span class="color-grey mr50">&lt;!&ndash;上传&ndash;&gt;类型&nbsp;<%#= file.tag_list[0] %></span>-->
<%# end %>
<span class="mb5 color-grey mr50"><!--文件:-->大小&nbsp;<%= number_to_human_size(file.filesize) %></span>
<span class="color-grey mr50">下载&nbsp;<%= file.downloads%></span>
<span class="color-grey">引用&nbsp;<%= file.quotes.nil? ? 0:file.quotes %> </span>
</div>
<div class="cl"></div>
<!--添加标签部分-->
<!--<div class="tag_h">
&lt;!&ndash; container_type = 1 代表是课程里的资源 &ndash;&gt;
<%#= render :partial => 'tags/tag_new', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
<%#= render :partial => 'tags/tag_add', :locals => {:obj => file, :object_flag => "6",:tag_name => @tag_name} %>
</div>-->
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<li>
<i class="fa fa-bars color-grey-bc"></i>
<% if User.current.logged? || User.current.admin? %>
<% if User.current.admin? || ((is_course_teacher(User.current,@course) || file.author_id == User.current.id) && course_contains_attachment?(@course,file)) %>
<% if User.current.admin? || ((delete_allowed || User.current.id == file.author_id) && file.container_id == @course.id && file.container_type == "Course") %>
<ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
<li><%= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>
<li><%= link_to '更新版本',attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<!--<li><%#= link_to '延期发布',file_hidden_course_file_path(@course,file),:class => "postOptionLink",:remote=>true %></li>-->
<li><%= link_to '设&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;置'.html_safe,attachments_versions_path(file),:class => "postOptionLink",:remote=>true %></li>
<% if @course.is_public? %>
<li>
<span id="is_public_<%= file.id %>">

View File

@ -1,7 +1,7 @@
<script src="/javascripts/jquery.datetimepicker.js" type="text/javascript"></script>
<div class="task-popup" style="width:450px;">
<div class="task-popup-title clearfix">
<h3 class="fl color-grey">上传资源</h3>
<h3 class="fl">上传资源</h3>
<a href="javascript:void(0);" onclick="$('#datetimepicker_mask').datetimepicker('destroy');" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
@ -13,7 +13,7 @@
<%= form_tag(course_files_path(course), :multipart => true,:remote => !ie8?,:id=>"upload_course_file_form") do %>
<input type="hidden" name="in_course_toolbar" value="Y">
<!--<p class="c_grey fr mt10 mr5">-->
<ul class="c_dark mt10 mb10 f14 attachment_type_ul">
<!--<ul class="c_dark mt10 mb10 f14 attachment_type_ul">
<li class="fl">
<input id="atta_type_1" name="course_attachment_type[]" type="checkbox" value="1" checked class="fl magic-checkbox" />
<label for="atta_type_1" class="c_grey fl">课件&nbsp;|&nbsp;</label>
@ -38,13 +38,18 @@
<input id="atta_type_6" name="course_attachment_type[]" type="checkbox" value="6" class="fl magic-checkbox"/>
<label for="atta_type_6" class="c_grey fl">其他</label>
</li>
</ul>
</ul>-->
<div class="cl"></div>
<div class="mb10 mt10">
<%= render :partial => 'files/new_style_attachment_list',:locals => {:container => course} %>
</div>
<div class="cl"></div>
<p class="clearfix mb10">
<span class="fl mr20">
<input type="checkbox" name="is_public" value="1" id="public_user" class="ml-3 mr5 magic-checkbox">
<label for="public_user">选中后所有用户可见,否则仅课堂成员可见</label>
</span>
</p>
<% if User.current.allowed_to?(:as_teacher,course) %>
<div class="mb10">
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
@ -110,6 +115,7 @@
$("#upload_file_count_notice").hide();
if(regex_publish_time()) {
$('#submit_resource').parent().submit();
hideModal();
}
}
<% else %>
@ -120,6 +126,7 @@
}else {
$("#upload_file_count_notice").hide();
$('#submit_resource').parent().submit();
hideModal();
}
<% end %>
}

View File

@ -1,4 +1 @@
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");

View File

@ -1,6 +1,5 @@
<% if @course %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/course_file',:locals => {course:@course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} )%>");
$("#pages").html('<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>');
<% else %>
$("#resource_list").html("<%= escape_javascript( render :partial => 'files/project_file',:locals => {project:@project, all_attachments:@all_attachments, sort:@sort, order:@order, project_attachments:@obj_attachments}) %>");
$("#tip_attachment_count").html("<%= escape_javascript( render :partial => 'files/tip_attachment_count') %>");

View File

@ -1,32 +1,154 @@
<!-- 编程题 -->
<div class="-layout -stretch -fit -vertical centerH">
<div class="-layout -vertical -flex -relative -bg-black -flex-basic70" id="games_repository_contents" style="overflow:hidden;">
<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>
<div class="fr mt5 -horizontal mr15">
<a href="javascript:void(0);" onclick="repository_extend_and_zoom();" id="extend_and_zoom"><i class="fa fa-expand font-16"></i></a>
</div>
</ul>
<div class="cl"></div>
<div id="codotab_con_1" class="white_bg" style="overflow-y: auto;height: 100%">
<div class="panel-header clearfix" id="top_repository" style="border-bottom:0;padding:15px;">
<% @game_challenge.challenge_chooses.each_with_index do |choose, index| %>
<p class="font-bd font-18 color-grey3"><%= (index + 1).to_s + "." + (choose.category == 1 ? "单选题" : "多选题") %></p>
<div class="font-15 color-grey3 mb10 new_li read_only" unselectable="on" id="choose_subject_<%= index + 1 %>" style="padding: 10px 0px 10px 10px">
<textarea style="display:none;"><%= choose.subject %></textarea>
</div>
<div class="problem_single">
<% choose.challenge_questions.each_with_index do |question, i| %>
<p class="ml10 mb10 ">
<span>
<% if choose.category == 1 %>
<input type="radio" <%= (choose.choose_outputs.try(:answer) == (i + 65).chr) ? "checked" : "" %> name="answer[<%= index + 1 %>]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-radio ml5">
<% else %>
<!--多选-->
<input type="checkbox" <%= (!choose.choose_outputs.try(:answer).nil? && (choose.choose_outputs.try(:answer).include? ((i + 65).chr))) ? "checked" : "" %> name="answer[]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-checkbox ml5">
<% end %>
<label class="<%= (!choose.choose_outputs.try(:answer).nil? && (choose.choose_outputs.try(:answer).include? ((i + 65).chr))) ? "color-orange05" : "" %>" for="result_<%= index %>_<%= i %>" style="top: 0px"><span><%= (question.position + 65).chr %></span>.<%= question.option_name %></label>
</span>
</p>
<% end %>
<input type="hidden" name="user_answer">
</div>
<% end %>
<!--<div class="pl5 pr5 pt10 pb10 bor-grey-e">
<div for="result_<%#= question.position %>" class="card -elevation-1 mt10 mb5 <%#= (@user_answer.nil? || @user_answer.index(i.to_s).nil?) ? "" : "card-check color_white" %>" onclick="">
&lt;!&ndash;单选&ndash;&gt;
<%# if choose.category == 1 %>
<input type="radio" name="answer[]" value="<%#= (question.position + 65).chr %>" id="result_<%#= question.position %>" class="ml-3 mr5 magic-radio ml5">
<%# else %>
&lt;!&ndash;多选&ndash;&gt;
<input type="checkbox" name="answer[]" value="<%#= (question.position + 65).chr %>" id="result_<%#= question.position %>" class="ml-3 mr5 magic-checkbox ml5">
<%# end %>
<div class="-layout-h -center break_word" for="result_<%#= question.position %>">
<span class="mr10"><%#= (question.position + 65).chr %>.</span>
<div class="markdown">
<p><code class="font-16"><%#= question.option_name %></code></p>
</div>
</div>
</div>
</div>-->
<h3 id="save_status" class="ml15 fl" style="font-weight: normal"></h3>
</div>
</div>
</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_choose_results', :locals => { :game_challenge => @game_challenge} %>
</div>
</div>
<script>
$(document).ready(function() {
editormd.loadKaTeX(function() {
var lens = $("#top_repository .read_only").length;
for(i = 1; i <= lens; i++){
editormd.markdownToHTML("choose_subject_" + i, {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 数学公式
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}
});
});
$(function(){
$(".problem_single p input").live("change",function(event){
var $this=$(this).parents(".problem_single").find("input[name='user_answer']");
var value="";
if($(this).attr("category")=="1"){
value="";
//alert($(this).siblings("label").find("span").html());
if($(this).attr("checked")=="checked"){
value=$(this).siblings("label").find("span").html();
$(this).parents(".problem_single").find("label").removeClass("color-orange05");
$(this).siblings("label").addClass("color-orange05");
}
}else{
var p=$(this).parents(".problem_single").find("p");
value="";
if($(this).attr("checked")=="checked"){
$(this).siblings("label").addClass("color-orange05");
}else{
$(this).siblings("label").removeClass("color-orange05");
}
for(var i=0;i< p.length;i++){
if(p.eq(i).find("input").attr("checked")=="checked"){
//alert(p.eq(i).find("input").siblings("label").find("span").html());
value+=p.eq(i).find("input").siblings("label").find("span").html();
}
}
}
$this.val(value);
})
})
</script>
<% if false %>
<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>
<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;height: 100%">
<div id="codotab_con_1" class="white_bg" style="overflow-y: auto;height: 100%">
<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-grey-bf <%= (@user_answer.nil? || @user_answer.index(i.to_s).nil?) ? "" : "card-check color_white" %>" onclick="choice_answer('<%= @st %>', this)">
<input type="hidden" name="answer" value="<%= question.position %>">
<div class="-layout-h -center break_word">
<span class="mr10"><%= (question.position + 65).chr %>.</span>
<div class="markdown">
<p><code class="font-16"><%= question.option_name %></code></p>
</div>
</div>
</div>
<p class="font-bd font-18 color-grey3">1.单选题</p>
<p class="font-15 color-grey3 mb10">应在下列程序划线处填入的语句是()</p>
<pre class="mb10 back-f6-grey"></pre>
<div class="pl5 pr5 pt10 pb10 bor-grey-e">
<% @game_challenge.challenge_chooses.each do |choose| %>
<% choose.challenge_questions.each_with_index do |question, i| %>
<div for="result_<%= question.position %>" class="card -elevation-1 mt10 mb5 <%= (@user_answer.nil? || @user_answer.index(i.to_s).nil?) ? "" : "card-check color_white" %>" onclick="choice_answer('<%= @st %>', this)">
<!--单选-->
<input type="radio" name="answer[]" value="<%= question.position %>" id="result_<%= question.position %>" class="ml-3 mr5 magic-radio ml5">
<!--多选-->
<input type="checkbox" name="answer[]" value="<%= question.position %>" id="result_<%= question.position %>" class="ml-3 mr5 magic-checkbox ml5">
<div class="-layout-h -center break_word">
<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 %>
<% end %>
</div>
<h3 id="save_status" class="ml15 fl" style="font-weight: normal"></h3>
</div>
</div>
</div>
</div>
</div>
<% end %>

View File

@ -22,15 +22,15 @@
<% if @game.status == 1 %>
<a class="shixun-task-btn mt8 mr15" id="code_testing">评测中..</a>
<% end %>
<% if show_next_stage?(@game, @myshixun.shixun.try(:status)) %>
<% if @had_done == 0 %>
<% if show_next_stage?(@game, @myshixun.shixun.try(:status)) %>
<%= link_to "下一关 ", {:controller => 'games', :action => "next_step", :id => @game, :myshixun_id => @myshixun},
:class => "shixun-task-btn task-btn-blue mr15 mt8", :id => "next_step", :remote => true %>
<!--<a href="javascript:void(0);" onclick="shixun_next_step();" class="task-btn task-btn-blue mr15 mt8">下 一 步</a>-->
<% end %>
<% else %>
<a href="<%= shixun_path(@myshixun.shixun) %>" id="exit_shixun" class="shixun-task-btn task-btn-blue mt8 mr15">退出实训</a>
<% end %>
<% end %>
</div>
<script>
// 如果是HTML实训则在效果显示栏实时渲染code
@ -81,57 +81,25 @@
// 选择题提交评测
// 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;
var user_answer = [];
var input_answer = $("input[name='user_answer']");
var lens = input_answer.length;
for(i = 0; i < lens; i++ ){
var answer = $(input_answer[i]).val();
if(answer == ""){
notice_sure_box("第"+ (i+1) + "题未答,请确认!");
return;
}
user_answer.push(answer)
}
console.log(user_answer);
$("#code_test").html("<a class='task-btn mt8 mr15'>评测中..</a>");
$.ajax({
type: "post",
type: "POST",
url: '<%= evaluating_choice_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
data: {answer: answer},
dataType: "json",
data: {answer:user_answer},
dataType: "script",
success: function(data){
console.log(data);
clearInterval(cm);
var icon = $("#game_status_<%= @game_challenge.id %>"); // 实训列表的icon
icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center");
icon.find("a:last").attr("title", "已完成");
$("#code_test").remove();
if(data.correct){
$("#correct_tip").show();
$("#user_grade").html(data.grade);
$("#shixun_exp_<%=@game_challenge.id %>").html("经验值<span class='color-light-green mr5'>+"+ data.score + "</span>");
$("#shixun_grade_<%=@game_challenge.id %>").html("金币<span class='color-light-green mr5'>+"+ data.score + "</span>");
$("#shixun_tag_<%=@game_challenge.id %>").html("技能标签<span class='color-light-green mr5'>+"+ data.tag_count + "</span>");
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(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game => @game, :myshixun => @myshixun, :had_done => 1}) %>";
}
// 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕
pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight);
}else{
$("#error_tip").show();
var span_class = parseInt(data.score) < 0 ? "u-color-light-red" : "color-light-green";
$("#shixun_exp_<%=@game_challenge.id %>").html("经验值<span class='color-light-green mr5'>+0</span>");
$("#shixun_grade_<%=@game_challenge.id %>").html("金币<span class='"+ span_class +" mr5'>"+ data.score + "</span>");
$("#shixun_tag_<%=@game_challenge.id %>").html("技能标签<span class='color-light-green mr5'>+0</span>");
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(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
}
}
},
error: function(){
console.log("错了");

View File

@ -0,0 +1,57 @@
<ul id="blacktab_nav">
<li class="blacktab_con blacktab_hover">
<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 fa-arrows-alt" ></i></a>
<div class="cl"></div>
</ul>
<div class="cl"></div>
<div id="game_test_set_results" class="-flex -relative blacktab-inner">
<div id="blacktab_con_1" class="" >
<div class="fit -scroll">
<div class="-layout-v -fit">
<div class="-flex -scroll task-padding16">
<% unless game_challenge.choose_correct_num == nil %>
<% if game_challenge.choose_correct_num != game_challenge.challenge_chooses.count %>
<p class="-text-danger mb10">
<i class="fa fa-exclamation-circle font-16" ></i><span class="ml5 mr5 -text-danger"><%= game_challenge.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %></span>错误
</p>
<% else %>
<p class="color-light-green mb10">
<i class="fa fa-check-circle font-16" ></i><span class="ml5 mr5"><%= game_challenge.challenge_chooses.count %>/<%= game_challenge.challenge_chooses.count %></span> 全部通过
</p>
<% end %>
<% end %>
<% game_challenge.challenge_chooses.each_with_index do |choose, index| %>
<div class="-task-ces-box mb15 clearfix">
<div class="-task-ces-top" onclick="toggle_test_case('0', '<%= index %>')" style="cursor:pointer">
<i class="fa fa-caret-right mr5 font-16" ></i>
<span class="font-14">题目<%= index + 1 %></span>
<%# outputs = ChooseOutputs.where(:challenge_choose_id => choose.id).first %>
<% unless choose.choose_outputs.blank? %>
<% if choose.choose_outputs.try(:answer) != choose.standard_answer %>
<i class="fa fa-exclamation-circle -text-danger fr mt8 ml5" ></i>
<% else %>
<i class="fa fa-check-circle color-light-green fr mt8 ml5 f14" ></i>
<% end %>
<% else %>
<i class="fa fa-lock fr mt8" ></i>
<% end %>
</div>
<div class="-task-ces-info undis" id="test_case_<%= index %>">
<ul class=" font-14">
<% if choose.choose_outputs.blank? %>
<li><span class="ml30">尚未提交,暂不支持查看</span></li>
<% else %>
<li><span class="-task-ces-info-left color-blue">正确选项:</span><span><%= choose.standard_answer %></span></li>
<li><span class="-task-ces-info-left color-blue">你的选项:</span><span class="color-orange"><%= choose.choose_outputs.try(:answer).nil? ? "无" : choose.choose_outputs.try(:answer) %></span></li>
<% end %>
</ul>
</div>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>

View File

@ -17,19 +17,30 @@
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">过关任务</a>
</li>
<% unless @myshixun.shixun.try(:propaedeutics).blank? %>
<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_2" onclick="HoverLi1(2);">
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">背景知识</a>
</li>
<% end %>
<% unless @game_challenge.answer.blank? %>
<li id="tab_nav_3" onclick="open_answer('<%= @game.identifier %>', '<%= @myshixun.identifier %>')">
<% if @st == 0 %>
<% unless @game_challenge.answer.blank? %>
<li id="tab_nav_3" onclick="open_answer('<%= @game.identifier %>', '<%= @myshixun.identifier %>', false)">
<a href="javascript:void(0);" class="tab_type" style="font-size: 16px">参考答案</a>
</li>
<% end %>
<% else %>
<li id="tab_nav_3" onclick="open_answer('<%= @game.identifier %>', '<%= @myshixun.identifier %>', true)">
<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(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
</li>
<span class="btn-cir-big fr mt8 mr15" >经验值:<%= @game_challenge.score %></span>
<% if @st == 0 %>
<span class="btn-cir-big fr mt8 mr15" >经验值:<%= @game_challenge.score %></span>
<% else %>
<span class="btn-cir-big fr mt8 mr15" >经验值:<%= @game_challenge.choose_score %></span>
<% end %>
</ul>
<div class="cl"></div>
<div class="-flex -relative greytab-inner" >
@ -94,7 +105,7 @@
<% if @st != 0 %>
<!-- 单选多选题 -->
<%= render :partial => "games/choice_question" %>
<% else %>
<% 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;">

View File

@ -37,10 +37,16 @@
<div class="cl"></div>
<div style="display: flex;" class="with80 ml30">
<% if game.try(:status) == 0 || game.try(:status) == 1 || game.try(:status) == 3 %>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.challenge_tags.count %></span></span>
<% if game.try(:status) != 2 %>
<% if challenge.st == 0 %>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.challenge_tags.count %></span></span>
<% else %>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.choose_score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.choose_score %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.choose_tags_num %></span></span>
<% end %>
<% elsif game.try(:status) == 2 %>
<% final_score = (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : game.final_score.to_i %>
<% gold_score = @myshixun.shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
@ -48,6 +54,7 @@
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> ml5"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span></span>
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="color-light-green ml5">+<%= (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span></span>
<% end %>
</div>
</div>
</div>

View File

@ -10,6 +10,18 @@
$("#all_task_show").html("<%= j (render :partial => "games_list") %>");
$("#all_task_show").hide();
fadein = 0;
// 选择题
<% if params[:choose] == "1" %>
<% if @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(@myshixun.shixun) %>' class='task-btn task-btn-blue mt8 mr15' >退出实训</a>");
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game => @game, :myshixun => @myshixun, :had_done => 1}) %>";
<% end %>
// 传递具体屏幕的宽高,实现不同浏览器与不同分辨率都能撑满屏幕
pop_box_new2(htmlvalue, window.innerWidth, window.innerHeight);
<% end %>
<% else %>
$("#all_task_show").html("<%= j (render :partial => "games_list") %>");
$("#all_task_tab").trigger("click"); // 模拟全部任务点击事件

View File

@ -1,12 +1,11 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">匿评设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">匿评设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix edu-position">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input id="homework_anonymous_comment" class="magic-checkbox fl mt5 <%= @homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" <%= @homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> type="checkbox" value="1" name="homework_anonymous_comment" <%= @homework.anonymous_comment == 1 ? '' : 'checked' %>>
<ul class="pl30">
<li class="clearfix edu-position pl20 mb15">
<input id="homework_anonymous_comment" class="magic-checkbox fl mt5 <%= @homework.homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" <%= @homework.homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> type="checkbox" value="1" name="homework_anonymous_comment" <%= @homework.anonymous_comment == 1 ? '' : 'checked' %>>
<label for="homework_anonymous_comment" class="fl">启用匿评</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
@ -17,29 +16,29 @@
</li>
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">开始时间</label>
<input type="text" <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> name="homework_evaluation_start" readonly value="<%= format_time @homework_detail_manual.evaluation_start %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" placeholder="选择匿评开启时间" />
<input type="text" <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> name="homework_evaluation_start" readonly value="<%= format_time @homework.homework_detail_manual.evaluation_start %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" placeholder="选择匿评开启时间" />
<span class="color-orange fl ml20 mt5 none" id="homework_evaluation_start_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">结束时间</label>
<input type="text" <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 4 ? 'disabled' : '' %> name="homework_evaluation_end" readonly value="<%= format_time @homework_detail_manual.evaluation_end %>" class=" fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 4 ? 'disabled-bg' : '' %>" placeholder="选择匿评结束时间" />
<input type="text" <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 4 ? 'disabled' : '' %> name="homework_evaluation_end" readonly value="<%= format_time @homework.homework_detail_manual.evaluation_end %>" class=" fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 4 ? 'disabled-bg' : '' %>" placeholder="选择匿评结束时间" />
<span class="color-orange fl ml20 mt5 none" id="homework_evaluation_end_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class=" panel-form-label fl mr10">匿评数量</label>
<input type="text" <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> name="homework_evaluation_num" value="<%= @homework_detail_manual.evaluation_num %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" placeholder="3" />
<input type="text" <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 3 ? 'disabled' : '' %> name="homework_evaluation_num" value="<%= @homework.homework_detail_manual.evaluation_num %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 || @homework.homework_detail_manual.comment_status >= 3 ? 'disabled-bg' : '' %>" placeholder="3" />
<span class="color-orange fl ml20 mt5 none" id="homework_evaluation_num_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class=" panel-form-label fl mr10">缺评扣分</label>
<input type="text" <%= @homework.anonymous_comment == 1 ? 'disabled' : '' %> name="homework_absence_penalty" value="<%= @homework_detail_manual.absence_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 ? 'disabled-bg' : '' %>" placeholder="2" />
<input type="text" <%= @homework.anonymous_comment == 1 ? 'disabled' : '' %> name="homework_absence_penalty" value="<%= @homework.homework_detail_manual.absence_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_comment == 1 ? 'disabled-bg' : '' %>" placeholder="2" />
<span class="color-orange fl ml20 mt5 none" id="homework_absence_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
</ul>
<ul class="mt50 mb50 <%= @homework.anonymous_comment == 0 ? '' : 'none' %>" id="anon_relate_setting_ul" style="padding-bottom:5px;">
<ul class="mt50 mb50 pl30 <%= @homework.anonymous_comment == 0 ? '' : 'none' %>" id="anon_relate_setting_ul" style="padding-bottom:5px;">
<li class="clearfix edu-position">
<label class=" panel-form-label fl mr10">&nbsp;</label>
<input id="homework_anonymous_appeal" class="magic-checkbox fl mt5 <%= @homework_detail_manual.comment_status >= 4 ? 'disabled-bg' : '' %>" type="checkbox" value="1" name="homework_anonymous_appeal" <%= @homework.anonymous_appeal == 0 ? '' : 'checked' %> <%= @homework_detail_manual.comment_status >= 4 ? 'disabled' : '' %>>
<input id="homework_anonymous_appeal" class="magic-checkbox fl mt5 <%= @homework.homework_detail_manual.comment_status >= 4 ? 'disabled-bg' : '' %>" type="checkbox" value="1" name="homework_anonymous_appeal" <%= @homework.anonymous_appeal == 0 ? '' : 'checked' %> <%= @homework.homework_detail_manual.comment_status >= 4 ? 'disabled' : '' %>>
<label for="homework_anonymous_appeal" class="fl">启用匿评申诉</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
@ -56,13 +55,13 @@
</li>
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">申诉结束时间</label>
<input type="text" <%= @homework.anonymous_appeal == 1 && @homework_detail_manual.comment_status < 5 ? '' : 'disabled' %> name="homework_appeal_time" readonly value="<%= format_time @homework_detail_manual.appeal_time %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_appeal == 1 && @homework_detail_manual.comment_status < 5 ? '' : 'disabled-bg' %>" placeholder="选择匿评开启时间" />
<input type="text" <%= @homework.anonymous_appeal == 1 && @homework.homework_detail_manual.comment_status < 5 ? '' : 'disabled' %> name="homework_appeal_time" readonly value="<%= format_time @homework.homework_detail_manual.appeal_time %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_appeal == 1 && @homework.homework_detail_manual.comment_status < 5 ? '' : 'disabled-bg' %>" placeholder="选择匿评开启时间" />
<span class="color-orange fl ml20 mt5 none" id="homework_appeal_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">违规匿评扣分</label>
<input type="text" <%= @homework.anonymous_appeal == 1 ? '' : 'disabled' %> name="homework_appeal_penalty" value="<%= @homework_detail_manual.appeal_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_appeal == 1 ? '' : 'disabled-bg' %>" placeholder="3" />
<input type="text" <%= @homework.anonymous_appeal == 1 ? '' : 'disabled' %> name="homework_appeal_penalty" value="<%= @homework.homework_detail_manual.appeal_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.anonymous_appeal == 1 ? '' : 'disabled-bg' %>" placeholder="3" />
<span class="color-orange fl ml20 mt5 none" id="homework_appeal_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
</li>
</ul>

View File

@ -1,11 +1,11 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">补交设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">补交设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul >
<li class="clearfix mb20 edu-position">
<label class="panel-form-label fl mr10">作品补交</label>
<li class="clearfix mb20 edu-position pl50">
<label class="mt5 fl mr10">是否允许在截止日期之后进行补交</label>
<input id="edit_allow_late_1" class="magic-radio fl mt6" type="radio" name="homework_allow_late" value="1" <%= @homework.allow_late ? 'checked' : '' %>>
<label for="edit_allow_late_1" class="fl mr30 mt6">允许补交</label>
<input id="edit_allow_late_0" class="magic-radio fl mt6" type="radio" name="homework_allow_late" value="0" <%= @homework.allow_late ? '' : 'checked' %>>
@ -25,7 +25,7 @@
</li>
</ul>
<ul id="late_relate_setting_ul">
<li class="clearfix mb15">
<li class="clearfix mb15 pl30">
<label class="panel-form-label fl mr10">迟交扣分</label>
<input type="text" class="fl task-form-15 task-height-40 panel-box-sizing" value="<%= @homework.late_penalty %>" name="homework_late_penalty" placeholder="5" />
<span class="color-orange fl ml20 mt5 none" id="homework_late_penalty_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>

View File

@ -4,15 +4,15 @@
}
</style>
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">公开设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">公开设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<% if @homework.homework_type != 4 %>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class=" panel-form-label fl mr10">&nbsp;</label>
<input id="homework_work_public" class="magic-checkbox fl mt5" type="checkbox" name="homework_work_public" <%= @homework.work_public ? 'checked' : '' %>>
<label for="homework_work_public" class="fl">公开作品</label>
<span class="fl color-grey">(选中则在作业结束时间之后对班级学生公开所有作品,否则作品不公开)</span>

View File

@ -1,10 +1,10 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">发布设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt5">发布设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">发布时间</label>
<input type="text" name="homework_publish_time" readonly value="<%=format_time @homework.publish_time %>" <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= @homework.homework_detail_manual.try(:comment_status) > 0 ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 0000"/>
<span class="color-orange fl ml20 mt5 none" id="homework_publish_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
@ -16,11 +16,13 @@
<p>发布之前,学生不会收到作业</p>
</div>
</li>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">截止时间</label>
<input type="text" name="homework_end_time" readonly value="<%=format_time @homework.end_time %>" <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled' : '' %> class="fl task-form-15 task-height-40 panel-box-sizing <%= !@homework.end_time.nil? && @homework.end_time <= Time.now ? 'disabled-bg' : '' %>" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 1000"/>
<span class="color-orange fl ml20 mt5 none" id="homework_end_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
<span class="color-orange fl ml20 mt5 none" id="homework_end_time_notice">
<i class="fa fa-exclamation-circle mr5 color-orange"></i>
</span><span class="color-orange fl mt5 none">不能早于发布时间</span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
@ -29,7 +31,7 @@
<p><%= @homework.homework_type == 4 ? "截止时间后,系统将根据学生完成情况计算成绩" : "截止时间过后,学生不能修改作品和追加附件" %></p>
</div>
</li>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">结束时间</label>
<input type="text" name="homework_archive_time" readonly value="<%= format_time @homework.archive_time %>" class=" fl task-form-15 task-height-40 panel-box-sizing" placeholder="<%= Time.parse((Time.now + 1.days).to_s).strftime("%Y-%m-%d") %> 1000"/>
<span class="color-orange fl ml20 mt5 none" id="homework_archive_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>

View File

@ -1,5 +1,5 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">评分设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">评分设置</p>
</div>
<% if @homework.homework_type == 4 %>
<div class="ml30 mr30 pb10">
@ -10,9 +10,9 @@
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input id="answer_open_evaluation_0" class="magic-radio fl mt6" type="radio" name="answer_open_evaluation" value="0" <%= @homework_detail_manual.answer_open_evaluation ? '' : 'checked' %>>
<input id="answer_open_evaluation_0" class="magic-radio fl mt6" type="radio" name="answer_open_evaluation" value="0" <%= @homework.homework_detail_manual.answer_open_evaluation ? '' : 'checked' %>>
<label for="answer_open_evaluation_0" class="fl mt6 mr30">零分</label>
<input id="answer_open_evaluation_1" class="magic-radio fl mt6" type="radio" name="answer_open_evaluation" value="1" <%= @homework_detail_manual.answer_open_evaluation ? 'checked' : '' %>>
<input id="answer_open_evaluation_1" class="magic-radio fl mt6" type="radio" name="answer_open_evaluation" value="1" <%= @homework.homework_detail_manual.answer_open_evaluation ? 'checked' : '' %>>
<label for="answer_open_evaluation_1" class="fl mt6">满分</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
@ -44,32 +44,32 @@
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">助教评分</label>
</li>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input id="homework_ta_mode_1" class="magic-radio" type="radio" value="1" name="homework_ta_mode" <%= @homework_detail_manual.ta_mode == 1 ? 'checked' : '' %>>
<input id="homework_ta_mode_1" class="magic-radio" type="radio" value="1" name="homework_ta_mode" <%= @homework.homework_detail_manual.ta_mode == 1 ? 'checked' : '' %>>
<label for="homework_ta_mode_1">普通模式</label>
</span>
<span class="fl color-grey">(选中则取各助教最终评分的平均分)</span>
</li>
<li class="clearfix">
<li class="clearfix pl30">
<label class=" panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input id="homework_ta_mode_0" class="magic-radio" type="radio" value="0" name="homework_ta_mode" <%= @homework_detail_manual.ta_mode == 1 ? '' : 'checked' %>>
<input id="homework_ta_mode_0" class="magic-radio" type="radio" value="0" name="homework_ta_mode" <%= @homework.homework_detail_manual.ta_mode == 1 ? '' : 'checked' %>>
<label for="homework_ta_mode_0">复审模式</label>
</span>
<span class="fl color-grey">(选中则只取最终次的助教评分)</span>
</li>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">最终成绩组成</label>
</li>
<li class="clearfix edu-position">
<li class="clearfix edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input id="homework_final_mode_1" class="magic-radio" type="radio" value="0" name="homework_final_mode" <%= @homework_detail_manual.final_mode ? '' : 'checked' %>>
<input id="homework_final_mode_1" class="magic-radio" type="radio" value="0" name="homework_final_mode" <%= @homework.homework_detail_manual.final_mode ? '' : 'checked' %>>
<label for="homework_final_mode_1">多项评分配比</label>
</span>
<span class="color-orange fl ml20 none" id="homework_final_mode_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
@ -91,52 +91,52 @@
<% end %>
</div>
</li>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">教师评分</label>
<%= select_tag :te_proportion,options_for_select(ta_proportion_option,@homework_detail_manual.te_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
<%= select_tag :te_proportion,options_for_select(ta_proportion_option,@homework.homework_detail_manual.te_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
</span>
</li>
<li class="clearfix ">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">助教评分</label>
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option,@homework_detail_manual.ta_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
<%= select_tag :ta_proportion,options_for_select(ta_proportion_option,@homework.homework_detail_manual.ta_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
</span>
</li>
<% if @homework.homework_type == 2 %>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">系统评分</label>
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,@homework_detail_programing.ta_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
<%= select_tag :sy_proportion,options_for_select(ta_proportion_option,@homework.homework_detail_programing.ta_proportion), {:class => "task-height-40 task-form-30 normal-bg"} %>
</span>
</li>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">学生匿评</label>
<select class="task-height-40 task-form-30 <%= @homework.anonymous_comment == 1 ? 'disabled-bg' : 'normal-bg' %>" name="st_proportion" <%= @homework.anonymous_comment == 1 ? 'disabled' : '' %>>
<%= options_for_select(ta_proportion_option,(100 - @homework_detail_manual.te_proportion*100.round() - @homework_detail_manual.ta_proportion*100.round() - @homework_detail_programing.ta_proportion*100.round())/100) %>
<%= options_for_select(ta_proportion_option,(100 - @homework.homework_detail_manual.te_proportion*100.round() - @homework.homework_detail_manual.ta_proportion*100.round() - @homework.homework_detail_programing.ta_proportion*100.round())/100) %>
</select>
</span>
</li>
<% else %>
<li class="clearfix">
<li class="clearfix pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">学生匿评</label>
<select class="task-height-40 task-form-30 <%= @homework.anonymous_comment == 1 ? 'disabled-bg' : 'normal-bg' %>" name="st_proportion" <%= @homework.anonymous_comment == 1 ? 'disabled' : '' %>>
<%= options_for_select(ta_proportion_option,(100 - @homework_detail_manual.te_proportion*100.round() - @homework_detail_manual.ta_proportion*100.round())/100) %>
<%= options_for_select(ta_proportion_option,(100 - @homework.homework_detail_manual.te_proportion*100.round() - @homework.homework_detail_manual.ta_proportion*100.round())/100) %>
</select>
</span>
</li>
<% end %>
<li class="clearfix mt30 edu-position">
<li class="clearfix mt30 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input id="homework_final_mode_0" class="magic-radio" type="radio" value="1" name="homework_final_mode" <%= @homework_detail_manual.final_mode ? 'checked' : '' %>>
<input id="homework_final_mode_0" class="magic-radio" type="radio" value="1" name="homework_final_mode" <%= @homework.homework_detail_manual.final_mode ? 'checked' : '' %>>
<label for="homework_final_mode_0">单项评分优先</label>
</span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
@ -150,7 +150,7 @@
</p>
</div>
</li>
<li class="clearfix mb50">
<li class="clearfix mb50 pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl ml25">
<% if @homework.homework_type == 2 %>
@ -163,4 +163,4 @@
</ul>
</div>
</div>
<% end %>
<% end %>

View File

@ -1,14 +1,19 @@
<% if homework_commons.count != 0 %>
<div class="mh550">
<% homework_commons.each_with_index do |homework_common, index|%>
<div class="clearfix edu-class-con-list pr">
<% unless homework_common.is_public %>
<div id="homework_public_<%= homework_common.id %>" >
<%# 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 ">
</div>-->
<%# end %>
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># <%= get_hw_index(homework_common, @is_teacher, @homework_type) + 1 %></span>
<% 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"%>
<%= 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 color-grey3"%>
<% unless homework_common.is_public %>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<% end %>
<% if homework_curr_status[:status] != "" %>
<span class="edu-filter-btn <%= homework_status_color homework_curr_status[:status] %> ml10 fl mt3"><%= homework_curr_status[:status] %></span>
<% end %>
@ -17,41 +22,41 @@
<span class="edu-filter-btn <%= homework_status_color allow_late %> ml10 fl mt3"><%= allow_late %></span>
<% end %>
<div class="cl"></div>
<p class="color-grey font-12">
<span class=""># <%= get_hw_index(homework_common, @is_teacher, @homework_type) + 1 %></span>
<span class="ml30">创建于<%=time_from_now homework_common.created_at %></span>
<p class="color-grey font-12 mt20">
<span>创建于<%=time_from_now homework_common.created_at %></span>
<!--<span class="ml30"><%#=homework_common.homework_type_ch %></span>-->
<% if [1,2,3,4,5,6].include?(homework_common.homework_detail_manual.try(:comment_status)) %>
<% if @is_teacher %>
<span class="ml30">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :status => ['1', '2']), :class => 'link-color-blue mr5', :target => '_blank' %>
<span class="ml50">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :status => ['1', '2']), :class => 'color-orange03 mr5', :target => '_blank' %>
已交
</span>
<span class="ml30">
<%= link_to had_uncommit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :status => ['0']), :class => 'link-color-blue mr5', :target => '_blank' %>
<span class="ml50">
<%= link_to had_uncommit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :status => ['0']), :class => 'color-orange03 mr5', :target => '_blank' %>
未交
</span>
<span class="ml30">
<%= link_to had_unevaluate_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :comment => ['0']), :class => 'link-color-blue mr5', :target => '_blank' %>
<span class="ml50">
<%= link_to had_unevaluate_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2, :comment => ['0']), :class => 'color-orange03 mr5', :target => '_blank' %>
未评
</span>
<% else %>
<span class="ml30">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2), :class => 'link-color-blue mr5', :target => '_blank' %>
<span class="ml50">
<%= link_to had_commit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2), :class => 'color-orange03 mr5', :target => '_blank' %>
已交
</span>
<span class="ml30">
<%= link_to had_uncommit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2), :class => 'link-color-blue mr5', :target => '_blank' %>
<span class="ml50">
<%= link_to had_uncommit_studentwork_count(homework_common), student_work_index_path(:homework => homework_common.id, :tab => 2), :class => 'color-orange03 mr5', :target => '_blank' %>
未交
</span>
<% end %>
<span class="ml30 color-orange"><%= homework_curr_status[:time] %></span>
<span class="ml50 <%= homework_common.homework_detail_manual.try(:comment_status) == 6 ? 'color-grey' : 'color-orange' %>"><%= homework_curr_status[:time] %></span>
<% end %>
</p>
</div>
<% if @is_teacher %>
<div class="fr edu-position edu-position-hidebox mr20 mt20">
<a href="javascript:void(0);"><i class="fa fa-ellipsis-v font-16"></i></a>
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<% if homework_common.homework_type != 4 %>
<li>
@ -61,16 +66,16 @@
<li>
<%= link_to "设置", setting_homework_common_path(homework_common) %>
</li>
<li><%= link_to "导出成绩", student_work_index_path(:homework => homework_common, :format => 'xls'), :id => "export_student_work" %></li>
<% if homework_common.homework_type == 1 || homework_common.homework_type == 3 %>
<li>
<% if homework_common.student_works.has_committed.empty?%>
<!--<li><%#= link_to "导出成绩", student_work_index_path(:homework => homework_common, :format => 'xls'), :id => "export_student_work" %></li>-->
<%# if homework_common.homework_type == 1 || homework_common.homework_type == 3 %>
<!--<li>
<%# if homework_common.student_works.has_committed.empty?%>
<a href="javascript:void(0)" onclick="notice_box('没有学生提交作业,暂无附件可下载');">导出作品附件</a>
<% else%>
<%= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common, format: :json), remote: true, :class => "download_homework_attachments" %>
<% end%>
</li>
<% end %>
<%# else%>
<%#= link_to "导出作品附件", zipdown_assort_path(obj_class: homework_common.class,obj_id: homework_common, format: :json), remote: true, :class => "download_homework_attachments" %>
<%# end%>
</li>-->
<%# end %>
<% unless homework_common.is_public %>
<li id="set_homework_public_<%= homework_common.id %>">
<a href="javascript:void(0);" onclick="delete_confirm_box('<%= set_public_homework_common_path(homework_common) %>', '您确定要公开吗?<br/>公开后不能重设为私有')">设为公开</a>
@ -99,9 +104,9 @@
<% end %>
</div>
<% end %>
<% if @obj_count > 20 %>
<% if @obj_count > 15 %>
<div style="text-align:center;">
<div class="pages" style="width:auto; display:inline-block;">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true, :is_new => true %>
</ul>
@ -109,8 +114,9 @@
</div>
</div>
<% end %>
</div>
<% else %>
<div style="background-color: #fff;padding-bottom: 10px;">
<%= render :partial => "welcome/no_data" %>
</div>
<% end %>
<% end %>

View File

@ -1,4 +1,19 @@
<%= form_tag(homework_common_index_path(:course => @course.id, :order => @order, :homework_type => @homework_type), :remote => true , :method => 'get', :id => 'resource_search_form') do %>
<input type="text" name="search" placeholder="输入作业名称进行搜索" class="task-form-100 panel-box-sizing" id="homework_name_search" value="<%= @search %>" />
<a href="javascript:void(0);" onfocus = 'this.blur();' onclick="$('#resource_search_form').submit();" class="edu-btn-search font-16 color-grey mt8"><i class="fa fa-search"></i></a>
<% end %>
<!--<input type="text" name="search" placeholder="输入作业名称进行搜索" class="task-form-100 panel-box-sizing" id="homework_name_search" value="<%#= @search %>" />
<a href="javascript:void(0);" onfocus = 'this.blur();' onclick="$('#resource_search_form').submit();" class="edu-btn-search font-16 color-grey mt8"><i class="fa fa-search"></i></a>-->
<div class="edu-find fr with95 mr20 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" name="search" placeholder="输入作业名称进行搜索" value="<%= @search %>" id="homework_name_search"/>
<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>
</div>
<a href="javascript:void(0);" onclick="$('#resource_search_form').submit();" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
</div>
<% end %>
<script>
function colse_searchbox(){
$("#homework_name_search").val("");
$('#resource_search_form').submit();
}
</script>

View File

@ -1,5 +1,5 @@
<div class="edu-con-top user_bg_shadow">
<p class="ml15 color-grey"><%= edit_mode ? '编辑' : '新建' %>普通作业</p>
<div class="edu-con-top user_bg_shadow bor-grey-e">
<p class="ml15 color-grey3"><%= edit_mode ? '编辑' : '新建' %>普通作业</p>
</div>
<div class="alert alert-red mt15 none" id="new_homework_notice">
<button class="task-close fr" type="button">×</button>
@ -7,17 +7,16 @@
<ul>
</ul>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow" style="padding:30px 0;">
<div class="ml30 mr30">
<div class="">
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" style="padding:30px 0;">
<div>
<ul>
<input type="hidden" name="homework_type" value="<%= @homework_type %>">
<li class="clearfix mb15">
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>标题&nbsp;&nbsp;&nbsp;</label>
<li class="clearfix mb15 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"><span class="color-orange mr5">*</span>标题&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="homework_common[name]" id="new_homework_name" value="<%= @homework.name %>" class="panel-form-width-690 panel-form-height-30 fl panel-box-sizing" maxlength="60" placeholder="最多60个字符" />
</li>
<li class="clearfix mb5">
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>内容&nbsp;&nbsp;&nbsp;</label>
<li class="clearfix mb5 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"><span class="color-orange mr5">*</span>内容&nbsp;&nbsp;&nbsp;</label>
<%= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
<%= f.kindeditor :description, :editor_id => 'homework_description_editor',
@ -32,12 +31,14 @@
:maxlength => 5000 }
%>
</li>
<li class="clearfix mb15">
<li class="clearfix mb15 pl30 pr30 bor-bottom-greyE">
<%= render :partial => 'users/user_homework_attachment', :locals => {:container => @homework} %>
</li>
<li class="clearfix mb5">
<label class="panel-form-label fl"> 参考答案&nbsp;&nbsp;</label>
<li class="clearfix mb10 pl30 pr30">
<div class="alert alert-orange mb15 mt15" style="margin-left: 10%">是否允许学生在作业结束时间后查看参考答案,请在作业设置中进行设置</div>
</li>
<li class="clearfix mb5 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"> 参考答案&nbsp;&nbsp;</label>
<textarea class="panel-form-width-690 panel-form-height-150 fl task-textarea-pd" style="display: none;"></textarea>
<%= f.kindeditor :reference_answer, :editor_id => 'homework_ref_answer_editor',
:owner_id => @ref_answer.nil? ? 0: @ref_answer.id,
@ -54,7 +55,7 @@
<!--<li class="clearfix">-->
<!--<%#= render :partial => 'homework_common/reference_answers_attachments', :locals => {:container => @ref_answer} %>-->
<!--</li>-->
<li class="clearfix mt10">
<li class="clearfix mt10 pl30 pr30">
<a href="javascript:void(0);" onclick="submit_new_common_homework(1);" class="task-btn task-btn-blue fr">保存</a>
<% if edit_mode %>
<%= link_to '取消', student_work_index_path(:homework => @homework.id), :class => 'task-btn fr mr10' %>
@ -64,5 +65,4 @@
</li>
</ul>
</div>
</div>
</div>

View File

@ -1,11 +1,10 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">匿评设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">匿评设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix edu-position">
<label class="panel-form-label fl mr10">&nbsp;</label>
<ul class="pl30">
<li class="clearfix edu-position pl20 mb15">
<input class="magic-checkbox fl mt5 magic-checkbox_show" disabled type="checkbox" <%= @homework.anonymous_comment == 1 ? '' : 'checked' %>>
<label class="fl">启用匿评</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
@ -17,24 +16,23 @@
</li>
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">开始时间</label>
<input type="text" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" value="<%= format_time @homework_detail_manual.evaluation_start %>" id="show_evaluation_start" placeholder="选择匿评开启时间" />
<input type="text" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" value="<%= format_time @homework.homework_detail_manual.evaluation_start %>" id="show_evaluation_start" placeholder="选择匿评开启时间" />
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">结束时间</label>
<input type="text" disabled value="<%= format_time @homework_detail_manual.evaluation_end %>" id="show_evaluation_end" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="选择匿评结束时间" />
<input type="text" disabled value="<%= format_time @homework.homework_detail_manual.evaluation_end %>" id="show_evaluation_end" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="选择匿评结束时间" />
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">匿评数量</label>
<input type="text" disabled value="<%= @homework_detail_manual.evaluation_num %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="3" />
<input type="text" disabled value="<%= @homework.homework_detail_manual.evaluation_num %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="3" />
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">缺评扣分</label>
<input type="text" disabled value="<%= @homework_detail_manual.absence_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="2" />
<input type="text" disabled value="<%= @homework.homework_detail_manual.absence_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="2" />
</li>
</ul>
<ul class="mt50 mb50 <%= @homework.anonymous_appeal == 1 ? '' : 'none' %>">
<li class="clearfix edu-position">
<label class=" panel-form-label fl mr10">&nbsp;</label>
<ul class="mt50 pl30 mb50 <%= @homework.anonymous_appeal == 1 ? '' : 'none' %>">
<li class="clearfix edu-position pl20 mb15">
<input class="magic-checkbox fl mt5" disabled type="checkbox" <%= @homework.anonymous_appeal == 0 ? '' : 'checked' %>>
<label class="fl">启用匿评申诉</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
@ -50,41 +48,15 @@
</p>
</div>
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class="panel-form-label fl mr10">申诉结束时间</label>
<input type="text" disabled value="<%= format_time @homework_detail_manual.appeal_time %>" id="show_appeal_time" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="选择匿评开启时间" />
<input type="text" disabled value="<%= format_time @homework.homework_detail_manual.appeal_time %>" id="show_appeal_time" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="选择匿评开启时间" />
</li>
<li class="clearfix mb15 ">
<li class="clearfix mb15">
<label class=" panel-form-label fl mr10">违规匿评扣分</label>
<input type="text" disabled value="<%= @homework_detail_manual.appeal_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="3" />
<input type="text" disabled value="<%= @homework.homework_detail_manual.appeal_penalty %>" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="3" />
</li>
</ul>
</div>
</div>
<script>
function anon_cancel_edit(){
hideModal();
$('#show_anon_setting').show();
$('#edit_anon_setting').html("<%= j(render :partial => 'edit_anon_setting') %>").hide();
$("input[name='homework_evaluation_start']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
$("input[name='homework_evaluation_end']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
$("input[name='homework_appeal_time']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
}
</script>
</div>

View File

@ -1,11 +1,11 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">补交设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">补交设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul>
<li class="clearfix mb20 edu-position">
<label class="panel-form-label fl mr10">作品补交</label>
<li class="clearfix mb20 edu-position pl50">
<label class="mt5 fl mr10">是否允许在截止日期之后进行补交</label>
<input class="magic-radio fl mt6" type="radio" disabled value="1" <%= @homework.allow_late ? 'checked' : '' %>>
<label class="fl mt6 mr30">允许补交</label>
<input class="magic-radio fl mt6" type="radio" disabled value="0" <%= @homework.allow_late ? '' : 'checked' %>>
@ -25,18 +25,10 @@
</li>
</ul>
<ul>
<li class="clearfix mb15">
<li class="clearfix mb15 pl30">
<label class="panel-form-label fl mr10">迟交扣分</label>
<input type="text" value="<%= @homework.late_penalty %>" disabled class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="5" />
</li>
</ul>
</div>
</div>
<script>
function late_cancel_edit(){
hideModal();
$('#show_late_setting').show();
$('#edit_late_setting').html("<%= j(render :partial => 'edit_late_setting') %>").hide();
}
</script>
</div>

View File

@ -7,10 +7,10 @@
height: 16px;
}
</style>
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">公开设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">公开设置</p>
</div>
<div class="ml30 mr30">
<div class="ml30 mr30 mb15">
<div class="clearfix">
<ul>
<% if @homework.homework_type != 4 %>
@ -18,36 +18,23 @@
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled <%= @homework.work_public ? 'checked' : '' %>>
<label class="fl">公开作品</label>
<span class="fl color-grey">(选中则在作业结束时间之后对班级学生公开所有作品,否则作品不公开)</span>
<span class="fl color-grey">(选中则在作业结束时间之后对课堂成员公开所有作品,否则作品不公开)</span>
</li>
<% end %>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled <%= @homework.score_open == 1 ? 'checked' : '' %>>
<label class="fl">公开成绩</label>
<span class="fl color-grey">(选中则在作业结束时间之后对班级学生公开作品成绩,否则成绩不公开)</span>
<span class="fl color-grey">(选中则在作业结束时间之后对课堂成员公开作品成绩,否则成绩不公开)</span>
</li>
<% if @homework.homework_type != 4 %>
<li class="clearfix ">
<label class=" panel-form-label fl mr10">&nbsp;</label>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled <%= @homework.answer_public ? 'checked' : '' %>>
<label class=" fl">公开答案</label>
<span class=" fl color-grey">(选中则在作业结束时间之后对班级学生公开作业答案,否则答案不公开)</span>
<span class=" fl color-grey">(选中则在作业结束时间之后对课堂成员公开作业答案,否则答案不公开)</span>
</li>
<% end %>
</ul>
</div>
</div>
<script>
function score_cancel_edit(){
hideModal();
$('#show_score_setting').show();
$('#edit_score_setting').html("<%= j(render :partial => 'edit_score_setting') %>").hide();
}
function public_cancel_edit(){
hideModal();
$('#show_public_setting').show();
$('#edit_public_setting').html("<%= j(render :partial => 'edit_public_setting') %>").hide();
}
</script>
</div>

View File

@ -1,13 +1,13 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">发布设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt5">发布设置</p>
<% if @is_teacher %>
<a href="javascript:void(0);" class="task-btn task-btn-blue fr mr15" title="编辑" onclick="show_edit_setting();">编辑</a>
<a href="javascript:void(0);" class="white-btn orange-btn fr mr15 mt15" title="编辑" onclick="show_edit_setting();">编辑</a>
<% end %>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">发布时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" value="<%= format_time @homework.publish_time %>" disabled />
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
@ -16,7 +16,7 @@
<p>发布之前,学生不会收到作业</p>
</div>
</li>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">截止时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_end_time" value="<%= format_time @homework.end_time %>" disabled />
<div class="cl"></div>
@ -26,7 +26,7 @@
<p><%= @homework.homework_type == 4 ? "截止时间后,系统将根据学生完成情况计算成绩" : "截止时间过后,学生不能修改作品和追加附件" %></p>
</div>
</li>
<li class="clearfix mb15 edu-position">
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">结束时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_archive_time" value="<%= format_time @homework.archive_time %>" disabled />
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
@ -37,52 +37,4 @@
</li>
</ul>
</div>
</div>
<script>
function publish_cancel_edit(){
hideModal();
$('#show_publish_setting').show();
$('#edit_publish_setting').html("<%= j(render :partial => 'edit_publish_setting') %>").hide();
$("input[name='homework_publish_time']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false,
onSelectDate:function() {
$("#reset_publish_time").show();
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
},
onSelectTime:function() {
$("#reset_publish_time").show();
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
}
});
$("input[name='homework_end_time']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false,
onSelectDate:function() {
$("#reset_end_time").show();
},
onSelectTime:function() {
$("#reset_end_time").show();
}
});
$("input[name='homework_archive_time']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
});
}
</script>
</div>

View File

@ -1,5 +1,5 @@
<div class="edu-con-top clearfix mb15">
<p class="ml15 fl">评分设置</p>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt15">评分设置</p>
</div>
<% if @homework.homework_type == 4 %>
<div class="ml30 mr30 pb10">
@ -10,9 +10,9 @@
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-radio fl mt6" type="radio" disabled value="1" <%= @homework_detail_manual.answer_open_evaluation ? '' : 'checked' %>>
<input class="magic-radio fl mt6" type="radio" disabled value="1" <%= @homework.homework_detail_manual.answer_open_evaluation ? '' : 'checked' %>>
<label class="fl mt6 mr30">零分</label>
<input class="magic-radio fl mt6" type="radio" disabled value="0" <%= @homework_detail_manual.answer_open_evaluation ? 'checked' : '' %>>
<input class="magic-radio fl mt6" type="radio" disabled value="0" <%= @homework.homework_detail_manual.answer_open_evaluation ? 'checked' : '' %>>
<label class="fl mt6">满分</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
@ -43,14 +43,14 @@
<% else %>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<ul class="pl30">
<li class="clearfix">
<label class="panel-form-label fl mr10">助教评分</label>
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input class="magic-radio" disabled type="radio" <%= @homework_detail_manual.ta_mode == 1 ? 'checked' : '' %>>
<input class="magic-radio" disabled type="radio" <%= @homework.homework_detail_manual.ta_mode == 1 ? 'checked' : '' %>>
<label>普通模式</label>
</span>
<span class="fl color-grey">(选中则取各助教最终评分的平均分)</span>
@ -58,7 +58,7 @@
<li class="clearfix ">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input class="magic-radio" disabled type="radio" <%= @homework_detail_manual.ta_mode == 0 ? 'checked' : '' %>>
<input class="magic-radio" disabled type="radio" <%= @homework.homework_detail_manual.ta_mode == 0 ? 'checked' : '' %>>
<label>复审模式</label>
</span>
<span class="fl color-grey">(选中则只取最终次的助教评分)</span>
@ -69,7 +69,7 @@
<li class="clearfix edu-position">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input class="magic-radio" type="radio" disabled <%= @homework_detail_manual.final_mode ? '' : 'checked' %>>
<input class="magic-radio" type="radio" disabled <%= @homework.homework_detail_manual.final_mode ? '' : 'checked' %>>
<label>多项评分配比</label>
</span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
@ -94,14 +94,14 @@
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">教师评分</label>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework_detail_manual.te_proportion * 100).to_i %>%" disabled>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework.homework_detail_manual.te_proportion * 100).to_i %>%" disabled>
</span>
</li>
<li class="clearfix ">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">助教评分</label>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework_detail_manual.ta_proportion * 100).to_i %>%" disabled>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework.homework_detail_manual.ta_proportion * 100).to_i %>%" disabled>
</span>
</li>
<% if @homework.homework_type == 2 %>
@ -109,14 +109,14 @@
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">系统评分</label>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework_detail_programing.ta_proportion * 100).to_i %>%" disabled>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= (@homework.homework_detail_programing.ta_proportion * 100).to_i %>%" disabled>
</span>
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">学生匿评</label>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= 100 - (@homework_detail_manual.te_proportion * 100).to_i - (@homework_detail_manual.ta_proportion * 100).to_i - (@homework_detail_programing.ta_proportion * 100).to_i%>%" disabled>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= 100 - (@homework.homework_detail_manual.te_proportion * 100).to_i - (@homework.homework_detail_manual.ta_proportion * 100).to_i - (@homework.homework_detail_programing.ta_proportion * 100).to_i%>%" disabled>
</span>
</li>
<% else %>
@ -124,14 +124,14 @@
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5 task-form-30 ml20">
<label class="mr5">学生匿评</label>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= 100 - (@homework_detail_manual.te_proportion * 100).to_i - (@homework_detail_manual.ta_proportion * 100).to_i %>%" disabled>
<input type="text" class="task-height-40 task-form-30 panel-box-sizing disabled-bg" value="<%= 100 - (@homework.homework_detail_manual.te_proportion * 100).to_i - (@homework.homework_detail_manual.ta_proportion * 100).to_i %>%" disabled>
</span>
</li>
<% end %>
<li class="clearfix mt30 edu-position">
<label class="panel-form-label fl mr10">&nbsp;</label>
<span class="fl mr5">
<input class="magic-radio" type="radio" disabled <%= @homework_detail_manual.final_mode ? 'checked' : '' %>>
<input class="magic-radio" type="radio" disabled <%= @homework.homework_detail_manual.final_mode ? 'checked' : '' %>>
<label>单项评分优先</label>
</span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
@ -158,11 +158,4 @@
</ul>
</div>
</div>
<% end %>
<script>
function score_cancel_edit(){
hideModal();
$('#show_score_setting').show();
$('#edit_score_setting').html("<%= j(render :partial => 'edit_score_setting') %>").hide();
}
</script>
<% end %>

View File

@ -1,13 +1,13 @@
<div class="with85 fl">
<div class="ml15 user_bg_shadow">
<div class="ml15 user_bg_shadow bor-grey-e">
<div class="edu-con-top clearfix">
<p class="ml15 color-grey fl">作业列表</p>
<p class="ml15 color-grey fl"><%= @homework_type == 4 ? '实训列表' : '作业列表' %></p>
<% if @is_teacher %>
<% if @homework_type != 4 %>
<%= link_to '新建', new_homework_common_path(:course => @course.id, :homework_type =>@homework_type), :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %>
<%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "edu-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %>
<%= link_to '新建', new_homework_common_path(:course => @course.id, :homework_type =>@homework_type), :class => "white-btn orange-btn fr mr20", :title => "新建作业" %>
<%= link_to("题库选用", user_import_homeworks_user_path(User.current.id, :select_course => @course.id, :homework_type =>@homework_type), :class => "white-btn orange-btn fr mr10",:remote => true,:title=>"导入自己发布过的作业,或者共享题库中的作业") %>
<% else %>
<%= link_to '选用实训', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "task-btn task-btn-blue fr mr20", :title => "新建作业" %>
<%= link_to '选用实训', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "white-btn orange-btn fr mr20", :title => "新建作业" %>
<% end %>
<% end %>
<!--<a href="<%#= export_course_member_excel_course_path(@course) %>" class="edu-btn fr mr10">导出成绩</a>-->
@ -17,9 +17,10 @@
<p class="fl task-form-60 mt3 ml15" id="homework_index_tab">
<%= render :partial => "homework_common/homework_index_tab" %>
</p>
<div id="search_div" class="edu-position fr task-form-30 mr15">
<div id="search_div" class="edu-position fr task-form-30 mr15" style="padding: 0px">
<%= render :partial => 'homework_search_form', :locals => {:course => @course} %>
</div>
</div>
<div id="homework_index_list" class="mh400">
<%= render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks,:course_id => @course.id} %>

View File

@ -1,3 +1,3 @@
$("#homework_index_list").html("<%=escape_javascript(render :partial => 'homework_common/homework_index_list', :locals => {:homework_commons => @homeworks, :course_id => @course.id, :order => @order, :search => @search}) %>");
$("#homework_index_tab").html("<%= j( render :partial => "homework_common/homework_index_tab") %>");
$("#search_div").html("<%= j( render :partial => "homework_common/homework_search_form") %>");
//$("#search_div").html("<%#= j( render :partial => "homework_common/homework_search_form") %>");

View File

@ -10,65 +10,67 @@
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e">
<p class="ml15 color-grey fl">
<p class="ml15 color-grey3 fl">
<% if !@homework.is_public %>
<i class="fa fa-lock mr5"></i>
<i class="fa fa-lock mr5 color-grey"></i>
<% end %>
<%= @homework.name %></p>
<%= link_to '作业详情', student_work_index_path(:homework => @homework.id), :class => 'fr font-12 mr15 color-blue mt3' %>
<%= link_to '作业详情', student_work_index_path(:homework => @homework.id), :class => 'fr font-12 mr15 color-orange03 mt3' %>
</div>
<%= form_tag(homework_setting_homework_common_path(@homework), :method => "post", :id => 'homework_setting_form') do |f| %>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="homework_publish_setting">
<% edit_mode = @is_new && @is_teacher %>
<div class="<%= edit_mode ? 'none' : '' %>" id="show_publish_setting">
<%= render :partial => 'show_publish_setting' %>
<div class="edu-con-bg01 mt30 user_bg_shadow bor-grey-e" id="homework_publish_setting">
<!--发布设置-->
<div class="bor-bottom-greyE pt10 pb10 pl30 pr30">
<% edit_mode = @is_new && @is_teacher %>
<div class="<%= edit_mode ? 'none' : '' %>" id="show_publish_setting">
<%= render :partial => 'show_publish_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_publish_setting">
<%= render :partial => 'edit_publish_setting' %>
</div>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_publish_setting">
<%= render :partial => 'edit_publish_setting' %>
</div>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="homework_late_setting">
<!--补交设置-->
<div class="bor-bottom-greyE pt10 pb10 pl30 pr30">
<div class="<%= edit_mode ? 'none' : '' %>" id="show_late_setting">
<%= render :partial => 'show_late_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_late_setting">
<%= render :partial => 'edit_late_setting' %>
</div>
</div>
<% if @homework.homework_type != 4 %>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="homework_anon_setting">
<div class="<%= edit_mode ? 'none' : '' %>" id="show_anon_setting">
<%= render :partial => 'show_anon_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_anon_setting">
<%= render :partial => 'edit_anon_setting' %>
</div>
</div>
<% end %>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="homework_score_setting">
</div></div>
<!--匿评设置-->
<% if @homework.homework_type != 4 %>
<div class="bor-bottom-greyE pt10 pb10 pl30 pr30">
<div class="<%= edit_mode ? 'none' : '' %>" id="show_anon_setting">
<%= render :partial => 'show_anon_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_anon_setting">
<%= render :partial => 'edit_anon_setting' %>
</div></div>
<% end %>
<!--评分设置-->
<div class="bor-bottom-greyE pt10 pb10 pl30 pr30">
<div class="<%= edit_mode ? 'none' : '' %>" id="show_score_setting">
<%= render :partial => 'show_score_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_score_setting">
<%= render :partial => 'edit_score_setting' %>
</div>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="homework_public_setting">
</div></div>
<!--公开设置-->
<div class="pt10 pl30 pr30">
<div class="<%= edit_mode ? 'none' : '' %>" id="show_public_setting">
<%= render :partial => 'show_public_setting' %>
</div>
<div class="<%= edit_mode ? '' : 'none' %>" id="edit_public_setting">
<%= render :partial => 'edit_public_setting' %>
</div>
</div>
<div class="clearfix mt15 mb15 mr15 pl30 pr30 <%= edit_mode ? '' : 'none' %>" id="homework_setting_submit_block">
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">确定</a>
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_work_index_path(:homework => @homework.id) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
</div>
</div>
<div class="clearfix mt15 <%= edit_mode ? '' : 'none' %>" id="homework_setting_submit_block">
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">确定</a>
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_work_index_path(:homework => @homework.id) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
</div>
<% end %>
</div>

View File

@ -20,14 +20,20 @@
</div>
<div class="edu-class-box">
<div class="edu-class-top clearfix mb20 pr user_bg_shadow">
<div class="edu-class-top clearfix mb20 pr user_bg_shadow bor-grey-e">
<!-- <div class="edu-class-img fl">
<%= image_tag(url_to_avatar(@course),width:"178", height: "100", :id=>'nh_source_tx') %>
</div>
-->
<ul class="fl edu-class-top-info ml15" style="width:95%;" >
<li class="mb10 font-16 clearfix">
<span class="fl " style="width:80%;"><%= @course.name %> </span>
<ul class="fl edu-class-top-info" style="width:100%;" >
<li class="mb10 font-16 clearfix mr30">
<span class="fl" style="width:80%;">
<span class="fl"><%= @course.name %></span>
<% if @course.is_public == 0 %>
<i class="fa fa-lock color-grey font-18 ml10 fl mt8"></i>
<% end %>
</span>
<span class="fl font-14 fr">邀请码:<span class="color-orange">
<% if @course.invite_code_halt == 0 %>
<% if User.current.admin? || User.current.member_of_course?(@course) %>
@ -68,11 +74,11 @@
<% is_TE = get_user_member_roles_course @course, User.current, 9 %>
<% is_ST = get_user_member_roles_course @course, User.current, 10 %>
<% if !is_teacher && (is_TE || is_AD) %>
<%= link_to '切换为教师', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TE ? 9 : 3)), :class => "btn color-grey font-14", :title => "由学生身份切换至教师身份" %>
<%= link_to '切换为教师', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => (is_TE ? 9 : 3)), :class => "white-btn orange-btn font-14 fr", :title => "由学生身份切换至教师身份" %>
<% elsif !is_teacher && is_TA %>
<%= link_to '切换为助教', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => 7), :class => "btn color-grey font-14", :title => "由学生身份切换至助教身份" %>
<%= link_to '切换为助教', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => 10, :tar_role => 7), :class => "white-btn orange-btn font-14 fr", :title => "由学生身份切换至助教身份" %>
<% elsif is_teacher && is_ST %>
<%= link_to '切换为学生', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : (is_TE ? 9 : 3)), :tar_role => 10), :class => "btn color-grey font-14", :title => "由教师身份切换至学生身份" %>
<%= link_to '切换为学生', switch_role_course_path(@course, :user_id => User.current.id, :curr_role => (is_TA ? 7 : (is_TE ? 9 : 3)), :tar_role => 10), :class => "white-btn orange-btn font-14 fr", :title => "由教师身份切换至学生身份" %>
<% end %>
<% unless (is_teacher || is_TA || is_TE || is_ST) %>
@ -85,7 +91,7 @@
<% if is_teacher %>
<div class="fr edu-position edu-position-hidebox" style="margin-top:-3px;" >
<div class="fr edu-position edu-position-hidebox" style="margin-top:-3px;position: absolute;right: 22px" >
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0);" onclick="delete_confirm_box('<%=private_or_public_course_path(@course) %>', '您确定要设置为<%= @course.is_public == 0 ? "公开" : "私有" %>吗?');"><%= @course.is_public == 0 ? "设为公开" : "设为私有" %></a></li>
@ -100,7 +106,7 @@
</div>
<% elsif User.current.logged? && User.current.member_of_course?(@course) %>
<div class="fr edu-position edu-position-hidebox" style="margin-top:-3px;" >
<div class="fr edu-position-hidebox" style="margin-top:-3px;position: absolute;right: 22px" >
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('<%=join_path(:object_id => @course.id) %>', '您确定要退出该班级吗?');">退出班级</a></li>

View File

@ -6,14 +6,14 @@
<li class="clearfix" id="sy_04">
<a href="<%= course_news_index_path(@course) %>" class="fl ml15 ">通知</a>
<span class="edu-cir-grey fl ml10 mt15"><%= @course.news.count %></span>
<%= link_to( "+",new_course_news_path(@course, :is_new => 1), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_course_news_new)}") if is_teacher %>
<%#= link_to( "+",new_course_news_path(@course, :is_new => 1), :class => 'fr mr15 font-18 link-color-grey', :title => "#{l(:label_course_news_new)}") if is_teacher %>
</li>
<% count = course_board ? course_board.messages.count : 0 %>
<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( "+", 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? %>
</li>
<li class="clearfix" id="sy_05">
@ -36,13 +36,13 @@
<li class="clearfix" id="sy_08">
<a href="<%= User.current.logged? ? exercise_index_path(:course_id => @course.id) : signin_url_without_domain %>" class="fl ml15 ">试卷</a>
<span class="edu-cir-grey fl ml10 mt15"><%= count %></span>
<%= link_to( "+", new_exercise_path(:course_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"新建试卷") if is_teacher %>
<%#= link_to( "+", new_exercise_path(:course_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"新建试卷") if is_teacher %>
</li>
<li class="clearfix" id="sy_07">
<a href="<%=poll_index_path(:polls_type => "Course", :polls_group_id => @course.id) %>" class="fl ml15 ">问卷</a>
<span class="edu-cir-grey fl ml10 mt15"><%=course_poll_count %></span>
<%= link_to( "+", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"#{l(:label_new_poll)}") if is_teacher %>
<%#= link_to( "+", new_poll_path(:polls_type => "Course",:polls_group_id => @course.id), :class => 'fr mr15 font-18 link-color-grey', :title =>"#{l(:label_new_poll)}") if is_teacher %>
</li>
<li class="clearfix" id="sy_010">

View File

@ -9,7 +9,7 @@
<div class="cl"></div>
<div class="fl mt20" style="width:650px;height: 50px">
<!-- <p class="footer_con-p">Email:zhiqingcs@163.com</p>-->
<p class="footer_con-p">Copyright 2007~2017, All Rights Reserved.&nbsp;&nbsp;湘ICP备17009477号<br />Powered by Trustie and IntelliDE.</p>
<p class="footer_con-p">Copyright 2007~2017, All Rights Reserved.&nbsp;&nbsp;湘ICP备17009477号<br />Powered by <a href="www.trustie.net" style="color: #888;">Trustie</a> and <a href="intellide.trustie.net" style="color: #888;">IntelliDE</a>.</p>
</div>
<div class="fr mt20">
<!--<ul class="saoma-box fl mr30">-->

View File

@ -41,7 +41,7 @@
</script>
</head>
<!--add by huang-->
<body onload="prettyPrint();" style="height: 100%;">
<body onload="prettyPrint();" style="height: 100%;background: #fff">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<% if User.current.logged? %>
@ -65,7 +65,7 @@
</div>
<div class="edu-class-inner mb20 clearfix">
<div class="with15 fl ">
<div class="mb10 user_bg_shadow">
<div class="mb10 user_bg_shadow bor-grey-e">
<ul class="edu-class-leftnav">
<li class="clearfix" id="sy_01">
<a href="<%= course_path(@course) %>" class="fl ml15">动态</a>
@ -73,9 +73,9 @@
<li class="clearfix" id="sy_03_1">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 1) %>" class="fl ml15 ">普通作业</a>
<span class="edu-cir-grey fl ml10 mt15"><%= visable_course_homework @course, 1 %></span>
<% if is_teacher %>
<%= link_to '+', new_homework_common_path(:course => @course.id, :homework_type => 1), :class => "fr mr15 font-18 link-color-grey", :title => "新建作业" %>
<% end %>
<%# if is_teacher %>
<%#= link_to '+', new_homework_common_path(:course => @course.id, :homework_type => 1), :class => "fr mr15 font-18 link-color-grey", :title => "新建作业" %>
<%# end %>
</li>
<!--<li class="clearfix" id="sy_03_2">-->
<!--<a href="<%#= homework_common_index_path(:course => @course.id, :homework_type => 2) %>" class="fl ml15 ">编程作业</a>-->
@ -94,23 +94,23 @@
<li class="clearfix" id="sy_03_4">
<a href="<%= homework_common_index_path(:course => @course.id, :homework_type => 4) %>" class="fl ml15 ">实训作业</a>
<span class="edu-cir-grey fl ml10 mt15"><%= visable_course_homework @course, 4 %></span>
<% if is_teacher %>
<%= link_to '+', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "fr mr15 font-18 link-color-grey", :title => "新建作业" %>
<% end %>
<%# if is_teacher %>
<%#= link_to '+', shixuns_homework_common_index_path(:course => @course.id), :remote => true, :class => "fr mr15 font-18 link-color-grey", :title => "新建作业" %>
<%# end %>
</li>
<li class="clearfix" id="sy_05">
<a href="<%= course_files_path(@course) %>" class="fl ml15 ">资源</a>
<span class="edu-cir-grey fl ml10 mt15"><%= course_file_num %></span>
<% if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<a class="fr mr15 font-18 link-color-grey" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();">+</a>
<% end %>
<%# if is_teacher || (@course.publish_resource == 1 && User.current.member_of_course?(@course)) %>
<!--<a class="fr mr15 font-18 link-color-grey" title="上传资源" href="javascript:void(0);" onclick="course_files_upload();">+</a>-->
<%# end %>
</li>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<% count = course_board ? course_board.messages.count : 0 %>
<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( "+", 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? %>
<%#= 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

@ -14,7 +14,7 @@
<%= call_hook :view_layouts_base_html_head %>
<%= yield :header_tags -%>
</head>
<body onload="prettyPrint();" style="">
<body onload="prettyPrint();" style="background:#fff;height: 100%">
<div class="newContainer"> <!-- 页面全部内容 -->
<div class="newHeader"> <!-- 头部 -->
<div class="header"><%= render :partial => User.current.logged? ? 'layouts/logined_header' : 'layouts/unlogin_header' %></div>

View File

@ -9,7 +9,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/font-awesome','css/taskstyle', 'css/project','css/popup','repository','css/gantt','css/cssPlus-v.0.2-build', 'css/edu-common','css/edu-public', 'css/edu-popup', 'css/edu-tooltipster' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/font-awesome','css/taskstyle', 'css/project','css/popup','repository','css/gantt','css/cssPlus-v.0.2-build', 'css/edu-common','css/edu-public', 'css/edu-popup', 'css/edu-tooltipster', 'css/magic-check' %>
<%= javascript_include_tag 'edu/application', 'edu/edu_tpi' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->

View File

@ -1,13 +1,31 @@
<div class="panel-mes-head clearfix">
<h4 class="fl">全部回复<span class="ml5"><%= count %></span></h4>
<h4 class="fl">全部回复<span class="ml5">(<%= count %>)</span></h4>
<p class="fr mr15">
<span class="mr10 color-grey"><i class="fa fa-eye color-grey mr5"></i><%= @topic.visits %></span>
<span id="praise_count_<%=activity.id %>">
<%= render :partial => 'praise_tread/edu_praise', :locals => {:activity=>activity, :user_activity_id=>activity.id,:type=>"activity"} %>
<a href="javascript:void(0);" class="mr15 white-btn orange-btn" onclick="editor_focus(<%= activity.id %>);"><i class="fa fa-comments-o mr5"></i>回复<!--<span class="ml5"><%#= count %></span>--></a>
<!--<span class="mr10 color-grey"><i class="fa fa-eye color-grey mr5"></i><%#= @topic.visits %></span>-->
<!--<span id="praise_count_<%=activity.id %>">
<%#= render :partial => 'praise_tread/edu_praise', :locals => {:activity=>activity, :user_activity_id=>activity.id,:type=>"activity"} %>
</span>-->
<span id="praise_count_<%=activity.id %>" class="fr mr10">
<%#= render :partial => 'praise_tread/edu_praise', :locals => {:activity=>activity, :user_activity_id=>activity.id,:type=>"activity"} %>
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<a href="javascript:void(0)" class="white-btn orange-btn" onclick="ThumbUp(this)" attr-thumb="0"><i class="fa fa-thumbs-up mr5" attr-thumb="0"></i><span><%= (num.nil? ? 0 : num) > 0 ? num : 0 %></span></a>
</span>
<a href="javascript:void(0);" class="mr15" onclick="editor_focus(<%= activity.id %>);"><i class="fa fa-comments-o mr5"></i>回复<span class="ml5"><%= count %></span></a>
</p>
</div>
<script>
function ThumbUp(item){
$(item).toggleClass("orange-btn");
$(item).toggleClass("orange-bg-btn");
if($(item).attr("attr-thumb")=="0"){
$(item).find("span").html(parseInt($(item).find("span").html())+1);
$(item).attr("attr-thumb","1");
}else{
$(item).find("span").html(parseInt($(item).find("span").html())-1);
$(item).attr("attr-thumb","0");
}
}
</script>
<div class="panel-comment_item">
<% no_children_comments.each do |comment| %>
<% unless comment.nil? %>
@ -22,14 +40,8 @@
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
</div>
<div class="t_content fl">
<div class="J_Comment_Info">
<div class="t_info clearfix">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
</div>
<div class="J_Comment_Reply">
<div class="comment_orig_content">
<div class="comment_orig_content" style="margin:0px">
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
<% parents_rely = [] %>
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
@ -60,23 +72,10 @@
<% end %>
</div>
<% end %>
<div class="comment_content clearfix" onmouseover="$('#delete_reply_<%=activity.id %>_<%=comment.id %>').show();" onmouseout="$('#delete_reply_<%=activity.id %>_<%=comment.id %>').hide();">
<div class="t_txt"><%= comment.content_detail.html_safe %></div>
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
<div class="comment_content clearfix" >
<div class="color-grey3"><%= comment.content_detail.html_safe %></div>
<div class="">
<p class="fr mr10 orig_reply">
<% if is_teacher || comment.creator_user == User.current%>
<a href="javascript:void(0);" class="mr5 none" id="delete_reply_<%=activity.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= delete_board_message_path(:id => comment, :user_activity_id => activity.id, :activity_id => activity.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
<%= link_to(
'<i class="fa fa-comments-o mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:class=>'mr15', :reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
</p>
<div class="cl"></div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
</div>
@ -84,6 +83,29 @@
<!--回复end-->
</div>
</div>
<div class="J_Comment_Info clearfix">
<div class="t_info fl">
<%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %>
<span class="t_area fl"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if is_teacher || comment.creator_user == User.current%>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%=activity.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= delete_board_message_path(:id => comment, :user_activity_id => activity.id, :activity_id => activity.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-comments-o mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id},
:remote => true,
:method => 'get',
:title => l(:button_reply)) %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -13,50 +13,53 @@
<p class="mb10">
<i class="fa fa-map-marker mr5 color-grey"></i>
<%= link_to @course.name, course_path(@course) %> > <%= link_to '讨论区列表', course_boards_path(@course) %></p>
<div class="edu-con-top user_bg_shadow clearfix">
<p class="ml15 fl color-grey">
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix">
<p class="ml15 fl color-grey3">
帖子详情
</p>
<a href="<%= course_boards_path(@course, :flag => true) %>" class="fr font-12 link-color-grey mr15"><i class="fa fa-reply-all mr5"></i>返回帖子列表</a>
<a href="<%= course_boards_path(@course, :flag => true) %>" class="fr font-12 color-orange03 mr15"><i class="fa fa-reply-all mr5"></i>返回帖子列表</a>
</div>
<div class="edu-con-bg01 mt15">
<div class="">
<div class="edu-tab clearfix mb20 user_bg_shadow">
<div class="edu-tab clearfix mb20 user_bg_shadow bor-grey-e">
<div class="panel-inner-fourm nobg">
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 60, :height => 60, :alt => "用户头像", :class => "panel-list-img mr15"), user_path(@topic.author) %>
<div class="panel-list-infobox clearfix" style="margin-top:0">
<h6 class="panel-list-title fl">
<%= @topic.subject %>
<% if @topic.sticky == 1 %>
<span class="btn-cir btn-cir-red mt5 ml5">顶</span>
<% end %>
</h6>
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 60, :height => 60, :alt => "用户头像", :class => "panel-list-img mr15"), user_path(@topic.author),:class => "fl" %>
<div class="panel-list-infobox fl" style="margin:0">
<p class="color-grey panel-lightgrey fl mt3">
<%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl font-12 mr5 color-grey' %>
<span class="fl mr10">发表于<%= time_from_now(@topic.created_on) %></span>
</p>
<% if User.current.logged? %>
<p class="fr mt3 font-16">
<p class="fr font-16">
<% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %>
<a href="javascript:void(0);" class="mr10" data-tip-down="删除"><i class="fa fa-trash-o"></i></a>
<% end %>
<!--<a href="javascript:void(0);" class="mr10" title="发送" onclick="show_send(<%#= @topic.id %>, <%#= User.current.id %>, 'message');"><i class="fa fa-send-o"></i></a>-->
<% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %>
<a href="<%= edit_board_message_path(@topic.board_id, @topic) %>" class="mr10" data-tip-down="编辑"><i class="fa fa-edit"></i></a>
<% end %>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) %>
<a href="<%= sticky_topic_board_message_path(@topic.board_id, @topic) %>" class="mr10" data-tip-down="<%= @topic.sticky == 1 ? '取消置顶' : '置顶' %>"><i class="fa <%= @topic.sticky == 1 ? 'fa-arrow-circle-o-down' : 'fa-arrow-circle-o-up' %>"></i></a>
<% end %>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %>
<a href="javascript:void(0);" class="mr10" data-tip-down="删除"><i class="fa fa-trash-o"></i></a>
<a href="<%= edit_board_message_path(@topic.board_id, @topic) %>" class="mr10" data-tip-down="编辑"><i class="fa fa-pencil color-grey"></i></a>
<% end %>
<%# if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) %>
<!--<a href="<%#= sticky_topic_board_message_path(@topic.board_id, @topic) %>" class="mr10" data-tip-down="<%#= @topic.sticky == 1 ? '取消置顶' : '置顶' %>"><i class="fa <%#= @topic.sticky == 1 ? 'fa-arrow-circle-o-down' : 'fa-arrow-circle-o-up' %>"></i></a>-->
<%# end %>
</p>
<% end %>
<div class="cl"></div>
<p class="color-grey panel-lightgrey">
<%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl mr5' %>
<span class="fl mr10">发表于<%= time_from_now(@topic.created_on) %></span>
</p>
<h6 class="panel-list-title">
<%= @topic.subject %>
<% if @topic.sticky == 1 %>
<span class="btn-top btn-cir-red mt5 ml5">顶</span>
<% end %>
</h6>
<!--<p class="fr panel-lightgrey">
<span class="mr10"><i class="fa fa-eye color-grey mr5"></i><%= @topic.visits %></span>
</p>-->
</div>
<div class="panel-inner-info mt20">
<div class="panel-inner-info clearfix mt20">
<%= @topic.content.html_safe %>
</div>
<ul class="panel-inner-info mt20">

View File

@ -0,0 +1,19 @@
<% if PraiseTread.praised(activity) %>
<a href='<%= praise_tread_praise_plus_path({:obj_id => activity.id,
:obj_type => activity.class,
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="white-btn orange-btn" title="点赞">
<i class="fa fa-thumbs-up mr5"></i>赞
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span><%= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>
</a>
<% else %>
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
:obj_type => activity.class,
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="white-btn orange-bg-btn" title="取消点赞" >
<i class="fa fa-thumbs-up mr5"></i>赞
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span><%= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>
</a>
<% end %>

View File

@ -2,8 +2,8 @@
<a href='<%= praise_tread_praise_plus_path({:obj_id => activity.id,
:obj_type => activity.class,
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="fr mr5" title="点赞">
<i class="fa fa-thumbs-up mr5 color-grey"></i>赞
:type => type }) %>' data-remote="true" class="fr mr5 color-grey" title="点赞">
<i class="fa fa-thumbs-up mr5"></i>赞
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span class="ml5"><%= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>
</a>
@ -11,7 +11,7 @@
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
:obj_type => activity.class,
:user_activity_id => user_activity_id,
:type => type }) %>' data-remote="true" class="fr mr5 link-color-green" title="取消点赞" >
:type => type }) %>' data-remote="true" class="fr mr5 color-orange03" title="取消点赞" >
<i class="fa fa-thumbs-up mr5"></i>赞
<% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<span class="ml5"><%= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>

View File

@ -1,7 +1,7 @@
<% if @activity %>
<% if @type.to_s == 'activity' %>
<% if (@obj_type == 'HomeworkCommon' || @obj_type == 'Message') && @obj_id == @user_activity_id %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/activity_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% else %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% end %>

View File

@ -1,7 +1,7 @@
<% if @activity %>
<% if @type.to_s == 'activity' %>
<% if (@obj_type == 'HomeworkCommon' || @obj_type == 'Message') && @obj_id == @user_activity_id %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/activity_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% else %>
$('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>');
<% end %>

View File

@ -0,0 +1,15 @@
<div class="task-popup" style="width:550px;">
<div class="task-popup-title clearfix task-popup-bggrey">
<h3 class="fl">申请镜像</h3>
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
<div class="task_popup_con">
<li class="clearfix mb15">
<label class="panel-form-label fl"><span class="color-red fl mt3">*</span>详细描述:&nbsp;&nbsp;</label>
<textarea class="fl task-form-80 task-height-150"></textarea>
</li>
<a href="javascript:void(0);" class="task-btn task-btn-blue fr">确定</a>
<a href="javascript:void(0);" class="pop_close task-btn fr mr10">取消</a>
<div class="cl"></div>
</div>
</div>

View File

@ -66,7 +66,35 @@
<li class="clearfix mb15">
<label class="panel-form-label fl"><span class="color-orange mr5">*</span>技术平台&nbsp;&nbsp;&nbsp;</label>
<%= select_tag :language, options_for_select(shixun_language, "Java"), :id => 'shixun_language', :class => "fl task-form-10 task-height-40" %>
<!--<div class="with20 fl pr" select-for>
<input type="hidden" name="major_level" id="major_level" value="0">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" readonly placeholder="请选择类别"/>
<div class="down-select bor-grey-e user_bg_shadow" id="shixun_type">
<p data-major="1">java1.8</p>
<p data-major="2">python3.6</p>
<p data-major="3">java1.7</p>
</div>
</div>
<div class="with20 fl pr ml20" select-for>
<input type="hidden" name="major_level" id="major_level" value="0">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" readonly placeholder="请选择镜像"/>
<div class="down-select bor-grey-e user_bg_shadow" id="shixun_language">
<p data-major="1">java1.8ssh</p>
<p data-major="2">python3.6</p>
<p data-major="3">java1.7</p>
</div>
</div>
<div class="with20 fl pr ml20" select-for>
<input type="hidden" name="major_level" id="major_level" value="0">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" readonly placeholder="镜像安装软件"/>
<div class="down-select bor-grey-e user_bg_shadow" id="shixun_language">
<p data-major="1">python3.6</p>
<p data-major="2">mysql1.5</p>
<p data-major="3">jdk1.6</p>
</div>
</div>-->
</li>
<!--<li><span style="margin-left: 10%;">列表中没有?<a href="javascript:void(0)" class="color-orange05" onclick="show_apply()">申请新建</a></span></li>-->
<li class="clearfix mb15">
<label class="panel-form-label fl">命令行&nbsp;&nbsp;&nbsp;</label>
<span class="fl mr20">
@ -232,4 +260,10 @@
md_clear_data(k,mdu,id);
}
}
function show_apply(){
var htmlvalue = "<%= escape_javascript(render :partial => 'shixuns/apply_mirror') %>";
pop_box_new(htmlvalue,460,416);
}
</script>

View File

@ -1,4 +1,4 @@
<ul class="nav_check_item clearfix">
<ul class="nav_check_item border-bottom-orange clearfix mb15">
<li class="fl <%= @order == 'myshixun_count' ? 'check_nav' : "" %>">
<%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
</li>

View File

@ -55,14 +55,14 @@
$(".task-header-info .shixun-task-btn").css("margin-top",$(".task-header-info").height() / 2 - 15);
$(".shixun-task-ban-btn").css("margin-top",$(".task-header-info").height() / 2 - 15);
function apply_publish_shixun(url){
if($("#apply_publish_shixun").attr("data-option") == '1'){
$("#apply_publish_shixun").attr("data-option", 0);
$("#apply_publish_shixun").addClass("disabled-grey-bg");
$.ajax({
url: url,
type: 'get'
});
}
}
function apply_publish_shixun(url){
if($("#apply_publish_shixun").attr("data-option") == '1'){
$("#apply_publish_shixun").attr("data-option", 0);
$("#apply_publish_shixun").addClass("disabled-grey-bg");
$.ajax({
url: url,
type: 'get'
});
}
}
</script>

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