diff --git a/app/assets/javascripts/debates.js.coffee b/app/assets/javascripts/debates.js.coffee new file mode 100644 index 000000000..761567942 --- /dev/null +++ b/app/assets/javascripts/debates.js.coffee @@ -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/ diff --git a/app/assets/stylesheets/debates.css.scss b/app/assets/stylesheets/debates.css.scss new file mode 100644 index 000000000..6c45b3be9 --- /dev/null +++ b/app/assets/stylesheets/debates.css.scss @@ -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/ diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index f14c0ccc7..f31ff8eb5 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -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? diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index aef0170ff..375596075 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -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? diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 887b24d06..9eef2c48f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -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 diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb new file mode 100644 index 000000000..5e442e4bb --- /dev/null +++ b/app/controllers/debates_controller.rb @@ -0,0 +1,2 @@ +class DebatesController < ApplicationController +end diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index ed646354c..337f951aa 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -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] diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 69194f1f8..438c6f8ee 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -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) +"题:
" - @answer += choose.answer + @answer += (choose.answer.blank? ? choose.standard_answer : choose.answer) @answer += "


" 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) +"题:
" + @answer += (choose.answer.blank? ? choose.standard_answer : choose.answer) + @answer += "


" + end end + @game.update_column(:answer_open, true) end def refresh_game_list diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 32010e53f..ca8c7f1a3 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -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 diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 7f4c1d48e..7e9662563 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -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 diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 813c790b4..a2aadf706 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -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? diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index ee87d34bc..5d44a3cbc 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -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 diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 75c51dde5..e627ef519 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -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") diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 3e5a0c0a3..1f545fd9e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e13cf05b8..20c101543 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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)") + " ".html_safe + " | "+ " ".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 += '挂起' + str += '未发布' elsif homework_common.homework_detail_manual.comment_status == 0 str += '未发布' 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 diff --git a/app/helpers/debates_helper.rb b/app/helpers/debates_helper.rb new file mode 100644 index 000000000..f551d98d1 --- /dev/null +++ b/app/helpers/debates_helper.rb @@ -0,0 +1,2 @@ +module DebatesHelper +end diff --git a/app/models/apply_action.rb b/app/models/apply_action.rb index 508371521..af19e832b 100644 --- a/app/models/apply_action.rb +++ b/app/models/apply_action.rb @@ -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 diff --git a/app/models/challenge_choose.rb b/app/models/challenge_choose.rb index c14a0c02d..38b7d8685 100644 --- a/app/models/challenge_choose.rb +++ b/app/models/challenge_choose.rb @@ -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 diff --git a/app/models/game.rb b/app/models/game.rb index 7c0e913ae..e278690c4 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -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 diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index 9e7e2a0aa..ace51c51f 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -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 diff --git a/app/models/output.rb b/app/models/output.rb index 4ce462eff..8f1547cfe 100644 --- a/app/models/output.rb +++ b/app/models/output.rb @@ -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 diff --git a/app/models/school.rb b/app/models/school.rb index 6dc909229..d07303e09 100644 --- a/app/models/school.rb +++ b/app/models/school.rb @@ -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 diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 5ef891af0..f102e2f36 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,7 +1,7 @@
-

帖子列表

<%= @all_count %> +

帖子列表

<% if User.current.logged? %> + 我要发布 <% end %> diff --git a/app/views/challenges/_choose_type.html.erb b/app/views/challenges/_choose_type.html.erb index 1947a3760..a47d921f9 100644 --- a/app/views/challenges/_choose_type.html.erb +++ b/app/views/challenges/_choose_type.html.erb @@ -4,8 +4,10 @@ <%= render :partial => "challenges/choose_tab" %>
- + 单选题 - + 多选题 + <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + + 单选题 + + 多选题 + <% end %>
@@ -79,8 +81,6 @@ } } - - $(".stage-part-2").find(".nav_option li").eq(length-1).after(html); $.ajax({ diff --git a/app/views/challenges/_content_list.html.erb b/app/views/challenges/_content_list.html.erb index 71fb21030..cda61ccd4 100644 --- a/app/views/challenges/_content_list.html.erb +++ b/app/views/challenges/_content_list.html.erb @@ -5,8 +5,8 @@ <%= @challenges.count %> <% end %> <% if User.current.manager_of_shixun?(@shixun) && @shixun.status == 0 %> - +实践任务 - +选择题任务 + +实践任务 + +选择题任务 <% end %> @@ -19,7 +19,7 @@ <% if challenge.st == 0 %> <% else %> - + <% end%> diff --git a/app/views/challenges/_edit_evaluating.html.erb b/app/views/challenges/_edit_evaluating.html.erb index 891458a70..bb589188c 100644 --- a/app/views/challenges/_edit_evaluating.html.erb +++ b/app/views/challenges/_edit_evaluating.html.erb @@ -3,7 +3,7 @@
">

- <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + <% if User.current.manager_of_shixun?(@shixun) %> 编辑 <% end %>

@@ -49,8 +49,8 @@ <% end %>

-
输入:

<%= match_specific_symbol test.input unless test.input.blank? %>

-
输出:

<%= match_specific_symbol test.output unless test.output.blank? %>

+
输入:

<%= match_specific_symbol test.input unless test.input.blank? %>

+
输出:

<%= match_specific_symbol test.output unless test.output.blank? %>

<% end %> <% else %> diff --git a/app/views/challenges/_single_or_multiple_question_show.html.erb b/app/views/challenges/_single_or_multiple_question_show.html.erb index d93673911..7a2503bb1 100644 --- a/app/views/challenges/_single_or_multiple_question_show.html.erb +++ b/app/views/challenges/_single_or_multiple_question_show.html.erb @@ -3,8 +3,11 @@
  • - 编辑 - 删除 + <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + 编辑 + 删除 + + <% end %>
  • diff --git a/app/views/challenges/_task_pass_form.html.erb b/app/views/challenges/_task_pass_form.html.erb index 215f085d5..394bb633f 100644 --- a/app/views/challenges/_task_pass_form.html.erb +++ b/app/views/challenges/_task_pass_form.html.erb @@ -46,6 +46,28 @@ diff --git a/app/views/courses/_course_index_search.html.erb b/app/views/courses/_course_index_search.html.erb index c30e47177..5d4827952 100644 --- a/app/views/courses/_course_index_search.html.erb +++ b/app/views/courses/_course_index_search.html.erb @@ -2,7 +2,8 @@
    - + + ×
    diff --git a/app/views/courses/settings.html.erb b/app/views/courses/settings.html.erb index 4f72975ec..fe69cbbd1 100644 --- a/app/views/courses/settings.html.erb +++ b/app/views/courses/settings.html.erb @@ -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 %> + + } + \ No newline at end of file diff --git a/app/views/courses/settings/_add_students.html.erb b/app/views/courses/settings/_add_students.html.erb index 9937847e4..b2364003d 100644 --- a/app/views/courses/settings/_add_students.html.erb +++ b/app/views/courses/settings/_add_students.html.erb @@ -26,9 +26,9 @@
  • -

    +

    -

    -

    +

    -

    -

    角色:

    +

    角色:

    - 取消 - 确定 + 取消 + 确定
    <% end %>
    diff --git a/app/views/courses/settings/_all_student_list.html.erb b/app/views/courses/settings/_all_student_list.html.erb index 5c2fd729e..ad54ce938 100644 --- a/app/views/courses/settings/_all_student_list.html.erb +++ b/app/views/courses/settings/_all_student_list.html.erb @@ -16,7 +16,7 @@ <% @course.course_groups.each do |group| %>
  • - <%= group.name %> + <%= group.name %> <%= group.members.count %>

    @@ -27,3 +27,13 @@
  • <%= render :partial => "courses/settings/all_student_list_block" %>
    + + \ No newline at end of file diff --git a/app/views/courses/settings/_all_student_list_block.html.erb b/app/views/courses/settings/_all_student_list_block.html.erb index 91792b86d..24e52571e 100644 --- a/app/views/courses/settings/_all_student_list_block.html.erb +++ b/app/views/courses/settings/_all_student_list_block.html.erb @@ -40,8 +40,9 @@ <% end %>
    - - + + + ×
    diff --git a/app/views/courses/settings/_all_teacher_list_ul.erb b/app/views/courses/settings/_all_teacher_list_ul.erb index db3e22090..9886dbec3 100644 --- a/app/views/courses/settings/_all_teacher_list_ul.erb +++ b/app/views/courses/settings/_all_teacher_list_ul.erb @@ -12,11 +12,20 @@ <% unless @course.course_groups.empty? %> <% @course.course_groups.each do |group| %>
  • -

    +

    <%= group.name %> <%= group.members.count %> -

  • <% end %> -<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file diff --git a/app/views/courses/settings/_has_group_student_list.html.erb b/app/views/courses/settings/_has_group_student_list.html.erb index 465e05525..5116e46e2 100644 --- a/app/views/courses/settings/_has_group_student_list.html.erb +++ b/app/views/courses/settings/_has_group_student_list.html.erb @@ -14,8 +14,8 @@ <% end %> <% unless @course.course_groups.empty? %> <% @course.course_groups.each do |group| %> -
  • -

    +

  • +

    <%= group.name %> <%= group.members.count %> @@ -26,4 +26,14 @@

  • <%= render :partial => "courses/settings/has_group_student_list_block" %> - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/views/courses/settings/_has_group_student_list_block.html.erb b/app/views/courses/settings/_has_group_student_list_block.html.erb index 44178da15..5bf490f8c 100644 --- a/app/views/courses/settings/_has_group_student_list_block.html.erb +++ b/app/views/courses/settings/_has_group_student_list_block.html.erb @@ -34,8 +34,9 @@ <% end %>
    - - + + + ×
    diff --git a/app/views/courses/settings/_members.html.erb b/app/views/courses/settings/_members.html.erb index 1c1806e00..cdb8e9d0b 100644 --- a/app/views/courses/settings/_members.html.erb +++ b/app/views/courses/settings/_members.html.erb @@ -46,20 +46,22 @@ <% end %> - <% @apply_users.each_with_index do |apply, index| %> - <% user = User.find(apply.course_message_id) %> - - <%= @teacher_count + index + 1 %> - - <%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %> - - <%= user.try(:login) %> - <%= apply.content && apply.content.include?('9') ? "教师" : "助教" %> - - <%= 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'%> - - + <% if is_teacher %> + <% @apply_users.each_with_index do |apply, index| %> + <% user = User.find(apply.course_message_id) %> + + <%= @teacher_count + index + 1 %> + + <%= link_to user.show_real_name, user_path(user), :target => '_blank', :class => 'edu-txt-w140 task-hide mt5' %> + + <%= user.try(:login) %> + <%= apply.content && apply.content.include?('9') ? "教师" : "助教" %> + + <%= 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'%> + + + <% end %> <% end %> diff --git a/app/views/courses/settings/_no_group_student_list.html.erb b/app/views/courses/settings/_no_group_student_list.html.erb index 42eae5fb0..96cf02f3f 100644 --- a/app/views/courses/settings/_no_group_student_list.html.erb +++ b/app/views/courses/settings/_no_group_student_list.html.erb @@ -14,7 +14,7 @@ <% unless @course.course_groups.empty? %> <% @course.course_groups.each do |group| %>
  • -

    +

    <%= group.name %> <%= group.members.count %> @@ -26,3 +26,14 @@ <%= render :partial => "courses/settings/no_group_student_list_block" %> + + + \ No newline at end of file diff --git a/app/views/courses/settings/_no_group_student_list_block.html.erb b/app/views/courses/settings/_no_group_student_list_block.html.erb index 2cb30a5a5..86b6ec0ff 100644 --- a/app/views/courses/settings/_no_group_student_list_block.html.erb +++ b/app/views/courses/settings/_no_group_student_list_block.html.erb @@ -20,8 +20,9 @@ <% end %>

    - - + + + ×
    diff --git a/app/views/courses/settings/_search_not_students_list.html.erb b/app/views/courses/settings/_search_not_students_list.html.erb index d0ad45ea1..882b28edc 100644 --- a/app/views/courses/settings/_search_not_students_list.html.erb +++ b/app/views/courses/settings/_search_not_students_list.html.erb @@ -7,7 +7,8 @@ diff --git a/app/views/courses/settings/_search_not_teachers_list.html.erb b/app/views/courses/settings/_search_not_teachers_list.html.erb index ae3b96c78..30f71c656 100644 --- a/app/views/courses/settings/_search_not_teachers_list.html.erb +++ b/app/views/courses/settings/_search_not_teachers_list.html.erb @@ -7,7 +7,8 @@ diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 4d7fc2d04..3ae3a9804 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -8,20 +8,24 @@
    - <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> - + <% if false %> + <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> + + <% end %> <% end %>
    <%= render :partial => 'courses/course_activity_content', :locals => {:course_activities => @course_activities} %> diff --git a/app/views/exercise/examination_setting.html b/app/views/exercise/examination_setting.html new file mode 100644 index 000000000..4f2e60585 --- /dev/null +++ b/app/views/exercise/examination_setting.html @@ -0,0 +1,392 @@ + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22 +

    +
    +

    + + 实验四 多周期CPU与存储器实验 +

    + 返回 +
    + +
    +
    + +
    +
    +
    +

    发布设置

    + 编辑 +
    +
    +
    +
      +
    • + + + +
    • +
    • + + +
      +
    • +
    • + + + +
    • +
    +
    +
    +
    +
    +
    +

    发布设置

    +
    +
    +
    +
      +
    • + + + + +
    • +
    • + + + + + + 不能早于发布时间 +
    • +
    • + + + + +
    • +
    +
    +
    +
    +
    + +
    +
    +
    +

    答题设置

    +
    +
    +
    +
      +
    • + + + + +
    • +
    • + + + + (选中则学生答题时,题目顺序按照题型随机显示) +
      + + + (选中则学生答题时,选项顺序随机显示) +
    • +
    +
      +
    • + + + + + + +
    • +
    • + + + +
    • +
    • + + + +
    • +
    +
    +
    +
    +
    +
    +

    答题设置

    +
    +
    +
    +
      +
    • + + + + +
    • +
    • + + + + (选中则学生答题时,题目顺序按照题型随机显示) +
      + + + (选中则学生答题时,选项顺序随机显示) +
    • +
    +
      +
    • + + + + + + +
    • +
    • + + + +
    • +
    • + + + +
    • +
    +
    +
    +
    +
    + +
    +
    +
    +

    主观题评分设置

    +
    +
    +
    +
      +
    • + + + + (选中则取各助教最终评分的平均分) +
      + + + (选中则只取最终次的助教评分) +
    • +
    +
      +
    • + + +
    • +
    • + + + + +
    • +
    • + + + +
    • +
    +
    +
    +
    +
    +
    +

    主观题评分设置

    +
    +
    +
    +
      +
    • + + + + (选中则取各助教最终评分的平均分) +
      + + + (选中则只取最终次的助教评分) +
    • +
    +
      +
    • + + + +
    • +
    • + + + +
    • +
    • + + + +
    • +
    +
    +
    +
    +
    + +
    +
    + +
    +

    公开设置

    +
    +
    +
    +
      +
    • + + + + (选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开) +
    • +
    • + + + + (选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开) +
    • +
    +
    +
    +
    +
    +
    +

    公开设置

    +
    +
    +
    +
      +
    • + + + + (选中则在截止时间之后对班级学生公开所有成员的成绩,否则不公开) +
    • +
    • + + + + (选中则在截止时间之后对班级学生公开试卷题目的答案,否则不公开) +
    • +
    +
    +
    +
    +
    +
    + 保存 + 取消 +
    +
    +
    +
    +
    +
    + + diff --git a/app/views/exercise/student_look_fortime.html b/app/views/exercise/student_look_fortime.html new file mode 100644 index 000000000..391b3d7fb --- /dev/null +++ b/app/views/exercise/student_look_fortime.html @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22>胡莎莎 +

    +
    +

    软件测试小测

    + 按时 + + 返回 +
    + +
    +

    试卷须知:
    + 共有选择、填空、简答、编程题4种题型,其中选择题包括单选题和多选题。
    + 请大家认真答题,本次作业成绩将计入期末成绩。

    +
    +
    +

    + 单选题 3 题,共 15  + 多选题 5 题,共 25  + 填空题 10 题,共 25  + 简答题 10 题,共 25 分 +

    +

    合计 18 题,共 100

    +
    +
    + +
    + 满分 + 零分 + 其它 +

    总分:89

    +
    +
    + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 +
    + +
    + 已答 + 未答 +
    +
    + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 +
    +
    +
    +
    +
    +

    第1题:[多选题]10

    + +

    10

    + +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • + + +
    + 标准答案:ABCD +
    + + + +
    +
    +

    第2题:[单选题]5

    +

    0

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + 标准答案:A +
    +
    + +
    +
    +

    第3题:[填空题]5

    +

    0

    +
    +

    黑盒测试和白盒测试(没有)区别

    +
    +

    候选答案1:哈哈哈哈

    +

    候选答案1:呵呵呵呵

    +
    +
    + +
    +
    +

    第4题:[简答题]10

    +

    9

    +
    +

    黑盒测试和白盒测试的区别

    +
    学生所填答案收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试.验收测试验收测.
    +
    +

    参考答案

    +

    黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下,

    +
    +
    + +
    +
    + + + + +
    +
    + 保存 + 取消 +
    +
    +
    +
    + + + + + + + diff --git a/app/views/exercise/student_write_answer.html b/app/views/exercise/student_write_answer.html new file mode 100644 index 000000000..2f4822b59 --- /dev/null +++ b/app/views/exercise/student_write_answer.html @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22>胡莎莎 +

    +
    +

    软件测试小测

    + + + 返回 +
    + +
    +

    试卷须知:
    + 共有选择、填空、简答、编程题4种题型,其中选择题包括单选题和多选题。
    + 请大家认真答题,本次作业成绩将计入期末成绩。

    +
    +
    +

    + 单选题 3 题,共 15  + 多选题 5 题,共 25  + 填空题 10 题,共 25  + 简答题 10 题,共 25 分 +

    +

    合计 18 题,共 100

    +
    +
    +
    + 已答 + 未答 +

    交卷

    +
    +
    + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 +
    +
    +
    +
    +
    +

    第1题:[多选题]10

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + +
    +
    +

    第2题:[单选题]5

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + +
    +
    +

    第3题:[填空题]5

    +
    +

    黑盒测试和白盒测试()区别

    +
    + +
    +
    + +
    +
    +

    第4题:[简答题]10

    +
    +

    黑盒测试和白盒测试的区别

    +
    + +
    +
    +
    +
    +
    +
    + + + diff --git a/app/views/exercise/teacher_check_exam.html b/app/views/exercise/teacher_check_exam.html new file mode 100644 index 000000000..c5f04c08a --- /dev/null +++ b/app/views/exercise/teacher_check_exam.html @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22>胡莎莎 +

    +
    +

    软件测试小测

    + 按时 + + 返回 +
    + +
    +

    试卷须知:
    + 共有选择、填空、简答、编程题4种题型,其中选择题包括单选题和多选题。
    + 请大家认真答题,本次作业成绩将计入期末成绩。

    +
    +
    +

    + 单选题 3 题,共 15  + 多选题 5 题,共 25  + 填空题 10 题,共 25  + 简答题 10 题,共 25 分 +

    +

    合计 18 题,共 100

    +
    +
    +
    + 主观题 + 已评 + 未评 +
    +
    + 1 + 2 + 3 + 4 + 5 +
    +
    + 客观题 + 正确 + 错误 +
    +
    + 1 + 2 + 3 + 4 + 5 +
    +
    +
    +
    +
    +

    第1题:[多选题]10

    +

    10

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + 标准答案:ABCD +
    +
    + +
    +
    +

    第2题:[单选题]5

    +

    0

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + 标准答案:A +
    +
    + +
    +
    +

    第3题:[填空题]5

    +

    0

    +
    +

    黑盒测试和白盒测试(没有)区别

    +
    +

    候选答案1:哈哈哈哈

    +

    候选答案1:呵呵呵呵

    +
    +
    + +
    +
    +

    第4题:[简答题]10

    +

    9

    +
    +

    黑盒测试和白盒测试的区别

    +
    学生所填答案收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试验收测试.验收测试验收测.
    + 隐藏参考答案 +
    +

    参考答案

    +

    黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下,

    +
    +
    + +
    +
    + + + + +
    +
    + 保存 + 取消 +
    +
    +
    +
    +
    +
    +
    +
    + + + diff --git a/app/views/exercise/teacher_edit_exam.html b/app/views/exercise/teacher_edit_exam.html new file mode 100644 index 000000000..5d6d59945 --- /dev/null +++ b/app/views/exercise/teacher_edit_exam.html @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22>胡莎莎 +

    +
    +

    软件测试小测

    + 按时 + + 返回 +
    + +
    +

    试卷须知:
    + 共有选择、填空、简答、编程题4种题型,其中选择题包括单选题和多选题。
    + 请大家认真答题,本次作业成绩将计入期末成绩。

    +
    +
    +

    + 单选题 3 题,共 15  + 多选题 5 题,共 25  + 填空题 10 题,共 25  + 简答题 10 题,共 25 分 +

    +

    合计 18 题,共 100

    +
    +
    +
    +
    +

    第1题:[多选题]10

    +

    + + + + + +

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + 标准答案:ABCD +
    +
    +
    +
    +

    第2题:[单选题]5

    +

    + + + + + +

    +
    +

    黑盒测试和白盒测试的区别

    +
    +
  • +
  • +
  • +
  • +
    +
    + 标准答案:A +
    +
    + +
    +
    +

    第3题:[填空题]5

    +

    + + + + + +

    +
    +

    黑盒测试和白盒测试( )区别

    +
    +

    候选答案1:哈哈哈哈

    +

    候选答案1:呵呵呵呵

    +
    +
    + +
    +
    +

    第4题:[简答题]10

    +

    + + + + + +

    +
    +

    黑盒测试和白盒测试的区别

    +
    +

    参考答案

    +

    黑盒测试也称功能测试或数据驱动测试,它是在已知产品所应具有的功能,通过测试来检测每个功能是否都能正常使用,在测试时,把程序看作一个不能打开的黑盆子,在完全不考虑程序内部结构和内部特性的情况下,

    +
    +
    +
    +
    +
    单选题
    +
    多选题
    +
    填空题
    +
    简答题
    +
    +
    +
    +
    + + + diff --git a/app/views/exercise/teacher_examination_list.html b/app/views/exercise/teacher_examination_list.html new file mode 100644 index 000000000..104d04c57 --- /dev/null +++ b/app/views/exercise/teacher_examination_list.html @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 胡莎莎 > 智能课堂> 计算机基础> 计算机基础学院工程专业 +

    +
    +
      +
    • + + 计算概论-2016计算机科学与技术/软件工程/网络工程 + + 邀请码:CZPU8 + +
    • +
    • + 欧阳建权 + 湘潭大学 + 教师1 + 学生260 + 分班1 + 学分260 + 结束97 天后 +
    • +
    + +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +

    试卷列表

    + + 新建 + + 题库选用 + 导出成绩 +
    +
    +
    +

    + 全部 + 挂起 + 提交中 + 补交中 + 评阅中 + 已结束 +

    +
    +
    +
    + + +
    + +
    +
    +
    +
    +
    +
    + # 1 + 实训样式 + + 挂起 + 未答 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    +
    +
    + # 1 + 实训样式 + + 评阅中 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    +
    +
    + # 1 + 实训样式 + + 提交中 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    +
    +
    + # 1 + 实训样式 + + 评阅中 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    +
    +
    + # 1 + 实训样式 + + 补交中 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    +
    +
    + # 1 + 实训样式 + + 已结束 +
    +

    + 创建于21天前 + 更新于1天前 + 60已答 + 2未答 + 60未评 + 10  5 小时 10  +

    +
    + +
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/app/views/exercise/teacher_score_list.html b/app/views/exercise/teacher_score_list.html new file mode 100644 index 000000000..d306ecdb0 --- /dev/null +++ b/app/views/exercise/teacher_score_list.html @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷列表> #22 +

    +
    +

    + 实验四 多周期CPU与存储器实验 +

    + 返回 + 设置 + + 查看设置 +
    +
    + +
    + +
  • + 导出成绩 +
    +
    + + +
    + +
    +
  • +
  • + 你的评阅: + + 不限 + + + + + +
  • +
  • + 作品状态: + + 不限 + + + + + +
  • +
  • + 分班情况: + + 不限 + + + +
  • +
    + 提交时间排序 + | + 最终成绩排序 +

    242 个检索结果(学生:108人)

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    序号姓名学号提交状态提交时间客观题得分主观题教师评分主观题助教评分最终成绩操作
    48李航2015551337按时提交2016-11-24 17:53----91.0 + + 91.0 + + 评阅
    48胡莎莎2015551337延时提交2016-11-24 17:5395--91.0 + + 52.0 + + 评阅
    48李航2015551337未提交2016-11-24 17:53--65.065.0 + + 91.0 + + + 评阅 + + +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + diff --git a/app/views/exercise/teacher_send_examination.html b/app/views/exercise/teacher_send_examination.html new file mode 100644 index 000000000..e75a489d8 --- /dev/null +++ b/app/views/exercise/teacher_send_examination.html @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + +
    +
    +
    +

    + + 班级首页 > 试卷 +

    +
    +

    新建试卷

    + 返回 +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    单选题
    +
    多选题
    +
    填空题
    +
    简答题
    +
    + + +
    +
    +

    单选题

    + +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + +
  • +
  • + + +

    + 温馨提示:[单选题]属于客观题将由系统自动评分,请设置标准答案 + 保存 + 取消 +

    +
  • +
    + + +
    +
    +

    多选题

    + +
    +
  • + + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + +
  • +
  • + + +

    + 温馨提示:[多选题]属于客观题将由系统自动评分,请设置标准答案 + 保存 + 取消 +

    +
  • +
    + + +
    +

    填空题

    +
  • + + +
  • +
  • + + + +
  • +
  • + + + +
  • +
  • + + +
  • +
  • + + +

    + 温馨提示:[填空题]属于客观题将由系统自动评分,请设置标准答案 + 保存 + 取消 +

    +
  • +
    + +
    +

    简答题

    +
  • + + +
  • +
  • + + +
  • +
  • + + +

    + 温馨提示:[简答题]属于主观题需要人工评分,未作答的情况下系统将自动评分 +   参考答案仅作为人工评分的参考 + 保存 + 取消 +

    +
  • +
    + +
    +

    + 单选题 3 题,共 15  + 多选题 5 题,共 25  + 填空题 10 题,共 25  + 简答题 10 题,共 25  +

    + + 合计 10 题,共 100  + +
    +
    +
    +
    + + + diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 78c46541f..a3bdfbb10 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -94,9 +94,10 @@
    - + + ×
    - +

    <%= render :partial => 'course_file_filter_order', :locals => {:remote => @is_remote, :sort => @sort, :order => @order} %> diff --git a/app/views/files/_course_list.html.erb b/app/views/files/_course_list.html.erb index c1836895b..67c6a458d 100644 --- a/app/views/files/_course_list.html.erb +++ b/app/views/files/_course_list.html.erb @@ -1,3 +1,10 @@ + <% 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 @@

    <%= file.filename %>是私有资源
    <% end %> <% end %> +
    +
    + +
    +
    +
    - <% else %>
    <%= render :partial => "welcome/no_data" %> diff --git a/app/views/forums/_file_form.html.erb b/app/views/forums/_file_form.html.erb index cbb53c2cc..93c2e089f 100644 --- a/app/views/forums/_file_form.html.erb +++ b/app/views/forums/_file_form.html.erb @@ -3,11 +3,13 @@ input.is_public_checkbox{margin-left:4px;margin-right:4px;}
    - + <% if defined?(container) && container && container.saved_attachments %> <% container.attachments.each_with_index do |attachment, i| %> - <%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly => 'readonly') %><%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style => "display: inline-block;") %><%= l(:field_is_public) %>: + + + <%= 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;") %><%= l(:field_is_public) %>: <%= 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(''.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}" %>
    @@ -47,7 +49,7 @@ <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> <%#= 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' %> <%= file_field_tag 'attachments[dummy][file]', :id => '_file', @@ -74,7 +76,11 @@ <%#= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %> - + + + + 上传附件 + <% content_for :header_tags do %> <%= javascript_include_tag 'attachments' %> <% end %> diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 5b9f374f8..7aa89bdab 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,3 +1,92 @@ +
    +

    + + <%= @user.show_name %> > 论坛 +

    +
    +
    + +
      +
    • <%= @memos_praise_count %>
      被赞
    • +
    • <%= @my_memos_count %>
      回复/评论
    • +
    • <%= @my_forums_count %>
      主题
    • +
    +
    +
    +
    +
    +

    问吧

    + + 新话题 +
    +
    + <% @memos.each_with_index do |memo, index| %> +
    + + <%= image_tag(url_to_avatar(memo.author), :width => 50, :height => 50,:alt=>'用户头像', :class=>"bor-radius-all mt3" ) %> + +
    +

    + + <%= memo.subject %> + + <% if memo.sticky %> + + <% end %> +

    +

    <%= memo.content.html_safe %>

    +
    + <%= User.find(memo.author_id).try(:show_name) %> + <%= time_from_now memo.updated_at %> + +

    + <%= memo.viewed_count %> + <%= get_praise_num(memo) %> + <%= Memo.where(:root_id => memo.id).count %> + + +

    +
    + + <% if @user.admin? || @user == memo.author %> +
    + + +
    + <% end %> +
    +
    + <% end %> +
    +
    +
    +
    +
      + <%= pagination_links_full @topic_pages, @topic_count, :per_page_links => false, :remote => @is_remote, :flag => true, :is_new => true %> +
    +
    +
    +
    +
    + +<% 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(); } - \ No newline at end of file + +<% end %> diff --git a/app/views/games/_choice_question.html.erb b/app/views/games/_choice_question.html.erb index 8330ad846..0cddf1cf0 100644 --- a/app/views/games/_choice_question.html.erb +++ b/app/views/games/_choice_question.html.erb @@ -13,6 +13,7 @@
    <% @game_challenge.challenge_chooses.each_with_index do |choose, index| %> + <% output = @game.outputs.where(:test_set_position => choose.position).first %>

    <%= (index + 1).to_s + "." + (choose.category == 1 ? "单选题" : "多选题") %>

    @@ -22,16 +23,16 @@

    <% if choose.category == 1 %> - name="answer[<%= index + 1 %>]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-radio ml5"> + name="answer[<%= index + 1 %>]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-radio ml5"> <% else %> - name="answer[]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-checkbox ml5"> + name="answer[]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-checkbox ml5"> <% end %> - +

    <% end %> - +
    <% end %>
    @@ -34,7 +34,7 @@ <% end %>
  • - 评论<%= @discusses_count if @discusses_count > 0%> + 评论<%= @discusses_count if @discusses_count.to_i > 0 %> <%#= link_to '', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
  • @@ -43,7 +43,6 @@ <% else %> 经验值:<%= @game_challenge.choose_score.to_i %> <% end %> -
    @@ -102,6 +101,34 @@
    + + + <% if @tpm_modified %> +
    +
    + +
    +
    +

    更新通知

    + <% if false%> + +

    本关的测试集已更新,你的代码可能无法通过新的测试集,重新评测试试!

    + + <% end %> + +

    关卡任务的代码文件有更新,点击立即更新获取最新代码!

    +
    + <%#= link_to "立即更新", sync_codes_myshixun_game_path(@game, :myshixun_id => @myshixun), :remote => true, :class => "fl color-orange03", :onclick => "sync_hide_tip_content();" %> + 立即更新 + 稍后再说 +
    +
    +
    + <% end %> +
    @@ -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); + } + } + }) + } \ No newline at end of file diff --git a/app/views/games/_pass_game_show.html.erb b/app/views/games/_pass_game_show.html.erb index ef086eb99..5b1329923 100644 --- a/app/views/games/_pass_game_show.html.erb +++ b/app/views/games/_pass_game_show.html.erb @@ -1,53 +1,25 @@ <%= stylesheet_link_tag 'css/edu-common', 'css/edu-popup' %> -<% if game.challenge.st != 0 %> -
    +
    "> - <% if had_done == 0 %> -
    +
    + <% if had_done == 0 %>

    恭喜您通过本关

    -

    本题正确: <%= game.challenge.choose_correct_num.to_i %> 

    -

    本题错误: <%= game.challenge.challenge_chooses.count - game.challenge.choose_correct_num.to_i %> 

    -
    - <% else %> - -
    -

    本题正确: <%= game.challenge.choose_correct_num.to_i %> 

    -

    本题错误: <%= game.challenge.challenge_chooses.count - game.challenge.choose_correct_num.to_i %> 

    -
    - <% end %> -
    - <% 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 %> -
    -<% else %> -
    -
    "> - -
    - <% if had_done == 0 %> -

    恭喜您通过本关

    - <%= link_to "下 一 关", {:controller => 'games', :action => "next_step", :id => game, :myshixun_id => myshixun}, :class => "task-su-btn", :onclick => "hideModal();", :remote => true %> - <% else %> - 查看光辉历史 - <% end %> -
    -
    + <%= link_to "下 一 关", {:controller => 'games', :action => "next_step", :id => game, :myshixun_id => myshixun}, :class => "task-su-btn", :onclick => "hideModal();", :remote => true %> + <% else %> + 查看光辉历史 + <% end %>
    -<% end %> - +
    +
    \ No newline at end of file diff --git a/app/views/games/_shixun_comment_list.html.erb b/app/views/games/_shixun_comment_list.html.erb index 2707561a3..d4a50066d 100644 --- a/app/views/games/_shixun_comment_list.html.erb +++ b/app/views/games/_shixun_comment_list.html.erb @@ -13,7 +13,7 @@ <%= link_to dis.user.show_name, user_path(dis.user), :class => "fl link-color-grey mr20" ,:style => "display: block" %> <%= time_from_now dis.created_at %> <% if dis.try(:challenge_id).present? %> - [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] + [第<%= Challenge.find(dis.try(:challenge_id)).try(:position) %>关] <% end %> <%= render :partial => "discusses/dis_praise", :locals => {:discuss => dis} %> @@ -80,12 +80,15 @@ \ No newline at end of file diff --git a/app/views/games/show.js.erb b/app/views/games/show.js.erb index 2419d5fec..25f057ced 100644 --- a/app/views/games/show.js.erb +++ b/app/views/games/show.js.erb @@ -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("下一关"); var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>"; diff --git a/app/views/homework_common/_homework_index_tab.html.erb b/app/views/homework_common/_homework_index_tab.html.erb index c28992cc8..55336d0b4 100644 --- a/app/views/homework_common/_homework_index_tab.html.erb +++ b/app/views/homework_common/_homework_index_tab.html.erb @@ -1,6 +1,6 @@ edu-filter-cir-grey mr5 font-12 fl" data-remote="true">全部 <% if @is_teacher %> - edu-filter-cir-grey mr5 font-12 fl" data-remote="true">挂起 + edu-filter-cir-grey mr5 font-12 fl" data-remote="true">未发布 <% end %> edu-filter-cir-grey mr5 font-12 fl" data-remote="true">提交中 edu-filter-cir-grey mr5 font-12 fl" data-remote="true">匿评中 diff --git a/app/views/homework_common/_homework_search_form.html.erb b/app/views/homework_common/_homework_search_form.html.erb index cf354cd21..c2f03570a 100644 --- a/app/views/homework_common/_homework_search_form.html.erb +++ b/app/views/homework_common/_homework_search_form.html.erb @@ -4,8 +4,9 @@
    - - + + + ×
    diff --git a/app/views/homework_common/index.html.erb b/app/views/homework_common/index.html.erb index e7fca0de0..9e77b7116 100644 --- a/app/views/homework_common/index.html.erb +++ b/app/views/homework_common/index.html.erb @@ -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 %> diff --git a/app/views/layouts/_course_base_info.html.erb b/app/views/layouts/_course_base_info.html.erb index a275be916..893fb84cf 100644 --- a/app/views/layouts/_course_base_info.html.erb +++ b/app/views/layouts/_course_base_info.html.erb @@ -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 => "由学生身份切换至教师身份" %> +
    <%= 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 " %>
    <% 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 => "由学生身份切换至助教身份" %> +
    <%= 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 " %>
    <% 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 => "由教师身份切换至学生身份" %> +
    <%= 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 " %>
    <% end %> <% unless (is_teacher || is_TA || is_TE || is_ST) %> diff --git a/app/views/layouts/_group_children_list.html.erb b/app/views/layouts/_group_children_list.html.erb index 486e0aa76..417226ba8 100644 --- a/app/views/layouts/_group_children_list.html.erb +++ b/app/views/layouts/_group_children_list.html.erb @@ -13,9 +13,19 @@ <% @course.course_groups.each do |group| %>
  • <% count = group.members.count %> - <%=group.name %> - <%= count %> + <%=group.name %> + <%= count %>
  • <% end %> -<% end %> \ No newline at end of file +<% end %> + + diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index 73acfb0e7..d43a20612 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -18,6 +18,7 @@
  • <%= link_to "全部实训", shixuns_path, :class => "new-nav-a font-16" %>
  • <%= link_to "实训路径", subjects_path, :class => "new-nav-a font-16" %>
  • <%= link_to "在线课堂", courses_path, :class => "new-nav-a font-16" %>
  • + diff --git a/app/views/layouts/base_management.html.erb b/app/views/layouts/base_management.html.erb index a61425574..57d2fc743 100644 --- a/app/views/layouts/base_management.html.erb +++ b/app/views/layouts/base_management.html.erb @@ -100,9 +100,9 @@
  • 留言 -
      -
    • <%= link_to "实训留言", shixun_feedback_managements_path %>
    • -
    + + +
  • 审批
      diff --git a/app/views/layouts/base_shixun.html.erb b/app/views/layouts/base_shixun.html.erb index 8c9fa67de..345153daf 100644 --- a/app/views/layouts/base_shixun.html.erb +++ b/app/views/layouts/base_shixun.html.erb @@ -39,7 +39,9 @@ <% end %>
    • ">合作者
    • -
    • ">学员统计
    • + <% if @shixun.shixun_status == "已发布" %> +
    • ">学员统计
    • + <% end %> <% if User.current.manager_of_shixun?(@shixun) %>
    • ">配置
    • <% end %> diff --git a/app/views/managements/_add_auto_users_trial.html.erb b/app/views/managements/_add_auto_users_trial.html.erb new file mode 100644 index 000000000..8d9b2b1b2 --- /dev/null +++ b/app/views/managements/_add_auto_users_trial.html.erb @@ -0,0 +1,91 @@ +
      +
      +

      新增自动授权单位

      + +
      +
      + 单位名称: + + +
      + 请选择单位 +
      + +
      +
      + +
      + 取消 + 确定 +
      +
      +
      + \ No newline at end of file diff --git a/app/views/managements/_auto_users_authorization_list.html.erb b/app/views/managements/_auto_users_authorization_list.html.erb index 07a340803..bddd85645 100644 --- a/app/views/managements/_auto_users_authorization_list.html.erb +++ b/app/views/managements/_auto_users_authorization_list.html.erb @@ -10,15 +10,15 @@ - <% @schools.each_with_index do |school,index| %> + <% @apply_action.each_with_index do |apply_action,index| %> <%= index + 1 %> - <%= school.name %> - <%= UserExtensions.where(:school_id =>school.id).count %> - <%= User.where(:status => 1) && UserExtensions.where(:school_id =>school.id).count %> - + <%= apply_action.name %> + <%= UserExtensions.where(:school_id => apply_action.id).count %> + <%= ApplyAction.where(:user_id => UserExtensions.where(:school_id => apply_action.id).map(&:user_id), :container_type => "TrialAuthorization" ,:status => 1).count %> + <%= format_time(apply_action.updated_at) %> - 删除 + 删除 <% end %> @@ -28,7 +28,7 @@
        - <%= 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 %>
      diff --git a/app/views/managements/_leave_message_list.html.erb b/app/views/managements/_leave_message_list.html.erb index f65fbf4c8..7bbbcc9b8 100644 --- a/app/views/managements/_leave_message_list.html.erb +++ b/app/views/managements/_leave_message_list.html.erb @@ -23,8 +23,8 @@ <%= format_time(jour.created_on) %> - <%= jour.m_parent_id.nil? ? strip_html(jour.notes) : 'RE: ' + strip_html(jour.notes) %> - + <%= 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' %> + <% replys = JournalsForMessage.where(:m_parent_id => jour.id) %> <%= replys.nil? ? 0 : replys.count %> diff --git a/app/views/managements/_publish_shixun_list.html.erb b/app/views/managements/_publish_shixun_list.html.erb index 8d3844909..d5900bbbc 100644 --- a/app/views/managements/_publish_shixun_list.html.erb +++ b/app/views/managements/_publish_shixun_list.html.erb @@ -1,14 +1,15 @@ - - - + + + + @@ -29,9 +30,13 @@ - + <% 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" + }); + }) \ No newline at end of file diff --git a/app/views/managements/add_departments_part.html.erb b/app/views/managements/add_departments_part.html.erb index a4d6ea839..d94e166a9 100644 --- a/app/views/managements/add_departments_part.html.erb +++ b/app/views/managements/add_departments_part.html.erb @@ -2,12 +2,51 @@ <%= form_tag save_school_managements_path(),method: "post",:id => "save_school" do %>
      - <%= 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) %> 上传图片 <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%> 删除图片
      + + <%#= 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 + } %> + + + + + + + + + + + + + + + + + + + +
        diff --git a/app/views/managements/auto_users_trial.html.erb b/app/views/managements/auto_users_trial.html.erb index 1fd06ab47..45baf995e 100644 --- a/app/views/managements/auto_users_trial.html.erb +++ b/app/views/managements/auto_users_trial.html.erb @@ -4,8 +4,14 @@ 搜索 清除
      + 新增
      <%= render :partial => "auto_users_authorization_list" %>
      - + diff --git a/app/views/managements/departments_part.html.erb b/app/views/managements/departments_part.html.erb index 19aff672b..28ff8ef59 100644 --- a/app/views/managements/departments_part.html.erb +++ b/app/views/managements/departments_part.html.erb @@ -3,8 +3,7 @@ 搜索清除 - <% 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" %> <% end %> diff --git a/app/views/managements/identity_authentication.html.erb b/app/views/managements/identity_authentication.html.erb index 5e6ae63a9..d4a79aa55 100644 --- a/app/views/managements/identity_authentication.html.erb +++ b/app/views/managements/identity_authentication.html.erb @@ -19,7 +19,7 @@
      - <%= render :partial => "admin/authentication_list" %> + <%= render :partial => "authentication_list" %>
      diff --git a/app/views/managements/reject_authentication_pro.js.erb b/app/views/managements/reject_authentication_pro.js.erb new file mode 100644 index 000000000..5c15ea523 --- /dev/null +++ b/app/views/managements/reject_authentication_pro.js.erb @@ -0,0 +1 @@ +$("#pro_authentication_list").html("<%= j( render :partial => "pro_authentication_list" ) %>"); \ No newline at end of file diff --git a/app/views/managements/update_user.html.erb b/app/views/managements/update_user.html.erb index 0b5540fd6..ae5aa6e9e 100644 --- a/app/views/managements/update_user.html.erb +++ b/app/views/managements/update_user.html.erb @@ -10,11 +10,11 @@
      -
      +
      - <%= 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| %>
      • @@ -166,20 +161,30 @@
      • - > + > 请填写真实姓名
      • - - - - - - - - - + <% if @user.user_extensions && @user.user_extensions.gender && @user.user_extensions.gender == 1 %> + + + + + + + + + <% else %> + + + + + + + + + <% end %>
      • @@ -272,17 +277,12 @@

        你的部门不在列表中?请点击申请添加

      • -
      • +
      • -
      - <% end %> -
      -
      - <%= form_tag(my_password_path(:user_id => @user.id),:id => 'my_password_form') do %> -
    • +
    • @@ -294,29 +294,65 @@ 两次密码输入不一致
    • +
    • + + + +
      + 邮箱格式不正确 +
    • +
    • + + + +
      + 手机号输入不正确 + +
    • +
    • + 保存 + 取消 +
    • + <% end %>
      -
      -
    • - - - -
      - 邮箱格式不正确 -
    • -
    • - - - -
      - 手机号输入不正确 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    • -
    • - 保存 - 取消 -
    • -
      + + + + + +
      ID实训名称实训名称 已通关 已开启 创建者 发布时间 color-light-green ml5" title="功能完善中,敬请期待"> 操作允许复制 首页显示
      <%= link_to "关闭", publish_shixuns_managements_path(:close => shixun.id), :class => "", :remote => true %> + + name="can_copy" value="<%= shixun.id %>" id="can_copy_<%= shixun.id %>" class="ml5 mr5 magic-checkbox" > + + class="ml-3 mr5 magic-checkbox" id="join_course_role_<%= shixun.id %>"> - +
      +
      <% unless @path.blank? %> diff --git a/app/views/shixuns/_add_collaborators.html.erb b/app/views/shixuns/_add_collaborators.html.erb index 84ae4b521..44fb5419f 100644 --- a/app/views/shixuns/_add_collaborators.html.erb +++ b/app/views/shixuns/_add_collaborators.html.erb @@ -7,14 +7,23 @@
      <%= form_tag url_for(shixun_members_added_shixun_path(@shixun)), :remote => true, :method => :post, :id => 'add_collaborators_form' do |f| %> -
      -
      +
      +
      +

      + + +

      -
        +
          <%#= render :partial => 'courses/settings/search_not_teachers_list' %>
      diff --git a/app/views/shixuns/_add_collaborators_list.html.erb b/app/views/shixuns/_add_collaborators_list.html.erb new file mode 100644 index 000000000..e219ceb7a --- /dev/null +++ b/app/views/shixuns/_add_collaborators_list.html.erb @@ -0,0 +1,17 @@ +<% unless @users.empty? %> + <% @users.each do |user| %> + <% if user && user.user_extensions %> +
    • + + + + +
    • + <% end %> + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/shixuns/_form.html.erb b/app/views/shixuns/_form.html.erb index 7d1b105ff..e3ec54edd 100644 --- a/app/views/shixuns/_form.html.erb +++ b/app/views/shixuns/_form.html.erb @@ -106,7 +106,7 @@ name="can_copy" value="1" id="can_copy" class="ml5 mr5 magic-checkbox" > - +
    • diff --git a/app/views/shixuns/_settings_edit.html.erb b/app/views/shixuns/_settings_edit.html.erb index 1b7288b19..70e1f9768 100644 --- a/app/views/shixuns/_settings_edit.html.erb +++ b/app/views/shixuns/_settings_edit.html.erb @@ -54,7 +54,7 @@ name="can_copy" value="<%= @shixun.can_copy ? 1 : 0 %>" id="can_copy" class="ml5 mr5 magic-checkbox" > - +
    • diff --git a/app/views/shixuns/_settings_show.html.erb b/app/views/shixuns/_settings_show.html.erb index 15a875d70..05d29c7ba 100644 --- a/app/views/shixuns/_settings_show.html.erb +++ b/app/views/shixuns/_settings_show.html.erb @@ -62,7 +62,7 @@ name="can_copy" value="<%= @shixun.can_copy ? 1 : 0 %>" id="can_copy" disabled="disabled" class="ml5 mr5 magic-checkbox" > - +
    • diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index 1c8c75159..22641e5a3 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -35,10 +35,15 @@ <% end %> 已关闭 <% end %> - <% if @shixun.can_copy %> - <%#= link_to "复制", copy_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-green mr15" %> - 复制 - <% end %> + <% if (@shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification) %> + + + <% end %> <% end %>
      <% unless User.current.manager_of_shixun?(@shixun) %> diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index 02340d7f0..2bad02525 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -16,27 +16,29 @@ <% @statistics.each do |statistics| %>
      - - diff --git a/app/views/shixuns/add_collaborators.js.erb b/app/views/shixuns/add_collaborators.js.erb index 36fbc2af7..1bdd537e4 100644 --- a/app/views/shixuns/add_collaborators.js.erb +++ b/app/views/shixuns/add_collaborators.js.erb @@ -1,5 +1,5 @@ <% if params[:is_observe] %> -$("#search_not_teachers_list").html("<%= j(render :partial => 'courses/settings/search_not_teachers_list') %>"); +$("#search_not_teachers_list").html("<%= j(render :partial => 'shixuns/add_collaborators_list') %>"); <% else %> var htmlvalue = "<%= j(render :partial => 'shixuns/add_collaborators') %>"; pop_box_new(htmlvalue, 600, 420); diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index 284f439ac..fc6235d62 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -171,7 +171,8 @@
      - + × +
      diff --git a/app/views/student_work/_score_appeal_box.html.erb b/app/views/student_work/_score_appeal_box.html.erb index 255c693e5..b10a17e35 100644 --- a/app/views/student_work/_score_appeal_box.html.erb +++ b/app/views/student_work/_score_appeal_box.html.erb @@ -18,7 +18,7 @@
      -
      + diff --git a/app/views/student_work/_shixun_work_show.html.erb b/app/views/student_work/_shixun_work_show.html.erb index 0f99ab2b8..20d266e12 100644 --- a/app/views/student_work/_shixun_work_show.html.erb +++ b/app/views/student_work/_shixun_work_show.html.erb @@ -4,13 +4,13 @@
      -
      -

      - <%= link_to @shixun.owner.try(:show_real_name), user_path(@shixun.owner), :class => "link-name-dark fl", :target => "_blank" %> - / +

      +

      + <%= link_to @shixun.owner.try(:show_real_name), user_path(@shixun.owner), :class => "color-grey3 fl", :target => "_blank" %> + / <%= link_to @shixun.name, shixun_path(@shixun), :class => "edu-info-dark fl", :target => "_blank" %>

      - 经验值:<%= @myshixun.total_score %> + 经验值:<%= @myshixun.total_score %>
      <%= link_to image_tag(url_to_avatar(@work.user), :width =>"50", :height => "50", :alt=>"头像", :style => "width:50px; height:50px;"), user_path(@work.user), :class => "fl edu-work-user-img", :target => "_blank" %> diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 096e8371b..265952a84 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -31,7 +31,7 @@ <% end %> <% if @homework.anonymous_appeal == 1 %> <% if @homework.homework_detail_manual.comment_status == 4 && score.student_work.user == User.current && score.reviewer_role == 3 && score.appeal_status == 0 %> - 申诉 + + 申诉 <% elsif score.reviewer_role == 3 && score.appeal_status == 1 %> 申诉中 <% elsif score.reviewer_role == 3 && score.appeal_status == 2 %> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 64b5e823d..4eecb92e1 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -32,18 +32,16 @@ <%= @homework.name %>

      <%= link_to '返回', homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type), :class => 'fr font-12 mr15 mt3 color-grey' %> - <% if @homework.homework_type == 4 && @is_teacher && @homework.homework_commons_shixuns && @homework.homework_commons_shixuns.shixun %> - <%= link_to '查看实训', shixun_path(@homework.homework_commons_shixuns.shixun), :target => "_blank", :class => 'fr font-12 mr15 mt3 color-orange03' %> - <% end %> +
        -
      • +
      • 作品列表
      • -
      • +
      • 作业问答
      • <% if @homework.homework_type!= 4 && (@is_teacher || (@homework.answer_public && @homework.homework_detail_manual.comment_status > 2)) %> @@ -58,45 +56,50 @@ <% if @is_teacher %>
        - -
          - <% if @homework.homework_type != 4 %> + <% if @homework.homework_type == 4 && @is_teacher && @homework.homework_commons_shixuns && @homework.homework_commons_shixuns.shixun %> + <%= link_to '查看实训', shixun_path(@homework.homework_commons_shixuns.shixun), :target => "_blank", :class => 'fr mt5 mr5 white-btn orange-btn' %> + <% end %> + <%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mt5 mr10 white-btn orange-btn', :id => "export_student_work"%> + + + - - - <% if @homework.homework_type == 4 %> + <%# end %> + <!–
        • –> + <!–<%#= link_to "设置", setting_homework_common_path(@homework) %>–> + <!–
        • –> + <%# if @homework.homework_type == 4 %>
        • - <%= link_to '进入实训', shixun_path(@homework.homework_commons_shixuns.shixun), :target => "_blank" %> + <%#= link_to '进入实训', shixun_path(@homework.homework_commons_shixuns.shixun), :target => "_blank" %>
        • - <% end %> - <% unless @homework.is_public %> -
        • - 设为公开 + <%# end %> + <%# unless @homework.is_public %> +
        • + 设为公开
        • - <% end %> - <% if (User.current.teacher_of_course(@homework.course) || @homework.user == User.current) && User.current.homework_banks.where(:homework_common_id => @homework.id).empty? %> -
        • - <%= link_to "加入题库", add_to_homework_bank_homework_common_path(@homework, :type => 1), :remote => true %> + <%# end %> + <%# if (User.current.teacher_of_course(@homework.course) || @homework.user == User.current) && User.current.homework_banks.where(:homework_common_id => @homework.id).empty? %> +
        • + <%#= link_to "加入题库", add_to_homework_bank_homework_common_path(@homework, :type => 1), :remote => true %>
        • - <% end %> - <% if @homework.user == User.current %> - <% if @homework.is_update && !User.current.homework_banks.where(:homework_common_id => @homework.id).blank? %> -
        • - <%= link_to "同步到题库", add_to_homework_bank_homework_common_path(@homework, :type => 2), :remote => true %> + <%# end %> + <%# if @homework.user == User.current %> + <%# if @homework.is_update && !User.current.homework_banks.where(:homework_common_id => @homework.id).blank? %> +
        • + <%#= link_to "同步到题库", add_to_homework_bank_homework_common_path(@homework, :type => 2), :remote => true %>
        • -
        • - <%= link_to "另存到题库", add_to_homework_bank_homework_common_path(@homework, :type => 3), :remote => true %> +
        • + <%#= link_to "另存到题库", add_to_homework_bank_homework_common_path(@homework, :type => 3), :remote => true %>
        • - <% end %> - <% end %> + <%# end %> + <%# end %>
        • - 删除 + 删除
        • -
        +
      -->
      <% else %> <%= user_work_status @homework %> @@ -107,7 +110,7 @@ <% end %>
      -
      +
      @@ -200,7 +203,7 @@ <%= render :partial => 'student_work_replies' %>
      -
      +
      <% if @is_teacher %> @@ -210,7 +213,7 @@
    • <% if @is_teacher %>
      - <%= link_to "导出成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :group => @group, :comment => @comment, :status => @status, :format => 'xls'),:class=>'fl mt8 mr5 white-btn orange-btn', :id => "export_student_work"%> + <% if @homework.homework_type == 1 || @homework.homework_type == 3 %> <% if @stundet_works.empty?%> <%= link_to "导出作品附件", "javascript:void(0)", class: "fl mt8 mr5 white-btn orange-btn", :onclick => "notice_box('该检索条件下没有作品,无法下载附件')" %> @@ -224,9 +227,10 @@
      - + × +
      - +
    • diff --git a/app/views/student_work/show.html.erb b/app/views/student_work/show.html.erb index b5e9958a7..90ca59999 100644 --- a/app/views/student_work/show.html.erb +++ b/app/views/student_work/show.html.erb @@ -3,7 +3,7 @@

      <%= @course.name %> > <%= @homework.homework_type_ch %>作业 > <%#= link_to get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1, student_work_index_path(:homework => @homework.id) %> - #<%= get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1 %> + #<%= get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1 %> > <% if @is_teacher || @work.user == User.current || (@homework.homework_detail_manual.comment_status != 3 && @homework.homework_detail_manual.comment_status != 4) %> <%= link_to @work.user.try(:show_real_name), user_path(@work.user) %> <% else %> diff --git a/app/views/subjects/show.html.erb b/app/views/subjects/show.html.erb index 6a4adae39..10208015c 100644 --- a/app/views/subjects/show.html.erb +++ b/app/views/subjects/show.html.erb @@ -8,8 +8,8 @@ <% end %>

      -
      -
      <%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %>
      +
      +
      <%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %>
      <% end %> @@ -142,7 +142,7 @@ <% end %>

      -
      <%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %>
      +
      <%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %>

      教学团队 diff --git a/app/views/users/_comment_reply_detail.html.erb b/app/views/users/_comment_reply_detail.html.erb index 50c7d7a4e..898058197 100644 --- a/app/views/users/_comment_reply_detail.html.erb +++ b/app/views/users/_comment_reply_detail.html.erb @@ -1,5 +1,5 @@

      -<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %> +<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33",:class => "bor-radius-all"), user_path(comment.creator_user), :alt => "用户头像" %>
      - - <%= link_to image_tag(url_to_avatar(statistics.owner), :width => "36", :height => "36", :alt => "头像"), user_path(statistics.owner), :target => '_blank', :class => "", :style => "border-radius:18px;"%> + + <%= link_to image_tag(url_to_avatar(statistics.owner), :width => "36", :height => "36", :alt => "头像", :style => "border-radius:18px;margin:15px 0 0 10px;"), user_path(statistics.owner), :target => '_blank', :class => ""%> - <%= link_to statistics.owner.try(:show_name), user_path(statistics.owner), :class => "panel-table-name hide fl color-grey" %> + + <%= link_to statistics.owner.try(:show_name), user_path(statistics.owner), :class => "panel-table-name hide fl color-black" %> <%= format_time(statistics.created_at) %> 开启 -
      +
      +
      - 挑战至第<%= statistics.current_stage %>关/共<%= statistics.games.count %>关 + + 挑战至第<%= statistics.current_stage %>关/共<%= statistics.games.count %>关 +
      - <% if statistics.total_score == 0 %> + <% if statistics.total_score == 0 || statistics.total_score.nil? %> -- <% else %> - + <%= statistics.total_score %> 经验值 + + <%= statistics.total_score.to_i %> 经验值 <% end %>