Merge branch 'develop' into dev_huang

This commit is contained in:
huang 2017-09-30 15:36:48 +08:00
commit b54362162c
143 changed files with 4459 additions and 979 deletions

View File

@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/

View File

@ -0,0 +1,3 @@
// Place all the styles related to the debates controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View File

@ -586,7 +586,8 @@ class AccountController < ApplicationController
def apply_trail
apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first
if User.current.user_extensions.identity == 1 && !User.current.user_extensions.student_id.nil? && User.current.user_extensions.student_id != "" && !User.current.user_extensions.school.nil? && [1579, 2438, 1587, 117].include?(User.current.user_extensions.school_id)
school_ids = School.where(:auto_users_trial => 1).map(&:id)
if User.current.user_extensions.identity == 1 && !User.current.user_extensions.student_id.nil? && User.current.user_extensions.student_id != "" && !User.current.user_extensions.school.nil? && school_ids.include?(User.current.user_extensions.school_id)
User.current.update_attributes(:certification => 1)
@tip = "申请成功,我们将在一分钟内完成审核"
if apply_action.blank?

View File

@ -132,6 +132,8 @@ class ChallengesController < ApplicationController
end
end
@index = params[:position].to_i - 1
# 发起重置请求
shixun_modify_status_without_publish(@shixun, 1)
respond_to do |format|
format.js
end
@ -157,6 +159,8 @@ class ChallengesController < ApplicationController
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
# 发起重置请求
shixun_modify_status_without_publish(@shixun, 1)
@challenge_choose.challenge_tags.delete_all unless @challenge_choose.challenge_tags.blank?
unless params[:knowledge].blank?
params[:knowledge][:input].each do |input|
@ -197,7 +201,8 @@ class ChallengesController < ApplicationController
def destroy_challenge_choose
@challenge_choose = ChallengeChoose.where(:id => params[:choose_id]).first
@challenge_choose.destroy
# 发起重置请求
shixun_modify_status_without_publish(@shixun, 1)
redirect_to edit_shixun_challenge_path(@challenge, :shixun_id => @shixun)
end
@ -255,7 +260,7 @@ class ChallengesController < ApplicationController
end
end
# 向jenkins端发送请求构建公共测试用例
add_shixun_modify_status(@shixun, 1)
shixun_modify_status_publish(@shixun, 1)
elsif params[:tab].to_i == 5
@challenge_tags.delete_all unless @challenge_tags.blank?
unless params[:knowledge].blank?

View File

@ -36,8 +36,9 @@ class CoursesController < ApplicationController
before_filter :require_login, :only => [:join, :unjoin]
#before_filter :allow_join, :only => [:join]
require 'bundler/setup'
require 'simple_xlsx_reader'
if RUBY_PLATFORM =~ /linux/
require 'simple_xlsx_reader'
end
# params[:search] 搜索课程的名称
# params[:select] "join" "create" "all" 参与的 创建的 所有的课程
#
@ -103,6 +104,17 @@ class CoursesController < ApplicationController
@import_attachments = Attachment.where(:container_id => @course.id, :container_type => "ImportStudent")
end
def shixun_statistics
@homeworks = @course.homework_commons.where("homework_type = 4").order("created_at asc")
filename="#{format_date(Time.now)}_#{@course.teacher.show_real_name.to_s}_#{@course.name}_实训数据报告";
respond_to do |format|
format.xls {
send_data(shixun_xls(@homeworks,@course), :type => 'application/octet-stream', :filename => filename_for_content_disposition("#{filename}.xls"))
}
end
end
# REDO性能需要优化这块是管理员后台任务不影响用户使用
def sync_students
school_id = User.find(@course.tea_id).try(:user_extensions).try(:school_id)
@ -1988,6 +2000,87 @@ class CoursesController < ApplicationController
@results = paginateHelper @results, @limit
end
def shixun_xls homeworks, course
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
black = Spreadsheet::Format.new :color => :black, :weight => :bold, :size => 10
current_row = 0
homeworks.each_with_index do |homework, i|
sheet = book.create_worksheet :name => "#{i+1}次作业"
sheet.row(0).default_format = blue
sheet[0,0] = "课堂编号"
sheet[0,1] = "主讲老师"
sheet[0,2] = "课堂名称"
sheet[0,3] = "作业编号"
sheet[0,4] = "作业/实训名称"
sheet[0,5] = "关卡"
sheet[0,6] = "学生id"
sheet[0,7] = "学生姓名"
sheet[0,8] = "经验值"
sheet[0,9] = "金币"
sheet[0,10] = "评测历史"
sheet[0,11] = "评测时间"
sheet[0,12] = "评测结果"
sheet[1,0] = course.id
sheet[1,1] = course.teacher.show_real_name
sheet[1,2] = course.name
sheet[1,3] = "# #{i + 1}"
sheet[1,4] = homework.name
current_row = 1
shixun = homework.homework_commons_shixuns.shixun if homework.homework_commons_shixuns
if shixun
shixun.challenges.each_with_index do |challenge, j|
sheet[current_row,5] = "#{j+1}"
games = Game.where(:challenge_id => challenge.id, :user_id => homework.student_works.where("work_status != 0").map(&:user_id))
count_exp_score = 0
count_gold_score = 0
count_test = 0
count_time = 0
if games.count > 0
games.each do |game|
user = game.user
sheet[current_row,6] = user.login
sheet[current_row,7] = user.show_real_name
sheet[current_row,8] = game.final_score ? "+#{game.final_score.to_s} 经验值" : "--"
count_exp_score = count_exp_score + (game.final_score ? game.final_score.to_i : 0)
sheet[current_row,9] = game.final_score ? (game.answer_open? ? "#{-challenge.score.to_i} 金币" : "+#{game.final_score.to_i} 金币") : "--"
count_gold_score = count_gold_score + (game.final_score ? (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) : 0)
count = game.outputs.count
if count > 0
outputs = game.outputs.where(:test_set_position => 1).order("created_at asc")
outputs.each_with_index do |output, k|
count_test = count_test + 1
sheet[current_row,10] = "#{k+1}次评测"
sheet[current_row,11] = k == 0 ? game_spend_time((output.created_at - game.created_at).to_i) : game_spend_time((output.created_at - outputs[k-1].created_at).to_i)
count_time = count_time + (k == 0 ? (output.created_at - game.created_at).to_i : (output.created_at - outputs[k-1].created_at).to_i)
sheet[current_row,12] = game.outputs.where(:query_index => output.query_index).select{|ou| ou.result == false}.count > 0 ? "失败" : "成功"
current_row = current_row + 1
end
else
current_row = current_row + 1
end
end
else
current_row = current_row + 1
end
sheet[current_row,6] = "合计"
sheet[current_row,7] = games.count.to_s + ""
sheet[current_row,8] = count_exp_score >= 0 ? "+#{count_exp_score} 经验值" : "-#{count_exp_score} 经验值"
sheet[current_row,9] = count_gold_score >= 0 ? "+#{count_gold_score} 金币" : "-#{count_gold_score} 金币"
sheet[current_row,10] = "#{count_test}次评测"
sheet[current_row,11] = game_spend_time((count_time == 0 ? 0 : (count_time / count_test)).to_i)+"/次"
sheet.row(current_row).default_format = black
current_row = current_row + 1
end
end
end
book.write xls_report
xls_report.string
end
def member_to_xls homeworks, course, members,groups
xls_report = StringIO.new
book = Spreadsheet::Workbook.new

View File

@ -0,0 +1,2 @@
class DebatesController < ApplicationController
end

View File

@ -119,8 +119,10 @@ class ForumsController < ApplicationController
end
def index
order = ""
order = "sticky desc, created_at desc"
@order_str = ""
@user = User.current
=begin
if(params[:reorder_complex])
order = "replies_count #{params[:reorder_complex]}, #{Memo.table_name}.created_at #{params[:reorder_complex]}"
@order_str = "reorder_complex="+params[:reorder_complex]
@ -134,6 +136,7 @@ class ForumsController < ApplicationController
order = "#{Memo.table_name}.updated_at desc"
@order_str = "reorder_time=desc"
end
=end
@memo = Memo.new(:forum => @forum)
@memos = Memo.where("parent_id is null")
@topic_count = @memos.count
@ -148,10 +151,13 @@ class ForumsController < ApplicationController
@my_forums_count = Memo.where("author_id =? and parent_id is null", User.current.id).count
@my_memos_count = Memo.where("author_id =? and parent_id is not null", User.current.id).count
@errors = params[:errors]
memos_id = Memo.where("author_id =?", User.current.id).map(&:id)
@memos_praise_count = PraiseTread.where(:praise_tread_object_id => memos_id, :praise_tread_object_type => "Memo").count
respond_to do |format|
format.js
format.html {
render :layout => 'base_new_forum'
render :layout => 'base_edu'
}# show.html.erb
format.json { render json: @forum }
end
@ -181,13 +187,10 @@ class ForumsController < ApplicationController
end
@memo = Memo.new(:forum => @forum)
@topic_count = @forum.topics.count
@topic_pages = Paginator.new @topic_count, per_page_option, params['page']
@memos = @forum.topics.includes(:last_reply).
limit(@topic_pages.per_page).
offset(@topic_pages.offset).
reorder(order).
preload(:author, {:last_reply => :author}).
all
@limit = 20
@is_remote = true
@topic_pages = Paginator.new @topic_count, @limit, params['page'] || 1
@memos = paginateHelper @forum.topics.includes(:last_reply).reorder(order).preload(:author, {:last_reply => :author}), @limit
@my_topic_count = Memo.where("forum_id = #{@memo.forum_id} and parent_id is null").count
@my_replies_count = Memo.where("forum_id = #{@memo.forum_id} and parent_id is not null").count
@errors = params[:errors]

View File

@ -4,13 +4,72 @@ class GamesController < ApplicationController
skip_before_filter :verify_authenticity_token, :only => [:file_update]
before_filter :find_myshixun, :only => [:index]
before_filter :find_game, :only => [:show, :game_build, :entry,:next_step, :prev_step,:outputs_show, :file_edit, :file_update, :get_waiting_time,
:game_status, :change_status, :answer, :minus_score, :refresh_game_list, :reset_original_code, :reset_new_code, :evaluating_choice]
:game_status, :change_status, :answer, :minus_score, :refresh_game_list, :reset_original_code, :reset_new_code, :evaluating_choice, :sync_codes]
before_filter :find_repository, :only => [:show, :entry, :file_edit, :file_update, :reset_original_code, :reset_new_code, :html_show]
before_filter :allowd_manager
before_filter :allowd_view, :only => [:show]
before_filter :find__shixun_language, :only => [:show, :entry]
include ApplicationHelper
require 'open3'
# 同步更新最新代码
# 同步完成后需要更新myshixun的commit_id为实训的commit最新值
# --------------------------
# 新思路有冲突则则重置没有冲突直接pull
# --------------------------
def sync_codes
g = Gitlab.client
myshixun_user_login = User.where(:id => @myshixun.user_id).first.try(:login)
myshixun_rep_identifier = Repository.where(:myshixun_id => @myshixun.id, :type => "Repository::Gitlab").first.try(:identifier)
gitlab_address = Redmine::Configuration['gitlab_address']
gitlab_myshixun_url = git_myshixun_url(@myshixun, @myshixun.try(:user_id))
shixun = @myshixun.shixun
gitlab_shixun_url = git_shixun_url(shixun, (shixun.try(:fork_from).blank? ? "educoder" : "eduforge"))
if RUBY_PLATFORM =~ /w32/
path = "c:/test/"
else
path = "/home/pdl/myshixun_shell"
end
script = "cd #{path}
git clone #{gitlab_address.to_s+'/'+myshixun_user_login+'/'+ myshixun_rep_identifier}.git
cd #{myshixun_rep_identifier}/
git remote set-url origin https://#{shixun.fork_from.blank? ? "educoder" : "eduforge"}:xinhu1ji2qu3@testbdgit.trustie.net/#{myshixun_user_login}/#{myshixun_rep_identifier}.git
git remote add remote_origin #{gitlab_shixun_url}
#git pull
git pull remote_origin master
if [ $? -eq 0 ];then
echo -e 'git pull succssed'
else
git reset --hard #{@myshixun.commit_id}
git pull remote_origin master
if [ $? -eq 0 ];then
echo -e 'git reset and pull succssed'
else
echo -e 'git reset and pull failed'
fi
fi
git push -f origin master
if [ $? -eq 0 ];then
echo -e 'git push succssed'
cd ../
rm -rf #{myshixun_rep_identifier}/
else
echo -e 'git push failed'
fi"
aFile =File.new(File.join("#{path}","#{@myshixun.identifier}.sh"), "w+")
if aFile
aFile.syswrite(script)
else
logger.error "Unable to open file!"
end
system("sh #{path}/#{@myshixun.identifier}.sh")
# stdin, stdout, stderr = Open3.popen3("sh #{path}/#{@myshixun.identifier}.sh")
shixun_new_commit = g.commits(@myshixun.shixun.try(:gpid)).first.try(:id)
@myshixun.update_column(:commit_id, shixun_new_commit)
sleep(2) # g
render :json => {:status => 200}
end
def index
@games = @myshixun.games.includes(:challenge)
@games_count = @games.count
@ -28,7 +87,7 @@ class GamesController < ApplicationController
# git_repository_url @myshixun, "Myshixun"
# @st 0 实践任务 1 多选任务 2 单选任务
def show
# 展示全部实训
# 展示全部实训
@is_subject = params[:is_subject]
if @game.status == 1
# 放置页面ajax数据还没获取就关闭
@ -39,6 +98,9 @@ class GamesController < ApplicationController
@game_challenge = @game.challenge
@challenges = Challenge.where(:shixun_id => @myshixun.shixun_id)
@shixun = @myshixun.shixun
# 判断tpm是否修改了
@tpm_modified = tpm_is_modified(@myshixun, @shixun.try(:gpid))
# end
@praise_count = PraiseTread.where(:praise_tread_object_id => @game_challenge.id, :praise_tread_object_type => "Challenge").count
@tread_count = PraiseTread.where(:praise_tread_object_id => @game_challenge.id, :praise_tread_object_type => "ChallengeTread").count
# @games_count = @games.count
@ -166,7 +228,7 @@ class GamesController < ApplicationController
raise("实训云平台繁忙繁忙等级94")
end
render :json => {:result => "success", :onRun => res['onRun'], :waitNum => res['waitNum'], :waitingTime => res['waitingTime'], :resubmit => resubmit }
#render :json => {:result => "success", :onRun => 0, :waitNum => 12, :waitingTime => 1234 }
#render :json => {:result => "success", :onRun => 0, :waitNum => 12, :waitingTime => 1234 }
rescue Exception => e
render :json => {:result => "failed"}
end
@ -316,9 +378,9 @@ class GamesController < ApplicationController
answer_right = []
@game_challenge.challenge_chooses.each_with_index do |choose, index|
correct = (params[:answer][index] == choose.standard_answer) ? true : false
if choose.current_choose_outputs.blank?
ChooseOutputs.create(:challenge_choose_id => choose.id, :user_id => User.current.id, :answer => params[:answer][index], :correct => correct)
end
#choose.current_choose_outputs.delete if choose.current_choose_outputs.present?
#ChooseOutputs.create(:challenge_choose_id => choose.id, :user_id => User.current.id, :answer => params[:answer][index], :correct => correct)
Output.create(:game_id => @game.id, :test_set_position => choose.position, :actual_output => params[:answer][index], :result => correct, :query_index => @game.query_index)
if @shixun.status > 1 && !@game.answer_open
if correct
score += choose.score
@ -332,14 +394,15 @@ class GamesController < ApplicationController
end
answer_right << correct
end
@game.update_attributes(:status => 2, :end_time => Time.now)
@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)
if @right
@game.update_attributes(:status => 2, :end_time => Time.now)
reward_grade(@game.user, @game.id, 'Game', score)
reward_experience(@game.user, @game.id, 'Game', score)
@game.update_attribute(:final_score, score)
end
respond_to do |format|
format.js{redirect_to myshixun_game_path(@game, :myshixun_id => @myshixun, :choose => 1)}
format.js{redirect_to myshixun_game_path(@game, :myshixun_id => @myshixun, :choose => @right)}
end
end
@ -407,7 +470,7 @@ class GamesController < ApplicationController
if(params[:choose] == "true")
challenge.challenge_chooses.each_with_index do |choose, index|
@answer += ""+ ((index + 1).to_s) +"题:<br />"
@answer += choose.answer
@answer += (choose.answer.blank? ? choose.standard_answer : choose.answer)
@answer += "<br /><br /><br />"
end
else
@ -434,11 +497,17 @@ class GamesController < ApplicationController
user = User.current
challenge_score = @game_challenge.score.to_i
reward_grade(user, @game.id, 'Answer', -challenge_score)
@answer = @game_challenge.answer
@game.update_column(:answer_open, true)
respond_to do |format|
format.js
@answer = ""
if @game.challenge.st == 0
@answer = @game_challenge.answer
else
@game_challenge.challenge_chooses.each_with_index do |choose, index|
@answer += ""+ ((index + 1).to_s) +"题:<br />"
@answer += (choose.answer.blank? ? choose.standard_answer : choose.answer)
@answer += "<br /><br /><br />"
end
end
@game.update_column(:answer_open, true)
end
def refresh_game_list

View File

@ -7,6 +7,80 @@ class ManagementsController < ApplicationController
include UsersHelper
include ApplicationHelper
#用户修改
def account
@user = User.find(params[:user_id])
ue = @user.user_extensions
# @trail_authentication = ApplyAction.where(:user_id => @user.id, :container_type => "TrialAuthorization").order("created_at desc").first
# @authentication = @user.authentication
# if @user.nickname.nil? || @user.lastname.nil? || ue.try(:identity).nil? || ue.try(:location).nil? || ue.try(:location).nil?
# @require_auth = true
# else
# if User.current.certification != 1 && (@trail_authentication.blank? || (@trail_authentication.status == 2 && (@trail_authentication.updated_at.to_i + 5*60) < Time.now.to_i))
# @require_trail_auth = true
# end
# end
# @s_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddSchools').first
# @d_message = AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddDepartment').first
# AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddSchools').update_all(:viewed => true)
# AppliedMessage.where(:status => 3, :user_id => User.current.id, :viewed => 0, :applied_type => 'ApplyAddDepartment').update_all(:viewed => true)
lg = @user.login
@pref = @user.pref
diskfile = disk_filename('User', @user.id)
diskfile1 = diskfile + 'temp'
begin
if request.post?
@user.nickname = params[:nickname]
@user.lastname = params[:lastname]
@user.firstname = ""
@user.show_realname = params[:show_realname] ? 0 : 1
@user.pref.attributes = params[:pref]
@user.mail = params[:mail]
@user.phone = params[:phone]
@user.password = params[:new_password]
@user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
@se = @user.extensions
@se.school_id = params[:occupation]
@se.department_id = params[:department_id]
@se.gender = params[:sex]
@se.location = params[:province] if params[:province]
@se.location_city = params[:city] if params[:city]
@se.identity = params[:identity].to_i if params[:identity]
if @se.identity == 0
@se.technical_title = params[:te_technical_title] if params[:te_technical_title]
@se.student_id = nil
elsif @se.identity == 1
@se.student_id = params[:no] if params[:no]
@se.technical_title = nil
elsif @se.identity == 2
@se.technical_title = params[:pro_technical_title] if params[:pro_technical_title]
@se.student_id = nil
end
@se.brief_introduction = params[:brief_introduction]
if @user.save && @se.save
reward_grade(@user, @user.id, 'Account', 500)
# 头像保存
FileUtils.mv diskfile1, diskfile, force: true if File.exist? diskfile1
@user.pref.save
@user.notified_project_ids = (@user.mail_notification == 'selected' ? params[:notified_project_ids] : [])
set_language_if_valid @user.language
flash[:notice] = l(:notice_account_updated)
return
else
@user.login = lg
end
end
# 不管前面是否有异常,如果文件已存在就删除
ensure
File.delete(diskfile1) if File.exist?(diskfile1)
end
@setting_type = 1
end
# 镜像管理
def mirror_repository
@menu_type = 3
@ -482,14 +556,26 @@ end
def save_school
uploaded_io = params[:logo]
sl = School.create(:name => params[:schoolname],:province => params[:province],:city => params[:city],:address => params[:address])
# sl = School.create(:name => params[:school],:province => params[:schollProvince],:city => params[:schoolCity],:address => params[:address])
unless uploaded_io.nil?
File.new(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb').write(sl.id)
# File.new(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb') do |file|
# file.write(uploaded_io.read)
# end
File.open(Rails.root.join('public', 'images', 'school', sl.id.to_s+'.png'), 'wb') do |file|
file.write(uploaded_io.read)
end
sl.logo_link = '/images/school/'+sl.id.to_s+'.png'
sl.save
end
@user = User.current
@se = @user.extensions
# if @user.save && @se.save
# diskfile1 = disk_filename('school', sl.id , 'id')
# diskfileID = diskfile1 + 'temp'
# begin
# FileUtils.mv diskfileID, diskfile1, force: true if File.exist? diskfileID
# ensure
# File.delete(diskfileID) if File.exist?(diskfileID)
# end
# end
redirect_to departments_part_managements_path
end
@ -764,36 +850,35 @@ end
def classroom_classment
@menu_type = 2
@sub_type = 2
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
@sx_order = params[:sx_order].blank? ? "desc" : params[:sx_order]
@courses = Course.where(:is_delete => 0)
@timing = Course.where(:is_end=>false).count
@end = Course.where(:is_end=>true).count
@timing=Course.where(:is_end=>false).count
@end=Course.where(:is_end=>true).count
@course_lists = CourseList.where(:id => Course.where(:is_delete => 0 ).map(&:course_list_id) )
unless params[:school_id] || params[:search] || params[:keyword] || params[:status]
user_exs=UserExtensions.where(:school_id=> @courses.map(&:school_id))
@schools = School.where(:id =>user_exs.map(&:school_id))
user_exs=UserExtensions.where(:school_id=> @courses.map(&:school_id))
@schools = School.where(:id =>user_exs.map(&:school_id))
end
@search = params[:search] # 搜索字
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
status = params[:status].to_i
courselist = params[:course_list]
@status = params[:status]
@courselist = params[:course_list]
@school_id = params[:school_id]
if params[:school_id] && params[:school_id] != ''
@school_id = params[:school_id]
@courses = @courses.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}")
@courses = Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}")
end
if params[:homepage_show]
@courses = @courses.where(:homepage_show => params[:homepage_show].to_i)
end
if courselist && courselist != ''
@courses = @courses.where(:course_list_id => courselist)
if params[:course_list] && params[:course_list] != ''
@courses = @courses.where(:course_list_id => @courselist)
end
if params[:status] && params[:status]!=''
@status = params[:status]
@courses =@courses.where(:is_end =>status)
@courses =@courses.where(:is_end => @status.to_i)
end
if "u_name" == @keyword
if @search.blank?
@ -806,6 +891,7 @@ end
@courses= @courses.where("name like '%#{@search}%'")
end
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime #{@sx_order}")
@export_courses = @courses
@courses_count = @courses.count
limit = 20
@is_remote = true
@ -815,6 +901,11 @@ end
respond_to do |format|
format.js
format.html
format.xls{
@export_courses = @export_courses.all
filename = "#{l(:label_course_list_xls)}.xls"
send_data(course_list_xls(@export_courses), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
@ -1055,6 +1146,14 @@ end
end
end
# 允许复制
def shixun_can_copy
if params[:shixun_id]
shixun = Shixun.find params[:shixun_id]
shixun.update_attributes(:can_copy => !shixun.can_copy)
end
end
# 已关闭的实训
def close_shixuns
@menu_type = 3
@ -1105,19 +1204,31 @@ end
def auto_users_trial
@menu_type = 7
@sub_type = 3
@schools = School.where("0=0")
@schools_count = @schools.count
@apply_action = School.where(:auto_users_trial => 1).order('updated_at desc')
@apply_action_count = @apply_action.count
limit = 20
@is_remote = true
@schools_pages = Paginator.new @schools_count, limit, params['page'] || 1
@offset ||= @schools_pages.offset
@schools = paginateHelper @schools, limit
@apply_action_pages = Paginator.new @apply_action_count, limit, params['page'] || 1
@offset ||= @apply_action_pages.offset
@apply_action = paginateHelper @apply_action, limit
respond_to do |format|
format.html
format.js
end
end
# 添加
def create_auto_users_trial
School.where(:id => params[:school]).update_all(:auto_users_trial => 1)
redirect_to auto_users_trial_managements_path
end
# 删除
def update_auto_users_trial
School.where(:id => params[:school]).update_all(:auto_users_trial => 0)
redirect_to auto_users_trial_managements_path
end
def search_user
=begin
@ -1358,7 +1469,14 @@ end
user = User.find(apply_user.user_id)
apply_user.update_attribute(:status, 1)
user.update_attribute(:authentication, true)
@unapproved_user = ApplyUserAuthentication.where(:status => 0, :auth_type => 1).order("updated_at desc")
@unapproved_user_count = @unapproved_user.count
@limit = 15
@is_remote = true
@unapproved_user_pages = Paginator.new @unapproved_user_count, @limit, params['page'] || 1
@offset ||= @unapproved_user_pages.offset
@unapproved_user = paginateHelper @unapproved_user, @limit
respond_to do |format|
format.js
end
@ -1369,6 +1487,7 @@ end
apply_user = ApplyUserAuthentication.where(:id => params[:apply_id], :auth_type => 2).first
reason = apply_user.update_attributes(:status => 2, :remarks => params[:reject_reason])
render :json => {success: reason}
end
# 同意职业认证
@ -1378,6 +1497,12 @@ end
apply_user.update_attribute(:status, 1)
user.update_attribute(:professional_certification, true)
@unapproved_user = ApplyUserAuthentication.where(:status => 0, :auth_type => 2).order("updated_at desc")
@unapproved_user_count = @unapproved_user.count
@limit = 15
@is_remote = true
@unapproved_user_pages = Paginator.new @unapproved_user_count, @limit, params['page'] || 1
@offset ||= @unapproved_user_pages.offset
@unapproved_user = paginateHelper @unapproved_user, @limit
respond_to do |format|
format.js
end
@ -1406,7 +1531,8 @@ end
@menu_type = 10
@sub_type = 5
@type = trial_authorization_status params[:type]
@authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type).order("created_at desc")
# sql = select * from apply_actions where dealer_id is null
@authorizations = ApplyAction.where(:container_type => "ApplyShixun", :status => @type,:dealer_id =>'').order("created_at desc")
search = params[:search]
unless search.blank?
@authorizations = @authorizations.where(:container_id => Shixun.where(:id => @authorizations.map(&:container_id)).where("name like '%#{search}%'").map(&:id)).order("created_at desc")
@ -1509,28 +1635,29 @@ end
render_404
end
def course_list_xls course
def course_list_xls courses
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "course"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","私有","状态","创建者单位","创建者","动态时间"])
count_row = 1
issues.each do |issue|
sheet1[count_row,0] = issue.id
sheet1[count_row,1] = issue_tracker_change(issue.tracker_id)
sheet1[count_row,2] = issue.subject
sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe
sheet1[count_row,4] = issue_status_change(issue.status_id)
sheet1[count_row,5] = issue.assigned_to.try(:show_name)
sheet1[count_row,6] = issue_priority_change(issue.priority_id)
sheet1[count_row,7] = issue.author.show_name
sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,9] = issue.fixed_version.try(:name)
sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d')
sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d')
sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id)
courses.each do |course|
school = course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.school_name
teacher_name = course.teacher ? course.teacher.show_real_name : ""
sheet1[count_row,0] = course.id
sheet1[count_row,1] = course.name
sheet1[count_row,2] = course.members.count
sheet1[count_row,3] = course.attachments.count
sheet1[count_row,4] = course.homework_commons.where(:homework_type => 1).count
sheet1[count_row,5] = course.homework_commons.where(:homework_type => 4).count
sheet1[count_row,6] = course.exercises.count
sheet1[count_row,7] = course.is_public.to_i == 1 ? '否' : '是'
sheet1[count_row,8] = course.is_end ? "已结束" : "正在进行"
sheet1[count_row,9] = school
sheet1[count_row,10] = teacher_name
sheet1[count_row,11] = format_time(course.updatetime)
count_row += 1
end
book.write xls_report

View File

@ -1,6 +1,6 @@
class MemosController < ApplicationController
default_search_scope :memos
before_filter :find_forum, :only => [:new, :create, :preview, :update]
before_filter :find_forum, :only => [:new, :create, :preview, :update, :reply]
before_filter :find_attachments, :only => [:preview]
before_filter :find_memo, :except => [:new, :create, :preview]
before_filter :authenticate_user_edit, :only => [:edit, :update]
@ -29,13 +29,14 @@ class MemosController < ApplicationController
def new
# 如何是问吧主页来的,导航不显示具体贴吧名
@user = User.current
@memo = Memo.new
@my_forums_count = Memo.where("author_id =? and parent_id is null", User.current.id).count
@my_memos_count = Memo.where("author_id =? and parent_id is not null", User.current.id).count
@my_forums_count = Memo.where("author_id =? and parent_id is null",@user.id).count
@my_memos_count = Memo.where("author_id =? and parent_id is not null", @user.id).count
@forums = Forum.reorder("topic_count desc,updated_at desc")
respond_to do |format|
format.js
format.html {render layout: 'base_new_forum'}
format.html {render layout: 'base_edu'}
format.json { render json: @memo }
end
end
@ -88,6 +89,7 @@ class MemosController < ApplicationController
REPLIES_PER_PAGE = 20 unless const_defined?(:REPLIES_PER_PAGE)
def show
@user = User.current
# 更新贴吧帖子留言对应的memo_messages的viewed字段
unless @memo.children.blank?
@memo.children.each do |child|
@ -141,19 +143,20 @@ class MemosController < ApplicationController
respond_to do |format|
format.js
format.html {render :layout => 'base_new_forum'}
format.html {render :layout => 'base_edu'}
format.json { render json: @memo }
format.xml { render xml: @memo }
end
end
def edit
@my_topic_count = 0
@my_replies_count = Memo.where(:parent_id => @memo.id).count
@forums = Forum.reorder("topic_count desc,updated_at desc")
@replying = false
#@my_topic_count = 0
#@my_replies_count = Memo.where(:parent_id => @memo.id).count
#@forums = Forum.reorder("topic_count desc,updated_at desc")
#@replying = false
@user = User.current
respond_to do |format|
format.html {render :layout => 'base_new_forum'}
format.html {render :layout => 'base_edu'}
end
end
@ -173,7 +176,7 @@ class MemosController < ApplicationController
@flag = @memo.save
# @memo.root.update_attribute(:updated_at, @memo.updated_at)
format.js
format.html {redirect_to back_memo_url, notice: "#{l :label_memo_update_succ}"}
format.html {redirect_to back_memo_url}
else
format.js
format.html { render action: "edit" }
@ -182,12 +185,64 @@ class MemosController < ApplicationController
end
end
def reply
if params[:memo].present? && params[:memo][:parent_id].present?
parent = Memo.find params[:memo][:parent_id]
@memo = params[:activity_id].blank? ? parent : Memo.find(params[:activity_id].to_i)
@reply = Memo.new
@reply.author = User.current
@reply.forum_id = parent.forum_id
@reply.content = params[:content]
@reply.subject = "RE: #{@memo.subject}"
#@reply.reply_id = params[:id]
@reply.root_id = parent.root_id.nil? ? parent.id : parent.root_id
# @reply.reply_id = params[:id]
parent.children << @reply
else
@reply = Memo.new()
@reply.content = params[:content]
@reply.subject = @memo.subject
@reply.author = User.current
@reply.forum_id = @forum.id
#@reply.content = @quote + @reply.content
#@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
@reply.root_id = @memo.id
@reply.safe_attributes = params[:reply]
@memo.children << @reply
# @reply.reply_id = params[:id]
end
redirect_to message_replies_forum_memo_path(@memo.forum, @memo, :user_activity_id => params[:user_activity_id])
end
def message_replies
@replies = Memo.where(:root_id => @memo.id).order("created_at desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
#@limit_count = @replies.count
#@page = params[:page] ? params[:page].to_i + 1 : 0
#@limit = 10
#@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new()
@user_activity_id = params[:user_activity_id].blank? ? @memo.id : params[:user_activity_id].to_i
respond_to do |format|
format.js
end
end
def destroy
@memo.destroy
respond_to do |format|
# format.html { redirect_to @back_url }
format.html { redirect_to back_memo_or_forum_url }
#format.html { redirect_to @back_url }
format.html { redirect_to forums_path }
format.js{
@memo = Memo.find(params[:user_activity_id].to_i)
@replies = Memo.where(:root_id => @memo.id).order("created_at desc")
@reply_count = @replies.count
@replies = get_no_children_comments_all @replies
#redirect_to message_replies_forum_memo_path(@memo.forum, @memo, :user_activity_id => params[:user_activity_id])
}
format.json { head :no_content }
end
end
@ -196,7 +251,13 @@ class MemosController < ApplicationController
def change_sticky
@memo.sticky ? @memo.update_attribute(:sticky, false) : @memo.update_attribute(:sticky, true)
respond_to do |format|
format.html { redirect_to forum_memo_path(@memo.forum, @memo) }
format.html {
if params[:index]
redirect_to forums_path
else
redirect_to forum_memo_path(@memo.forum, @memo)
end
}
end
end

View File

@ -127,7 +127,6 @@ class MyshixunsController < ApplicationController
compile_success = jsonTestDetails['compileSuccess']
# message = Base64.decode64(params[:msg]) unless params[:msg].blank?
logger.info(outPut)
logger.info("##################"+ compile_success)
game = Game.find(game_id)
challenge = game.challenge
unless jenkins_testsets.blank?
@ -135,7 +134,6 @@ class MyshixunsController < ApplicationController
actual_output = tran_base64_decode64(j_test_set['output'])
game_outputs = Output.create(:code => status, :game_id => game_id, :out_put => outPut, :test_set_position => j_test_set['caseId'],
:actual_output => actual_output, :result => j_test_set['passed'].to_i, :query_index => game.query_index, :compile_success => compile_success.to_i)
logger.info("compile_success:"+ compile_success)
# output = Output.where(:game_id => game.id, :test_set_position => j_test_set['caseId'].to_i).first
# logger.info("#############{outPut}")
# if output.nil?

View File

@ -25,7 +25,7 @@ class ShixunsController < ApplicationController
end
def statistics_students
@statistics = @shixun.myshixuns.order("created_at desc")
@statistics = @shixun.myshixuns.where("").order("created_at desc")
@statistics_count = @statistics.count
@limit = 10
@is_remote = true
@ -122,9 +122,9 @@ class ShixunsController < ApplicationController
@rev = params[:rev]
@content = params[:content]
code_file = g.edit_file(@shixun.gpid, :content => params[:content], :file_path => @path, :branch_name => @rev, :commit_message => "shixun entry")
if @shixun.try(:status).to_i < 2
shixun_modify_status_without_publish(@shixun, 1)
end
# if @shixun.try(:status).to_i < 2
shixun_modify_status_without_publish(@shixun, 1)
# end
respond_to do |format|
format.js
end
@ -262,9 +262,9 @@ class ShixunsController < ApplicationController
# 确定 sort 1升序 2 降序
@order = params[:order] || "myshixun_count"
bsort = params[:sort] || "desc"
@sort = bsort == "desc" ? "asc" : "desc"
@sort = bsort == "asc" ? "desc" : "asc"
if @order == "updated_at"
order_str = "#{Shixun.table_name}.updated_at #{bsort}"
order_str = "#{Shixun.table_name}.updated_at #{@sort}"
else
order_str = "myshixun_count #{bsort}, #{Shixun.table_name}.updated_at #{bsort}"
end
@ -289,7 +289,7 @@ class ShixunsController < ApplicationController
@courses = CourseList.where(:support_shixuns_search => 1)
#if !@course.blank? && (@major.blank? || MajorCourse.where(:major_id => @major, :course_list_id => @course).count == 1)
if !@course.blank?
@shixuns = @shixuns.where(:id => ShixunMajorCourse.where(:course_list_id => @course).map(&:shixun_id))
@shixuns = @shixuns.where(:id => ShixunMajorCourse.where(:course_list_id => @course).map(&:shixun_id))
end
# if !@major.blank? && MajorCourse.where(:major_id => @major, :course_list_id => @course).count == 0
# @course = nil
@ -424,7 +424,9 @@ class ShixunsController < ApplicationController
end
gshixun = g.fork(@shixun.gpid, User.current.gid)
if !gshixun.try(:id).blank?
myshixun.update_column(:gpid, gshixun.id) if myshixun.try(:gpid).blank? # 为了防止多次fork
myshixun.update_column(:gpid, gshixun.id) if myshixun.try(:gpid).blank?
commit_id = g.commits(@shixun.gpid).first.try(:id)
myshixun.update_column(:commit_id, commit_id)
rep = Repository.create!(:myshixun_id => myshixun.id, :identifier => gshixun.name,:project_id => -1, :shixun_id => -2)
rep.update_column(:type, "Repository::Gitlab")
rep_url = Base64.urlsafe_encode64(git_shixun_url_ip @shixun, (@shixun.try(:fork_from).blank? ? "educoder" : "eduforge")) # 注意educoder为默认给实训创建版本库的用户如果换成别的用户名字要相应的修改
@ -554,6 +556,10 @@ class ShixunsController < ApplicationController
end
def copy
unless (@shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification)
render_403
return
end
ActiveRecord::Base.transaction do
begin
new_shixun = Shixun.new
@ -582,7 +588,7 @@ class ShixunsController < ApplicationController
gshixun = g.fork(@shixun.gpid, user_gid)
raise "版本库创建失败" if gshixun.try(:id).blank?
gshixun = g.edit_project(gshixun.id, new_shixun.identifier, new_shixun.identifier)
raise "版本库创建失败" if (gshixun.try(:name) != new_shixun.identifier || gshixun.try(:path) != new_shixun.identifier)
raise "实训复制失败" if (gshixun.try(:name) != new_shixun.identifier || gshixun.try(:path) != new_shixun.identifier)
new_shixun.update_column(:gpid, gshixun.id)
# 同步复制合作者,合作者加入到gitlab
@ -592,7 +598,7 @@ class ShixunsController < ApplicationController
@shixun.shixun_members.each do |shixun_member|
if ShixunMember.where(:shixun_id => new_shixun.try(:id), :user_id => shixun_member.user_id).blank?
ShixunMember.create!(:user_id => shixun_member.try(:user_id), :shixun_id => new_shixun.try(:id),
:role => (shixun_member.try(:user_id) == User.current.id ? 1 : 2))
:role => (shixun_member.try(:user_id) == User.current.id ? 1 : 2))
end
s = Trustie::Gitlab::Sync.new
gid = User.find(shixun_member.user_id).try(:gid)
@ -729,7 +735,7 @@ class ShixunsController < ApplicationController
ActiveRecord::Base.transaction do
begin
@shixun.save!
if language != params[:language]
if language != params[:language] && @shixun.status != 2 # 已发布不触发重置
add_shixun_modify_status(@shixun, 1)
end
rescue

View File

@ -336,6 +336,7 @@ class StudentWorkController < ApplicationController
def index
# 作业消息状态更新?
@tab = params[:tab].nil? ? 1 : params[:tab].to_i
homeworkcommon_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_message_id => @homework.id, :course_message_type => "HomeWorkCommon")
homeworkcommon_messages.update_all(:viewed => true)
studentwork_messages = CourseMessage.where(:user_id => User.current.id, :viewed => 0, :course_id => @homework.course, :course_message_type => "StudentWork")

View File

@ -321,6 +321,11 @@ class UsersController < ApplicationController
when 'Syllabus'
@reply = JournalsForMessage.find params[:reply_id]
@type = 'Syllabus'
when 'Memo'
@reply = Memo.find params[:reply_id]
@user_activity_id = params[:user_activity_id]
@activity_id = params[:activity_id]
@type = 'Memo'
end
respond_to do |format|
format.js

View File

@ -33,6 +33,19 @@ module ApplicationHelper
extend Forwardable
def_delegators :wiki_helper, :wikitoolbar_for, :heads_for_wiki_formatter
# 判断TPM的代码是否被修改了
def tpm_is_modified myshixun, shixun_gpid
g = Gitlab.client
myshixun_commit_id = myshixun.commit_id
if myshixun_commit_id.blank?
myshixun_commit_id = g.commits(myshixun.gpid).last.try(:id)
myshixun.update_column(:commit_id, myshixun_commit_id)
end
shixun_commit_id = g.commits(shixun_gpid).first.try(:id)
result = myshixun_commit_id != shixun_commit_id ? true :false
return result
end
# 定义当前关卡是否有权开启下一关
# :实训若发布了,必须通过当前关卡才能查看下一关
# :未发布的实训,除了最后一关,其它的关卡都可以进入下一关
@ -44,7 +57,6 @@ module ApplicationHelper
end
end
# 适用与已经用url_safe编码后回调字符串形式
def tran_base64_decode64 str
if str.blank?
@ -101,6 +113,17 @@ module ApplicationHelper
shixun_modify_status_without_publish shixun, type
end
def shixun_modify_status_publish shixun, type
shixun_tomcat = Redmine::Configuration['shixun_tomcat']
gameInfo = shixun.gameInfo
uri ="#{shixun_tomcat}/bridge/game/publishGame"
params = {gameInfo:gameInfo}
res = uri_exec uri, params
if res && res['code'].to_i != 0
raise("实训云平台繁忙繁忙等级90")
end
end
# 仅仅产生记录用于已执行publish的方法
# ShixunModify中status 1表示有更改开启实训的时候需要重置0表示不需要重置或已重置完成
def shixun_modify_status_without_publish shixun, type
@ -463,6 +486,14 @@ module ApplicationHelper
gitUrl = gitlab_address.to_s+"/"+login+"/"+ rep_identify + "."+"git"
end
# myshixun git url by domain
def git_myshixun_url myshixun, user_id
login = User.where(:id => user_id).first.try(:login)
rep_identify = Repository.where(:myshixun_id => myshixun.id, :type => "Repository::Gitlab").first.try(:identifier)
gitlab_address = Redmine::Configuration['gitlab_address']
gitUrl = gitlab_address.to_s+"/"+login+"/"+ rep_identify + "."+"git"
end
def uri_exec uri, params
begin
logger.error("@parmas is #{params}, url is #{uri}")
@ -501,29 +532,29 @@ module ApplicationHelper
# homework_common状态
# 0挂起1提交中2匿评中3评阅中
def new_homework_common_status status
case status
when 0
"挂起"
when 1
"提交中"
when 2
"补交中"
when 3
"匿评中"
when 4
"申诉中"
when 5
"评阅中"
when 6
"已结束"
end
case status
when 0
"未发布"
when 1
"提交中"
when 2
"补交中"
when 3
"匿评中"
when 4
"申诉中"
when 5
"评阅中"
when 6
"已结束"
end
end
# 作业不同状态的不同样式
def homework_status_color status
style = ""
case status
when '挂起'
when '未发布'
style = 'edu-filter-btn-yellow'
when '提交中'
style = 'edu-filter-btn-blue'
@ -571,7 +602,7 @@ module ApplicationHelper
if ho_detail_manual
case ho_detail_manual.comment_status
when 0
status = "挂起"
status = "未发布"
when 1
if homework_common.end_time && homework_common.end_time >= Time.now
status = "提交中"
@ -830,7 +861,7 @@ module ApplicationHelper
end
# 项目issue列表导出Excel功能
def issue_list_xls issues
def issue_list_xls issues
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "issues"
@ -944,7 +975,7 @@ module ApplicationHelper
score = obj.issue_num * 4 + obj.issue_journal_num + (obj.changeset_num||0) * 4 + obj.board_num * 2 + obj.board_message_num + obj.attach_num * 5
end
# 获取组织成员中文名字
# 获取组织成员中文名字
def get_org_member_role_name member
unless member.roles[0].nil?
case member.roles[0].name
@ -1154,7 +1185,7 @@ module ApplicationHelper
name = h(user.name(options[:format]))
else
name = h(user.show_name)
end
end
link_to name, {:controller=> 'users', :action => 'show', id: user.id, host: Setting.host_user}, :class => "pro_info_p"
else
h(user.to_s)
@ -1761,7 +1792,7 @@ module ApplicationHelper
def authority_pubilic_for_files(project, file)
@result = false
if (is_project_manager?(User.current.id, @project.id) && User.current.allowed_to?(:manage_files, project)) || file.author_id == User.current.id || User.current.admin &&
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project"
@result = true
end
return @result
@ -2054,7 +2085,7 @@ module ApplicationHelper
title << @user.show_name
end
elsif @syllabus
title << (@syllabus.title.nil? ? "在线课堂" : @syllabus.title)
title << (@syllabus.title.nil? ? "在线课堂" : @syllabus.title)
else
title << (User.current.id == 2 ? "未登录" : User.current.show_name)
end
@ -2778,7 +2809,7 @@ module ApplicationHelper
def check_all_links(form_name)
link_to_function_none(l(:button_check_all), "checkAll('#{form_name}', true)") + "&nbsp;".html_safe + " | "+ "&nbsp;".html_safe +
link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
link_to_function_none(l(:button_uncheck_all), "checkAll('#{form_name}', false)")
end
# 本次修改,修改为只显示关闭的所占%比
@ -2792,8 +2823,8 @@ module ApplicationHelper
content_tag('span',
content_tag('tr',
(pcts[0] > 0 ? content_tag('span', '', :style => "width: #{pcts[0]}%;", :class => 'roadmap_progressbar_inner', :title => "已关闭:#{pcts[0]}%") : ''.html_safe) #+
# (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => "开发中:#{pcts[1]}%") : ''.html_safe) +
#(pcts[1] > 0 ? content_tag('span', '', :style => "width: #{pcts[1]}%;", :class => 'roadmap_progressbar ml5', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
# (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => "开发中:#{pcts[1]}%") : ''.html_safe) +
#(pcts[1] > 0 ? content_tag('span', '', :style => "width: #{pcts[1]}%;", :class => 'roadmap_progressbar ml5', :title => "未完成:#{pcts[1]}%") : ''.html_safe), :style => "width: #{width}"
), :class => 'roadmap_progressbar ml5').html_safe
# + content_tag('p', legend, :class => 'percent').html_safe
end
@ -2932,11 +2963,11 @@ module ApplicationHelper
end
end
if sources && !sources.empty?
super(sources, options)
else
''
end
if sources && !sources.empty?
super(sources, options)
else
''
end
end
def content_for(name, content = nil, &block)
@ -3226,17 +3257,17 @@ module ApplicationHelper
# 课程某个班级的成员
def syllabus_course_member user, course
result = false
syllabus = course.syllabus
if syllabus
syllabus.courses.each do |course|
if user.member_of_course?(course)
result = true
return result
result = false
syllabus = course.syllabus
if syllabus
syllabus.courses.each do |course|
if user.member_of_course?(course)
result = true
return result
end
end
end
end
result
result
end
def attachment_candown attachment
@ -3656,48 +3687,48 @@ module ApplicationHelper
def anonymous_comment_link(bid, course)
link = case bid.comment_status
when 0
confirm_info = "开启匿评后学生将不能对作品进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作品列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
when 2
'匿评结束'
end
when 0
confirm_info = "开启匿评后学生将不能对作品进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作品列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
when 2
'匿评结束'
end
content_tag('span', link, id: "#{bid.id}_anonymous_comment")
end
def anonymous_comment_notice(bid, course)
case bid.comment_status
when 0
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
@has_evaluations = 0
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
case bid.comment_status
when 0
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
@has_evaluations = 0
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作品,已评价#{@has_evaluations}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作品,已评价#{@has_evaluations}份作品,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
end
def get_technical_title user
@ -3833,12 +3864,12 @@ module ApplicationHelper
link = link_to "启动匿评","javascript:void(0)", :class => "wpostOptionLink", :title => "作业截止日期之前不可以启动匿评"
elsif homework.student_works.has_committed.count >= 2 && homework.homework_detail_manual#作业份数大于2
case homework.homework_detail_manual.comment_status
when 1
link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'wpostOptionLink'
when 2
link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'wpostOptionLink'
when 3
# link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
when 1
link = link_to '启动匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'wpostOptionLink'
when 2
link = link_to '关闭匿评', Setting.protocol + "://" + Setting.host_name + "/homework_common/" + homework.id.to_s + "/alert_anonymous_comment?hw_status=" + hw_status.to_s + "&user_activity_id=" + user_activity_id.to_s, id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'wpostOptionLink'
when 3
# link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
end
else
link = link_to "启动匿评","javascript:void(0)", :class => "wpostOptionLink", :title => "学生提交作业数大于等于2时才可以启动匿评"
@ -3980,33 +4011,33 @@ module ApplicationHelper
if User.current.allowed_to?(:as_teacher, homework.course)
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "查看作品", :target => '_blank'
else User.current.member_of_course?(homework.course)
work = cur_user_works_for_homework homework
project = cur_user_projects_for_homework homework
if work.nil? && homework.end_time >= Time.now
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "关联项目", student_work_index_url_in_org(homework.id, 1), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
end
elsif work.nil? && homework.end_time < Time.now
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "关联项目", student_work_index_url_in_org(homework.id, 1), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'btn_orange_big fr mt5', :target => '_blank'
end
work = cur_user_works_for_homework homework
project = cur_user_projects_for_homework homework
if work.nil? && homework.end_time >= Time.now
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "关联项目", student_work_index_url_in_org(homework.id, 1), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "匿评已结束", :target => '_blank'
elsif homework.homework_type == 2 && homework.end_time >= Time.now#编程作业不能修改作品
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
elsif homework.end_time >= Time.now && work.user_id == User.current.id
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
else
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
end
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
end
elsif work.nil? && homework.end_time < Time.now
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
link_to "关联项目", student_work_index_url_in_org(homework.id, 1), :class => 'hw_btn_green fr mt5',:title => '查看分组作业详情', :target => '_blank'
else
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'btn_orange_big fr mt5', :target => '_blank'
end
else
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "开启匿评后不可修改作品", :target => '_blank'
elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
link_to "查看作品",student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "匿评已结束", :target => '_blank'
elsif homework.homework_type == 2 && homework.end_time >= Time.now#编程作业不能修改作品
link_to "修改作品", new_student_work_url_without_domain(homework.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
elsif homework.end_time >= Time.now && work.user_id == User.current.id
link_to "修改作品", edit_student_work_url_without_domain(work.id),:class => 'hw_btn_green fr mt5', :target => '_blank'
else
link_to "查看作品", student_work_index_url_in_org(homework.id, 2), :class => 'hw_btn_green fr mt5', :title => "作业截止后不可修改作品", :target => '_blank'
end
end
end
end
@ -4614,47 +4645,47 @@ def sortby_time_countcommon_hassticky topics,sortstr
tmpIndex = 0
tmpTopics.each_with_index do |topic,index|
if topic.sticky == 0
if tStart == -1
if (index != tmpTopics.count-1) && (topic[:infocount] == tmpTopics[index+1][:infocount])
tStart = index
end
if topic.sticky == 0
if tStart == -1
if (index != tmpTopics.count-1) && (topic[:infocount] == tmpTopics[index+1][:infocount])
tStart = index
end
else
if ((topic[:infocount] == tmpTopics[index-1][:infocount]) && ((index != tmpTopics.count-1) && (topic[:infocount] == tmpTopics[index+1][:infocount])))
tEnd = index
else
if ((topic[:infocount] == tmpTopics[index-1][:infocount]) && ((index != tmpTopics.count-1) && (topic[:infocount] == tmpTopics[index+1][:infocount])))
if (topic[:infocount] == tmpTopics[index-1][:infocount])
tEnd = index
else
if (topic[:infocount] == tmpTopics[index-1][:infocount])
tEnd = index
end
if tEnd > tStart
for i in tStart..tEnd
tmpTopics_1[tmpIndex] = tmpTopics[i]
tmpIndex = tmpIndex + 1
end
if sortstr == "created_at"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:created_at].to_i <=> x[:created_at].to_i }
elsif sortstr == "created_on"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:created_on].to_i <=> x[:created_on].to_i }
elsif sortstr == "updated_at"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:updated_at].to_i <=> x[:updated_at].to_i }
elsif sortstr == "updated_on"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:updated_on].to_i <=> x[:updated_on].to_i }
end
tmpIndex = 0
for i in tStart..tEnd
tmpTopics[i] = tmpTopics_1[tmpIndex]
tmpIndex = tmpIndex + 1
end
end
tStart = -1
tEnd = -1
tmpTopics_1 = []
tmpIndex = 0
end
if tEnd > tStart
for i in tStart..tEnd
tmpTopics_1[tmpIndex] = tmpTopics[i]
tmpIndex = tmpIndex + 1
end
if sortstr == "created_at"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:created_at].to_i <=> x[:created_at].to_i }
elsif sortstr == "created_on"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:created_on].to_i <=> x[:created_on].to_i }
elsif sortstr == "updated_at"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:updated_at].to_i <=> x[:updated_at].to_i }
elsif sortstr == "updated_on"
tmpTopics_1 = tmpTopics_1.sort{|x,y| y[:updated_on].to_i <=> x[:updated_on].to_i }
end
tmpIndex = 0
for i in tStart..tEnd
tmpTopics[i] = tmpTopics_1[tmpIndex]
tmpIndex = tmpIndex + 1
end
end
tStart = -1
tEnd = -1
tmpTopics_1 = []
tmpIndex = 0
end
end
end
end
return tmpTopics
end
@ -4775,7 +4806,7 @@ def get_hw_status homework_common
str = ""
if homework_common.homework_detail_manual
if homework_common.homework_detail_manual.comment_status == 0 && homework_common.publish_time.nil?
str += '<span class="grey_homework_btn_cir ml5">挂起</span>'
str += '<span class="grey_homework_btn_cir ml5">未发布</span>'
elsif homework_common.homework_detail_manual.comment_status == 0
str += '<span class="grey_homework_btn_cir ml5">未发布</span>'
elsif homework_common.homework_detail_manual.comment_status == 1
@ -4895,17 +4926,17 @@ def create_works_list homework
unless homework.course.nil?
students = homework.course.student
if !students.empty? && homework.student_works.empty?
name = homework.name
name_str = name + "的作品提交"
str = ""
students.each do |student|
if str != ""
str += ","
name = homework.name
name_str = name + "的作品提交"
str = ""
students.each do |student|
if str != ""
str += ","
end
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
end
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
end
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
ActiveRecord::Base.connection.execute sql
end
end
end
@ -5283,10 +5314,10 @@ def quote_homework_bank homework, course
)
end
homework.homework_bank_samples.each_with_index do |homework_test|
new_homework.homework_samples << HomeworkSample.new(
input: homework_test.input,
output: homework_test.output
)
new_homework.homework_samples << HomeworkSample.new(
input: homework_test.input,
output: homework_test.output
)
end
end

View File

@ -0,0 +1,2 @@
module DebatesHelper
end

View File

@ -2,6 +2,5 @@
class ApplyAction < ActiveRecord::Base
default_scope :order => 'updated_at desc'
attr_accessible :container_id, :container_type, :dealer_id, :reason, :user_id, :status, :apply_reason
belongs_to :user
end

View File

@ -7,6 +7,7 @@ class ChallengeChoose < ActiveRecord::Base
has_many :challenge_tags, :dependent => :destroy
has_many :challenge_questions, :dependent => :destroy
has_one :choose_outputs, :dependent => :destroy
#has_many :outputs, :dependent => :destroy
validates_presence_of :subject

View File

@ -66,4 +66,18 @@ class Game < ActiveRecord::Base
challenge = self.challenge
challenge.try(:position).to_i == challenge.shixun.challenges.count ? true : false
end
def choose_correct_num
num = 0
outputs = self.outputs.where(:query_index => (self.query_index - 1))
if outputs.blank?
num = nil
else
outputs.each do |output|
num += output.result ? 1 : 0
end
end
return num
end
end

View File

@ -48,7 +48,7 @@ class Myshixun < ActiveRecord::Base
score = 0
self.games.each do |game|
if game.status == 2
score += game.final_score
score += game.final_score.to_i
end
end
score

View File

@ -4,5 +4,5 @@ class Output < ActiveRecord::Base
# compile_success 1 表示程序未报错,有正常输出, 0.表示程序抛异常了,报错!
default_scope :order => 'query_index desc'
belongs_to :game
#belongs_to :challenge_choose
end

View File

@ -1,6 +1,6 @@
class School < ActiveRecord::Base
default_scope :order => 'created_at desc'
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link
attr_accessible :name, :province, :pinyin, :city, :address, :logo_link,:auto_users_trial
has_many :courses
has_many :departments, :dependent => :destroy

View File

@ -1,7 +1,7 @@
<div class="with85 fl">
<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>
<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="white-btn orange-btn fr">+ 我要发布</a>
<% end %>

View File

@ -4,8 +4,10 @@
<%= render :partial => "challenges/choose_tab" %>
</div>
<div class="fr option_item_con">
<a href="javascript:void(0)" class="mr10 white-btn green-btn white_bg addoption-btn mt5">+&nbsp;单选题</a>
<a href="javascript:void(0)" class="white-btn green-btn white_bg addoption-btn mt5">+&nbsp;多选题</a>
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<a href="javascript:void(0)" class="mr10 white-btn green-btn white_bg addoption-btn mt5">+&nbsp;单选题</a>
<a href="javascript:void(0)" class="white-btn green-btn white_bg addoption-btn mt5">+&nbsp;多选题</a>
<% end %>
</div>
</ul>
<div id="task_content" class="task-pm-box mh550 user_bg_shadow">
@ -79,8 +81,6 @@
}
}
$(".stage-part-2").find(".nav_option li").eq(length-1).after(html);
$.ajax({

View File

@ -5,8 +5,8 @@
<span class="btn-cir btn-cir-grey ml10 mt12 fl"><%= @challenges.count %></span>
<% end %>
<% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 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 => 0) %>" class="shixun-task-btn task-btn-green fr mt5" data-tip-down="新增代码编辑类型任务">+实践任务</a>
<a href="<%= new_shixun_challenge_path(@shixun, :st => 1) %>" class="shixun-task-btn task-btn-green fr mr10 mt5" data-tip-down="新增选择题类型的任务">+选择题任务</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 %>
@ -19,7 +19,7 @@
<% if challenge.st == 0 %>
<i class="fa fa-code font-16 color_white" data-tip-down="实践任务"></i>
<% else %>
<i class="fa fa-th-list color_white" data-tip-down="选任务"></i>
<i class="fa fa-th-list color_white" data-tip-down="选择题任务"></i>
<% end%>
</span>
<!-- <i class="fa fa-dot-circle-o font-18 color-green mr10"></i>-->

View File

@ -3,7 +3,7 @@
<div id="evaluating_show" class="<%= @challenge.evaluation_way == 0 ? "undis" : "" %>">
<div class="clearfix mb20">
<p class="fr">
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<% if User.current.manager_of_shixun?(@shixun) %>
<a href="javascript:void(0);" class="shixun-task-btn task-btn-green fr" id="edit_task_pass">编辑</a>
<% end %>
</p>
@ -49,8 +49,8 @@
<i class="fa fa-lock font-grey ml5" ></i>
<% end %>
</p>
<div class="clearfix"><span class="fl fb">输入:</span><p class="fl"><%= match_specific_symbol test.input unless test.input.blank? %></p></div>
<div class="clearfix"><span class="fl fb">输出:</span><p class="fl"><%= match_specific_symbol test.output unless test.output.blank? %></div>
<div class="clearfix"><span class="fl fb">输入:</span><p class="fl break_word with95"><%= match_specific_symbol test.input unless test.input.blank? %></p></div>
<div class="clearfix"><span class="fl fb">输出:</span><p class="fl break_word with95"><%= match_specific_symbol test.output unless test.output.blank? %></div>
</li>
<% end %>
<% else %>

View File

@ -3,8 +3,11 @@
<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>
<% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %>
<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="javascript:void(0);" onclick="delete_confirm_box_3('<%= destroy_challenge_choose_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.id) %>', '您是否确定删除?')" class="task-btn fr mr10 deloption-btn">删除</a>
<% end %>
</li>
<li class="clearfix">
<label class="panel-form-label fl">题干:&nbsp;&nbsp;</label>

View File

@ -46,6 +46,28 @@
<script type="text/javascript">
$(function() {
document.onkeydown = function(event) {
var target, code, tag;
if (!event) {
event = window.event; //针对ie浏览器
target = event.srcElement;
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return true; }
else { return false; }
}
}
else {
target = event.target; //针对遵循w3c标准的浏览器如Firefox
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return false; }
else { return true; }
}
}
};
taskpass_editormd = editormd("challenge_task_pass", {
width : "89.6%",
height : 600,

View File

@ -56,9 +56,11 @@
<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>
<% 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>
@ -83,7 +85,7 @@
</div>
</div>
<% else %>
<%= render :partial => "choose_type" %>
<%= render :partial => "choose_type" %>
<% end %>
</div>
<div class="save-tip">

View File

@ -8,7 +8,7 @@
</style>
<div class="task-pm-content">
<% if @shixun.status == 1 && (User.current.manager_of_shixun?(@shixun) || User.current.admin?) %>
<div class="alert alert-orange mb15 mt15">正在等待管理员的审核。如果需要重新编辑评测设置,请先撤销发布 </div>
<div class="alert alert-orange mb15 mt15">正在等待管理员的审核。在审核通过前,可以随时撤销发布 </div>
<% end %>
<div class="task-pm-box mt30 box_bg_shandow">
<div class="panel-header">

View File

@ -1,15 +1,87 @@
<div class="homepageRightBanner user_bg_shadow bor-grey-e mb10" style="width:973px;" >
<div class="NewsBannerName">
<%= get_acts_list_type @type %>
<div class="homepageRightBanner user_bg_shadow bor-grey-e mb10" style="width:1003px;padding: 0px" >
<div class="clearfix padding10">
<div class="NewsBannerName" style="width: 100px">
<%= get_acts_list_type @type %>
</div>
<div class="fl 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"%>
<%#= link_to "成员管理", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
</div>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<div class="fr activities_btn">
<% if false %>
<li class="activities_item">
<%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %>
<% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %>
<% if apply_count > 0 %>
<span class="ml10" style="cursor: pointer"><a href="<%= members_course_path(@course) %>" class="edu-cir-orange" data-tip-down="有<%= apply_count %>名助教或教师申请加入课堂,请审批"><%= apply_count %></a></span>
<% end %>
</li>
<% end %>
<div class="ml10 edu-dropdown">
<span class="mr10 color-orange03">新建</span><i class="fa fa-sort-down fl fr mt3 color-orange03"></i>
<ul class="edu-dropdown-menu" id="all_status_list" style="top:29px;left: -5px;width: 90px;">
<li>
<%= link_to '普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-grey" %>
</li>
<li>
<%= link_to '实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-grey", :remote => true %>
</li>
<li>
<a class="color-grey" onclick="course_files_upload();" style="cursor: pointer">资源</a>
</li>
<li>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<%= link_to '帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-grey" %>
</li>
</ul>
</div>
</div>
<% end %>
</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>
<% if false %>
<!--TO成员管理-->
<div class="resources mt10 user_bg_shadow bor-grey-e">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<a href="/images/avatars/User/15739?1501123240" alt="用户头像"><img alt="0" class="bor-radius-all" height="50" src="/images/avatars/User/0" width="50"></a>
</div>
<div class="homepagePostDes">
<div class="homepagePostTitle break_word">
<a href="javascript:void(0)" class="color-grey3 fl">蔡世申请加入课堂</a>
<span class="post_status_btn post_btn_red ml5 mt5">待处理</span>
<span class="post_status_btn post_btn_green ml5 mt5">已处理</span>
<a class="fr white-btn orange-btn">同意</a>
<a class="fr white-btn orange-btn mr10">拒绝</a>
</div>
<div class="homepagePostTo break_word clearfix" style="margin-bottom:10px">
<a href="/users/DSuperFunGuy" class="newsBlue mr15 color-grey-b">蔡世</a>
TO
<a href="/courses/792/files" class="newsBlue ml15 color-grey-b">成员管理</a>
</div>
<div class="fl"><span>提交时间:2017-09-28 15:44</span></div>
<div class="fr">
<span class="mr20">胡莎莎<span class="color-light-green">&nbsp;已同意</span><span class="color-red">&nbsp;已拒绝</span></span>
<span>处理时间:2017-09-28 15:44</span>
</div>
</div>
<div class="cl"></div>
</div>
</div>
<% end %>
<%= render :partial => 'courses/course_activity', :locals => {:course_activities => @course_activities,:page => 0,:type => @type} %>
<script>
$(function(){
$(".edu-dropdown").hover(function(){
$(this).find(".edu-dropdown-menu").show();
},function(){
$(this).find(".edu-dropdown-menu").hide();
})
})
</script>

View File

@ -2,7 +2,8 @@
<div class="searchFor fr" style="margin-top: -3px">
<div class="searchCon">
<input type="text" class="searchinput" name="search" value="<%= @search %>" placeholder="请输入课堂名称的关键字进行搜索" style="background: none;"/>
<i class="fa fa-close mr5 color-dark-grey" onclick="colse_searchbox();" title="搜索"></i>
<!--<i class="fa fa-close mr5 color-dark-grey" onclick="colse_searchbox();" title="搜索"></i>-->
<span class="search_close" onclick="colse_searchbox();" data-tip-down="清除">×</span>
</div>
<i class="fa fa-search mr5 color-dark-grey search_icon" onclick="$('#search_syllabuses_name').submit();" style="margin:10px" data-tip-down="搜索"></i>
</div>

View File

@ -152,4 +152,16 @@
timepicker:false,
validateOnBlur:false
});
function addtip(){
console.log("<%= @course.course_groups%>");
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($(".setting_group_<%= group.id %> span").width() == 115){
$(".setting_group_<%= group.id %>").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
}
</script>

View File

@ -26,9 +26,9 @@
</div>
<input id="choose_student_ids" name="choose_student_ids" type="hidden" value="">
<p style="width:520px;" class="ml10">
<p style="width:520px;background: #f7f9fd;height: 25px">
<input id="all_student_select" type="checkbox" name="all_student_select" class="fl mt7 mr5 magic-checkbox" value="">
<label for="all_student_select">
<label for="all_student_select" class="ml10">
<span class="span1 edu-name-dark edu-txt-w140 task-hide font-bd" style="text-align: center">姓名</span>
<span class="span2 ml10 edu-txt-w140 task-hide font-bd" style="text-align: center">学号</span>
<span class="span3 ml10 edu-txt-w140 task-hide font-bd" style="text-align: center">用户ID</span>

View File

@ -20,9 +20,9 @@
</div>
<input id="choose_student_ids" name="choose_student_ids" type="hidden" value="">
<p style="width:520px;" class="ml10">
<p style="width:520px;background: #f7f9fd;height: 25px">
<input id="all_student_select" type="checkbox" name="all_student_select" class="fl mt7 mr5 magic-checkbox" value="">
<label for="all_student_select">
<label for="all_student_select" class="ml10">
<span class="span1 edu-name-dark edu-txt-w140 task-hide font-bd" style="text-align: center">姓名</span>
<span class="span2 ml10 edu-txt-w140 task-hide font-bd" style="text-align: center">学号</span>
<span class="span3 ml10 edu-txt-w140 task-hide font-bd" style="text-align: center">用户ID</span>
@ -35,7 +35,7 @@
</div>
<div class="right fl">
<h4 class="font-16 mt95">角色:</h4>
<h4 class="font-16 mt100">角色:</h4>
<ul class="pl20 pb20">
<li>
<label>
@ -51,8 +51,8 @@
</li>
</ul>
<a href="javascript:void(0);" class="pop_close task-btn mb10" style="margin-top: 164px;">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-blue" style="margin-top: 164px;" onclick="submit_add_teacher_form()">确定</a>
<a href="javascript:void(0);" class="pop_close task-btn" style="margin-top: 197px;">取消</a>
<a href="javascript:void(0);" class="task-btn task-btn-blue" style="margin-top: 197px;" onclick="submit_add_teacher_form()">确定</a>
</div>
<% end %>
</div>

View File

@ -16,7 +16,7 @@
<% @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 data-tip-left="<%= group.name %>"><%= group.name %></span>
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
@ -27,3 +27,13 @@
</div>
<%= render :partial => "courses/settings/all_student_list_block" %>
</div>
<script>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($(".setting_group_<%= group.id %> span").width() == 115){
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
</script>

View File

@ -40,8 +40,9 @@
<% end %>
<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>
<input type="text" class="with100 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>-->
<span class="edu-close" onclick="colse_searchbox();" data-tip-down="关闭">×</span>
</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>

View File

@ -12,11 +12,20 @@
<% 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" data-tip-left="<%= group.name.length > 6 ? group.name : ''%>">
<p class="p1">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
</p>
</li>
<% end %>
<% end %>
<% end %>
<script>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($(".setting_group_<%= group.id %> span").width() == 115){
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
</script>

View File

@ -14,8 +14,8 @@
<% end %>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
<li class="<%= @group.id == group.id ? 'sheet' : '' %>" data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>">
<p class="p1" data-tip-left="<%= group.name %>">
<li class="<%= @group.id == group.id ? 'sheet' : '' %>" data-option="hasclass" data-group-id="<%= group.id %>" data-course-id="<%= @course.id %>" class="setting_group_<%= group.id %>" id = "setting_group_<%= group.id %>" >
<p class="p1">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
@ -26,4 +26,14 @@
</ul>
</div>
<%= render :partial => "courses/settings/has_group_student_list_block" %>
</div>
</div>
<script>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($("#setting_group_<%= group.id %> span").width() == 115){
$("#setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
</script>

View File

@ -34,8 +34,9 @@
<% end %>
<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>
<input type="text" class="with100 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>-->
<span class="edu-close" onclick="colse_searchbox();" data-tip-down="关闭">×</span>
</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>

View File

@ -46,20 +46,22 @@
</td>
</tr>
<% end %>
<% @apply_users.each_with_index do |apply, index| %>
<% user = User.find(apply.course_message_id) %>
<tr id="setting_member_<%= user.id %>">
<td><%= @teacher_count + index + 1 %></td>
<td>
<%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %>
</td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.try(:login) %></span></td>
<td><%= apply.content && apply.content.include?('9') ? "教师" : "助教" %></td>
<td>
<%= link_to '同意', dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>apply.id), :class=>'color-red mr5'%>
<%= link_to '拒绝', dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>apply.id), :class=>'color-red'%>
</td>
</tr>
<% if is_teacher %>
<% @apply_users.each_with_index do |apply, index| %>
<% user = User.find(apply.course_message_id) %>
<tr id="setting_member_<%= user.id %>">
<td><%= @teacher_count + index + 1 %></td>
<td>
<%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %>
</td>
<td><span class="edu-txt-w140 task-hide mt5"><%= user.try(:login) %></span></td>
<td><%= apply.content && apply.content.include?('9') ? "教师" : "助教" %></td>
<td>
<%= link_to '同意', dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>apply.id), :class=>'color-red mr5'%>
<%= link_to '拒绝', dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>apply.id), :class=>'color-red'%>
</td>
</tr>
<% end %>
<% end %>
</tbody>
</table>

View File

@ -14,7 +14,7 @@
<% 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" data-tip-left="<%= group.name %>">
<p class="p1">
<span><%= group.name %></span>
<em><%= group.members.count %></em>
<!--<i class="fa fa-bars" aria-hidden="true"></i>-->
@ -26,3 +26,14 @@
</div>
<%= render :partial => "courses/settings/no_group_student_list_block" %>
</div>
<script>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($(".setting_group_<%= group.id %> span").width() == 115){
$(".setting_group_<%= group.id %> p").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
</script>

View File

@ -20,8 +20,9 @@
<% end %>
<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>
<input type="text" class="with100 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>-->
<span class="edu-close" onclick="colse_searchbox();" data-tip-down="关闭">×</span>
</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>

View File

@ -7,7 +7,8 @@
<!--<i class="fa fa-check-square-o color-blue blue fl" style="display:none;" aria-hidden="true"></i>-->
<input id="add_student_<%= user.id %>" type="checkbox" class="fl mt7 mr5 magic-checkbox" name="membership[user_ids][]" value="<%= user.id %>">
<label for="add_student_<%= user.id %>" style="top:0px">
<a href="<%= user_path(user) %>" target="_blank" class="task-hide span1 edu-name-dark edu-txt-w140"><%= user.show_real_name %>(<%= user.login %>)</a>
<!--(<%#= user.login %>)-->
<a href="<%= user_path(user) %>" target="_blank" class="task-hide span1 edu-name-dark edu-txt-w140" style="text-align: center"><%= user.show_real_name %></a>
<span class="span2 ml10 edu-txt-w140 task-hide" style="text-align: center"><%= user.user_extensions.try(:student_id) %></span>
<span class="span3 ml10 edu-txt-w140 task-hide" style="text-align: center"><%= user.login %></span>
</label>

View File

@ -7,7 +7,8 @@
<!--<i class="fa fa-check-square-o color-blue blue fl" style="display:none;" aria-hidden="true"></i>-->
<input id="add_student_<%= user.id %>" type="checkbox" class="fl mt7 mr5 magic-checkbox" name="membership[user_ids][]" value="<%= user.id %>">
<label for="add_student_<%= user.id %>" style="top:0px">
<a href="<%= user_path(user) %>" target="_blank" class="task-hide span1 edu-name-dark edu-txt-w140"><%= user.show_real_name %>(<%= user.login %>)</a>
<!--(<%#= user.login %>)-->
<a href="<%= user_path(user) %>" target="_blank" class="task-hide span1 edu-name-dark edu-txt-w140" style="text-align: center"><%= user.show_real_name %></a>
<span class="span2 ml10 edu-txt-w140 task-hide" style="text-align: center"><%= user.user_extensions.try(:student_id) %></span>
<span class="span3 ml10 edu-txt-w140 task-hide" style="text-align: center"><%= user.login %></span>
</label>

View File

@ -8,20 +8,24 @@
<input type="hidden" value="<%= @type%>" name="type" id="user_activities_type">
<div class="homepageRight mt0 " style="width:85%; float:left;">
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<ul class="with100 mb20 ml15 clearfix df activities_btn font-16" style="width:1003px;">
<li><%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %>
<% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %>
<% if apply_count > 0 %>
<span class="ml10" style="cursor: pointer"><a href="<%= members_course_path(@course) %>" class="edu-cir-orange" data-tip-down="有<%= apply_count %>名助教或教师申请加入课堂,请审批"><%= apply_count %></a></span>
<% end %>
</li>
<li><%= link_to '+&nbsp;发布普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-orange03" %></li>
<li><%= link_to '+&nbsp;发布实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-orange03", :remote => true %></li>
<li><a class="color-orange03" onclick="course_files_upload();" style="cursor: pointer">+&nbsp;发布资源</a></li>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<li><%= link_to '+&nbsp;发布帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-orange03" %></li>
</ul>
<% if false %>
<% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %>
<ul class="with100 mb20 ml15 clearfix df activities_btn font-16" style="width:1003px;">
<% if false %>
<li><%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %>
<% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %>
<% if apply_count > 0 %>
<span class="ml10" style="cursor: pointer"><a href="<%= members_course_path(@course) %>" class="edu-cir-orange" data-tip-down="有<%= apply_count %>名助教或教师申请加入课堂,请审批"><%= apply_count %></a></span>
<% end %>
</li>
<% end %>
<li><%= link_to '+&nbsp;发布普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-orange03" %></li>
<li><%= link_to '+&nbsp;发布实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-orange03", :remote => true %></li>
<li><a class="color-orange03" onclick="course_files_upload();" style="cursor: pointer">+&nbsp;发布资源</a></li>
<% course_board = @course.boards.where("parent_id is NULL").first %>
<li><%= link_to '+&nbsp;发布帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-orange03" %></li>
</ul>
<% end %>
<% end %>
<div id="course_activities_content">
<%= render :partial => 'courses/course_activity_content', :locals => {:course_activities => @course_activities} %>

View File

@ -0,0 +1,392 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<title></title>
<style>
.magic-radio + label:after{left: 5px;top: 11px;}
</style>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt; <a href="javascript:void(0)">试卷列表</a>&gt; #22
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 fl color-grey3">
<i class="fa fa-lock mr5 color-grey"></i>
实验四 多周期CPU与存储器实验
</p>
<a href="/homework_common?course=791&amp;homework_type=1" class="fr font-12 mr15 mt3 color-grey">返回</a>
</div>
<div class="user_bg_shadow bor-grey-e clearfix">
<div id="homework_publish_setting">
<!--发布设置-->
<div class="bor-bottom-greyE pt10 pb10 pr10">
<div class="none" id="show_publish_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt5">发布设置</p>
<a href="javascript:void(0);" class="white-btn orange-btn fr mr15 mt15" title="编辑" onclick="show_edit_setting();">编辑</a>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">发布时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" value="2016-10-30 00:00" disabled="">
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
<em></em>
<span></span>
<p>发布之前,学生不会收到试卷</p>
</div>
</li>
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">截止时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_end_time" value="2016-11-16 23:59" disabled="">
<div class="cl"></div>
</li>
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">结束时间</label>
<input type="text" class="disabled-bg fl task-form-15 task-height-40 panel-box-sizing" id="show_archive_time" value="" disabled="">
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>结束之后,系统自动归档试卷</p>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="" id="edit_publish_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt5">发布设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">发布时间</label>
<input type="text" name="homework_publish_time" readonly="" value="2016-10-30 00:00" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="请选择发布时间">
<span class="color-orange fl ml20 mt5 none" id="homework_publish_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px; width:405px;">
<em></em>
<span></span>
<p>发布之前,学生不会收到试卷</p>
</div>
</li>
<li class="clearfix mb15 edu-position pl30">
<label class="panel-form-label fl mr10">截止时间</label>
<input type="text" name="homework_end_time" readonly="" value="2016-11-16 23:59" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="请选择截止时间">
<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>
</li>
<li class="clearfix mb15 edu-position pl30">
<label class=" panel-form-label fl mr10">结束时间</label>
<input type="text" name="homework_archive_time" readonly="" value="" class=" fl task-form-15 task-height-40 panel-box-sizing" placeholder="请选择结束时间">
<span class="color-orange fl ml20 mt5 none" id="homework_archive_time_notice"><i class="fa fa-exclamation-circle mr5 color-orange"></i></span>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>结束之后,系统自动归档试卷</p>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
<!--答题设置-->
<div class="bor-bottom-greyE pt10 pb10 pr10">
<div class="none" id="show_late_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">答题设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">答题时长</label>
<input type="text" value="10" disabled="" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" placeholder="5">
<label class="fl mt8 ml5">分钟</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>答题时长不填写,则表示不限时长</p>
<p>学生答题时间即使没有超过答题时长的限制</p>
<p>但是已到截止时间点,则系统自动为正在答题的学生提交试卷</p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">答题显示</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_1" disabled="" type="checkbox" checked="">
<label class="fl" for="dt_1">题目顺序随机打乱</label>
<span class="fl color-grey mt5">(选中则学生答题时,题目顺序按照题型随机显示)</span>
<div class="cl"></div>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_2" disabled="" type="checkbox" checked="">
<label class="fl" for="dt_2" style="margin-left: 11%;">选项顺序随机打乱</label>
<span class="fl color-grey mt5">(选中则学生答题时,选项顺序随机显示)</span>
</li>
</ul>
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">补交答题</label>
<input id="edit_allow_late_1" disabled="" class="magic-radio fl" type="radio" name="homework_allow_late" value="1">
<label for="edit_allow_late_1" class="fl mr30">允许</label>
<input id="edit_allow_late_0" disabled="" class="magic-radio fl" type="radio" name="homework_allow_late" value="0" checked="">
<label for="edit_allow_late_0" class="fl">禁止</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>允许补交,则在补交截止日期之前,未答题的学生可以补交答题</p>
<p>但是在发布截止日期~补交截止时间内才答题的学生,将被扣迟交分</p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">截止时间</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">迟交扣分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">
</li>
</ul>
</div>
</div>
</div>
<div class="" id="edit_late_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">答题设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">答题时长</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">
<label class="fl mt8 ml5">分钟</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>答题时长不填写,则表示不限时长</p>
<p>学生答题时间即使没有超过答题时长的限制</p>
<p>但是已到截止时间点,则系统自动为正在答题的学生提交试卷</p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">答题显示</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_3" type="checkbox" checked="">
<label class="fl" for="dt_3">题目顺序随机打乱</label>
<span class="fl color-grey mt5">(选中则学生答题时,题目顺序按照题型随机显示)</span>
<div class="cl"></div>
<input class="magic-checkbox fl mt5 magic-checkbox_show" id="dt_4" type="checkbox" checked="">
<label class="fl" for="dt_4" style="margin-left: 11%;">选项顺序随机打乱</label>
<span class="fl color-grey mt5">(选中则学生答题时,选项顺序随机显示)</span>
</li>
</ul>
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">补交答题</label>
<input id="edit_allow_late_2" class="magic-radio fl" type="radio" name="homework_allow_late_1" value="1">
<label for="edit_allow_late_2" class="fl mr30 mt3">允许</label>
<input id="edit_allow_late_3" class="magic-radio fl" type="radio" name="homework_allow_late_1" value="0" checked="">
<label for="edit_allow_late_3" class="fl mt3">禁止</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>允许补交,则在补交截止日期之前,未答题的学生可以补交答题</p>
<p>但是在发布截止日期~补交截止时间内才答题的学生,将被扣迟交分</p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">截止时间</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">迟交扣分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">
</li>
</ul>
</div>
</div>
</div>
</div>
<!--主观题评分设置-->
<div class="bor-bottom-greyE pt10 pb10 pr10">
<div class="none" id="show_late_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">主观题评分设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">助教评分</label>
<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_1" name="zg[]_1" disabled="" type="radio" checked="">
<label class="fl" for="zg_1">普通模式</label>
<span class="fl color-grey mt5">(选中则取各助教最终评分的平均分)</span>
<div class="cl"></div>
<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_2" name="zg[]_1" disabled="" type="radio">
<label class="fl" for="zg_2" style="margin-left: 11%;">复审模式</label>
<span class="fl color-grey mt5">(选中则只取最终次的助教评分)</span>
</li>
</ul>
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">最终成绩</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>计算说明</p>
<p class="mb10">教师评分*其百分比+助教评分+其百分比+迟交扣分</p>
<p>注意</p>
<p>非零百分比的评分选项,在没有评分记录的情况下,其百分比平摊到另外</p><p>的评分选项上。例如教师评分60% + 助教评分40% 学生A没有得到</p><p>教师评分则最终成绩将按照助教评分100% 进行计算 </p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">教师评分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">助教评分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing disabled-bg" disabled="" placeholder="5">
</li>
</ul>
</div>
</div>
</div>
<div class="" id="edit_late_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">主观题评分设置</p>
</div>
<div class="ml30 mr30" style="padding-bottom:20px;">
<div class="clearfix">
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">助教评分</label>
<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_3" name="zg[]_2" type="radio" checked="">
<label class="fl" for="zg_3">普通模式</label>
<span class="fl color-grey mt5">(选中则取各助教最终评分的平均分)</span>
<div class="cl"></div>
<input class="magic-radio fl mt5 magic-checkbox_show" id="zg_4" name="zg[]_2" type="radio" checked="">
<label class="fl" for="zg_4" style="margin-left: 11%;">复审模式</label>
<span class="fl color-grey mt5">(选中则只取最终次的助教评分)</span>
</li>
</ul>
<ul>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">最终成绩</label>
<div class="popup_tip_box fontGrey2" style="right:-15px; top:0px;width:405px;">
<em></em>
<span></span>
<p>计算说明</p>
<p class="mb10">教师评分*其百分比+助教评分+其百分比+迟交扣分</p>
<p>注意</p>
<p>非零百分比的评分选项,在没有评分记录的情况下,其百分比平摊到另外</p><p>的评分选项上。例如教师评分60% + 助教评分40% 学生A没有得到</p><p>教师评分则最终成绩将按照助教评分100% 进行计算 </p>
</div>
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">教师评分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">
</li>
<li class="clearfix mb20 edu-position pl30">
<label class="panel-form-label fl mr10">&nbsp;</label>
<label class="mt8 fl mr10">助教评分</label>
<input type="text" value="10" class="fl task-form-15 task-height-40 panel-box-sizing" placeholder="5">
</li>
</ul>
</div>
</div>
</div>
</div>
<!--公开设置-->
<div class="pt10 pr10">
<div class="none" id="show_public_setting">
<style>
.magic-radio + label:before, .magic-checkbox_show + label:before{
width: 16px;
height: 16px;
}
</style>
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">公开设置</p>
</div>
<div class="ml30 mr30 mb15">
<div class="clearfix">
<ul>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled="" checked="">
<label class="fl">公开成绩</label>
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开)</span>
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl mt5 magic-checkbox_show" type="checkbox" disabled="" checked="">
<label class="fl">公开答案</label>
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开)</span>
</li>
</ul>
</div>
</div>
</div>
<div class="" id="edit_public_setting">
<div class="clearfix mb15">
<p class="ml15 fl font-16 mt10">公开设置</p>
</div>
<div class="ml30 mr30">
<div class="clearfix">
<ul>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl magic-checkbox_show" type="checkbox" id="public_scroe" checked="">
<label class="fl" for="public_scroe" style="top:0px">公开成绩</label>
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开)</span>
</li>
<li class="clearfix">
<label class="panel-form-label fl mr10">&nbsp;</label>
<input class="magic-checkbox fl magic-checkbox_show" type="checkbox" id="public_answer" checked="">
<label class="fl" for="public_answer" style="top:0px">公开答案</label>
<span class="fl color-grey">(选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开)</span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="clearfix mt15 mb15 mr15 pr10" id="exam_setting_submit_block">
<a href="javascript:void(0);" class="task-btn task-btn-blue fr">保存</a>
<a href="javascript:void(0);" class="task-btn fr mr10">取消</a>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,179 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/stylesheets/jquery/jquery-ui-1.9.2.css" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/course.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt;<a href="javascript:void(0)"> 试卷列表</a>&gt; #22&gt;胡莎莎
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e mb20">
<p class="ml15 fl color-grey3"><i class="fa fa-lock mr5"></i>软件测试小测</p>
<span class="post_status_btn post_btn_green ml5 mt6">按时</span>
<!--<span class="post_status_btn post_btn_red ml5 mt6">延时提交</span>-->
<a href="/student_work?homework=4368&amp;tab=2" class="fr font-12 mr15 mt3 color-grey">返回</a>
</div>
<div class="edu-con-top font-14 color-grey clearfix user_bg_shadow bor-grey-e">
<p class="ml20">试卷须知:</br>
<span class="ml40">共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题。</span></br>
<span class="ml40">请大家认真答题,本次作业成绩将计入期末成绩。</span></p>
</div>
<div class="clearfix mt10 mb10 pl5 pr5">
<p class="fl">
<span class="mr20">单选题<span>&nbsp;3&nbsp;</span>题,共<span>&nbsp;15&nbsp;</span></span>
<span class="mr20">多选题<span>&nbsp;5&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span class="mr20">填空题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span>简答题&nbsp;10&nbsp;题,共&nbsp;25&nbsp;</span>
</p>
<p class="fr">合计 <span class="color-orange03">18</span> 题,共 <span class="color-orange03">100</span></p>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<!--学生查看作品,截止日期后 -->
<div class="clearfix pl15">
<span class="checkstatus_box_small post_btn_green mt10"></span><span class="fl mr20 font-12 mt3">满分</span>
<span class="checkstatus_box_small post_btn_red mt10"></span><span class="fl mr20 font-12 mt3">零分</span>
<span class="checkstatus_box_small post_btn_green_q mt10"></span><span class="fl font-12 mt3">其它</span>
<p class="mr15 mt3 fr color-grey font-14">总分:<span class="color-light-green">89</span></p><!--<span class="color-red">95</span>-->
</div>
<div class="clearfix ml15 mt10 mb15">
<span class="checkstatus_box_big post_btn_red">1</span>
<span class="checkstatus_box_big post_btn_green">2</span>
<span class="checkstatus_box_big post_btn_green">3</span>
<span class="checkstatus_box_big post_btn_green">4</span>
<span class="checkstatus_box_big post_btn_red">5</span>
<span class="checkstatus_box_big post_btn_green">6</span>
<span class="checkstatus_box_big post_btn_green">7</span>
<span class="checkstatus_box_big post_btn_green">8</span>
<span class="checkstatus_box_big post_btn_green">9</span>
<span class="checkstatus_box_big post_btn_green_q">10</span>
<span class="checkstatus_box_big post_btn_green_q">11</span>
</div>
<!--学生查看作品,截止日期前 -->
<div class="clearfix pl15">
<span class="checkstatus_box_small post_btn_white mt10" style="border: 1px solid #CCCCCC;"></span><span class="fl mr20 font-12 mt3">已答</span>
<span class="checkstatus_box_small post_btn_grey mt10"></span><span class="fl mr20 font-12 mt3">未答</span>
</div>
<div class="clearfix ml15 mt10 mb15">
<span class="checkstatus_box_big post_btn_grey">1</span>
<span class="checkstatus_box_big post_btn_white">2</span>
<span class="checkstatus_box_big post_btn_white">3</span>
<span class="checkstatus_box_big post_btn_white">4</span>
<span class="checkstatus_box_big post_btn_grey">5</span>
<span class="checkstatus_box_big post_btn_white">6</span>
<span class="checkstatus_box_big post_btn_white">7</span>
<span class="checkstatus_box_big post_btn_white">8</span>
<span class="checkstatus_box_big post_btn_white">9</span>
<span class="checkstatus_box_big post_btn_grey">10</span>
<span class="checkstatus_box_big post_btn_grey">11</span>
</div>
</div>
<div class="clearfix">
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第1题:<span class="color-orange03 ml10">[多选题]</span><span class="ml10">10</span></p>
<!--截止日期前不显示-->
<p class="fr"><span class="color-light-green mr3"><i class="mr5 fa fa-check font-14"></i>10</span></p>
<!---->
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_0" type="checkbox" disabled=""><label class="fl color-grey3" for="dx_0">没区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_1" type="checkbox" disabled="" checked=""><label class="fl color-grey3" for="dx_1">有区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_2" type="checkbox" disabled=""><label class="fl color-grey3" for="dx_2">有一点点区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_4" type="checkbox" disabled="" checked=""><label class="fl color-grey3" for="dx_4">有很多区别</label></li>
</div>
<!--截止日期前不显示-->
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案ABCD
</div>
<!---->
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第2题:<span class="color-orange03 ml10">[单选题]</span><span class="ml10">5</span></p>
<p class="fr"><span class="color-red mr3"><i class="mr5 fa fa-close font-14"></i>0</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_1" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_1">没区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_2" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_2">有区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_3" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_3">有一点点区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_4" name="sx" type="radio" disabled="" checked=""><label class="fl color-grey3" for="sx_4">有很多区别</label></li>
</div>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案A
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第3题:<span class="color-orange03 ml10">[填空题]</span><span class="ml10">5</span></p>
<p class="fr"><span class="color-red mr3"><i class="mr5 fa fa-close font-14"></i>0</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试(<span class="color-light-green">没有</span>)区别</p>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
<p>候选答案1哈哈哈哈</p>
<p>候选答案1呵呵呵呵</p>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第4题:<span class="color-orange03 ml10">[简答题]</span><span class="ml10">10</span></p>
<p class="fr"><span class="color-light-green mr3">9</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="break-word write_answer">学生所填答案收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试.验收测试验收测.</div>
<div class="clearfix bor-top-greyE padding15 answer_con">
<p>参考答案</p>
<p style="text-align:justify;">黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下, </p>
</div>
<div>
<!--<p class="clearfix padding15 font-16 bor-top-greyE">
<span class="fl">全部评阅10</span>
<a class="fr white-btn orange-btn undis">下一题</a>
</p>-->
<div class="clearfix padding15 bor-top-greyE">
<div class="with85 fl">
<label class="fl color-grey mt5"> 评分&nbsp;&nbsp;</label>
<input type="number" class="fl task-form-10 task-height-40 panel-box-sizing" name="score" id="score_" value="0" min="-1" max="100" size="4" data-units="dollars" />
<span class="ml5 fl mt5"></span>
<span id="score_notice_span_" class="ml5 fl mt5 color-red" style="display: none;">未评分</span>
</div>
<div class="with15 fr mt5">
<a href="javascript:void(0);" class="task-btn task-btn-orange fr">保存</a>
<a href="javascript:void(0);" class="task-btn mr10 fr">取消</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$('#score_').peSlider({range: 'min'});
})
</script>
</body>
</html>

View File

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/stylesheets/jquery/jquery-ui-1.9.2.css" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/course.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt;<a href="javascript:void(0)"> 试卷列表</a>&gt; #22&gt;胡莎莎
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e mb20">
<p class="ml15 fl color-grey3"><i class="fa fa-lock mr5"></i>软件测试小测</p>
<!--<span class="post_status_btn post_btn_green ml5 mt7">按时</span>-->
<!--<span class="post_status_btn post_btn_red ml5 mt7">延时提交</span>-->
<a href="/student_work?homework=4368&amp;tab=2" class="fr font-12 mr15 mt3 color-grey">返回</a>
</div>
<div class="edu-con-top font-14 color-grey clearfix user_bg_shadow bor-grey-e">
<p class="ml20">试卷须知:</br>
<span class="ml40">共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题。</span></br>
<span class="ml40">请大家认真答题,本次作业成绩将计入期末成绩。</span></p>
</div>
<div class="clearfix mt10 mb10 pl5 pr5">
<p class="fl">
<span class="mr20">单选题<span>&nbsp;3&nbsp;</span>题,共<span>&nbsp;15&nbsp;</span></span>
<span class="mr20">多选题<span>&nbsp;5&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span class="mr20">填空题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span>简答题&nbsp;10&nbsp;题,共&nbsp;25&nbsp;</span>
</p>
<p class="fr">合计 <span class="color-orange03">18</span> 题,共 <span class="color-orange03">100</span></p>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<div class="clearfix pl15">
<span class="checkstatus_box_small post_btn_white mt10" style="border: 1px solid #CCCCCC;"></span><span class="fl mr20 font-12 mt3">已答</span>
<span class="checkstatus_box_small post_btn_grey mt10"></span><span class="fl mr20 font-12 mt3">未答</span>
<p class="fr mr15"><a href="javascript:void(0)" style="width: 50px;" class="task-btn task-btn-orange">交卷</a></p>
</div>
<div class="clearfix ml15 mt10 mb15">
<span class="checkstatus_box_big post_btn_grey">1</span>
<span class="checkstatus_box_big post_btn_white">2</span>
<span class="checkstatus_box_big post_btn_white">3</span>
<span class="checkstatus_box_big post_btn_white">4</span>
<span class="checkstatus_box_big post_btn_grey">5</span>
<span class="checkstatus_box_big post_btn_white">6</span>
<span class="checkstatus_box_big post_btn_white">7</span>
<span class="checkstatus_box_big post_btn_white">8</span>
<span class="checkstatus_box_big post_btn_white">9</span>
<span class="checkstatus_box_big post_btn_grey">10</span>
<span class="checkstatus_box_big post_btn_grey">11</span>
</div>
</div>
<div class="clearfix">
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第1题:<span class="color-orange03 ml10">[多选题]</span><span class="ml10">10</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb15">
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_0" type="checkbox"><label class="fl color-grey3" for="dx_0">没区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_1" type="checkbox"><label class="fl color-grey3" for="dx_1">有区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_2" type="checkbox"><label class="fl color-grey3" for="dx_2">有一点点区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_4" type="checkbox"checked=""><label class="fl color-grey3" for="dx_4">有很多区别</label></li>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第2题:<span class="color-orange03 ml10">[单选题]</span><span class="ml10">5</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb15">
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_1" name="sx" type="radio"><label class="fl color-grey3" for="sx_1">没区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_2" name="sx" type="radio"><label class="fl color-grey3" for="sx_2">有区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_3" name="sx" type="radio"><label class="fl color-grey3" for="sx_3">有一点点区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_4" name="sx" type="radio"><label class="fl color-grey3" for="sx_4">有很多区别</label></li>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第3题:<span class="color-orange03 ml10">[填空题]</span><span class="ml10">5</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试()区别</p>
<div class="ml15 mr15 mb15 mt10">
<textarea class="task-height-40 with100"></textarea>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第4题:<span class="color-orange03 ml10">[简答题]</span><span class="ml10">10</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="ml15 mr15 mb15 mt10">
<textarea class="task-height-150 with100"></textarea>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$('#score_').peSlider({range: 'min'});
})
</script>
</body>
</html>

View File

@ -0,0 +1,166 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/stylesheets/jquery/jquery-ui-1.9.2.css" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/course.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt;<a href="javascript:void(0)"> 试卷列表</a>&gt; #22&gt;胡莎莎
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e mb20">
<p class="ml15 fl color-grey3"><i class="fa fa-lock mr5"></i>软件测试小测</p>
<span class="post_status_btn post_btn_green ml5 mt6">按时</span>
<!--<span class="post_status_btn post_btn_red ml5 mt6">延时提交</span>-->
<a href="/student_work?homework=4368&amp;tab=2" class="fr font-12 mr15 mt3 color-grey">返回</a>
</div>
<div class="edu-con-top font-14 color-grey clearfix user_bg_shadow bor-grey-e">
<p class="ml20">试卷须知:</br>
<span class="ml40">共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题。</span></br>
<span class="ml40">请大家认真答题,本次作业成绩将计入期末成绩。</span></p>
</div>
<div class="clearfix mt10 mb10 pl5 pr5">
<p class="fl">
<span class="mr20">单选题<span>&nbsp;3&nbsp;</span>题,共<span>&nbsp;15&nbsp;</span></span>
<span class="mr20">多选题<span>&nbsp;5&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span class="mr20">填空题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span>简答题&nbsp;10&nbsp;题,共&nbsp;25&nbsp;</span>
</p>
<p class="fr">合计 <span class="color-orange03">18</span> 题,共 <span class="color-orange03">100</span></p>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<div class="clearfix">
<span class="fl ml15 mr20 font-15">主观题</span>
<span class="checkstatus_box_small post_btn_white mt10" style="border: 1px solid #CCCCCC;"></span><span class="fl mr20 font-12 mt3">已评</span>
<span class="checkstatus_box_small post_btn_grey mt10"></span><span class="fl font-12 mt3">未评</span>
</div>
<div class="clearfix ml80 mt10 mb15">
<span class="checkstatus_box_big post_btn_grey">1</span>
<span class="checkstatus_box_big post_btn_white">2</span>
<span class="checkstatus_box_big post_btn_white">3</span>
<span class="checkstatus_box_big post_btn_white">4</span>
<span class="checkstatus_box_big post_btn_grey">5</span>
</div>
<div class="clearfix">
<span class="fl ml15 mr20 font-15">客观题</span>
<span class="checkstatus_box_small post_btn_green mt10"></span><span class="fl mr20 font-12 mt3">正确</span>
<span class="checkstatus_box_small post_btn_red mt10"></span><span class="fl font-12 mt3">错误</span>
</div>
<div class="clearfix ml80 mt10 mb5">
<span class="checkstatus_box_big post_btn_green">1</span>
<span class="checkstatus_box_big post_btn_green">2</span>
<span class="checkstatus_box_big post_btn_green">3</span>
<span class="checkstatus_box_big post_btn_green">4</span>
<span class="checkstatus_box_big post_btn_red">5</span>
</div>
</div>
<div class="clearfix">
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第1题:<span class="color-orange03 ml10">[多选题]</span><span class="ml10">10</span></p>
<p class="fr"><span class="color-light-green mr3"><i class="mr5 fa fa-check font-14"></i>10</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_0" type="checkbox" disabled=""><label class="fl color-grey3" for="dx_0">A.没区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_1" type="checkbox" disabled="" checked=""><label class="fl color-grey3" for="dx_1">B.有区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_2" type="checkbox" disabled=""><label class="fl color-grey3" for="dx_2">C.有一点点区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_4" type="checkbox" disabled="" checked=""><label class="fl color-grey3" for="dx_4">D.有很多区别</label></li>
</div>
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案ABCD
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第2题:<span class="color-orange03 ml10">[单选题]</span><span class="ml10">5</span></p>
<p class="fr"><span class="color-red mr3"><i class="mr5 fa fa-close font-14"></i>0</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_1" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_1">A.没区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_2" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_2">B.有区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_3" name="sx" type="radio" disabled=""><label class="fl color-grey3" for="sx_3">C.有一点点区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_4" name="sx" type="radio" disabled="" checked=""><label class="fl color-grey3" for="sx_4">D.有很多区别</label></li>
</div>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案A
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第3题:<span class="color-orange03 ml10">[填空题]</span><span class="ml10">5</span></p>
<p class="fr"><span class="color-red mr3"><i class="mr5 fa fa-close font-14"></i>0</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试(<span class="color-light-green">没有</span>)区别</p>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
<p>候选答案1哈哈哈哈</p>
<p>候选答案1呵呵呵呵</p>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第4题:<span class="color-orange03 ml10">[简答题]</span><span class="ml10">10</span></p>
<p class="fr"><span class="color-light-green mr3">9</span></p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="break-word write_answer">学生所填答案收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试.验收测试验收测.</div>
<a href="javascript:void(0)" class="fr color-orange05 mb5 mr15 hide_answer">隐藏参考答案</a>
<div class="clearfix bor-top-greyE padding15 answer_con">
<p>参考答案</p>
<p style="text-align:justify;">黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下, </p>
</div>
<div>
<!--<p class="clearfix padding15 font-16 bor-top-greyE">
<span class="fl">全部评阅10</span>
<a class="fr white-btn orange-btn undis">下一题</a>
</p>-->
<div class="clearfix padding15 bor-top-greyE">
<div class="with85 fl">
<label class="fl color-grey mt5"> 评分&nbsp;&nbsp;</label>
<input type="number" class="fl task-form-10 task-height-40 panel-box-sizing" name="score" id="score_" value="0" min="-1" max="100" size="4" data-units="dollars" />
<span class="ml5 fl mt5"></span>
<span id="score_notice_span_" class="ml5 fl mt5 color-red" style="display: none;">未评分</span>
</div>
<div class="with15 fr mt10">
<a href="javascript:void(0);" class="task-btn task-btn-orange fr">保存</a>
<a href="javascript:void(0);" class="task-btn mr10 fr">取消</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(".hide_answer").live("click",function(){
$(this).siblings(".answer_con").slideToggle(500);
})
$('#score_').peSlider({range: 'min'});
})
</script>
</body>
</html>

View File

@ -0,0 +1,163 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/jquery/jquery-ui-1.9.2.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/course.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt;<a href="javascript:void(0)"> 试卷列表</a>&gt; #22&gt;胡莎莎
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e mb20">
<p class="ml15 fl color-grey3"><i class="fa fa-lock mr5"></i>软件测试小测</p>
<span class="post_status_btn post_btn_green ml5 mt7">按时</span>
<!--<span class="post_status_btn post_btn_red ml5 mt7">延时提交</span>-->
<a href="/student_work?homework=4368&amp;tab=2" class="fr font-12 mr15 mt3 color-grey">返回</a>
</div>
<div class="edu-con-top font-14 color-grey clearfix user_bg_shadow bor-grey-e">
<p class="ml20">试卷须知:</br>
<span class="ml40">共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题。</span></br>
<span class="ml40">请大家认真答题,本次作业成绩将计入期末成绩。</span></p>
</div>
<div class="clearfix mt10 mb10 pl5 pr5">
<p class="fl">
<span class="mr20">单选题<span>&nbsp;3&nbsp;</span>题,共<span>&nbsp;15&nbsp;</span></span>
<span class="mr20">多选题<span>&nbsp;5&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span class="mr20">填空题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span>简答题&nbsp;10&nbsp;题,共&nbsp;25&nbsp;</span>
</p>
<p class="fr">合计 <span class="color-orange03">18</span> 题,共 <span class="color-orange03">100</span></p>
</div>
<div class="clearfix sortable pr" id="sortable">
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第1题:<span class="color-orange03 ml10">[多选题]</span><span class="ml10">10</span></p>
<p class="fr exam_operator font-18">
<a href="javascript:void(0)" class="down_question"><i class="fa fa-arrow-circle-down mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="up_question"><i class="fa fa-arrow-circle-up mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="add_question"><i class="fa fa-plus-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-times-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-pencil color-orange05"></i></a>
</p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_0" type="checkbox"><label class="fl color-grey3" for="dx_0">A.没区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_1" type="checkbox"><label class="fl color-grey3" for="dx_1">B.有区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_2" type="checkbox"><label class="fl color-grey3" for="dx_2">C.有一点点区别</label></li>
<li class="clearfix"><input class="magic-checkbox fl mt5 magic-checkbox_show" id="dx_4" type="checkbox"><label class="fl color-grey3" for="dx_4">D.有很多区别</label></li>
</div>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案ABCD
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第2题:<span class="color-orange03 ml10">[单选题]</span><span class="ml10">5</span></p>
<p class="fr exam_operator font-18">
<a href="javascript:void(0)" class="down_question"><i class="fa fa-arrow-circle-down mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="up_question"><i class="fa fa-arrow-circle-up mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="add_question"><i class="fa fa-plus-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-times-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-pencil color-orange05"></i></a>
</p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试的区别</p>
<div class="pl15 pr15 mb10">
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_0" name="sx" type="radio"><label class="fl color-grey3" for="sx_0">A.没区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_1" name="sx" type="radio"><label class="fl color-grey3" for="sx_1">B.有区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_2" name="sx" type="radio"><label class="fl color-grey3" for="sx_2">C.有一点点区别</label></li>
<li class="clearfix"><input class="magic-radio fl mt5 magic-checkbox_show" id="sx_4" name="sx" type="radio"><label class="fl color-grey3" for="sx_4">D.有很多区别</label></li>
</div>
<div class=" pl15 pr15 pt10 pb10 bor-top-greyE">
标准答案A
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第3题:<span class="color-orange03 ml10">[填空题]</span><span class="ml10">5</span></p>
<p class="fr exam_operator font-18">
<a href="javascript:void(0)" class="down_question"><i class="fa fa-arrow-circle-down mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="up_question"><i class="fa fa-arrow-circle-up mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="add_question"><i class="fa fa-plus-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-times-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-pencil color-orange05"></i></a>
</p>
</div>
<p class="break-word pl15 pr15">黑盒测试和白盒测试( )区别</p>
<div class="pl15 pr15 pt10 pb10 bor-top-greyE">
<p>候选答案1哈哈哈哈</p>
<p>候选答案1呵呵呵呵</p>
</div>
</div>
<div class="question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15">
<div class="clearfix pl15 pr15">
<p class="fl font-15">第4题:<span class="color-orange03 ml10">[简答题]</span><span class="ml10">10</span></p>
<p class="fr exam_operator font-18">
<a href="javascript:void(0)" class="down_question"><i class="fa fa-arrow-circle-down mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="up_question"><i class="fa fa-arrow-circle-up mr10 color-orange05"></i></a>
<a href="javascript:void(0)" class="add_question"><i class="fa fa-plus-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-times-circle mr10 color-orange05"></i></a>
<a href="javascript:void(0)"><i class="fa fa-pencil color-orange05"></i></a>
</p>
</div>
<p class="break-word pl15 pr15 mb10">黑盒测试和白盒测试的区别</p>
<div class="clearfix bor-top-greyE padding15 answer_con">
<p>参考答案</p>
<p style="text-align:justify;">黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下, </p>
</div>
</div>
</div>
<div class="question_item_con edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<div class="fl mr20 add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>单选题</div>
<div class="fl mr20 add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>多选题</div>
<div class="fl mr20 add_item_part" class="add_question"><i class="fa fa-plus-circle color-light-green mr5"></i>填空题</div>
<div class="fl add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>简答题</div>
</div>
</div>
</div>
</div>
<script>
$(function(){
//上移下移
$(".down_question").live("click",function(){
var count=$("#sortable").find(".question_item_con").length;
var thishtml=$(this).parents(".question_item_con");
if(thishtml.index()<count-1){
var html="<div class=\"question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15\">"+thishtml.html()+"</div>";
thishtml.next().after(html);
thishtml.remove();
}
})
$(".up_question").live("click",function(){
var thishtml=$(this).parents(".question_item_con");
if(thishtml.index()>0){
var html="<div class=\"question_item_con font-14 user_bg_shadow bor-grey-e mb20 pt15\">"+thishtml.html()+"</div>";
thishtml.prev().before(html);
thishtml.remove();
}
})
})
</script>
</body>
</html>

View File

@ -0,0 +1,316 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">胡莎莎</a> &gt; 智能课堂&gt; 计算机基础&gt; 计算机基础学院工程专业
</p>
<div class="edu-class-top clearfix mb30 pr user_bg_shadow bor-grey-e df">
<ul class="fl edu-class-top-info" style="flex: 1;">
<li class="mb10 font-16 clearfix mr30">
<span class="fl" style="width:80%;">
<span class="fl">计算概论-2016计算机科学与技术/软件工程/网络工程</span>
</span>
<span class="fl font-14 fr">邀请码:<span class="color-orange">CZPU8</span>
</span>
</li>
<li class="color-grey clearfix font-14">
<span class="javascript:void(0);"><a href="/users/ouyjq" class="edu-info-dark color-grey3 task-hide fl">欧阳建权</a></span>
<span class="ml30 edu-info-dark task-hide fl">湘潭大学</span>
<span class="ml30" id="teacher_number">教师<a href="/courses/792/members" class="ml5 edu-cir-grey-q color-orange05" id="teacher_number">1</a></span>
<span class="ml30" id="student_number">学生<a href="/courses/792/members?role=as" class="ml5 edu-cir-grey-q color-orange05" id="student_number">260</a></span>
<span class="ml30" id="teacher_number">分班<a href="/courses/792/members" class="ml5 edu-cir-grey-q color-orange05" id="teacher_number">1</a></span>
<span class="ml30" id="student_number">学分<a href="/courses/792/members?role=as" class="ml5 edu-cir-grey-q color-orange05" id="student_number">260</a></span>
<span class="ml30">结束<span class="ml5 edu-cir-grey-q color-grey3">97&nbsp;天后</span></span>
</li>
</ul>
<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('/courses/792/private_or_public', '您确定要设置为私有吗?');">设为私有</a></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box('/courses/792/set_invite_code_halt', '邀请码停用后,用户不能主动加入该课堂了<br/>您是否确认停用');">停用邀请码</a></li>
<li><a href="/courses/792/settings">设置</a></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('/courses/792', '课堂删除后数据将无法恢复,是否确定删除?')">删除</a></li>
</ul>
</div>
</div>
<div class="news">
<div class="edu-class-inner container mb20 clearfix">
<div class="member for-content-0 for-content">
<div class="people clearfix">
<div class="with15 fl ">
<div class="mb10 user_bg_shadow bor-grey-e">
<ul class="edu-class-leftnav">
<li class="clearfix" id="sy_01">
<a href="javascript:void(0)" class="fl ml15">动态</a>
</li>
<li class="clearfix" id="sy_03_1">
<a href="javascript:void(0)" class="fl ml15 ">讨论</a>
<span class="edu-cir-grey fl ml10 mt15">2</span>
</li>
<li class="clearfix" id="sy_03_4">
<a href="javascript:void(0)" class="fl ml15 ">资源</a>
<span class="edu-cir-grey fl ml10 mt15">1</span>
</li>
<li class="clearfix" id="sy_05">
<a href="javascript:void(0)" class="fl ml15 ">作业</a>
<span class="edu-cir-grey fl ml10 mt15">2</span>
</li>
<li class="clearfix active" id="sy_02">
<a href="javascript:void(0)" class="fl ml15">试卷</a>
<span class="edu-cir-grey fl ml10 mt15">12</span>
</li>
</ul>
</div>
</div>
<div class="with85 fl">
<div class="ml15 user_bg_shadow bor-grey-e">
<div class="edu-con-top clearfix">
<p class="ml15 color-grey3 fl">试卷列表</p>
<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="新建">+&nbsp;新建</a>
<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="题库选用">+&nbsp;题库选用</a>
<a href="javascript:void(0)" class="white-btn orange-btn fr mr20 mt3" data-remote="true" title="导出成绩">导出成绩</a>
</div>
<div class="edu-class-innner-conbox">
<div class="edu-con-top clearfix">
<p class="fl task-form-60 mt3 ml15" id="homework_index_tab">
<a href="javascript:void(0)" class="active edu-filter-cir-grey mr5 font-12 fl" data-remote="true">全部</a>
<a href="javascript:void(0)" class=" edu-filter-cir-grey mr5 font-12 fl" data-remote="true">挂起</a>
<a href="javascript:void(0)" class=" edu-filter-cir-grey mr5 font-12 fl" data-remote="true">提交中</a>
<a href="javascript:void(0)" class=" edu-filter-cir-grey mr5 font-12 fl" data-remote="true">补交中</a>
<a href="javascript:void(0)" class=" edu-filter-cir-grey mr5 font-12 fl" data-remote="true">评阅中</a>
<a href="javascript:void(0)" class=" edu-filter-cir-grey mr5 font-12 fl" data-remote="true">已结束</a>
</p>
<div id="search_div" class="edu-position fr task-form-30 mr15" style="padding: 0px">
<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="" 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>
</div>
</div>
<div id="homework_index_list" class="mh550 clearfix">
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-yellow ml10 fl mt3">挂起</span>
<span class="post_status_btn post_btn_orange ml5 mt6">未答</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>
</div>
</div>
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-green ml10 fl mt3">评阅中</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<!--<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>-->
<!--学生查看列表时显示的悬浮菜单-->
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">开始答题</a></li>
<li><a href="javascript:void(0)">答题统计</a></li>
<li><a href="javascript:void(0);">导出成绩</a></li>
<li><a href="javascript:void(0)">查看设置</a></li>
</ul>
</div>
</div>
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-blue ml10 fl mt3">提交中</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>
</div>
</div>
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-green ml10 fl mt3">评阅中</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>
</div>
</div>
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-orange ml10 fl mt3">补交中</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>
</div>
</div>
<div class="clearfix edu-class-con-list pr">
<div class="fl ml15 task-form-90 ">
<span class="fl mr10 mt3 color-grey3"># 1</span>
<a href="/student_work?homework=4842" class="edu-class-inner-list fl color-grey3">实训样式</a>
<i class="fa fa-lock color-grey fl mt8 ml15 font-18"></i>
<span class="edu-filter-btn edu-filter-btn-no-late ml10 fl mt3">已结束</span>
<div class="cl"></div>
<p class="color-grey font-12 mt20">
<span>创建于21天前</span>
<span class="ml25">更新于1天前</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>已答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">2</a>未答</span>
<span class="ml50"><a href="javascript:void(0)" class="color-orange05 mr3">60</a>未评</span>
<span class="ml50"><span class="color-orange03">10&nbsp;</span><span class="color-orange03">&nbsp;5&nbsp;</span>小时<span class="color-orange03">&nbsp;10&nbsp;</span></span>
</p>
</div>
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">预览</a></li>
<li><a href="javascript:void(0)">设置</a></li>
<li><a href="javascript:void(0);">答题统计</a></li>
<li><a href="javascript:void(0)">导出成绩</a></li>
<li><a href="javascript:void(0)">设为公开</a></li>
<li><a href="javascript:void(0)">加入题库</a></li>
<li><a href="javascript:void(0)">删除</a></li>
</ul>
</div>
</div>
<div class="fr pages_right_min mt10 mb10">
<ul>
<li><a href="javascript:void(0);" class="pages-big" data-remote="true">上一页</a></li>
<li><a class="active">1</a></li>
<li><a href="javascript:void(0);" class="page c_blue" data-remote="true">2</a></li>
<li><a href="javascript:void(0);" class="page c_blue" data-remote="true">3</a></li>
<li><a href="javascript:void(0);" class="pages-big pages-border-right" data-remote="true">下一页</a></li>
</ul>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,229 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/magic-check.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/course.js" type="text/javascript" charset="utf-8"></script>
<title></title>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt;<a href="javascript:void(0)"> 试卷列表</a>&gt; #22
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 fl color-grey3"><i class="fa fa-lock mr5 color-grey"></i>
实验四 多周期CPU与存储器实验
</p>
<a href="javascript:void(0)" class="fr font-12 mr15 mt3 color-grey">返回</a>
<a href="javascript:void(0)" class="fr font-12 mr15 mt3 color-grey">设置</a>
<!--学生查看时显示-->
<a href="javascript:void(0)" class="fr font-12 mr15 mt3 color-grey">查看设置</a>
</div>
<div class="edu-tab clearfix mb20">
<ul id="edu-tab-nav" class="border-bottom-orange">
<li id="edu-tab-nav-2" class="new-tab-nav background-orange" onclick="HoverLi(2);">
<a href="javascript:void(0);" class="tab_type">答题统计</a>
</li>
</ul>
<div id="list_count" class="user_bg_shadow bor-grey-e padding15">
<!--老师显示部分-->
<li class="clearfix mb5">
<a class="fr white-btn orange-btn ml10 mt8">导出成绩</a>
<div class="edu-find fr mr40 with20 pr">
<div class="edu-find-input">
<input type="text" class="task-form-100 panel-box-sizing" placeholder="姓名、学号关键字检索" value="" id="course_student_name">
<i class="fa fa-close mr5 color-grey edu-close" onclick="$('#course_student_name').val('');SearchByName_1();"></i>
</div>
<a href="javascript:void(0);" onclick="SearchByName_1();" class="edu-open font-16 color-grey "><i class="fa fa-search"></i></a>
</div>
</li>
<li class="clearfix mb5">
<span class="ml33 fl mr10 color-grey">你的评阅:</span>
<span class="fl mr25">
<a href="javascript:void(0);" id="py_no_limit" class="color-orange03">不限</a>
</span>
<input id="py_1" class="magic-checkbox fl" type="checkbox" value="0" name="comment[]">
<label for="py_1" class="fl mr25" style="top: 0px;">未评<span>(242)</span></label>
<input id="py_2" class="magic-checkbox fl" type="checkbox" value="1" name="comment[]">
<label for="py_2" class="fl mr25" style="top: 0px;">已评<span>(0)</span></label>
</li>
<li class="clearfix mb5">
<span class="ml33 fl mr10 color-grey">作品状态:</span>
<span class="fl mr25">
<a href="javascript:void(0);" id="zt_no_limit" class="color-orange03">不限</a>
</span>
<input id="zt_1" class="magic-checkbox fl" type="checkbox" value="0" name="comment[]">
<label for="zt_1" class="fl mr25" style="top: 0px;">未评<span>(242)</span></label>
<input id="zt_2" class="magic-checkbox fl" type="checkbox" value="1" name="comment[]">
<label for="zt_2" class="fl mr25" style="top: 0px;">已评<span>(0)</span></label>
</li>
<li class="clearfix mb5">
<span class="ml33 fl mr10 color-grey">分班情况:</span>
<span class="fl mr25">
<a href="javascript:void(0);" id="fb_no_limit" class="color-orange03">不限</a>
</span>
<label class="fl mr25">1班</label>
<label class="fl mr25">2班</label>
</li>
<div class="panel-bg-grey clearfix mb15">
<a href="javascript:void(0)" class="color-orange03 fl ml15" data-remote="true">提交时间排序</a>
<span class="mr5 ml5 fl">|</span>
<a href="javascript:void(0)" class=" fl" data-remote="true">最终成绩排序</a>
<p class="fr"> <span class="color-orange03">242</span> 个检索结果学生108人</p>
</div>
<!--学生显示部分-->
<!--<p class="clearfix">
<span class="edu-filter-btn edu-filter-btn-orange mb15">你已提交</span>
<span class="edu-filter-btn edu-filter-btn-orange mb15">你未提交</span>
<a class="white-btn orange-btn fr">查看答题</a>
</p>
<p class="clearfix font-12">
<span class="fr color-grey ml10">10人已交</span>
<span class="fr color-grey">答题剩余时间:<span class="color-orange03">1</span><span class="color-orange03">3</span>小时<span class="color-orange03">20</span></span>
</p>
-->
<table class="edu-pop-table edu-txt-center hover-td" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th>序号</th>
<th>姓名</th>
<th>学号</th>
<th>提交状态</th>
<th>提交时间</th>
<th>客观题得分</th>
<th>主观题教师评分</th>
<th>主观题助教评分</th>
<th>最终成绩</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr id="student_work_113619">
<td id="work_num_113619">48</td>
<td><a href="javascript:void(0)" class="color-grey3">李航</a></td>
<td title="2015551337">2015551337</td>
<td><span class="color-light-green">按时提交</span></td>
<td>2016-11-24 17:53</td>
<td class="color-grey">--</td>
<td class="color-grey">--</td>
<td class="color-red-light edu-position student_score_info">91.0
<div class="popup_tip_box-black" style="left: 120px; ">
<em></em>
<span></span>
<p>5名助教进行了评分<br>平均分91.0 分
</p>
</div>
</td>
<!-- 成绩 -->
<td class="color-red-light edu-position student_score_info">91.0
<div class="popup_tip_box-black" style="left: 100px; ">
<em></em>
<span></span>
<p>胡莎莎ruanjianlihang<br>
最终评分91.0 分<br>
迟交扣分0 分<br>
最终成绩91.0 分<br>
</p>
</div>
</td>
<td><a href="javascript:void(0)" target="_blank">评阅</a></td>
</tr>
<tr id="student_work_113619">
<td id="work_num_113619">48</td>
<td><a href="javascript:void(0)" class="color-grey3">胡莎莎</a></td>
<td title="2015551337">2015551337</td>
<td><span class="color-orange">延时提交</span></td>
<td>2016-11-24 17:53</td>
<td class="color-red-light">95</td>
<td class="color-grey">--</td>
<td class="color-red-light edu-position student_score_info">91.0
<div class="popup_tip_box-black" style="left: 120px;">
<em></em>
<span></span>
<p>1名助教进行了评分<br>复审分91.0 分
</p>
</div>
</td>
<!-- 成绩 -->
<td class="color-grey edu-position student_score_info">52.0
<div class="popup_tip_box-black" style="left: 100px;">
<em></em>
<span></span>
<p>李航ruanjianlihang<br>
最终评分91.0 分<br>
迟交扣分0 分<br>
最终成绩91.0 分<br>
</p>
</div>
</td>
<td><a href="javascript:void(0)" target="_blank">评阅</a></td>
</tr>
<tr id="student_work_113619">
<td id="work_num_113619">48</td>
<td><a href="javascript:void(0)" class="color-grey3">李航</a></td>
<td title="2015551337">2015551337</td>
<td><span class="color-grey">未提交</span></td>
<td>2016-11-24 17:53</td>
<td class="color-grey">--</td>
<td class="color-light-green">65.0</td>
<td class="color-light-green edu-position student_score_info">65.0
<div class="popup_tip_box-black" style="left: 120px;">
<em></em>
<span></span>
<p>1名助教进行了评分<br>复审分91.0 分
</p>
</div>
</td>
<!-- 成绩 -->
<td class="color-red-light edu-position student_score_info">91.0
<div class="popup_tip_box-black" style="left: 100px;">
<em></em>
<span></span>
<p>李航ruanjianlihang<br>
最终评分91.0 分<br>
迟交扣分0 分<br>
最终成绩91.0 分<br>
</p>
</div>
</td>
<td>
<a href="javascript:void(0)" target="_blank">评阅</a>
<!--学生显示查看-->
<!--<a href="javascript:void(0)" target="_blank">查看</a>-->
</td>
</tr>
</tbody>
</table>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul>
<li><a href="javascript:void(0)" class="pages-big" data-remote="true">上一页</a></li>
<li><a class="active">1</a></li>
<li><a href="javascript:void(0)" class="page c_blue" data-remote="true">2</a></li>
<li><a href="javascript:void(0)" class="page c_blue" data-remote="true">3</a></li>
<li><a class="c_blue">...</a></li>
<li><a href="javascript:void(0)" class="page c_blue" data-remote="true">5</a></li>
<li><a href="javascript:void(0)" class="pages-big pages-border-right" data-remote="true">下一页</a></li>
</ul>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,358 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/baiduTemplate.js" type="text/javascript" charset="utf-8"></script>
<title></title>
<style>
#mustBe::-webkit-input-placeholder::after {
display:block;
content:"Line 2\A Line 3";
}
#mustBe::-moz-placeholder:after{
display:block;
content:"试卷须知共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题 \A 您可以在此处填写本次试卷答题的相关说明";
};
</style>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">班级首页</a> &gt; 试卷
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 color-grey3 fl">新建试卷</p>
<a class="fr font-12 color-grey mr15 mt5" style="cursor: pointer;">返回</a>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<div class="ml15 mr15 mb15">
<input class="panel-box-sizing panel-form-width-100" placeholder="试卷标题" style="text-align: center;"/>
</div>
<div class="ml15 mr15">
<textarea id="mustBe" class="panel-box-sizing panel-form-width-100" placeholder="试卷须知共有选择、填空、简答、编程题4种题型其中选择题包括单选题和多选题;您可以在此处填写本次试卷答题的相关说明"></textarea>
</div>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<div class="fl mr20 add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>单选题</div>
<div class="fl mr20 add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>多选题</div>
<div class="fl mr20 add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>填空题</div>
<div class="fl add_item_part"><i class="fa fa-plus-circle color-light-green mr5"></i>简答题</div>
</div>
<script id="t:set-option-list" type="text/html">
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" name="option_span" data-tip-down="点击设置答案">A</span></label>
<input type="hidden" name="choice[answer][]">
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
</script>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 single_Temp" id="single_Temp">
<div class="clearfix">
<p class="fl mt15 font-16 mb10">单选题</p>
<label class="fr mt15">标准答案:<span class="color-orange current-option">请点击正确选项</span></label>
</div>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_span" data-tip-down="点击设置答案">A</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_span" data-tip-down="点击设置答案">B</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_span" data-tip-down="点击设置答案">C</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="add-option-item fr mr10 color-grey border-dash-orange" name="option_span">D</span></label>
<div class="fl panel-box-sizing add-option-input border-dash-orange"><a title="新增" href="javascript:void(0)" class="option_icon_add">新增选项</a></div>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input class="with10 mr5 fl panel-box-sizing task-height-40" /><label class="fl" style="line-height: 40px;"></label>
<p class="fr">
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案</span>
<a href="javascript:void(0)" class="fr task-btn task-btn-blue">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10">取消</a>
</p>
</li>
</div>
<script id="t:set-option-lists" type="text/html">
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" name="option_spans" data-tip-down="点击设置答案">A</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
</script>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 multiple_Temp" id="multiple_Temp">
<div class="clearfix">
<p class="fl mt15 font-16 mb10">多选题</p>
<label class="fr mt15">标准答案:<span class="color-orange current-option">请点击正确选项</span></label>
</div>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_spans" data-tip-down="点击设置答案">A</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_spans" data-tip-down="点击设置答案">B</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice " name="option_spans" data-tip-down="点击设置答案">C</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入选项内容"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="add-option-item fr mr10 color-grey border-dash-orange" name="option_spans">D</span></label>
<div class="fl panel-box-sizing add-option-input border-dash-orange"><a title="新增" href="javascript:void(0)" class="option_icon_add">新增选项</a></div>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input class="with10 mr5 fl panel-box-sizing task-height-40" /><label class="fl" style="line-height: 40px;"></label>
<p class="fr">
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案</span>
<a href="javascript:void(0)" class="fr task-btn task-btn-blue">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10">取消</a>
</p>
</li>
</div>
<script id="t:set-fillin-lists" type="text/html">
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 2</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="fill[cnt][]" placeholder="请输入参考答案(可选)"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
</script>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 fillin_Temp" id="fillin_Temp">
<p class="fl mt15 font-16 mb10">填空题</p>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入填空题的题干(注意:目前仅支持一个空)"></textarea>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 1</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="fill[cnt][]" placeholder="请输入参考答案"></textarea>
<!--<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>-->
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="fill_span">答案 2</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" name="fill[cnt][]" placeholder="请输入参考答案(可选)"></textarea>
<a title="移除" href="javascript:void(0)" class="position-delete option_icon_remove"><i class="fa fa-times-circle color-orange font-16 fl"></i></a>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span>&nbsp;</span></label>
<div class="fl panel-box-sizing add-option-input border-dash-orange"><a title="新增" href="javascript:void(0)" class="option_fillin_add">新增参考答案</a></div>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input class="with10 mr5 fl panel-box-sizing task-height-40"/><label class="fl" style="line-height: 40px;"></label>
<p class="fr">
<span class="font-12 color-grey mb10" style="display: block;">温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案</span>
<a href="javascript:void(0)" class="fr task-btn task-btn-blue">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10">取消</a>
</p>
</li>
</div>
<div class="user_bg_shadow bor-grey-e pl15 pr30 mb20 answer_Temp" id="answer_Temp">
<p class="fl mt15 font-16 mb10">简答题</p>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="mr10">题目</span></label>
<textarea class="panel-form-width2-690 fl panel-box-sizing" placeholder="请输入简答题的题干(注意:目前仅支持一个空)"></textarea>
</li>
<li class="clearfix pr mb20">
<label class="panel-form-label fl"><span class="fr mr10 color-grey" name="option_spans">参考答案</span></label>
<textarea class="fl panel-box-sizing with90 task-height-150 pl5 pt5" placeholder="如有参考答案,请输入参考答案"></textarea>
</li>
<li class="clearfix mb20">
<label class="panel-form-label fl"><span class="mr10">分值</span></label>
<input class="with10 mr5 fl panel-box-sizing task-height-40" /><label class="fl" style="line-height: 40px;"></label>
<p class="fr">
<span class="font-12 color-grey" style="display: block;">温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分</span>
<span class="font-12 color-grey mb10 ml50" style="display: block;">&nbsp;&nbsp;参考答案仅作为人工评分的参考</span>
<a href="javascript:void(0)" class="fr task-btn task-btn-blue">保存</a>
<a href="javascript:void(0)" class="fr task-btn mr10">取消</a>
</p>
</li>
</div>
<div class="edu-con-top user_bg_shadow bor-grey-e color-grey clearfix mb20 font-12">
<p class="ml15 fl">
<span class="mr20">单选题<span>&nbsp;3&nbsp;</span>题,共<span>&nbsp;15&nbsp;</span></span>
<span class="mr20">多选题<span>&nbsp;5&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span class="mr20">填空题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
<span>简答题<span>&nbsp;10&nbsp;</span>题,共<span>&nbsp;25&nbsp;</span></span>
</p>
<a class="fr mr15">
<span>合计<span class="color-orange03">&nbsp;10&nbsp;</span>题,共<span class="color-orange03">&nbsp;100&nbsp;</span></span>
</a>
</div>
</div>
</div>
</div>
<script>
$(function(){
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
/*新建单选题选项*/
$(".single_Temp").on('click',"a.option_icon_add", function () {
var html = bt('t:set-option-list', null);
$(this).parent().parent('.clearfix').before(html);
var inputs = document.getElementsByName("question[cnt][]");
var inputs_spans = document.getElementsByName("option_span");
for (var j = 0; j < inputs_spans.length; j++) {
if(j >= 0 && j <= 26){
$(inputs_spans[j]).html(String.fromCharCode(65 + j));
}
}
for (var i = 0; i < inputs.length; i++) {
autoTextarea(inputs[i], 0, 140);
}
$(inputs[inputs.length - 1]).focus();
});
$(".single_Temp").on('click',"a.option_icon_remove", function () {
var temp=$(this).parents("li").siblings("div").find(".current-option");
var singl=$(this).parents(".single_Temp").find(".check-option-bg");
temp.html("");
$(this).parents('li').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));
}
}
}
if(singl.length>0){
for(var i=0;i<singl.length;i++){
temp.html(temp.html()+singl.eq(i).html());
}
}else{
temp.html("请点击正确选项");
}
});
$(".single_Temp").find("li label").live("click",function(){
var temp=$(this).parents(".single_Temp");
if($(this).index()!=temp.find("li").length){
temp.find("li span").removeClass("check-option-bg");
$(this).find("span").toggleClass("check-option-bg");
}
temp.find(".current-option").html("");
if(temp.find(".check-option-bg").length>0){
for(var i=0;i<temp.find(".check-option-bg").length;i++){
temp.find(".current-option").html(temp.find(".current-option").html()+temp.find(".check-option-bg").eq(i).html());
}
}else{
temp.find(".current-option").html("请点击正确选项");
}
})
/*新建多选题选项*/
$(".multiple_Temp").on('click',"a.option_icon_add", function () {
var html = bt('t:set-option-lists', null);
$(this).parent().parent('.clearfix').before(html);
var inputs = document.getElementsByName("question[cnt][]");
var inputs_spans = document.getElementsByName("option_spans");
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();
});
$(".multiple_Temp").on('click',"a.option_icon_remove", function () {
var temp=$(this).parents("li").siblings("div").find(".current-option");
var muil=$(this).parents(".multiple_Temp").find(".check-option-bg");
var count=0;
if($(this).parents("li").find(".check-option-bg").length>0){
alert($(this).parents("li").find("label span").html());
count++;
}
temp.html("");
$(this).parents('li').remove();
var inputs_spans = document.getElementsByName("option_spans");
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));
}
}
}
if(parseInt(muil.length)-count>0){
for(var i=0;i<parseInt(muil.length)-count;i++){
temp.html(temp.html()+muil.eq(i).html());
}
}else{
temp.html("请点击正确选项");
}
});
$("#multiple_Temp").find("li label").live("click",function(){
if($(this).index()!=$("#multiple_Temp").find("li").length){
$(this).find("span").toggleClass("check-option-bg");
}
$("#multiple_Temp").find(".current-option").html("");
if($("#multiple_Temp").find(".check-option-bg").length>0){
for(var i=0;i<$("#multiple_Temp").find(".check-option-bg").length;i++){
$("#multiple_Temp").find(".current-option").html($("#multiple_Temp").find(".current-option").html()+$("#multiple_Temp").find(".check-option-bg").eq(i).html());
}
}else{
$("#multiple_Temp").find(".current-option").html("请点击正确选项");
}
})
/*新建填空题答案项*/
$(".fillin_Temp").on('click',"a.option_fillin_add", function () {
var html = bt('t:set-fillin-lists', null);
$(this).parent().parent('.clearfix').before(html);
var inputs = document.getElementsByName("fill[cnt][]");
var inputs_spans = document.getElementsByName("fill_span");
for (var j = 0; j < inputs_spans.length; j++) {
$(inputs_spans[j]).html("答案 "+(j+1));
}
for (var i = 0; i < inputs.length; i++) {
autoTextarea(inputs[i], 0, 140);
}
$(inputs[inputs.length - 1]).focus();
});
$(".fillin_Temp").on('click',"a.option_icon_remove", function () {
$(this).parents('li').remove();
var inputs_spans = document.getElementsByName("fill_span");
for (var j = 0; j < inputs_spans.length; j++) {
$(inputs_spans[j]).html("答案 "+(j+1));
}
});
})
</script>
</body>
</html>

View File

@ -94,9 +94,10 @@
<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>
<!--<i class="fa fa-close mr5 color-grey edu-close" onclick="colse_searchbox();"></i>-->
<span class="edu-close" style="top:1px;" onclick="colse_searchbox();" data-tip-down="关闭">×</span>
</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>
<a href="javascript:void(0);" style="top:3px;" 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} %>

View File

@ -1,3 +1,10 @@
<style>
.wlist_select a {
background-color:#FC7033;
color: #fff!important;
border: 1px solid #FC7033;
}
</style>
<% if curse_attachments.count != 0 %>
<% curse_attachments.each do |file| %>
<% if file.is_public? || User.current.member_of_course?(course) || User.current.admin? %>
@ -8,10 +15,15 @@
<div class="re_con_box"><span class='fr mr10 pr_join_span '><%= file.filename %>是私有资源</span></div>
<% end %>
<% end %>
<div style="text-align:center;margin-top:20px;margin-bottom:20px;" >
<div class="pages_right_min" style="width:auto; display:inline-block;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true %>
</ul>
<div class="cl"></div>
</div>
</div>
<ul class="wlist">
<%= pagination_links_full @feedback_pages, @feedback_count, :per_page_links => false, :remote => true, :flag => true%>
</ul>
<% else %>
<div class="mt10 user_bg_shadow" style="background-color: #fff;padding-bottom: 10px; margin-left: 7px;">
<%= render :partial => "welcome/no_data" %>

View File

@ -3,11 +3,13 @@
input.is_public_checkbox{margin-left:4px;margin-right:4px;}
</style>
<div class="fl">
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
<span id="attachments_fields" class="attachments_fields" xmlns="http://www.w3.org/1999/html">
<% if defined?(container) && container && container.saved_attachments %>
<% container.attachments.each_with_index do |attachment, i| %>
<span id="attachments_p<%= i %>" class="attachment">
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<label class="panel-form-label fl">&nbsp;</label>
<i class="fa fa-folder mr5 color-light-grey" aria-hidden="true"></i>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly',:style=>'border:none; max-width:980px;white-space: nowrap; text-overflow:ellipsis;font-family: Consolas;') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><span class="ispublic-label"><%= l(:field_is_public) %>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public, attachment.is_public == 1 ? true : false, :class => 'is_public') %>
<%= if attachment.id.nil?
#待补充代码
@ -16,7 +18,7 @@
end
%>
<%#= render :partial => 'tags/tag', :locals => {:obj => attachment, :object_flag => "6"} %>
<%= link_to('<i class="fa fa-trash-o mr5"></i>'.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
</span>
<div class="cl"></div>
@ -47,7 +49,7 @@
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%#= button_tag "文件浏览", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'AnnexBtn fl mt3' %>
<%= button_tag "上传附件", :id => "upload_attachments", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<%#= button_tag "上传附件", :id => "upload_attachments", :type=>"button", :onclick=>"$('#_file').click();",:onmouseover => 'this.focus()',:class => 'sub_btn' %>
<!--<a href="javascript:void(0);" onclick="_file.click();" class="AnnexBtn fl mr15">上传附件</a>-->
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
@ -74,7 +76,11 @@
<%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>
<!--)-->
<!--</span>-->
<label class="panel-form-label fl">&nbsp;</label>
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
<i class="fa fa-upload mr5"></i>
<span>上传附件</span>
</a>
<% content_for :header_tags do %>
<%= javascript_include_tag 'attachments' %>
<% end %>

View File

@ -1,3 +1,92 @@
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> &gt; 论坛
</p>
<div class="edu-class-top clearfix mb30 pr user_bg_shadow bor-grey-e">
<div class="clearfix">
<div class="fl with60 mt5">
<a href="<%= user_path(@user.show_name) %>" class="fl">
<%= image_tag(url_to_avatar(User.current), :width => 60, :height => 60,:alt=>'贴吧图像', :class=>"bor-radius-all" ) %>
</a>
<div class="fl ml15">
<li class="font-16"><a href="<%= user_path(@user.show_name) %>" class="color-grey3"><%= @user.show_name %></a></li>
<li class="mt5 color-grey"><%= @user.login %></li>
</div>
</div>
<ul class="fr" style="padding: 10px 0px;text-align:right">
<li class="fl" style="text-align:center"><span class="color-orange font-bd" id="all_syllabuses"><%= @memos_praise_count %></span><br><span>被赞</span></li>
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_memos_count %></span><br><span>回复/评论</span></li>
<li class="fl" style="text-align:center;margin-left: 60px;"><span class="color-orange font-bd" id="all_syllabuses"><%= @my_forums_count %></span><br><span>主题</span></li>
</ul>
</div>
</div>
<div class="clearfix user_bg_shadow bor-grey-e">
<div class="clearfix pt10 pb10 pl15 pr15 bor-bottom-greyE">
<p class="color-grey3 fl font-16">问吧</p>
<a href="<%= new_forum_memo_path(:forum_id => Forum.first.id, :forum_index => true) %>" class="mt3 white-btn orange-btn fr">+&nbsp;新话题</a>
</div>
<div id="forum_list" class="forum_table mh650">
<% @memos.each_with_index do |memo, index| %>
<div class="forum_table_item">
<a href="<%= user_path(memo.author_id) %>" class="fr mr15">
<%= image_tag(url_to_avatar(memo.author), :width => 50, :height => 50,:alt=>'用户头像', :class=>"bor-radius-all mt3" ) %>
</a>
<div class="fl color-grey pr" style="flex: 1;">
<p class="font-16 clearfix">
<a href="<%= forum_memo_path(memo.forum, memo) %>" class="clearfix item_name fl" target="_blank">
<%= memo.subject %>
</a>
<% if memo.sticky %>
<span class="btn-top btn-cir-red mt7 ml5 fl">顶</span>
<% end %>
</p>
<p style="width: 1091px;" class="overellipsis color-dark-grey mb10"><%= memo.content.html_safe %></p>
<div class="clearfix">
<a href="<%= user_path(memo.author_id) %>" class="fl"><%= User.find(memo.author_id).try(:show_name) %></a>
<span class="fl ml30"><%= time_from_now memo.updated_at %></span>
<!--<span class="fl ml50">最后回复:</span>-->
<p class="font-12 mt5 fr">
<span class="mr20 fl" style="cursor: default;" data-tip-down="浏览数"><i class="fa fa-eye mr5"></i><%= memo.viewed_count %></span>
<span class="mr20 fl" style="cursor: default;" data-tip-down="点赞数"><i class="fa fa-thumbs-o-up mr5"></i><%= get_praise_num(memo) %></span>
<span class="mr10 fl" style="cursor: default;" data-tip-down="回复数"><i class="fa fa-comments-o mr5"></i><%= Memo.where(:root_id => memo.id).count %></span>
<!--<span class="fl">类别:分享</span>-->
</p>
</div>
<% if @user.admin? || @user == memo.author %>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<% if @user.admin? %>
<% if memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(memo.forum,memo, :index => 1) %>">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(memo.forum,memo, :index => 1) %>">置&nbsp;&nbsp;顶</a></li>
<% end %>
<% end %>
<li><a href="<%= edit_forum_memo_path(memo.forum, memo)%>">编&nbsp;&nbsp;辑</a></li>
<li><a href="javascript:void(0)" onclick="delete_confirm_box_3('<%= forum_memo_path(memo.forum, memo) %>', '您确定要删除吗?')">删&nbsp;&nbsp;除</a></li>
</ul>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>
</div>
</div>
<% if false %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
@ -107,34 +196,34 @@
});
var first_click = true;
// function check_and_submit(){
// if(!check_memo_name()){
// return;
// }
// if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() && first_click){
// first_click = false;
// memo_content.sync();
// $.ajax({
// url:'/forums/'+'<%#= @forum.id.to_s%>'+'/memos',
// type:'post',
// data:$("#new_memo").serialize(),
// success:function(data){
//
// },
// error:function(){
// alert('请检查当前网络连接')
// }
// });
// //$("#new_memo").submit();
// }else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){
// $("#error").html("主题和内容不能为空").show();
// }
// else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){
// $("#error").html("主题不能为空").show();
// }else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.isEmpty()){
// $("#error").html("内容不能为空").show();
// }
// }
// function check_and_submit(){
// if(!check_memo_name()){
// return;
// }
// if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() && first_click){
// first_click = false;
// memo_content.sync();
// $.ajax({
// url:'/forums/'+'<%#= @forum.id.to_s%>'+'/memos',
// type:'post',
// data:$("#new_memo").serialize(),
// success:function(data){
//
// },
// error:function(){
// alert('请检查当前网络连接')
// }
// });
// //$("#new_memo").submit();
// }else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){
// $("#error").html("主题和内容不能为空").show();
// }
// else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){
// $("#error").html("主题不能为空").show();
// }else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.isEmpty()){
// $("#error").html("内容不能为空").show();
// }
// }
function check_memo_name(){
if($("#memo_subject").val().trim().length > 50){
@ -156,4 +245,5 @@
memo_content.html('')
$('#error').html('').hide();
}
</script>
</script>
<% end %>

View File

@ -13,6 +13,7 @@
<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| %>
<% output = @game.outputs.where(:test_set_position => choose.position).first %>
<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>
@ -22,16 +23,16 @@
<p class="ml10 mb10 ">
<span>
<% if choose.category == 1 %>
<input type="radio" <%= (choose.current_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">
<input type="radio" <%= (output.try(:actual_output)== (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.current_choose_outputs.try(:answer).present? && (choose.current_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">
<input type="checkbox" <%= (output.try(:actual_output).present? && (output.try(:actual_output).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="break-word <%=(!choose.current_choose_outputs.try(:answer).nil? && (choose.current_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>
<label class="break-word <%=(output.try(:actual_output).present? && (output.try(:actual_output).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">
<input type="hidden" name="user_answer" value="<%= output.try(:actual_output) %>">
</div>
<% end %>
<!--<div class="pl5 pr5 pt10 pb10 bor-grey-e">
@ -90,16 +91,16 @@
//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");
$(this).parents(".problem_single").find("label").removeClass("color-orange03");
$(this).siblings("label").addClass("color-orange03");
}
}else{
var p=$(this).parents(".problem_single").find("p");
value="";
if($(this).attr("checked")=="checked"){
$(this).siblings("label").addClass("color-orange05");
$(this).siblings("label").addClass("color-orange03");
}else{
$(this).siblings("label").removeClass("color-orange05");
$(this).siblings("label").removeClass("color-orange03");
}
for(var i=0;i< p.length;i++){
if(p.eq(i).find("input").attr("checked")=="checked"){

View File

@ -14,7 +14,7 @@
<div id="code_test">
<% if @st == 0 %>
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="training_task_submmit();">评测</a>
<% elsif @game.status != 2 %>
<% else %>
<a href="javascript:void(0)" class="shixun-task-btn task-btn-blue mr15 mt8" onclick="choice_submmit();">评测</a>
<% end %>
</div>

View File

@ -11,10 +11,10 @@
<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 %>
<% unless @game.choose_correct_num == nil %>
<% if @game.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>共有<%= game_challenge.challenge_chooses.count %>组测试集,其中有<%= game_challenge.challenge_chooses.count - game_challenge.choose_correct_num %>组测试结果不匹配。详情如下:
<i class="fa fa-exclamation-circle font-16" ></i><span class="ml5 mr5 -text-danger"><%= @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %></span>共有<%= game_challenge.challenge_chooses.count %>题,其中有<%= game_challenge.challenge_chooses.count - @game.choose_correct_num %>题结果不匹配。详情如下:
</p>
<% else %>
<p class="color-light-green mb10">
@ -23,14 +23,15 @@
<% end %>
<% end %>
<% game_challenge.challenge_chooses.each_with_index do |choose, index| %>
<% output = @game.outputs.where(:test_set_position => choose.position).first %>
<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.current_choose_outputs.blank? %>
<% if output.present? %>
<%# if choose.choose_outputs.try(:answer) != choose.standard_answer %>
<% if choose.current_choose_outputs.try(:answer) == choose.standard_answer %>
<% if output.result %>
<i class="fa fa-check-circle color-light-green fr mt8 ml5 f14" ></i>
<% else %>
<i class="fa fa-exclamation-circle -text-danger fr mt8 ml5" ></i>
@ -41,11 +42,15 @@
</div>
<div class="-task-ces-info undis" id="test_case_<%= index %>">
<ul class=" font-14">
<% if choose.choose_outputs.blank? %>
<% if output.try(:actual_output).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.current_choose_outputs.try(:answer).nil? ? "无" : choose.current_choose_outputs.try(:answer) %></span></li>
<% if output.result || @game.status == 2 %>
<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"><%= output.try(:actual_output) %></span></li>
<% else %>
<li><span class="-text-danger ml30">错误,不支持查看</span></li>
<% end %>
<% end %>
</ul>
</div>

View File

@ -1,12 +1,12 @@
<style>
.editormd-preview-container, .editormd-html-preview{
text-align: left;
font-size: 16px;
line-height: 1.8;
}
.-task-ml80 .CodeMirror pre{
font-size: 16px;
}
.editormd-preview-container, .editormd-html-preview{
text-align: left;
font-size: 16px;
line-height: 1.8;
}
.-task-ml80 .CodeMirror pre{
font-size: 16px;
}
</style>
<!--inner-left-->
<div class="split-panel--first -layout -vertical -flex -relative -flex-basic40" id="game_left_contents" >
@ -34,7 +34,7 @@
<% end %>
<li id="tab_nav_4">
<a href="<%= shixun_discuss_shixun_path(@myshixun.shixun, :challenge_id => @game_challenge.id) %>" class="tab_type" style="font-size: 16px" data-remote="true">
评论<span id="discusses_count" class="edu-cir-grey1" style="line-height: 18px!important;"><%= @discusses_count if @discusses_count > 0%></span>
评论<span id="discusses_count" class="edu-cir-grey1" style="line-height: 18px!important;"><%= @discusses_count if @discusses_count.to_i > 0 %></span>
</a>
<%#= link_to '', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
</li>
@ -43,7 +43,6 @@
<% else %>
<span class="btn-cir-big fr mt8 mr15" >经验值:<%= @game_challenge.choose_score.to_i %></span>
<% end %>
</ul>
<div class="cl"></div>
<div class="-flex -relative greytab-inner">
@ -102,6 +101,34 @@
<!--------------------------->
<!--inner-right-->
<div class="split-panel--second -layout -vertical -flex -relative -flex-basic50" id="game_right_contents">
<!--更新提示块-->
<% if @tpm_modified %>
<div class="tip-panel-animate clearfix user_bg_shadow bor-grey-e">
<div class="fl tip-img">
<img src="/images/bigdata/bigdata-logo.png"/>
</div>
<div class="fl pr tip-right-con">
<p class="mb5 ml5 color-grey3 font-16">更新通知</p>
<% if false%>
<!--测试集更新提示-->
<p class="ml5 color-dark-grey" style="line-height: 20px">本关的测试集已更新,你的代码可能无法通过新的测试集,重新评测试试!</p>
<div class="tip-operator-btn">
<a href="javascript:void(0)" class="fl color-orange03">立即评测</a>
<a href="javascript:void(0)" class="fl color-grey">稍后再说</a>
</div>
<% end %>
<!--代码更新提示-->
<p class="ml5 color-dark-grey" style="line-height: 20px">关卡任务的代码文件有更新,点击立即更新获取最新代码!</p>
<div class="tip-operator-btn">
<%#= link_to "立即更新", sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun), :remote => true, :class => "fl color-orange03", :onclick => "sync_hide_tip_content();" %>
<a href="javascript:void(0)" class="fl color-orange03" onclick="sync_hide_tip_content();">立即更新</a>
<a href="javascript:void(0)" class="fl color-grey" onclick="hide_tip_content();">稍后再说</a>
</div>
</div>
</div>
<% end %>
<div class="-layout-v -flex">
<div class="-flex -relative">
<div class="split-panel -fit -vertical" id="games_repository_valuation">
@ -144,6 +171,9 @@
};
$(document).ready(function() {
//显示更新提示
show_tip_content();
//以下两行代码用来解决兼容问题,切莫删除。
$("#games_repository_contents").css("height",$("#games_repository_valuation").height()*0.7);
$("#games_valuation_contents").css("height",$("#games_repository_valuation").height()*0.3);
@ -170,4 +200,26 @@
var praiseStatus = <%= @praise.nil? ? false : true %>; // 是否点赞
var treadStatus = <%= @tread.nil? ? false : true %>; // 是否踩
// 显示更新提示方法
function show_tip_content(){
$(".tip-panel-animate").addClass("animate-tip");
$(".tip-panel-animate").show();
}
// 隐藏更新提示方法
function sync_hide_tip_content(){
$(".tip-panel-animate").addClass("animate-tip-hide");
setTimeout('$(".tip-panel-animate").hide();', 700);
alert("test");
$.ajax({
url: "<%= sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun) %>",
dataType: "script",
success: function(data){
alert(data.status);
if(data.status == 200){
$('#'+target).html(data);
}
}
})
}
</script>

View File

@ -1,53 +1,25 @@
<%= stylesheet_link_tag 'css/edu-common', 'css/edu-popup' %>
<% if game.challenge.st != 0 %>
<div class="task-popup-warp" style="background-color: rgba(0,0,0,0.7);top: 0px;left: 0px;">
<div class="task-popup-warp" style="background-color: rgba(0,0,0,0.7);">
<div class="task-popup-box <%= had_done == 0 ? "task-box1" : "task-box2" %>">
<a href="javascript:void(0)" class="task-popup-close" onclick="refresh_game_list();"></a>
<% if had_done == 0 %>
<div class="task-su-con">
<div class="task-su-con">
<% if had_done == 0 %>
<p class="task-su-p">恭喜您通过本关</p>
<p class="mt8"><i class="fa fa-check-circle color-light-green mr5"></i>本题正确:<span class="color-orange03">&nbsp;<%= game.challenge.choose_correct_num.to_i %>&nbsp;</span>道</p>
<p><i class="fa fa-exclamation-circle color-orange mr5"></i>本题错误:<span class="color-orange03">&nbsp;<%= game.challenge.challenge_chooses.count - game.challenge.choose_correct_num.to_i %>&nbsp;</span>道</p>
</div>
<% else %>
<div class="task-su-con" style="position: absolute;width: 100%;z-index:3;padding-top: 63px;">
<img src="/images/task/task-success02.png"/>
<a href="<%= myshixun_game_path(myshixun, :index => 1) %>" class="task-su-btn-white mt30" onclick="hideModal();" data-remote="true">查看光辉历史</a>
</div>
<div style="text-align:center;background-color: #fff;border-radius: 0px 0px 8px 8px;width: 200px;position:absolute;z-index:2;height:100px;bottom:-30px;left:50%;margin-left:-100px;">
<p class="mt25"><i class="fa fa-check-circle color-light-green mr5"></i>本题正确:<span class="color-orange03">&nbsp;<%= game.challenge.choose_correct_num.to_i %>&nbsp;</span>道</p>
<p><i class="fa fa-exclamation-circle color-orange mr5"></i>本题错误:<span class="color-orange03">&nbsp;<%= game.challenge.challenge_chooses.count - game.challenge.choose_correct_num.to_i %>&nbsp;</span>道</p>
</div>
<% end %>
</div>
<% if had_done == 0 %>
<%= link_to "下 一 关", {:controller => 'games', :action => "next_step", :id => game, :myshixun_id => myshixun}, :class => "task-su-btn", :onclick => "hideModal();", :remote => true %>
<% end %>
</div>
<% else %>
<div class="task-popup-warp" style="background-color: rgba(0,0,0,0.7);">
<div class="task-popup-box <%= had_done == 0 ? "task-box1" : "task-box2" %>">
<a href="javascript:void(0)" class="task-popup-close" onclick="refresh_game_list();"></a>
<div class="task-su-con">
<% if had_done == 0 %>
<p class="task-su-p">恭喜您通过本关</p>
<%= link_to "下 一 关", {:controller => 'games', :action => "next_step", :id => game, :myshixun_id => myshixun}, :class => "task-su-btn", :onclick => "hideModal();", :remote => true %>
<% else %>
<a href="<%= myshixun_game_path(myshixun, :index => 1) %>" class="task-su-btn-white mt50" onclick="hideModal();" data-remote="true">查看光辉历史</a>
<% end %>
</div>
</div>
<%= link_to "下 一 关", {:controller => 'games', :action => "next_step", :id => game, :myshixun_id => myshixun}, :class => "task-su-btn", :onclick => "hideModal();", :remote => true %>
<% else %>
<a href="<%= myshixun_game_path(myshixun, :index => 1) %>" class="task-su-btn-white mt50" onclick="hideModal();" data-remote="true">查看光辉历史</a>
<% end %>
</div>
<% end %>
</div>
</div>
<script>
function refresh_game_list(){
$.ajax({
url: "<%= refresh_game_list_myshixun_game_path(game, :myshixun_id => myshixun) %>",
dataType: "script"
});
function refresh_game_list(){
$.ajax({
url: "<%= refresh_game_list_myshixun_game_path(game, :myshixun_id => myshixun) %>",
dataType: "script"
});
//$("#all_task_show").css("display","none");
}
//$("#all_task_show").css("display","none");
}
</script>

View File

@ -13,7 +13,7 @@
<%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %>
<span class="fl color-grey font-12 mt3 mr20"><%= time_from_now dis.created_at %></span>
<% if dis.try(:challenge_id).present? %>
<span class="fl color-grey font-12 mt3">[第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]</span>
<span class="fl color-light-green font-12 mt3">[第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关]</span>
<% end %>
<span class="fr color-grey font-12 color_Purple_grey" id="dis_praise_<%= dis.id %>">
<%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %>
@ -80,12 +80,15 @@
<script>
//二次回复的提示结构
var $points = $("<div class = \"points-data-tip-top\">"+
"<div class = \"data-tip-top\">请在此输入回复</div>"+
"<div class = \"data-tip-top1 \">请在此输入回复</div>"+
"</div>").appendTo("#bottom_points");
$("#reversion").click(function(){
$points.show();
});
$("#comment_news").blur(function(){
$points.hide();
$("#comment_news").bind("input propertychange",function(){
console.log(1);
if($("#comment_news").val() != ''){
$points.hide();
}
});
</script>

View File

@ -2,6 +2,10 @@
clearInterval(cm); // tpi关闭耗时
<% if !@type.blank? || !params[:path].nil? %>
$("#games_repository_contents").html('<%= escape_javascript(render :partial => 'games/repository') %>');
<% elsif params[:choose].present? %>
$("#games_valuation_contents").html("<%= j(render :partial => 'games/game_choose_results', :locals => { :game_challenge => @game_challenge}) %>");
$("#all_task_show").html("<%= j(render :partial => "games_list") %>");
$("#game_operate_action").html("<%= j(render :partial => "games/code_actions") %>");
<% else %>
$("#game_show_content").html('<%= escape_javascript(render :partial => 'games/game_show') %>');
<% end %>
@ -11,7 +15,7 @@
$("#all_task_show").hide();
fadein = 0;
// 选择题
<% if params[:choose] == "1" %>
<% if params[:choose] == "true" %>
<% if @had_done == 0 %>
$("#code_estimate").html("<a href='<%= next_step_myshixun_game_path(@game, :myshixun_id => @myshixun) %>' class='task-btn task-btn-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}) %>";

View File

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

View File

@ -4,8 +4,9 @@
<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>
<input type="text" class="with100 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>-->
<span class="edu-close" onclick="colse_searchbox();" data-tip-down="关闭">×</span>
</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>

View File

@ -8,6 +8,9 @@
<%= 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 => "white-btn orange-btn fr mr20", :title => "新建作业" %>
<% if User.current.admin? %>
<%= link_to("实训统计", shixun_statistics_course_path(@course, :format => "xls"), :class => "white-btn orange-btn fr mr10",:title=>"实训作业统计") %>
<% end %>
<% end %>
<% end %>
<!--<a href="<%#= export_course_member_excel_course_path(@course) %>" class="edu-btn fr mr10">导出成绩</a>-->

View File

@ -74,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 => "white-btn orange-btn font-14 fr", :title => "由学生身份切换至教师身份" %>
<div class="fr" data-tip-down = "由学生身份切换至教师身份"><%= 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 " %></div>
<% elsif !is_teacher && is_TA %>
<%= 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 => "由学生身份切换至助教身份" %>
<div class="fr" data-tip-down = "由学生身份切换至助教身份"><%= 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 " %></div>
<% 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 => "white-btn orange-btn font-14 fr", :title => "由教师身份切换至学生身份" %>
<div class="fr" data-tip-down = "由教师身份切换至学生身份"><%= 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 " %></div>
<% end %>
<% unless (is_teacher || is_TA || is_TE || is_ST) %>

View File

@ -13,9 +13,19 @@
<% @course.course_groups.each do |group| %>
<li id="course_group_<%=group.id %>" class="clearfix">
<% count = group.members.count %>
<a href="<%= has_group_student_list_course_path(@course, :group_id => group.id) %>" class="fl ml35 edu-break-outshort"><%=group.name %></a>
<span class="edu-cir-grey fl ml10 mt15"><%= count %></span>
<a href="<%= has_group_student_list_course_path(@course, :group_id => group.id) %>" class="fl mr5 ml35 edu-break-outshort"><%=group.name %></a>
<span class="edu-cir-grey fl mt15"><%= count %></span>
</li>
<% end %>
</ul>
<% end %>
<% end %>
<script>
<% unless @course.course_groups.empty? %>
<% @course.course_groups.each do |group| %>
if($("#course_group_<%=group.id %> a").width() == 96){
$("#course_group_<%=group.id %> a").attr("data-tip-left","<%= group.name %>");
}
<% end %>
<% end %>
</script>

View File

@ -18,6 +18,7 @@
<li><%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "实训路径", subjects_path, :class => "new-nav-a font-16" %></li>
<li><%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %></li>
<!-- <li><%#= link_to "讨论", forums_path, :class => "new-nav-a font-16" %></li>-->
<!-- <li><%#= link_to "论坛", forums_path, :class =>"new-nav-a", :target => "_blank" %></li>-->
<!-- <li><%#= link_to "帮助中心", "#{Setting.protocol}://#{Setting.host_name}/forums/1/memos/1168", :class => "new-nav-a", :target=>"_blank" %></li>-->

View File

@ -100,9 +100,9 @@
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 9 %>">
<a href="javascript:void(0);" class="edu-admin-nav-a">留言</a>
<ul class="edu-admin-nav-inner edu-absolute">
<li><%= link_to "实训留言", shixun_feedback_managements_path %></li>
</ul>
<!--<ul class="edu-admin-nav-inner edu-absolute">-->
<!--<li><%#= link_to "实训留言", shixun_feedback_managements_path %></li>-->
<!--</ul>-->
</li>
<li class="fl edu-admin-nav-li edu-position <%= 'active' if @menu_type == 10 %>"><a href="javascript:void(0);" class="edu-admin-nav-a">审批</a>
<ul class="edu-admin-nav-inner">

View File

@ -39,7 +39,9 @@
</li>
<% end %>
<li><a href="<%= collaborators_shixun_path(@shixun) %>" class="<%= params[:action] == "collaborators" ? "active" : "" %>">合作者</a></li>
<li><a href="<%= statistics_students_shixun_path(@shixun) %>"class="<%= params[:action] == "statistics_students" ? "active" : "" %>">学员统计</a></li>
<% if @shixun.shixun_status == "已发布" %>
<li><a href="<%= statistics_students_shixun_path(@shixun) %>"class="<%= params[:action] == "statistics_students" ? "active" : "" %>">学员统计</a></li>
<% end %>
<% if User.current.manager_of_shixun?(@shixun) %>
<li><a href="<%= settings_shixun_path(@shixun) %>" class="<%= params[:action] == "settings" ? "active" : "" %>">配置</a></li>
<% end %>

View File

@ -0,0 +1,91 @@
<div style="width:400px" class="task-popup">
<div class="task-popup-title clearfix ">
<h3 class="fl color-grey mt10 ml5">新增自动授权单位</h3>
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
<div class="mt10 ml30">
<span class="fl font-16 color-grey mr10 mt3 ">单位名称:</span>
<input nhname="tag" name="school" class="task-height-40 panel-box-sizing fl" type="text" placeholder="请输入单位名称" style="width: 260px" value="<%= @schools %>" />
<input nhname="tag" nh_tag_5="true" class="fl" id="school_id" name="school_id" style="display:none;" type="text" value="<%= @school_id %>"/> <!-- 单位名称的test框选中下拉列表框的id -->
<div class="cl"></div>
<span class="color-orange fl none" id="school_id_notice" style="margin-left:20%;"><i class="fa fa-exclamation-circle mr5" ></i>请选择单位</span>
</div>
<div id="search_school_result_list" style="width: 260px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display:none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<div id="schools_list" class="mt10 mb20 ml40 mr40">
</div>
<span id="choose_courses_notice" class="c_red"></span>
<div class="task-popup-submit clearfix ml25">
<a href="javascript:void(0);" onclick="hideModal();" class="task-btn fl pop_close mr10">取消</a>
<a href="javascript:void(0);" onfocus='this.blur();' onclick="school_submit();" class="task-btn task-btn-blue fr" >确定</a>
</div>
<div class="cl"></div>
</div>
<script type="text/javascript">
$("input[name='school']").on('input', function (e) {
throttle(department_search_fn, window, e);
});
var d_lastSearchCondition = '';
var d_page = 1; //唯一控制页码 变量
var d_count = 0; //查询结果的总量
var d_maxPage = 0;//最大页面值
function department_search_fn(e) {
if($(e.target).val().trim() == ''){
$("#search_school_result_list").hide();
$("input[name='school_id']").val("");
return;
}
if ($(e.target).val().trim() == d_lastSearchCondition && $(e.target).val().trim() != '') {//如果输入框没有改变或者输入框为空就返回
return;
}
d_lastSearchCondition = $(e.target).val().trim();
page = 1; //有新的搜索页面重置为1
$.ajax({
url: '<%= url_for(:controller => 'school',:action => 'on_search') %>' + '?name=' + e.target.value + '&school_id=' + $("input[name='occupation']").val() + '&page=' + d_page,
type: 'post',
success: function (data) {
d_schoolsResult = data.schools;
count = data.count;
maxPage = Math.ceil(count / 100); //最大页码值
if (d_schoolsResult.length != undefined && d_schoolsResult.length != 0) {
var i = 0;
$("#search_school_result_list").html('');
for (; i < d_schoolsResult.length; i++) {
link = '<a onclick="window.changeSchoolValue(\'' + d_schoolsResult[i].school.name.replace(/\s/g, " ") + '\',\'' + d_schoolsResult[i].school.id + '\')" href="javascript:void(0)">' + d_schoolsResult[i].school.name + '</a><br/>';
$("#search_school_result_list").append(link);
}
$("#search_school_result_list").css('left',108);
$("#search_school_result_list").css('top',113);
$("#search_school_result_list").css("position", "absolute");
$("#search_school_result_list").show();
} else {
$("#search_school_result_list").css('left', 108);
$("#search_school_result_list").css('top',113);
$("#search_school_result_list").css("position", "absolute");
$("#search_school_result_list").html('你的学校不在列表中?请确认后输入');
$("#search_school_result_list").show();
}
}
});
}
function changeSchoolValue(value, data) {
$("input[name='school']").val(value);
$("input[name='school_id']").val(data);
$("#search_school_result_list").hide();
};
function school_submit(){
var school=$("input[name='school_id']").val();
console.log(school);
if($("input[name='school']").val() == ""){
$("#school_id_notice").show();
} else{
$.ajax({
url: '/managements/create_auto_users_trial',
type: 'post',
dataType: 'script',
data:{school:school}
});
hideModal();
}
}
</script>

View File

@ -10,15 +10,15 @@
</tr>
</thead>
<tbody>
<% @schools.each_with_index do |school,index| %>
<% @apply_action.each_with_index do |apply_action,index| %>
<tr>
<td><%= index + 1 %></td>
<td><%= school.name %></td>
<td><%= UserExtensions.where(:school_id =>school.id).count %></td>
<td><%= User.where(:status => 1) && UserExtensions.where(:school_id =>school.id).count %></td>
<td></td>
<td><%= apply_action.name %></td>
<td><%= UserExtensions.where(:school_id => apply_action.id).count %></td>
<td><%= ApplyAction.where(:user_id => UserExtensions.where(:school_id => apply_action.id).map(&:user_id), :container_type => "TrialAuthorization" ,:status => 1).count %></td>
<td><%= format_time(apply_action.updated_at) %></td>
<td>
<a href="script:void(0)">删除</a>
<a href="javascript:void(0)" onclick="delete_confirm_box('<%= update_auto_users_trial_managements_path(:school =>apply_action.id)%>','您是否确定删除?')">删除</a>
</td>
</tr>
<% end %>
@ -28,7 +28,7 @@
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin:18px 0;">
<ul id="homework_pository_ref_pages">
<%= pagination_links_full @schools_pages, @schools_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
<%= pagination_links_full @apply_action_pages, @apply_action_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %>
</ul>
<div class="cl"></div>
</div>

View File

@ -23,8 +23,8 @@
</td>
<td><%= format_time(jour.created_on) %></td>
<td class="edu-txt-left" style="white-space:nowrap; overflow:hidden; text-overflow:ellipsis;">
<%= jour.m_parent_id.nil? ? strip_html(jour.notes) : 'RE: ' + strip_html(jour.notes) %>
</td>
<%= link_to jour.m_parent_id.nil? ? strip_html(jour.notes) : 'RE: ' + strip_html(jour.notes), student_work_index_path(:homework => jour.jour_id, :tab => 2),:target => '_blank' %>
</td>
<td>
<% replys = JournalsForMessage.where(:m_parent_id => jour.id) %>
<%= replys.nil? ? 0 : replys.count %>

View File

@ -1,14 +1,15 @@
<table class="edu-pop-table edu-txt-center" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
<thead>
<th width="9%">ID</th>
<th width="18%" class="edu-txt-left">实训名称</th>
<th width="8%">顶</th>
<th width="8%">踩</th>
<th width="16%" class="edu-txt-left">实训名称</th>
<th width="6%">顶</th>
<th width="6%">踩</th>
<th width="8%">已通关</th>
<th width="9%">已开启</th>
<th width="9%">创建者</th>
<th class="eud-pointer" width="11%">发布时间<i class="fa <%= @sx_order == "desc" ? "fa-long-arrow-down" : "fa-long-arrow-up" %> color-light-green ml5" title="功能完善中,敬请期待"></i></th>
<th width="9%">操作</th>
<th width="8%">允许复制</th>
<th>首页显示</th>
</thead>
<tbody>
@ -29,9 +30,13 @@
<td class="operate">
<%= link_to "关闭", publish_shixuns_managements_path(:close => shixun.id), :class => "", :remote => true %>
</td>
<td>
<td class="edu-txt-center">
<input type="checkbox" <%= shixun.can_copy ? 'checked' : "" %> name="can_copy" value="<%= shixun.id %>" id="can_copy_<%= shixun.id %>" class="ml5 mr5 magic-checkbox" >
<label style="top:-14px;" class="color-grey ml50" for="can_copy_<%= shixun.id %>"></label>
</td>
<td class="edu-txt-center">
<input type="checkbox" name="homepage_show" value="<%= shixun.id %>" <%= shixun.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= shixun.id %>">
<label style="top:-14px;" class="ml75" for="join_course_role_<%= shixun.id %>"></label>
<label style="top:-14px;" class="ml50" for="join_course_role_<%= shixun.id %>"></label>
</td>
</tr>
<% end %>
@ -65,4 +70,14 @@
dateType: "script"
});
})
$("input[name='can_copy']").click(function(){
var can_copy_val = $(this).val();
console.log(can_copy_val);
$.ajax({
url:"<%= shixun_can_copy_managements_path %>",
data: {shixun_id: can_copy_val},
type: 'post',
dateType: "script"
});
})
</script>

View File

@ -2,12 +2,51 @@
<%= form_tag save_school_managements_path(),method: "post",:id => "save_school" do %>
<div class="clearfix ml30">
<input type="hidden" value="<%= @school_name%>" name="school_name" class="w150">
<%= image_tag('', id: "avatar_image", :class=>"school_avatar ml25") %>
<%= image_tag('/images/school/default.png', id: "avatar_image", :class=>"school_avatar ml25", width:60,height:60) %>
<a type="button" onclick="$('#file').click();" style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey">上传图片</a>
<%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%>
<a type="button"style="margin: 90px 0 0 0px;padding: 2px 5px;cursor: pointer;text-decoration: none;width: 70px;" class="fl color-grey" >删除图片</a>
<div class="cl"></div>
</div>
<!--<div class="clearfix ml30">-->
<%#= file_field_tag 'avatar[image]',
# :id => "upload_img_id",
# :style => 'display:none;',
# :size => "1",
# :multiple => false,
# :onchange => 'addInputAvatar(this);',
# :data => {
# :max_file_size => Setting.authentication_img_max_size.to_i.kilobytes,
# :max_file_size_message => l(:error_user_auth_too_big, :max_size => number_to_human_size(Setting.authentication_img_max_size.to_i.kilobytes)),
# :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
# :file_type => Redmine::Configuration['pic_types'].to_s,
# :type_support_message => l(:error_pic_type),
# :upload_path => upload_avatar_path(:format => 'js'),
# :description_placeholder => nil ,# l(:label_optional_description)
# :source_type => 'school',
# :source_id => @user.id.to_s,
# :is_direct => 1
} %>
<!--<input type="hidden" value="0" id="upload_img_id_sign" />-->
<!--<a href="javascript:void(0);" onclick="$('#upload_img_id').click();" class="course-bth-blue mt5">+选择文件</a>-->
<!--</div>-->
<!--<div class="clearfix ml30">-->
<!--<label class="rz-label fl">&nbsp;</label>-->
<!--<div class="color-grey fl font-12 pr" id="shili_image">-->
<!--<%#= image_tag(url_to_auth_img(0, 'ID'), :width => 200, :height => 150, :id => 'nh_source_id') %>-->
<!--<br/>-->
<!--</div>-->
<!--</div>-->
<!--<script>-->
<!--$(function(){-->
<!--var image = $("#nh_source_id");-->
<!--var element = $("<a></a>").attr("href", image.attr('src')+".png");-->
<!--image.wrap(element);-->
<!--$("#nh_source_id").parent().colorbox({rel: 'nofollow', close: "关闭", returnFocus: false});-->
<!--});-->
<!--</script>-->
<div class="">
<div class="panel-form mr15">
<ul>

View File

@ -4,8 +4,14 @@
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt5" onclick="$('#management_search_user').submit();">搜索</a>
<a href="javascript:void(0);" class="fl task-btn ml5 mt5" id="clear_contents">清除</a>
</div>
<a href="javascript:void(0)" class="task-btn task-btn-green fr mt6 mr30" onclick="add_auto_users_trial()">新增</a>
</div>
<div class="edu-con-bg01 mt15">
<%= render :partial => "auto_users_authorization_list" %>
</div>
<script>
function add_auto_users_trial(){
var htmlvalue = "<%= escape_javascript( render :partial => 'managements/add_auto_users_trial') %>";
pop_box_new(htmlvalue, 400, 260);
}
</script>

View File

@ -3,8 +3,7 @@
<input class="fl task-form-20 task-height-30 ml35" id="shixun_Look_name" name="search" maxlength="" placeholder="输入关键字进行搜索" type="text" style="height: 21px;">
<a href="javascript:void(0);" class="fl task-btn task-btn-blue ml5 mt2" onclick="$('#department_part_search').submit();">搜索</a>
<a href="javascript:clearSearchCondition();" class="fl task-btn ml5 mt2" id="clear_contents">清除</a>
<% link_to "新建单位", :class => "task-btn task-btn-green fr mt6 mr30" %>
<%#= link_to "新建单位",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %>
<%= link_to "新建单位",add_departments_part_managements_path(),:class => "task-btn task-btn-green fr mt6 mr30" %>
<input name="sx_order" type="hidden">
</div>
<% end %>

View File

@ -19,7 +19,7 @@
</div>
<div class="cl"></div>
<div id="authentication_list">
<%= render :partial => "admin/authentication_list" %>
<%= render :partial => "authentication_list" %>
</div>
</div>
</div>

View File

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

View File

@ -10,11 +10,11 @@
</div>
<div class="-task-con-data fl">
<div class="top cl">
<div class="top-left fl mt20 mb10">
<div class="top-left fl mt10 mb10">
<p class="p1 font-16" style="overflow: hidden">
<a href="<%= %>" class="user_course_filtrate fl mt20 mr30 font-14" target="_blank">
<a href="<%= feedback_path(@user, :host=> Setting.host_user) %>" class="user_course_filtrate fl mt20 mr30 font-14" target="_blank">
<span class="user_filtrate_span1">留言</span>
<span class="user_filtrate_span2 ml10"><%= %></span>
<span class="user_filtrate_span2 ml10"><%= @user.journals_for_messages.count %></span>
</a>
<a href="<%= user_watchlist_user_path(@user) %>" class="user_course_filtrate fl mt20 mr30 font-14" target="_blank">
<span class="user_filtrate_span1">关注</span>
@ -61,11 +61,6 @@
</p>
<p class="p2 font-16">
<span class="fl">
<% if !@user.user_extensions.school_id.blank? && @user.user_extensions.school %>
<%= @user.user_extensions.school.name %>
<% end %>
</span>
<ul class="fr mb10 p2">
<a href="<%= authentication_account_path %>">
<% if @user.authentication %>
@ -129,7 +124,7 @@
</ul>
</p>
<p class="sub clearfix">
<a href="<%= %>" class="fr font-14 ml10 link-color-orange">给TA留言</a>
<a href="<%= feedback_path(@user, :host=> Setting.host_user) %>" class="fr font-14 ml10 link-color-orange">给TA留言</a>
<% if (@user.watched_by?(User.current)) %>
<%= link_to "已关注",
watch_path(:object_type => 'user', :object_id => @user.id, :target_id => @user.id),
@ -152,7 +147,7 @@
</div>
<div class=" clearfix mt15">
<!--<div>-->
<%= labelled_form_for :user, @user, :url => {:controller => "my",:action => "account"}, :html => {:id => 'my_account_form', :method => :post, :remote => true} do |f| %>
<%= labelled_form_for :user, @user, :url => {:controller => "managements",:action => "account"}, :html => {:id => 'my_account_form', :method => :post, :remote => true} do |f| %>
<ul>
<li class="clearfix mb10">
<label class="panel-form-label fl mr18">ID:</label>
@ -166,20 +161,30 @@
<li class="clearfix mb10">
<label class="panel-form-label fl mr18">姓名:</label>
<input type="text" id="lastname" name="lastname" maxlength="20" nh_required="1" required="required" class="mr15 input-height task-form-20 panel-box-sizing fl" placeholder="填写您的真实姓名" value="<%= @user.lastname+@user.firstname %>">
<input type="checkbox" id="show_realname" name="show_realname" class="fl magic-checkbox" value="1" <%= User.current.show_realname ? '' : 'checked' %>>
<input type="checkbox" id="show_realname" name="show_realname" class="fl magic-checkbox" value="1" <%= @user.show_realname ? '' : 'checked' %>>
<span class="color-orange fl hint none" id="lastname_hint" style="margin-left:20px;"><i class="fa fa-exclamation-circle mr5"></i>请填写真实姓名</span>
</li>
<li class="clearfix mb10">
<label class="panel-form-label fl mr18">性别:</label>
<span class="fl mt3 mr15">
<input id="sex_0" type="radio" class="magic-radio" name="sex" value="0" checked>
<label for="sex_0">男</label>
</span>
<span class="fl mt3">
<input id="sex_1" type="radio" class="magic-radio" name="sex" value="1">
<label for="sex_1">女</label>
</span>
<% if @user.user_extensions && @user.user_extensions.gender && @user.user_extensions.gender == 1 %>
<span class="fl mt3 mr15">
<input id="sex_0" class="magic-radio" type="radio" value="0" name="sex">
<label for="sex_0">男</label>
</span>
<span class="fl mt3">
<input id="sex_1" class="magic-radio" type="radio" name="sex" value="1" checked>
<label for="sex_1">女</label>
</span>
<% else %>
<span class="fl mt3 mr15">
<input id="sex_0" type="radio" class="magic-radio" name="sex" value="0" checked>
<label for="sex_0">男</label>
</span>
<span class="fl mt3">
<input id="sex_1" type="radio" class="magic-radio" name="sex" value="1">
<label for="sex_1">女</label>
</span>
<% end %>
<div class="cl"></div>
</li>
<li class="clearfix mb10 hascontont">
@ -272,17 +277,12 @@
<p id="no_department_hint" class="none fl ml10 mt8">你的部门不在列表中?请点击<a href="javascript:void(0);" class="link-color-blue">申请添加</a></p>
<div class="cl"></div>
</li>
<li class="clearfix mb10">
<li class="clearfix mb10" >
<label class="panel-form-label fl mr18">介绍:</label>
<textarea class="task-form-80 task-height-150 panel-box-sizing fl" name="brief_introduction" style="width:82%; resize: none;" placeholder=" 一句话介绍一下自己吧~最多100个字符"><%= @user.user_extensions.brief_introduction %></textarea>
<div class="cl"></div>
</li>
</ul>
<% end %>
</div>
<div class="clearfix mt20 mb20" style="border-bottom: 1px solid #ddd;border-top:1px solid #ddd ">
<%= form_tag(my_password_path(:user_id => @user.id),:id => 'my_password_form') do %>
<li class="clearfix mb10 mt30">
<li class="clearfix mb10 mt30 user">
<label class="panel-form-label fl mr18">修改密码:</label>
<input id="new_password" type="password" name="new_password" class="input-height task-form-20 panel-box-sizing fl" placeholder="设置8-16位新密码区分大小写字母">
<i class="fa font-16 ml20" id="user_password_2_check"></i>
@ -294,29 +294,65 @@
<i class="fa font-16 ml20" id="user_password_3_check"></i>
<span class="color-orange fl hint none" id="user_password_3_notice" style="margin-left:20px;">两次密码输入不一致</span>
</li>
<li class="clearfix mb10 user">
<label class="panel-form-label fl mr18">邮箱地址:</label>
<input type="email" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入真实有效的邮箱" value="<%= @user.mail %>" id="user_email_addr" name="mail">
<i class="fa font-16 ml20 " id="user_email_check"></i>
<div class="cl"></div>
<span class="color-orange fl hint none" id="user_email_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>邮箱格式不正确</span>
</li>
<li class="clearfix mb25">
<label class="panel-form-label fl mr18">手机号码:</label>
<input type="tel" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入手机号码" value="<%= @user.phone %>" id="user_phone" name="phone">
<i class="fa font-16 ml20 " id="user_phone_check"></i>
<div class="cl"></div>
<span class="color-orange fl hint none" id="user_phone_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>手机号输入不正确</span>
</li>
<li class="clearfix mb20" style="margin-right:41px;">
<a href="javascript:void(0);" id="user_form_link" class="task-btn task-btn-blue fr">保存</a>
<a href="javascript:void(0);" onclick="cancel_edit_account();" class="task-btn fr mr10">取消</a>
</li>
</ul>
<% end %>
</div>
<div class="clearfix mt20">
<li class="clearfix mb10">
<label class="panel-form-label fl mr18">邮箱地址:</label>
<input type="email" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入真实有效的邮箱" value="<%= @user.mail %>" id="user_email_addr">
<i class="fa font-16 ml20 " id="user_email_check"></i>
<div class="cl"></div>
<span class="color-orange fl hint none" id="user_email_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>邮箱格式不正确</span>
</li>
<li class="clearfix mb25">
<label class="panel-form-label fl mr18">手机号码:</label>
<input type="tel" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入手机号码" value="<%= @user.phone %>" id="user_phone">
<i class="fa font-16 ml20 " id="user_phone_check"></i>
<div class="cl"></div>
<span class="color-orange fl hint none" id="user_phone_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>手机号输入不正确</span>
<!--<div class="clearfix mt20 mb20" style="border-bottom: 1px solid #ddd;border-top:1px solid #ddd ">-->
<!--<%#= form_tag(my_password_path(:user_id => @user.id),:id => 'my_password_form') do %>-->
<!--<li class="clearfix mb10 mt30">-->
<!--<label class="panel-form-label fl mr18">修改密码:</label>-->
<!--<input id="new_password" type="password" name="new_password" class="input-height task-form-20 panel-box-sizing fl" placeholder="设置8-16位新密码区分大小写字母">-->
<!--<i class="fa font-16 ml20" id="user_password_2_check"></i>-->
<!--<span class="color-orange fl hint none" id="user_password_2_notice" style="margin-left:20px;"> 新密码8-16位区分大小写字母</span>-->
<!--</li>-->
<!--<li class="clearfix mb30">-->
<!--<label class="panel-form-label fl mr18">确认密码:</label>-->
<!--<input id="new_password_confirmation" name="new_password_confirmation" type="password" class="input-height task-form-20 panel-box-sizing fl" placeholder="确认密码">-->
<!--<i class="fa font-16 ml20" id="user_password_3_check"></i>-->
<!--<span class="color-orange fl hint none" id="user_password_3_notice" style="margin-left:20px;">两次密码输入不一致</span>-->
<!--</li>-->
<!--<%# end %>-->
<!--</div>-->
<!--<div class="clearfix mt20">-->
<!--<li class="clearfix mb10">-->
<!--<label class="panel-form-label fl mr18">邮箱地址:</label>-->
<!--<input type="email" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入真实有效的邮箱" value="<%#= @user.mail %>" id="user_email_addr">-->
<!--<i class="fa font-16 ml20 " id="user_email_check"></i>-->
<!--<div class="cl"></div>-->
<!--<span class="color-orange fl hint none" id="user_email_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>邮箱格式不正确</span>-->
<!--</li>-->
<!--<li class="clearfix mb25">-->
<!--<label class="panel-form-label fl mr18">手机号码:</label>-->
<!--<input type="tel" class="input-height task-form-20 panel-box-sizing fl" placeholder="请输入手机号码" value="<%#= @user.phone %>" id="user_phone">-->
<!--<i class="fa font-16 ml20 " id="user_phone_check"></i>-->
<!--<div class="cl"></div>-->
<!--<span class="color-orange fl hint none" id="user_phone_hint" style="margin-left:12%;"><i class="fa fa-exclamation-circle mr5"></i>手机号输入不正确</span>-->
</li>
<li class="clearfix mb20" style="margin-right:41px;">
<a href="javascript:void(0);" id="my_account_form_link" class="task-btn task-btn-blue fr">保存</a>
<a href="javascript:void(0);" onclick="cancel_edit_account();" class="task-btn fr mr10">取消</a>
</li>
</div>
<!--</li>-->
<!--<li class="clearfix mb20" style="margin-right:41px;">-->
<!--<a href="javascript:void(0);" id="my_account_form_link" class="task-btn task-btn-blue fr">保存</a>-->
<!--<a href="javascript:void(0);" onclick="cancel_edit_account();" class="task-btn fr mr10">取消</a>-->
<!--</li>-->
<!--</div>-->
<div id="search_school_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display: none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
</div>
<div id="search_department_result_list" style="width: 330px;line-height: 1.5;min-height:20px; max-height: 200px; height: auto !important;display: none;background: white;overflow: scroll;border: solid 1px #cccccc; overflow-x: hidden; overflow-y: auto;">
@ -627,15 +663,93 @@
$("#userIdentity").change();
$("input[name='confirm_password']").on('blur',function(){
confirm_password = $("input[name='confirm_password']").val();
password = $("input[name='password']").val();
if(confirm_password != password){
$("#password_hint").css('display','block');
}
});
$("#new_password_confirmation").on("blur",function(){
$("#user_form_link").on("click",function(){
my_account_form_submit();
});
function my_account_form_submit(){
if ($("#nickname").val() == '') {
$("#nickname").focus();
$("#nickname_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#nickname_hint").hide();
}
//姓名不能为空
if ($("#lastname").val() == '') {
$("#lastname").focus();
$("#lastname_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#lastname_hint").hide();
}
if ($("#userIdentity").val() == -1) {
$("#identity_hint").show();
e.stopImmediatePropagation(); // 阻止事件冒泡
return;
} else{
$("#identity_hint").hide();
}
if ($("#teacher").is(":visible") == true && $("#teacher").val() == "0") {
$("#identity_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#identity_hint").hide();
}
if ($("#profession").is(":visible") == true && $("#profession").val() == "0") {
$("#identity_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#identity_hint").hide();
}
if ($("#user_student_id").parent().is(":visible") == true && $("#user_student_id").val() == "") {
$("#user_student_id").focus();
e.stopImmediatePropagation();
return;
}
if ($("#userProvince").val() == "0" || $("#userCity").val() == "0"){
$("#province_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#province_hint").hide();
}
// 单位或高校必须从下拉列表中选择
if ($("input[name='school']").val().trim() != '' && $("input[name='occupation']").val().trim() == '') { //学校名字和id不对的话
$("#school_name_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#school_name_hint").hide();
}
if ($("input[name='school']").val().trim() == '') { //学校名字必须填写
$("#school_name_hint").show();
e.stopImmediatePropagation();
return;
} else{
$("#school_name_hint").hide();
}
$("input[name='confirm_password']").on('blur',function(){
confirm_password = $("input[name='confirm_password']").val();
password = $("input[name='password']").val();
if(confirm_password != password){
$("#password_hint").css('display','block');
}
});
if($("#new_password").val().length < 8 || $("#new_password").val().length > 16){
$("#user_password_2_check").removeClass("fa-check-circle").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orange");
$("#user_password_3_check").removeClass("fa-check-circle").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orange");
@ -649,20 +763,21 @@
} else{
$("#user_password_3_check").removeClass("fa-times-circle").removeClass("color-orange").addClass("fa-check-circle").addClass("color-light-green");
$('#user_password_3_notice').hide();
$("#my_password_form").submit();
$("#my_password_form").submit();
}
}
});
$("#user_email_addr").blur(function (event) {
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#user_phone_hint').show();
$('#user_phone_notice').show();
$("#user_email_check").removeClass("fa-check-circle").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orange");
$mail_correct = false;
return ;
}
});
$("#user_email_addr").blur(function (event) {
if (/^[a-zA-Z0-9]+([._\\]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(this.value) == false){
$('#user_phone_hint').show();
$('#user_phone_notice').show();
$("#user_email_check").removeClass("fa-check-circle").removeClass("color-light-green").addClass("fa-times-circle").addClass("color-orange");
$mail_correct = false;
return ;
}
});
$('#my_account_form').submit();
}
});
</script>

View File

@ -1,4 +1,4 @@
<div class="mt10 fl" style="width: 600px">
<div class="fl" style="width: 600px">
<% for attachment in attachments %>
<!--<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">-->
<!--<div style="max-width:55%;white-space: nowrap; overflow: hidden; text-overflow: ellipsis;float: left;">-->
@ -20,8 +20,11 @@
<div class="cl"></div>
<% else %>
<span class="pic_files fl "></span>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02', :download => true, :length => 45 -%>
<a href="javascript:void(0);" class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</a>
<i class="fa fa-folder mr5 color-orange03 mt8 fl" aria-hidden="true"></i>
<%= link_to_short_attachment attachment, :class => 'fl FilesName02 color-orange03', :download => true, :length => 45 -%>
<span class="fl FilesName02"> (<%= number_to_human_size attachment.filesize , :precision => 0 %>)</span>
<a href="<%= user_path(attachment.author) %>" class="fl color-orange05"><%= attachment.author %></a>
<span class="fl color-grey">,<%= format_time attachment.created_on %></span>
<% if options[:deletable] %>
<a href="<%=attachment_path(attachment) %>" onclick="confirm(<%=l(:text_are_you_sure) %>)" data-method="delete"> <span class="pic_del fl "></span> </a>
<% end %>

View File

@ -0,0 +1,113 @@
<div class="panel-mes-head clearfix">
<h4 class="fl">全部回复<span class="ml5">(<%= count %>)</span></h4>
<p class="fr mr15">
<a href="javascript:void(0);" class="mr15 white-btn orange-btn" onclick="editor_focus(<%= memo.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_<%= memo.id %>" class="fr mr10">
<%= render :partial => 'praise_tread/activity_praise', :locals => {:activity => memo, :user_activity_id => memo.id, :type => "Memo"} %>
</span>
</p>
</div>
<div class="panel-comment_item">
<% no_children_comments.each do |comment| %>
<% unless comment.nil? %>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="comment_item_cont clearfix">
<div class="J_Comment_Face fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
</div>
<div class="t_content fl">
<div class="J_Comment_Reply">
<div class="comment_orig_content" style="margin:0px">
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
<% parents_rely = [] %>
<% parents_rely = get_reply_parents_no_root parents_rely, comment %>
<% length = parents_rely.length %>
<div id="comment_reply_<%= comment.id %>">
<% if length <= 5 %>
<%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
<%=render :partial => 'messages/message_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => memo.id, :type => memo.class.to_s} %>
<% else %>
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<div class="orig_cont clearfix">
<%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
</div>
<div class="orig_cont_hide clearfix">
<i class="fa fa-long-arrow-down mr5"></i>
<%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => memo.id, :parent_id => comment.id),:remote=>true, :class => '' %>
</div>
<%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[3], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[2], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[1], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
</div>
<%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[0], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %>
</div>
<% end %>
</div>
<% end %>
<!--onmouseover="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').show();" onmouseout="$('#delete_reply_<%#=activity.id %>_<%#=comment.id %>').hide();"-->
<div class="comment_content clearfix" >
<div class="color-grey3"><%= comment.content_detail.html_safe %></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.created_at) %></span>
</div>
<p class="fr mr10 orig_reply">
<% if comment.creator_user == User.current %>
<a href="javascript:void(0);" class="color-grey" id="delete_reply_<%= memo.id %>_<%=comment.id %>" onclick="delete_confirm_box_2('<%= forum_memo_path(comment.forum, comment, :user_activity_id => memo.id) %>', '确定要删除该条回复吗?')"><i class="fa fa-trash-o mr5"></i>删除</a>
<% end %>
<span class="ml5 mr5 color-grey">|</span>
<%= link_to(
'<i class="fa fa-mail-reply mr5"></i>回复'.html_safe,
{:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id},
:remote => true,
:method => 'get',
:title => l(:button_reply),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
<div class="">
<div class="cl"></div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
</div>
</div>
<!--回复end-->
</div>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</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>

View File

@ -1,6 +1,120 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<ul>
<!--<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>
<div class="with30 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="major_level_option">
<p data-major="3">通 告</p>
<p data-major="2">智能课堂</p>
<p data-major="1">实训项目</p>
</div>
</div>
</li>-->
<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="memo[subject]" id="memo_subject" value="<%= @memo.try(:subject) %>" class="panel-form-width-690 panel-form-height-30 fl panel-box-sizing" maxlength="60" id="memo_subject" placeholder="最多60个字符">
<p class="color-orange undis" style="margin-left: 10%;" id="memo_notice"><i class="fa fa-exclamation-circle mr5"></i>标题不能超过60个字符</p>
</li>
<% if User.current.admin? %>
<li class="clearfix">
<label class="fl panel-form-label" style="width: 12%;">&nbsp;</label>
<span class="fl mr20">
<input type="checkbox" name="memo[sticky]" <%= @memo.sticky ? 'checked' : '' %> value="<%= @memo.sticky ? 1 : 0 %>" id="to_top" class="ml-3 mr5 magic-checkbox">
<label for="to_top">置顶</label>
</span>
</li>
<% end %>
<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 :content, :editor_id => 'memo_content_editor',
:owner_id => @memo.nil? ? 0: @memo.id,
:owner_type => OwnerTypeHelper::MESSAGE,
:width => '89.8%',
:height => 300,
:minHeight=>300,
:class => 'talk_text fl',
:input_html => { :id => 'memo_content',
:class => 'talk_text fl',
:maxlength => 5000 }
%>
<!-- <input id="asset_id" name="asset_id" style="display:none" type="hidden">
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing"></textarea>-->
<p class="color-orange undis" style="margin-left: 10%;" id="new_memo_content_notice"><i class="fa fa-exclamation-circle mr5"></i>内容不能为空</p>
</li>
<li class="clearfix mb5 pl30 pr30 ml25">
<%= render :partial => 'forums/file_form', :locals => {:container => @memo} %>
</li>
<li class="clearfix mt10 pl30 pr30">
<a href="javascript:void(0);" class="task-btn task-btn-blue fr" onclick="submitCoursesBoard()">保存</a>
<a href="<%= forums_path %>" class="task-btn fr mr10">取消</a>
</li>
</ul>
<script>
function regexSubject() {
var content = $.trim($("#memo_subject").val());
if (content.length == 0) {
$("#memo_notice").show();
return false;
}
else {
$("#memo_notice").hide();
return true;
}
return false;
}
function regexContent() {
if(memo_content_editor.isEmpty()){
$("#new_memo_content_notice").show();
return false;
}
else {
$("#new_memo_content_notice").hide();
return true;
}
return false;
}
function submitCoursesBoard(){
if(regexSubject() && regexContent()){
memo_content_editor.sync();
$("#memo-form").submit();
}
}
document.onkeydown = function(event) {
var target, code, tag;
if (!event) {
event = window.event; //针对ie浏览器
target = event.srcElement;
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return true; }
else { return false; }
}
}
else {
target = event.target; //针对遵循w3c标准的浏览器如Firefox
code = event.keyCode;
if (code == 13) {
tag = target.tagName;
if (tag == "INPUT") { return false; }
else { return true; }
}
}
};
</script>
<% if false %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="wenba-tiwenbox fl mr10 mb10">
<div class="wenba-tiwen-con">
@ -118,4 +232,7 @@
$("#memo_classify_tips").attr('style','color: #F00;');
}
}
</script>
</script>
<% end %>

View File

@ -1,40 +1,77 @@
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.replace(/<script>*/g, "<script>");
postContent = postContent.replace(/<html>*/g, "<html>");
$(this).html(postContent);
<%#= render :partial => "messages/common_reply_box", :locals => {:count => @reply_count, :activity => @topic, :no_children_comments => @replies, :is_teacher => is_teacher} %>
<%= render :partial => "memos/common_reply_box", :locals => {:count => @reply_count, :memo => @memo, :no_children_comments => @replies} %>
<div class="comment_item_cont clearfix">
<div class="comment_reply_box">
<div class="J_Comment_Face fl">
<%= link_to image_tag(url_to_avatar(User.current), :width => "50", :height => "50"), :target => "_blank", :alt => "用户头像" %>
</div>
<div nhname='new_message_<%= @memo.id%>' class="fr ml20 mr20" style="display:none; width: 92%;">
<%= form_for('memo', :as => :reply, :url => reply_forum_memo_path(@memo.forum, @memo), :method => "post", :remote => true) do |f|%>
<%#= form_for @memo, :as => :reply, :url => {:action => 'reply', :id => @topic}, :remote => true, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<%#= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%#= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%#= f.hidden_field :parent_id, :required => true, value: @memo.parent_id %>
<div nhname='toolbar_container_<%= @memo.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id %>' name="content"></textarea>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="mt10 task-btn task-btn-blue fr">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%>
</div>
<div class="cl"></div>
</div>
</div>
<% if false %>
<% @replies.each do |reply| %>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= reply.id %> p,#activity_description_<%= reply.id %> span,#activity_description_<%= reply.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
postContent = postContent.replace(/<script>*/g, "<script>");
postContent = postContent.replace(/<html>*/g, "<html>");
$(this).html(postContent);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
autoUrl('activity_description_<%= reply.id %>');
description_show_hide(<%= reply.id %>);
});
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
$(".homepagePostReplyDes").mouseover(function(){
$(this).find("a[id*='delete_memo_reply']").show();
}).mouseout(function(){
$(this).find("a[id*='delete_memo_reply']").hide();
});
</script>
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<div class="homepagePostReplyPublisher">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%>
</div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:15px;" id="activity_description_<%= reply.id %>">
<p><%= reply.content.gsub(/\/script/, "script").gsub(/script/, "&nbsp;script").html_safe %></p>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<div class="homepagePostReplyContainer" >
<div class="homepagePostReplyPortrait">
<%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %>
</div>
<div class="homepagePostReplyDes" onmouseover="$('#delete_reply_<%=reply.id %>').show();" onmouseout="$('#delete_reply_<%=reply.id %>').hide();">
<div class="homepagePostReplyPublisher">
<%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%>
</div>
<div class="homepagePostReplyContent break_word" style="margin-bottom:15px;" id="activity_description_<%= reply.id %>">
<p><%= reply.content.gsub(/\/script/, "script").gsub(/script/, "&nbsp;script").html_safe %></p>
</div>
<div class="orig_reply mb10 mt-10">
<div class="reply">
<span class="reply-right">
<span class="reply_praise_count_<%= reply.id %>">
<%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %>
@ -58,20 +95,21 @@
:title => l(:button_delete)
) if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
</span>
<div class="cl"></div>
<div class="cl"></div>
</div>
</div>
<div id="reply_message_<%= comment.id%>" class="reply_to_message"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @limit_count > @page * @limit + 10 %>
<div id="more_memo_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %>
</div>
</div>
<div id="reply_message_<%= reply.id%>" class="reply_to_message"></div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% if @limit_count > @page * @limit + 10 %>
<div id="more_memo_replies">
<div class="detail_cont_hide clearfix">
<span class="orig_icon" >&darr; </span>
<span class="orig_icon" style="display:none;" > &uarr;</span>
<%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %>
</div>
</div>
<% end %>
<% end %>

View File

@ -1 +1 @@
window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>'
window.location.href='<%= forum_memo_path(:forum_id => @memo.forum_id, :id => @memo.id ) %>';

View File

@ -0,0 +1,2 @@
$("#message_replies_box").html("<%= escape_javascript(render :partial => 'memos/memo_all_replies') %>");
sd_create_editor_from_data(<%= @memo.id %>,"","100%", "<%= @memo.class.to_s %>");

View File

@ -1,60 +1,15 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<%= javascript_include_tag 'new_user' %>
<% end %>
<script>
function check_and_submit(){
if($("textarea[name='memo[subject]']").val().trim() != "" && !memo_content.isEmpty() ){
if($("textarea[name='memo[subject]']").val().trim().length > 50 ){
$("#error").html('主题不能超过50个字符').show();
return;
}
if(memo_content.html().length > 20000){
$("#error").html("内容 过长(最长为 20000 个字符)").show();
$("html,body").animate({scrollTop:$("#error").offset().top},1000)
return false;
}
memo_content.sync();
$.ajax({
url:' /forums/'+'<%= @memo.forum_id.to_s %>'+'/memos/<%= @memo.id.to_s%>',
type:'put',
data:$("#edit_memo").serialize(),
success:function(data){
},
error:function(){
alert('请检查当前网络连接')
}
});
//$("#edit_memo").submit();
}else if($("textarea[name='memo[subject]']").val().trim() == "" && !memo_content.isEmpty() ){
$("#error").html("主题不能为空").show();
}else if($("textarea[name='memo[subject]']").val().trim() != "" && memo_content.isEmpty()){
$("#error").html("内容不能为空").show();
}else if($("textarea[name='memo[subject]']").val().trim() == "" && memo_content.isEmpty()){
$("#error").html("主题和内容不能为空").show();
}
}
</script>
<div class="banner-big f16 fontGrey3 mb10">
<%= link_to "问吧", forums_path, :class => "c_blue" %> > <%= link_to @forum.name, forum_path(@forum), :class => "c_blue" %> >
<%= @memo.subject %>
</div>
<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo),:html=>{:id => 'new_memo'}) do |f| %>
<%= render :partial => "memos/form", :locals => {:f => f} %>
<% end %>
<div class="fl">
<%= render :partial => "memos/my_show_count_message" %>
</div>
<script>
$(function(){
limitStrsize('memo_subject',50);
limitStrsize('memo_content',5000);
});
</script>
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> &gt; <a href="<%= forums_path %>">讨论 </a> &gt; 编辑
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e">
<p class="ml15 color-grey3">编辑话题</p>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e pt30 pb30">
<%#= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
<%= form_for @memo, :url => forum_memo_path(@memo.forum_id, @memo), :html => {:multipart => true, :id => 'memo-form'} do |f| %>
<%= render :partial => "memos/form", :locals => {:f => f} %>
<% end %>
</div>
</div>

View File

@ -0,0 +1,9 @@
<%# if @user_activity_id != @memo.id %>
/* $("#activity_post_reply_<%#= @user_activity_id %>").html("<%#= escape_javascript(render :partial => 'users/course_message_post_reply',
:locals => { :activity => @memo,
:user_activity_id => @user_activity_id}) %>");
sd_create_editor_from_data(<%#= @user_activity_id%>,"","100%", "UserActivity");*/
<%# else %>
$("#message_replies_box").html("<%= escape_javascript(render :partial => 'memos/memo_all_replies') %>");
sd_create_editor_from_data(<%= @memo.id %>,"","100%", "<%= @memo.class.to_s %>");
<%# end %>

View File

@ -1,6 +1,29 @@
<div class="banner-big f16 fontGrey3 mb10"><%= link_to "问吧", forums_path, :class => "c_blue" %> <% if params[:forum_index] != 'true'%> > <%= link_to @forum.name, forum_path(@forum), :class => "c_blue" %> <% end %> > 我要提问</div>
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
<%= render :partial => "memos/form", :locals => {:f => f} %>
<% end %>
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(@user) %>"><%= @user.show_name %></a> &gt; <a href="<%= forums_path %>">讨论 </a> &gt; 新建
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e">
<p class="ml15 color-grey3">新建话题</p>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e pt30 pb30">
<%#= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
<%= form_for @memo, :url => forum_memos_path(@forum), :html => {:multipart => true, :id => 'memo-form'} do |f| %>
<%= render :partial => "memos/form", :locals => {:f => f} %>
<% end %>
</div>
</div>
<%= render :partial => "forums/my_count_message" %>
<% if false %>
<div class="banner-big f16 fontGrey3 mb10">
<%= link_to "问吧", forums_path, :class => "c_blue" %>
</div>
<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %>
<%= render :partial => "memos/form", :locals => {:f => f} %>
<% end %>
<%#= render :partial => "forums/my_count_message" %>
<% end %>

View File

@ -1,131 +1,224 @@
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'forum' %>
<% end %>
<div class="banner-big f16 fontGrey3 mb10">
<%= link_to "问吧", forums_path, :class => "c_blue" %> > <%= link_to @forum.name, forum_path(@forum), :class => "c_blue" %> > <%=h @memo.subject %>
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="<%= user_path(@user.show_name)%>"><%= @user.show_name %></a> &gt; <a href="<%= forums_path %>">讨论 </a>
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 color-grey3 fl">
讨论详情
</p>
<!-- <p class="color-grey fr font-12 mr15 mt5"><a href="javascript:void(0)">返回</a></p>-->
</div>
<div class="edu-tab clearfix mb20 user_bg_shadow bor-grey-e">
<div class="panel-inner-fourm nobg">
<div class="clearfix pr">
<a href="<%= user_path(@memo.author) %>" class="fl">
<%= image_tag(url_to_avatar(@memo.author), :width => 60, :height => 60, :alt=>'用户头像', :class=>"panel-list-img mr15" ) %>
</a>
<div class="panel-list-infobox fl" style="margin:0;margin-left: 6px">
<div class="clearfix mb5">
<p class="color-grey3 fl" style="font-size: 16px;">
<%= h @memo.subject %>
<% if @memo.sticky %>
<span class="btn-top btn-cir-red mt5 ml5">顶</span>
<% end %>
</p>
<!-- <p class="color-grey fr font-12 mr15 mt5"><a href="javascript:void(0)">返回</a></p>-->
</div>
<p class="mb10"><a href="<%= user_path(@memo.author) %>" class="font-14 mr15 color-grey" target="_blank"><%= @memo.author.show_name %></a><span class="font-14 mr15 color-grey">发表于<%= time_from_now @memo.updated_at %></span></p>
<!--<p class="color-grey panel-lightgrey fl mt3">-->
<!--<span class="fl mr10 mt2">类别:分享</span>-->
<!-- </p>-->
</div>
<% if @user.admin? || @user == @memo.author %>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<% if @user.admin? %>
<% if @memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>">置&nbsp;&nbsp;顶</a></li>
<% end %>
<% end %>
<li><a href="<%= edit_forum_memo_path(@memo.forum, @memo)%>">编&nbsp;&nbsp;辑</a></li>
<li><a href="javascript:void(0)" onclick="delete_confirm_box_3('<%= forum_memo_path(@memo.forum, @memo) %>', '您确定要删除吗?')">删&nbsp;&nbsp;除</a></li>
</ul>
</div>
<% end %>
</div>
<div class="panel-inner-info clearfix memos_con">
<!--帖子内容-->
<%= @memo.content.html_safe %>
</div>
<ul class="panel-inner-info clearfix">
<!--上传的文件内容-->
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
<% end %>
</ul>
</div>
<div class="panel-mesbox" id="message_replies_box">
<%= render :partial => "memo_all_replies" %>
</div>
</div>
</div>
</div>
<script>
$(function() {
sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>");
});
function del_confirm(){
if(confirm('确认删除么?')){
$("#del_memo_link").click();
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");
}
}
$(function(){
sd_create_editor_from_data(<%= @memo.id %>, null, "100%", "<%= @memo.class.to_s %>");
});
</script>
<div class="postRightContainer mr10">
<div class="postThemeContainer">
<div class="postDetailPortrait">
<%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
</div>
<div class="postThemeWrap">
<% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<% if @memo.author.id == User.current.id || User.current.admin? %>
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<% end %>
<% if User.current.admin? || User.current == @forum.creator %>
<% if @memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">置顶</a></li>
<% end %>
<% end %>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum, @memo) %>" data-method="delete" id="del_memo_link" ></a></li>
</ul>
</li>
</ul>
</div>
<% end %>
<div class="postDetailTitle fl">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @memo.subject%></a>
</div>
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
<div class="cl"></div>
<div class="postDetailCreater">
<%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content ke-block" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%>
</div>
<div class="cl"></div>
<div class=" fl" style="width: 600px">
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
<% end %>
</div>
<div class="cl"></div>
<span class=" fr" style="color: #888888; font-size: 12px;">更新时间:<%= format_date(@memo.updated_at)%></span>
<% if false %>
<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: true) %>
<%= javascript_include_tag 'forum' %>
<% end %>
<div class="banner-big f16 fontGrey3 mb10">
<%= link_to "问吧", forums_path, :class => "c_blue" %> > <%= link_to @forum.name, forum_path(@forum), :class => "c_blue" %> > <%=h @memo.subject %>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%= @reply_count %></div>
<div class="homepagePostReplyBannerTime"></div>
</div>
<div class="" id="reply_div_<%= @memo.id %>">
<%= render :partial => 'memos/memo_all_replies' %>
</div>
<div class="cl"></div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @memo.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= @memo.id%>' style="display:none;">
<%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= @memo.id%>' class="kindeditor"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id %>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<script>
$(function() {
sd_create_editor_from_data(<%= @memo.id%>,null,"100%", "<%=@memo.class.to_s%>");
});
function del_confirm(){
if(confirm('确认删除么?')){
$("#del_memo_link").click();
}else{
}
}
</script>
<div class="postRightContainer mr10">
<div class="postThemeContainer">
<div class="postDetailPortrait">
<%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %>
</div>
<div class="postThemeWrap">
<% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %>
<div class="homepagePostSetting">
<ul>
<li class="homepagePostSettingIcon">
<ul class="homepagePostSettiongText">
<% if @memo.author.id == User.current.id || User.current.admin? %>
<li><a href="<%= edit_forum_memo_path(@memo.forum,@memo)%>" class="postOptionLink">编辑</a></li>
<% end %>
<% if User.current.admin? || User.current == @forum.creator %>
<% if @memo.sticky %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">取消置顶</a></li>
<% else %>
<li><a href="<%= change_sticky_forum_memo_path(@memo.forum,@memo) %>" class="postOptionLink">置顶</a></li>
<% end %>
<% end %>
<li><a href="javascript:void(0);" class="postOptionLink" onclick="del_confirm();">删除</a></li>
<li style="display: none"><a href="<%= forum_memo_path(@memo.forum, @memo) %>" data-method="delete" id="del_memo_link" ></a></li>
</ul>
</li>
</ul>
</div>
<% end %>
<div class="postDetailTitle fl">
<a href="javascript:void(0);" class="f14 linkGrey4 fb" style="overflow:hidden;">主题: <%= @memo.subject%></a>
</div>
<%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%>
<div class="cl"></div>
<div class="postDetailCreater">
<%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%></div>
<div class="postDetailDate mb5"><%= format_date( @memo.created_at)%></div>
<div class="cl"></div>
<div class="homepagePostIntro memo-content ke-block" id="activity_description_<%= @memo.id %>" style="word-break: break-all; word-wrap:break-word;margin-bottom: 0px !important;" >
<%= @memo.content.html_safe%>
</div>
<div class="cl"></div>
<div class=" fl" style="width: 600px">
<% if @memo.attachments.any?%>
<% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %>
<%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %>
<% end %>
</div>
<div class="cl"></div>
<span class=" fr" style="color: #888888; font-size: 12px;">更新时间:<%= format_date(@memo.updated_at)%></span>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<div class="homepagePostReply">
<div class="homepagePostReplyBanner">
<div class="homepagePostReplyBannerCount">回复(<%= @reply_count %></div>
<div class="homepagePostReplyBannerTime"></div>
</div>
<div class="" id="reply_div_<%= @memo.id %>">
<%= render :partial => 'memos/memo_all_replies' %>
</div>
<div class="cl"></div>
<div class="homepagePostReplyContainer borderBottomNone minHeight48">
<div class="homepagePostReplyPortrait mr15 imageFuzzy" id="reply_image_<%= @memo.id%>"><%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %></div>
<div class="homepagePostReplyInputContainer mb10">
<% if User.current.logged? %>
<div nhname='new_message_<%= @memo.id%>' style="display:none;">
<%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%>
<%= f.hidden_field :subject, :required => true, value: @memo.subject %>
<%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %>
<%= f.hidden_field :parent_id, :required => true, value: @memo.id %>
<%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %>
<div nhname='toolbar_container_<%= @memo.id%>' class="kindeditor"></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @memo.id %>' name="memo[content]"></textarea>
<a id="new_message_submit_btn_<%= @memo.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="blue_n_btn fr" style="display:none;margin-top:6px;">发送</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @memo.id%>'></p>
<% end%>
</div>
<% else %>
<%= render :partial => "users/show_unlogged" %>
<% end %>
<div class="cl"></div>
</div>
<div class="cl"></div>
</div>
</div>
</div>
<div class="fl">
<%= render :partial => "memos/my_show_count_message" %>
</div>
</div>
</div>
<div class="fl">
<%= render :partial => "memos/my_show_count_message" %>
</div>
<script type="text/javascript">
$(function(){
$("#activity_description_<%= @memo.id %> p,#activity_description__<%= @memo.id %> span,#activity_description_<%= @memo.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
<script type="text/javascript">
$(function(){
$("#activity_description_<%= @memo.id %> p,#activity_description__<%= @memo.id %> span,#activity_description_<%= @memo.id %> em").each(function(){
var postContent = $(this).html();
postContent = postContent.replace(/&nbsp;/g," ");
postContent= postContent.replace(/ {2}/g,"&nbsp; ");
postContent=postContent.replace(/&nbsp; &nbsp;/g,"&nbsp;&nbsp;&nbsp;");
postContent=postContent.replace(/&nbsp; /g,"&nbsp;&nbsp; ");
$(this).html(postContent);
});
autoUrl('activity_description_<%= @memo.id %>');
description_show_hide(<%= @memo.id %>);
});
autoUrl('activity_description_<%= @memo.id %>');
description_show_hide(<%= @memo.id %>);
});
</script>
</script>
<% end %>

View File

@ -38,6 +38,28 @@
<%= 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 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-mail-reply 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),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
<div class="J_Comment_Reply">
<div class="comment_orig_content" style="margin:0px">
<% if !comment.parent.nil? && !comment.parent.parent.nil? %>
@ -82,28 +104,7 @@
</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-mail-reply 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),:class => "color-grey") %>
<span class="ml5 mr5 color-grey">|</span>
<span class="reply_praise_count_<%= comment.id %>">
<%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%>
</span>
</p>
</div>
</div>
<div class="cl"></div>
</div>

View File

@ -36,7 +36,7 @@
<% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %>
<a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= delete_board_message_path(@topic.board_id, @topic) %>', '确定要删除该帖子吗?')" 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>
<a href="javascript:void(0);" class="mr10" data-tip-down="发送" 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-pencil"></i></a>
<% end %>

View File

@ -20,11 +20,11 @@
<%= link_to @course.name, course_path(@course), :title => "班级" %> &gt; <%= link_to "讨论区列表", course_boards_path(@course) %>
</p>
<div class="edu-con-top">
<div class="edu-con-top box_bg_shandow bor-grey-e">
<p class="ml15 color-grey">编辑帖子</p>
</div>
<div class="panel-content-box clearfix mt15">
<div class="panel-content-box clearfix mt15 box_bg_shandow bor-grey-e">
<%= form_for @message, :url => update_board_message_path(@message.board_id, @message), :html => {:id => 'message-form'} do |f| %>
<%= render :partial => "form_course", :locals => {:f => f} %>
<% end %>

View File

@ -1 +0,0 @@
alert("修改成功");

View File

@ -4,8 +4,9 @@
: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>
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<!--<span><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
<span><%= get_praise_num(activity) %></span>
</a>
<% else %>
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
@ -13,7 +14,8 @@
: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>
<span><%= get_praise_num(activity) %></span>
<%# 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

@ -4,8 +4,9 @@
:user_activity_id => user_activity_id,
: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>
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<!-- <span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
<span class="ml5"><%= get_praise_num(activity) %></span>
</a>
<% else %>
<a href='<%= praise_tread_praise_minus_path({:obj_id => activity.id,
@ -13,7 +14,8 @@
:user_activity_id => user_activity_id,
: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>
<span class="ml5"><%= get_praise_num(activity) %></span>
<%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %>
<!--<span class="ml5"><%#= (num.nil? ? 0 : num) > 0 ? num : 0 %></span>-->
</a>
<% end %>

View File

@ -5,6 +5,8 @@
<% 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 %>
<% elsif @type.to_s == 'Memo' %>
$('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>');
<% else @type.to_s == 'reply' %>
<% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %>
$('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>');

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