From 9a4741298f5844e81bfdb9ee381ef150d428c859 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 7 Sep 2017 16:11:12 +0800 Subject: [PATCH 01/79] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=8D=95=E4=B8=AA?= =?UTF-8?q?=E5=85=B3=E5=8D=A1=E6=B7=BB=E5=8A=A0=E8=83=8C=E6=99=AF=E7=9F=A5?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/edit.html.erb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/challenges/edit.html.erb b/app/views/challenges/edit.html.erb index 820019f86..5d6d37701 100644 --- a/app/views/challenges/edit.html.erb +++ b/app/views/challenges/edit.html.erb @@ -56,9 +56,11 @@
  • "> 参考答案
  • - + <% unless @challenge.ready_knowledge.blank? %> +
  • "> + 背景知识 +
  • + <% end %>
  • "> 评分设置
  • @@ -77,8 +79,8 @@ <%= render :partial => "edit_scoring" %> <% elsif @tab == 5 %> <%= render :partial => "edit_skill" %> - <%# elsif @tab == 6 %> - <%#= render :partial => "edit_propaedeutics" %> + <% elsif @tab == 6 %> + <%= render :partial => "edit_propaedeutics" %> <% end %> From 9599ccd152502a58c893ca97c120247c8a809931 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 15 Sep 2017 11:02:19 +0800 Subject: [PATCH 02/79] =?UTF-8?q?=E5=AF=BC=E5=87=BAexcel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 13 +++++++++---- app/views/managements/classroom_classment.html.erb | 3 ++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index f291c7d5c..65bea6d02 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -666,8 +666,10 @@ end end @search = params[:search] # 搜索字 @keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索 - status = params[:status].to_i - courselist = params[:course_list] + @status = params[:status].to_i + @school = params[:school_id] + @homework_show = params[:homepage_show] + @courselist = params[:course_list] if params[:school_id] && params[:school_id] != '' @school_id = params[:school_id] @@ -679,11 +681,11 @@ end end if params[:course_list] && params[:course_list] != '' - @courses = @courses.where(:course_list_id => courselist) + @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) end if "u_name" == @keyword if @search.blank? @@ -705,6 +707,9 @@ end respond_to do |format| format.js format.html + format.xls { + + } end end diff --git a/app/views/managements/classroom_classment.html.erb b/app/views/managements/classroom_classment.html.erb index 764f8f7ac..f5b91ba4e 100644 --- a/app/views/managements/classroom_classment.html.erb +++ b/app/views/managements/classroom_classment.html.erb @@ -31,7 +31,8 @@ <% end %> - <%#= link_to "导出Excel", export_excel_managements_path(:format => "xls"), :class => "task-btn task-btn-blue ml5 mt3 fr mb5 mr30" %> + + <%= link_to "导出Excel", classroom_classment_managements_path(:school_id => @school, :search => @search, :homepage_show => @homepage_show, :course_list => @course_list, :format => "xls"), :class => "task-btn task-btn-blue ml5 mt3 fr mb5 mr30" %> <% end %>
    From 55dd9d833eed29feb6a30383c349b96b793f1414 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 22 Sep 2017 23:23:10 +0800 Subject: [PATCH 03/79] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=90=88=E4=BD=9C?= =?UTF-8?q?=E8=80=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixuns/_add_collaborators_list.html.erb | 16 ++++++++++++++++ app/views/shixuns/add_collaborators.js.erb | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 app/views/shixuns/_add_collaborators_list.html.erb 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..d50ea2a2a --- /dev/null +++ b/app/views/shixuns/_add_collaborators_list.html.erb @@ -0,0 +1,16 @@ +<% 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/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); From 5af447875e1140f4ca8164b24f247479f58df515 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Sun, 24 Sep 2017 10:34:48 +0800 Subject: [PATCH 04/79] =?UTF-8?q?ajax=E5=8A=A0=E8=BD=BD=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/edu-common.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index e79899e4b..9d0f98b32 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -314,7 +314,7 @@ table.table-pa5 th,table.table-pa5 td{ padding:0 5px;} font-weight:bold; text-align:center; padding:0.6em; - z-index:100; + z-index:100000; opacity: 0.5; } From 539902fa7926aa0299bc8a0bd027d1ab5a4f2ce4 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 25 Sep 2017 08:56:51 +0800 Subject: [PATCH 05/79] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=AF=BC=E5=87=BAEXCEL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 5 +- app/controllers/managements_controller.rb | 64 +++++++++++++---------- 2 files changed, 38 insertions(+), 31 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 887b24d06..ed81fd98a 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" 参与的 创建的 所有的课程 # diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 32010e53f..b506f4f08 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -764,36 +764,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 +805,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 +815,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 @@ -1509,28 +1514,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 From 1ceca30356279794ef8449871298f269f2b2c69c Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Mon, 25 Sep 2017 09:01:38 +0800 Subject: [PATCH 06/79] issue --- app/views/managements/update_user.html.erb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/views/managements/update_user.html.erb b/app/views/managements/update_user.html.erb index 0b5540fd6..95c81a191 100644 --- a/app/views/managements/update_user.html.erb +++ b/app/views/managements/update_user.html.erb @@ -662,7 +662,5 @@ return ; } }); - - }); \ No newline at end of file From 80ee1896802977b73005e4859ab592a805fc4442 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 25 Sep 2017 09:17:45 +0800 Subject: [PATCH 07/79] =?UTF-8?q?TPM=E5=AD=A6=E5=91=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_statistics_student_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index 02340d7f0..139a9b83e 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -33,10 +33,10 @@ - <% if statistics.total_score == 0 %> + <% if statistics.total_score.to_i == 0 %> -- <% else %> - + <%= statistics.total_score %> 经验值 + + <%= statistics.total_score.to_i %> 经验值 <% end %> From 342dcb03b1ac5db8eb7e4abc8b6b2bbb0697d717 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 25 Sep 2017 09:28:28 +0800 Subject: [PATCH 08/79] =?UTF-8?q?=E5=AD=A6=E9=99=A2=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/shixuns/_statistics_student_list.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index 139a9b83e..ec30578db 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -33,10 +33,10 @@ - <% if statistics.total_score.to_i == 0 %> + <% if statistics.total_score == 0 || statistics.total_score.nil? %> -- <% else %> - + <%= statistics.total_score.to_i %> 经验值 + + <%= statistics.total_score.to_i %> 经验值 <% end %> From b7ce7e214e001f7f34de7448aa09aeee1799484e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 25 Sep 2017 09:34:45 +0800 Subject: [PATCH 09/79] =?UTF-8?q?=E5=AD=A6=E5=91=98=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/myshixun.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 5f185c0cd76a3fe43ed5f57a691ca971c8d22400 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Sep 2017 10:40:34 +0800 Subject: [PATCH 10/79] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E7=9A=84=E2=80=9C=E6=8C=82=E8=B5=B7=E2=80=9D=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=9C=AA=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 8 ++++---- app/views/homework_common/_homework_index_tab.html.erb | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e13cf05b8..1d2d2cb00 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -503,7 +503,7 @@ module ApplicationHelper def new_homework_common_status status case status when 0 - "挂起" + "未发布" when 1 "提交中" when 2 @@ -523,7 +523,7 @@ module ApplicationHelper def homework_status_color status style = "" case status - when '挂起' + when '未发布' style = 'edu-filter-btn-yellow' when '提交中' style = 'edu-filter-btn-blue' @@ -571,7 +571,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 = "提交中" @@ -4775,7 +4775,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 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">匿评中 From 7c024985bf37c4f7b3a1bd313c2bafe0b5fc77b2 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Mon, 25 Sep 2017 11:16:16 +0800 Subject: [PATCH 11/79] =?UTF-8?q?=E5=8D=95=E9=80=89=E5=A4=9A=E9=80=89?= =?UTF-8?q?=E9=A2=98=E7=AD=94=E9=A2=98=E6=A8=A1=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 16 ++--- app/controllers/shixuns_controller.rb | 4 +- app/views/games/_choice_question.html.erb | 2 +- app/views/games/_game_choose_results.html.erb | 8 ++- app/views/games/_pass_game_show.html.erb | 60 +++++-------------- public/stylesheets/css/edu-popup.css | 6 +- 6 files changed, 36 insertions(+), 60 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 69194f1f8..72d476c49 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -316,9 +316,8 @@ 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) if @shixun.status > 1 && !@game.answer_open if correct score += choose.score @@ -332,12 +331,13 @@ 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)} end diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index d11285bc7..170349350 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -254,9 +254,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 diff --git a/app/views/games/_choice_question.html.erb b/app/views/games/_choice_question.html.erb index 8330ad846..486fa2317 100644 --- a/app/views/games/_choice_question.html.erb +++ b/app/views/games/_choice_question.html.erb @@ -31,7 +31,7 @@

    <% end %> - +
    <% end %> - <%= 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;padding-top:15px;"), 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" %> <%= format_time(statistics.created_at) %> 开启 - -
    + +
    diff --git a/app/views/users/user_fanslist.html.erb b/app/views/users/user_fanslist.html.erb index edc5bb134..45d3a81a4 100644 --- a/app/views/users/user_fanslist.html.erb +++ b/app/views/users/user_fanslist.html.erb @@ -13,7 +13,7 @@ <%= str %>的粉丝 <%= @user_fanlist_count %> -
    +
    <%= render :partial => "user_watcher_or_fans_list", :locals => {:users => @user_fanlist, :user_count => @user_fanlist_count, :user_pages => @fans_pages} %>
    diff --git a/app/views/users/user_watchlist.html.erb b/app/views/users/user_watchlist.html.erb index 26ddf5bab..64cfeecef 100644 --- a/app/views/users/user_watchlist.html.erb +++ b/app/views/users/user_watchlist.html.erb @@ -13,7 +13,7 @@ <%= str %>的粉丝 <%= @user_fanlist_count %> -
    +
    <%= render :partial => "user_watcher_or_fans_list", :locals => {:users => @user_watchlist, :user_count => @user_watchlist_count, :user_pages => @watchlist_pages} %>
    diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 9d0f98b32..be4283974 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -328,7 +328,7 @@ html>body #ajax-indicator { position: fixed; } background-image: url(/images/loading.gif); padding-left: 26px; vertical-align: bottom; - z-index:999; + z-index:100000; } From 71e7725e5c63b78b1361145010dee20a2bb4a14f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 08:40:27 +0800 Subject: [PATCH 15/79] =?UTF-8?q?=E8=B4=B4=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/debates.js.coffee | 3 + app/assets/stylesheets/debates.css.scss | 3 + app/controllers/debates_controller.rb | 2 + app/controllers/forums_controller.rb | 6 +- app/helpers/debates_helper.rb | 2 + app/views/forums/index.html.erb | 184 +++++++++++++++++---- app/views/layouts/_logined_header.html.erb | 1 + config/routes.rb | 4 + 8 files changed, 175 insertions(+), 30 deletions(-) create mode 100644 app/assets/javascripts/debates.js.coffee create mode 100644 app/assets/stylesheets/debates.css.scss create mode 100644 app/controllers/debates_controller.rb create mode 100644 app/helpers/debates_helper.rb 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/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..a8d3adb0a 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -121,6 +121,7 @@ class ForumsController < ApplicationController def index order = "" @order_str = "" + @user = User.current 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] @@ -148,10 +149,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 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/views/forums/index.html.erb b/app/views/forums/index.html.erb index 5b9f374f8..3c42ad24e 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -1,3 +1,128 @@ +
    +

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

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

    问吧

    + + 新话题 +
    +
    + +
    + +
    + 华沙沙 +

    + 五个值得推荐的英语学习网站,不可错过哦! +

    +

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    +

    + 10 + 10 + 10 + + 最后更新:2小时前 +

    + +
    +
    + +
    + +
    + 华沙沙 +

    + 五个值得推荐的英语学习网站,不可错过哦! +

    +

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    +

    + 10 + 10 + 10 + + 最后更新:2小时前 +

    + +
    +
    + +
    + +
    + 华沙沙 +

    + 五个值得推荐的英语学习网站,不可错过哦! +

    +

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    +

    + 10 + 10 + 10 + + 最后更新:2小时前 +

    + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    + +<% if false %> <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> <% end %> @@ -107,34 +232,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 +281,5 @@ memo_content.html('') $('#error').html('').hide(); } - \ 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..2085a3c5d 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" %>
  • +
  • <%= link_to "讨论", forums_path, :class => "new-nav-a font-16" %>
  • diff --git a/config/routes.rb b/config/routes.rb index 700d20d6a..403cf5eaa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -738,6 +738,10 @@ RedmineApp::Application.routes.draw do end end + resources :debates do + + end + resources :cooperation do collection do From 859bcd3c8e81be5286178d08b7eb8cf3dcbe0891 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 09:00:30 +0800 Subject: [PATCH 16/79] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E8=80=83=E7=AD=94=E6=A1=88=E9=9C=80=E8=A6=81=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E7=94=9F=E6=88=901=E4=B8=AA+=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A2=98=E6=B2=A1=E6=9C=89=E8=AF=84=E6=B5=8B=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E8=AF=84=E6=B5=8B=E7=BB=93=E6=9E=9C=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E8=AF=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 2 +- app/views/games/_game_choose_results.html.erb | 2 +- app/views/games/_game_show.html.erb | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 78d7dd120..885ff73d2 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -407,7 +407,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 diff --git a/app/views/games/_game_choose_results.html.erb b/app/views/games/_game_choose_results.html.erb index c1ea40b5d..fba69efed 100644 --- a/app/views/games/_game_choose_results.html.erb +++ b/app/views/games/_game_choose_results.html.erb @@ -41,7 +41,7 @@
      - <% if choose.choose_outputs.blank? %> + <% if choose.current_choose_outputs.blank? %>
    • 尚未提交,暂不支持查看
    • <% else %> <% if choose.current_choose_outputs.try(:answer) == choose.standard_answer || @game.status == 2 %> diff --git a/app/views/games/_game_show.html.erb b/app/views/games/_game_show.html.erb index c30f163b9..b4e5f660a 100644 --- a/app/views/games/_game_show.html.erb +++ b/app/views/games/_game_show.html.erb @@ -43,7 +43,6 @@ <% else %> 经验值:<%= @game_challenge.choose_score.to_i %> <% end %> -
    From e4f304d431e9b12015af43dde99df4368a2ddc09 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 10:06:31 +0800 Subject: [PATCH 17/79] =?UTF-8?q?=E9=97=AE=E5=90=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/index.html.erb | 70 +++++---------------------------- 1 file changed, 9 insertions(+), 61 deletions(-) diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 3c42ad24e..f8dfd5fd1 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -27,21 +27,21 @@ + 新话题
    - + <% @memos.each_with_index do |memo, index| %>
    - 华沙沙 + <%= User.find(memo.author_id).try(:show_name) %>

    - 五个值得推荐的英语学习网站,不可错过哦! + <%= memo.subject %>

    -

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    +

    <%= memo.content %>

    - 10 - 10 - 10 + <%= memo.viewed_count %> + <%= get_praise_num(memo) %> + <%= Memo.where(:root_id => memo.id).count %> - 最后更新:2小时前 + 最后更新:<%= time_from_now memo.updated_at %>

    @@ -53,59 +53,7 @@
    - -
    - -
    - 华沙沙 -

    - 五个值得推荐的英语学习网站,不可错过哦! -

    -

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    -

    - 10 - 10 - 10 - - 最后更新:2小时前 -

    - -
    -
    - -
    - -
    - 华沙沙 -

    - 五个值得推荐的英语学习网站,不可错过哦! -

    -

    1.练习口语 在线英语: http://dwz.cn/1XHGmL(免费在线口语课领取,外教一对一交流互动~) 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈

    -

    - 10 - 10 - 10 - - 最后更新:2小时前 -

    - - -
    -
    + <% end %>
    From 587e1ab5bfc6e1c77f82b52d137f46e22371a466 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 26 Sep 2017 10:06:57 +0800 Subject: [PATCH 18/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/css/edu-common.css | 5 +++-- public/stylesheets/css/edu-public.css | 13 +++++++++++++ public/stylesheets/css/taskstyle.css | 11 +++++++++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index e79899e4b..5c9c6d1ff 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -101,7 +101,7 @@ a:hover.link-color-grey03{color:#3498db!important;} /*通用内外边距*/ .mt-10{ margin-top:-10px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;}.mt95{ margin-top:95px;} .mb5{ margin-bottom: 5px;}.mb10{ margin-bottom: 10px;}.mb15{ margin-bottom: 15px;}.mb20{ margin-bottom: 20px;}.mb25{ margin-bottom: 25px;}.mb30{ margin-bottom: 30px;}.mb40{ margin-bottom: 40px;}.mb50{ margin-bottom: 50px;} -.ml-3{ margin-left: -3px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml50{ margin-left: 50px;}.ml75{ margin-left: 75px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml230{ margin-left: 230px;} +.ml-3{ margin-left: -3px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml50{ margin-left: 50px;}.ml75{ margin-left: 75px;}.ml80{ margin-left: 80px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml230{ margin-left: 230px;} .mr3{margin-right: 3px}.mr5{ margin-right: 5px;}.mr10{ margin-right: 10px;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr40{margin-right:40px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;} .pt5{ padding-top:5px;}.pt10{ padding-top:10px;}.pt15{ padding-top:15px;}.pt20{ padding-top:20px;}.pt30{ padding-top:30px;}.pt40{ padding-top:40px;} .pb5{ padding-bottom:5px;}.pb10{ padding-bottom:10px;}.pb15{ padding-bottom:15px;}.pb20{ padding-bottom:20px;}.pb30{ padding-bottom:30px;} @@ -133,6 +133,7 @@ a:hover.task-btn-green{background: #19b17e;} a.task-btn-orange{ background:#fc8675; color:#fff !important;} a:hover.task-btn-orange{ background:#fc8675;} a.task-btn-blue{background: #3498db; color:#fff!important;} +a.task-btn-orange{background: #FF7500; color:#fff!important;} a:hover.task-btn-blue{background: #5faee3;color:#fff;} a.task-btn-grey{background-color: #d4d6d8; color: #4d555d!important;} a:hover.task-btn-grey{background-color: #d4d6d8; color: #4d555d;} @@ -158,7 +159,7 @@ a:hover.task-btn-ver{background:#5f7cab;} .new_login_submit:hover{background: #19b17e;} a.task-btn-email{display: inline-block;font-weight: bold;border: none; width:185px;color: #666;background: #e1e1e1;letter-spacing: 1px;text-align: center;font-size: 14px;height: 40px;line-height: 40px;border-radius: 3px;} a:hover.task-btn-email {background: #c3c3c3; color: #666;} -.white-btn{cursor: pointer;display: inline-block;padding: 0 8px;border: 1px solid #ccc;color: #666;letter-spacing: 1px;font-size: 14px;height: 26px;line-height: 26px;border-radius: 3px;} +.white-btn{text-align:center;cursor: pointer;display: inline-block;padding: 0 8px;border: 1px solid #ccc;color: #666;letter-spacing: 1px;font-size: 14px;height: 26px;line-height: 26px;border-radius: 3px;} a.white-btn.green-btn{color:#29bd8b;border:1px solid #29bd8b; } a.white-btn.orange-btn{color: #FF7500;border: 1px solid #FF7500} a.white-btn.orange-btn:hover{color: #FFFFFF;border: 1px solid #FF7500;background: #ff7500} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index 31779d857..97b210868 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -381,3 +381,16 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;} /*-----课程名称下拉框--------*/ .course_list_ul{display: none;position: absolute;top:40px;left: -1px;width: 100% !important;border:1px solid #eeeeee;background: #FFFFFF;padding-bottom: 5px; max-height: 150px;z-index: 10} .course_list_ul li{height:20px;padding:5px 10px;clear:both;line-height:28px;margin-bottom: 0 !important;cursor: pointer;} + +/*-----试卷提交状态--------*/ +.post_status_btn{display: block;float: left;padding: 0px 5px;font-size: 12px;color: #FFFFFF;border-radius: 4px;height: 20px;line-height: 20px;;} +.post_btn_green{background: #29bd8b;border: 1px solid #29bd8b!important;color: #fff;} +.post_btn_green_q{background: #5ECFBA;border: 1px solid #5ECFBA!important;color: #fff;} +.post_btn_red{background: #ee4a1f;border: 1px solid #ee4a1f!important;color: #fff;} +.post_btn_grey{background: #e4e4e3;border: 1px solid #e4e4e3!important;} +.post_btn_white{background: #ffffff;} +/*评阅状态*/ +.checkstatus_box_small{width: 10px;height: 10px;display: block;float: left;margin-right: 3px;} +.checkstatus_box_big{cursor: default;width: 30px;height: 30px;line-height: 30px;text-align: center;margin-right: 10px;border:1px solid #CCCCCC;display: block;float: left;} +.checkstatus_box_big i{position: absolute;top:18px;left: 10px;} + diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index b7e252bd8..7f741358a 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -420,11 +420,18 @@ html>body #ajax-indicator-base { position: fixed; } /*二次回复的提示语的样式*/ .points-data-tip-top{position:absolute;left:100px;top:-30px;opacity:.7;width:150px;height:30px;z-index:9999;display:none;} -.data-tip-top{position:relative;box-shadow:0px 0px 8px #000;background:#000;color:#fff;word-wrap: break-word; +.data-tip-top{position:relative;box-shadow:0px 0px 8px #000;backgund:#000;color:#fff;word-wrap: break-word; text-align:center;border-radius:4px;padding:0 10px;border:1px solid #000;} .data-tip-top:after,.data-tip-top:before{position: absolute;content:'';width:0;height:0;left: 45%;bottom:-10px;border-left: 5px solid transparent; border-right: 5px solid transparent;border-top: 10px solid #000;} .data-tip-top:before{bottom:-11px;} /*选择题tab切换*/ .nav_option li{overflow: hidden;width: 110px; text-align: center;cursor: pointer;height: 38px;line-height: 38px;border-top-right-radius: 5px;border-top-left-radius: 5px;border:1px solid #e2e2e2;border-bottom: 0px;color: #FF7500;border-right: none;} -.nav_option li:last-child{border-right: 1px solid #e2e2e2;} \ No newline at end of file +.nav_option li:last-child{border-right: 1px solid #e2e2e2;} + + +/*---------------------试卷----------------------*/ +.question_item_con{font-weight: normal!important;border:1px solid #EEEEEE!important;color: #333!important;background: #FFFFff!important;position: relative} +.exam_operator{cursor: pointer;position: absolute;right: 15px;top: 11px;} +.question_item_con .write_answer{border:1px solid #EEEEEE;background:#EFF9FD;padding: 10px 15px;text-align:justify;} +.add_item_part{width: auto;padding: 2px 20px;border: 1px solid #CCCCCC;border-radius: 3px;margin-left: 15px;cursor: pointer;} \ No newline at end of file From b47bd5c1bc4d5bd0bebb0487ff0c2a22afc2617d Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 26 Sep 2017 10:40:04 +0800 Subject: [PATCH 19/79] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/examination_setting.html | 392 ++++++++++++++++++ app/views/exercise/student_look_fortime.html | 179 ++++++++ app/views/exercise/student_write_answer.html | 124 ++++++ app/views/exercise/teacher_check_exam.html | 166 ++++++++ app/views/exercise/teacher_edit_exam.html | 163 ++++++++ app/views/exercise/teacher_score_list.html | 229 ++++++++++ .../exercise/teacher_send_examination.html | 358 ++++++++++++++++ 7 files changed, 1611 insertions(+) create mode 100644 app/views/exercise/examination_setting.html create mode 100644 app/views/exercise/student_look_fortime.html create mode 100644 app/views/exercise/student_write_answer.html create mode 100644 app/views/exercise/teacher_check_exam.html create mode 100644 app/views/exercise/teacher_edit_exam.html create mode 100644 app/views/exercise/teacher_score_list.html create mode 100644 app/views/exercise/teacher_send_examination.html 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_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  + +
    +
    +
    +
    + + + From 39c4213bbe5285808c067ad495fd6564b20a5fbd Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 26 Sep 2017 11:10:09 +0800 Subject: [PATCH 20/79] =?UTF-8?q?=E5=AE=9E=E8=AE=ADtpi=E4=B8=AD=E9=A2=84?= =?UTF-8?q?=E6=9C=9F=E8=BE=93=E5=87=BA=E7=9A=84=E7=AD=94=E6=A1=88=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E4=BB=8E=E5=86=92=E5=8F=B7=E5=90=8E=E5=BC=80=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exercise/teacher_examination_list.html | 315 ++++++++++++++++++ public/javascripts/edu/edu_tpi.js | 6 +- 2 files changed, 318 insertions(+), 3 deletions(-) create mode 100644 app/views/exercise/teacher_examination_list.html diff --git a/app/views/exercise/teacher_examination_list.html b/app/views/exercise/teacher_examination_list.html new file mode 100644 index 000000000..2d00dd18d --- /dev/null +++ b/app/views/exercise/teacher_examination_list.html @@ -0,0 +1,315 @@ + + + + + + + + + + + + + + + +
    +
    +
    +

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

    +
    +
      +
    • + + 计算概论-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/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 24ec6f918..6cb6b9431 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -439,19 +439,19 @@ function code_evaluation(test_sets, "
  • " + "
    " + "测试输入:" + - "

    " + ( test_sets[i].input == null ? "空" : test_sets[i].input.replace(/\r\n/g, "
    ") ) + "

    " + + "

    " + ( test_sets[i].input == null ? "空" : test_sets[i].input.replace(/\r\n/g, "
    ") ) + "

    " + "
    " + "
  • " + "
  • " + "
    " + " 预期输出:" + - "

    " + ( test_sets[i].output == null ? "空" : match_specific_symbol(test_sets[i].output)) + "

    " + + "

    " + ( test_sets[i].output == null ? "空" : match_specific_symbol(test_sets[i].output)) + "

    " + "
    " + "
  • " + "
  • " + "
    " + "实际输出:" + - "

    " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? match_specific_symbol(test_sets[i].actual_output) : test_sets[i].actual_output.replace(/\r\n/g, "
    "))) + "

    " + + "

    " + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? match_specific_symbol(test_sets[i].actual_output) : test_sets[i].actual_output.replace(/\r\n/g, "
    "))) + "

    " + "
    " + "
  • " + "" + From 016741ed3590c8edc68f470bd15dc1fdf42f63f3 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 26 Sep 2017 14:31:04 +0800 Subject: [PATCH 21/79] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E7=9A=84=E5=AE=9E=E8=AE=AD=E4=BD=9C=E4=B8=9A=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 92 ++++++++++++++++++++++++ app/views/homework_common/index.html.erb | 3 + config/routes.rb | 1 + 3 files changed, 96 insertions(+) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index ed81fd98a..e8fc3956c 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -104,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) @@ -1989,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) + outputs.order("created_at asc").each_with_index do |output, k| + count_test = count_test + 1 + sheet[current_row,10] = "第#{k+1}次评测" + sheet[current_row,11] = k == 0 ? 0 : (output.created_at - outputs[k-1].created_at).to_i + count_time += count_time + (k == 0 ? 0 : (output.created_at - outputs[k-1].created_at).to_i) + sheet[current_row,12] = output.result.nil? ? "--" : (output.result ? "成功" : "失败") + 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] = count_time + 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/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/config/routes.rb b/config/routes.rb index 700d20d6a..0e6481557 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1767,6 +1767,7 @@ RedmineApp::Application.routes.draw do post 'choose_course_group' match 'update_position', :via => [:get, :post] post 'delete_course_students' + get 'shixun_statistics' end collection do match 'join_private_courses', :via => [:get, :post] From ae2be013275205c3cf6d8b03fe4242c39e6f69f1 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Tue, 26 Sep 2017 14:45:19 +0800 Subject: [PATCH 22/79] =?UTF-8?q?=E8=AF=BE=E5=A0=82=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=B7=A6tab=E7=9A=84tip=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/settings.html.erb | 12 ++++++++++++ .../courses/settings/_all_student_list.html.erb | 12 +++++++++++- .../courses/settings/_all_teacher_list_ul.erb | 15 ++++++++++++--- .../settings/_has_group_student_list.html.erb | 16 +++++++++++++--- .../settings/_no_group_student_list.html.erb | 13 ++++++++++++- app/views/layouts/_group_children_list.html.erb | 12 +++++++++++- app/views/student_work/show.html.erb | 2 +- 7 files changed, 72 insertions(+), 10 deletions(-) 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/_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_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/_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/layouts/_group_children_list.html.erb b/app/views/layouts/_group_children_list.html.erb index 486e0aa76..75a026afe 100644 --- a/app/views/layouts/_group_children_list.html.erb +++ b/app/views/layouts/_group_children_list.html.erb @@ -18,4 +18,14 @@ <% end %> -<% end %> \ No newline at end of file +<% end %> + + \ No newline at end of file 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 %> From a1a045b135ece6674e25da4000647c7ce1ad4a57 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 15:03:28 +0800 Subject: [PATCH 23/79] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E7=BB=93?= =?UTF-8?q?=E6=9E=84=E6=9B=B4=E6=94=B9=EF=BC=8C=E4=BF=9D=E7=95=99=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=A4=9A=E6=AC=A1=E8=AF=84=E6=B5=8B=E7=9A=84=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/games_controller.rb | 5 +++-- app/controllers/myshixuns_controller.rb | 2 -- app/helpers/application_helper.rb | 2 +- app/models/challenge_choose.rb | 1 + app/models/game.rb | 14 ++++++++++++++ app/models/output.rb | 2 +- app/views/games/_choice_question.html.erb | 9 +++++---- app/views/games/_game_choose_results.html.erb | 17 +++++++++-------- 8 files changed, 34 insertions(+), 18 deletions(-) diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 885ff73d2..23d8a220a 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -316,8 +316,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 - 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) + #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 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/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d2d2cb00..d8e58790d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -830,7 +830,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" diff --git a/app/models/challenge_choose.rb b/app/models/challenge_choose.rb index c14a0c02d..9ea356870 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..62f0c24ad 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 + self.challenge.challenge_chooses.each do |choose| + outputs = Output.where(:game_id => self.id, :test_set_position => choose.position).first + if outputs.nil? + num = nil + else + num += (outputs.result ? 1 : 0) + end + end + return num + end + end diff --git a/app/models/output.rb b/app/models/output.rb index 4ce462eff..fe82c2a07 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/views/games/_choice_question.html.erb b/app/views/games/_choice_question.html.erb index 486fa2317..2255f8cad 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 %> -
    -
    -
    -

    发布设置

    - 编辑 -
    -
    -
    -
      -
    • - - - -
    • -
    • - - -
      -
    • -
    • - - - -
    • -
    -
    -
    -
    -
    -
    -

    发布设置

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

    答题设置

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

    答题设置

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

    主观题评分设置

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

    主观题评分设置

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

    公开设置

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

    公开设置

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

    - - 班级首页 > 试卷列表> #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 deleted file mode 100644 index 2f4822b59..000000000 --- a/app/views/exercise/student_write_answer.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    -
    -
    -

    - - 班级首页 > 试卷列表> #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 deleted file mode 100644 index c5f04c08a..000000000 --- a/app/views/exercise/teacher_check_exam.html +++ /dev/null @@ -1,166 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    -
    -
    -

    - - 班级首页 > 试卷列表> #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 deleted file mode 100644 index 5d6d59945..000000000 --- a/app/views/exercise/teacher_edit_exam.html +++ /dev/null @@ -1,163 +0,0 @@ - - - - - - - - - - - - - - - - - - -
    -
    -
    -

    - - 班级首页 > 试卷列表> #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 deleted file mode 100644 index 2d00dd18d..000000000 --- a/app/views/exercise/teacher_examination_list.html +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - - - - - - - - - -
    -
    -
    -

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

    -
    -
      -
    • - - 计算概论-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 deleted file mode 100644 index d306ecdb0..000000000 --- a/app/views/exercise/teacher_score_list.html +++ /dev/null @@ -1,229 +0,0 @@ - - - - - - - - - - - - - - - - - -
    -
    -
    -

    - - 班级首页 > 试卷列表> #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 deleted file mode 100644 index e75a489d8..000000000 --- a/app/views/exercise/teacher_send_examination.html +++ /dev/null @@ -1,358 +0,0 @@ - - - - - - - - - - - - - - - - -
    -
    -
    -

    - - 班级首页 > 试卷 -

    -
    -

    新建试卷

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

    单选题

    - -
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - -
  • -
  • - - -

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

    -
  • -
    - - -
    -
    -

    多选题

    - -
    -
  • - - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - -
  • -
  • - - -

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

    -
  • -
    - - -
    -

    填空题

    -
  • - - -
  • -
  • - - - -
  • -
  • - - - -
  • -
  • - - -
  • -
  • - - -

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

    -
  • -
    - -
    -

    简答题

    -
  • - - -
  • -
  • - - -
  • -
  • - - -

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

    -
  • -
    - -
    -

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

    - - 合计 10 题,共 100  - -
    -
    -
    -
    - - - diff --git a/app/views/layouts/_group_children_list.html.erb b/app/views/layouts/_group_children_list.html.erb index 486e0aa76..48b960f73 100644 --- a/app/views/layouts/_group_children_list.html.erb +++ b/app/views/layouts/_group_children_list.html.erb @@ -13,8 +13,8 @@ <% @course.course_groups.each do |group| %>
  • <% count = group.members.count %> - <%=group.name %> - <%= count %> + <%=group.name %> + <%= count %>
  • <% end %> diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 6cb6b9431..75776911d 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -523,7 +523,7 @@ function code_evaluation(test_sets, "" + "
  • " + "金币:" + - "= 0 ? "color-light-green" : "-text-danger") + "\"" +"id=\"grade_value\"> " + (gold >= 0 ? ("+" + gold) : gold) + "" + + "= 0 ? "color-light-green" : "-text-danger") + "\"" +"id=\"grade_value\">" + (gold >= 0 ? ("+ " + gold) : gold) + "" + "
  • " + "" + "" + diff --git a/public/stylesheets/css/edu-class.css b/public/stylesheets/css/edu-class.css index b4ab73fce..2cb9345a0 100644 --- a/public/stylesheets/css/edu-class.css +++ b/public/stylesheets/css/edu-class.css @@ -192,7 +192,7 @@ em{font-style:normal;} .stud-class-set .news .container .member .people .left li .p1{position:relative;} .stud-class-set .news .container .member .people .left li .p1 span{max-width:115px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display:inline-block;float:left} .edu-break-out{max-width:115px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display:inline-block;float:left} -.edu-break-outshort{max-width:105px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display:inline-block;float:left} +.edu-break-outshort{width:96px;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;display:inline-block;float:left} .stud-class-set .news .container .member .people .left li .p1 em{margin-left:10px;font-size:12px;background:#e9e9e9;border-radius:8px;padding:2px 5px;} .stud-class-set .news .container .member .people .left li .p1 i{color:#ddd;cursor: pointer;position:absolute;right:10px;top:17px;} .stud-class-set .news .container .member .people .left li .p1 i:hover{color:#FF7500;} diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index 424210682..0c321167d 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -99,7 +99,7 @@ a:hover.link-color-grey03{color:#3498db!important;} .font-28{ font-size: 28px!important;} .font-30{ font-size: 30px!important;} /*通用内外边距*/ -.mt-10{ margin-top:-10px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;}.mt95{ margin-top:95px;} +.mt-10{ margin-top:-10px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;}.mt95{ margin-top:95px;}.mt100{ margin-top:100px;} .mb5{ margin-bottom: 5px;}.mb10{ margin-bottom: 10px;}.mb15{ margin-bottom: 15px;}.mb20{ margin-bottom: 20px;}.mb25{ margin-bottom: 25px;}.mb30{ margin-bottom: 30px;}.mb40{ margin-bottom: 40px;}.mb50{ margin-bottom: 50px;} .ml-3{ margin-left: -3px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml15{ margin-left: 15px;}.ml18{ margin-left: 18px;}.ml20{ margin-left: 20px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml50{ margin-left: 50px;}.ml75{ margin-left: 75px;}.ml80{ margin-left: 80px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml230{ margin-left: 230px;} .mr3{margin-right: 3px}.mr5{ margin-right: 5px;}.mr10{ margin-right: 10px;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr40{margin-right:40px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;} From 3ec5a7991f90eb20e495e4c022cf779c4d9048a7 Mon Sep 17 00:00:00 2001 From: huang Date: Tue, 26 Sep 2017 15:47:31 +0800 Subject: [PATCH 26/79] =?UTF-8?q?=E5=B7=B2=E5=8F=91=E5=B8=83=E7=9A=84?= =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E5=A6=82=E6=9E=9C=E4=BF=AE=E6=94=B9=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E7=9A=84=E2=80=9C=E6=8A=80=E6=9C=AF=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E2=80=9D=E4=B8=8D=E8=A7=A6=E5=8F=91=E5=BC=BA=E5=88=B6=E9=87=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 799dac04f..3dd01f27c 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -721,7 +721,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 From bf634b56e12ae51915bd8c3d731f53d41fa36698 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 26 Sep 2017 15:53:17 +0800 Subject: [PATCH 27/79] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index c02e62fdf..9eef2c48f 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -2054,7 +2054,7 @@ class CoursesController < ApplicationController 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) + 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 @@ -2071,7 +2071,7 @@ class CoursesController < ApplicationController 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.to_i) + 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 From 6e27beea0823e5fa5ebed717e09dd388efb35360 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 16:14:14 +0800 Subject: [PATCH 28/79] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 2 ++ app/models/game.rb | 12 ++++++------ .../_single_or_multiple_question_show.html.erb | 6 ++++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index aef0170ff..8c1821434 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -157,6 +157,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| diff --git a/app/models/game.rb b/app/models/game.rb index 62f0c24ad..e278690c4 100644 --- a/app/models/game.rb +++ b/app/models/game.rb @@ -69,12 +69,12 @@ class Game < ActiveRecord::Base def choose_correct_num num = 0 - self.challenge.challenge_chooses.each do |choose| - outputs = Output.where(:game_id => self.id, :test_set_position => choose.position).first - if outputs.nil? - num = nil - else - num += (outputs.result ? 1 : 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 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..2db97aac5 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,10 @@
  • - 编辑 - 删除 + <% if @shixun.status == 0 && User.current.manager_of_shixun?(@shixun) %> + 编辑 + 删除 + <% end %>
  • From 82c5ee1a90e2c24ab41bc77f0d4d2d588c7bb669 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Tue, 26 Sep 2017 16:41:31 +0800 Subject: [PATCH 29/79] =?UTF-8?q?=E6=9C=AA=E7=AD=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/exercise/examination_setting.html | 392 ++++++++++++++++++ app/views/exercise/student_look_fortime.html | 179 ++++++++ app/views/exercise/student_write_answer.html | 124 ++++++ app/views/exercise/teacher_check_exam.html | 166 ++++++++ app/views/exercise/teacher_edit_exam.html | 163 ++++++++ .../exercise/teacher_examination_list.html | 316 ++++++++++++++ app/views/exercise/teacher_score_list.html | 229 ++++++++++ .../exercise/teacher_send_examination.html | 358 ++++++++++++++++ public/stylesheets/css/edu-public.css | 1 + 9 files changed, 1928 insertions(+) create mode 100644 app/views/exercise/examination_setting.html create mode 100644 app/views/exercise/student_look_fortime.html create mode 100644 app/views/exercise/student_write_answer.html create mode 100644 app/views/exercise/teacher_check_exam.html create mode 100644 app/views/exercise/teacher_edit_exam.html create mode 100644 app/views/exercise/teacher_examination_list.html create mode 100644 app/views/exercise/teacher_score_list.html create mode 100644 app/views/exercise/teacher_send_examination.html 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/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index a7851ab08..dda1482b1 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -386,6 +386,7 @@ input::-ms-input-placeholder,textarea::-ms-input-placeholder {color:#cccccc;} .post_status_btn{display: block;float: left;padding: 0px 5px;font-size: 12px;color: #FFFFFF;border-radius: 4px;height: 20px;line-height: 20px;;} .post_btn_green{background: #29bd8b;border: 1px solid #29bd8b!important;color: #fff;} .post_btn_green_q{background: #5ECFBA;border: 1px solid #5ECFBA!important;color: #fff;} +.post_btn_orange{background: #FF7500;border: 1px solid #FF7500!important;color: #fff;} .post_btn_red{background: #ee4a1f;border: 1px solid #ee4a1f!important;color: #fff;} .post_btn_grey{background: #e4e4e3;border: 1px solid #e4e4e3!important;} .post_btn_white{background: #ffffff;} From 14c6ba0479a5b2166386ee869be735cd86b95496 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 18:31:15 +0800 Subject: [PATCH 30/79] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E7=BC=BA?= =?UTF-8?q?=E9=99=B7=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/_choose_type.html.erb | 6 ++++-- app/views/games/_game_choose_results.html.erb | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/challenges/_choose_type.html.erb b/app/views/challenges/_choose_type.html.erb index 1947a3760..c4a3ec190 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 %>
    diff --git a/app/views/games/_game_choose_results.html.erb b/app/views/games/_game_choose_results.html.erb index a3c086f0a..cb1908a7d 100644 --- a/app/views/games/_game_choose_results.html.erb +++ b/app/views/games/_game_choose_results.html.erb @@ -14,7 +14,7 @@ <% unless @game.choose_correct_num == nil %> <% if @game.choose_correct_num != game_challenge.challenge_chooses.count %>

    - <%= @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %>共有<%= game_challenge.challenge_chooses.count %>组测试集,其中有<%= game_challenge.challenge_chooses.count - @game.choose_correct_num %>组测试结果不匹配。详情如下: + <%= @game.choose_correct_num %>/<%= game_challenge.challenge_chooses.count %>共有<%= game_challenge.challenge_chooses.count %>题,其中有<%= game_challenge.challenge_chooses.count - @game.choose_correct_num %>题结果不匹配。详情如下:

    <% else %>

    From b520e61fc222e77168a4f63123e7d5575a06aa3d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 18:43:41 +0800 Subject: [PATCH 31/79] =?UTF-8?q?=E5=8D=95=E9=80=89=E9=A2=98=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/show.js.erb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/views/games/show.js.erb b/app/views/games/show.js.erb index 2edcea941..a378ea0dd 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(: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 %> From 6f9ad2bdab7f75744f5e6603c1d5744b79a9fc6e Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 26 Sep 2017 18:48:07 +0800 Subject: [PATCH 32/79] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/show.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/games/show.js.erb b/app/views/games/show.js.erb index a378ea0dd..25f057ced 100644 --- a/app/views/games/show.js.erb +++ b/app/views/games/show.js.erb @@ -3,7 +3,7 @@ <% 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(:partial => 'games/game_choose_results', :locals => { :game_challenge => @game_challenge}) %>"); + $("#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 %> From 82bb30622f5e73d7bc44f39aa2610ac7b82c46c6 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 27 Sep 2017 08:47:48 +0800 Subject: [PATCH 33/79] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 3 ++- app/models/challenge_choose.rb | 2 +- app/models/output.rb | 2 +- app/views/games/_game_choose_results.html.erb | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 8c1821434..8c0143c62 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -199,7 +199,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 diff --git a/app/models/challenge_choose.rb b/app/models/challenge_choose.rb index 9ea356870..38b7d8685 100644 --- a/app/models/challenge_choose.rb +++ b/app/models/challenge_choose.rb @@ -7,7 +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 + #has_many :outputs, :dependent => :destroy validates_presence_of :subject diff --git a/app/models/output.rb b/app/models/output.rb index fe82c2a07..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 + #belongs_to :challenge_choose end diff --git a/app/views/games/_game_choose_results.html.erb b/app/views/games/_game_choose_results.html.erb index cb1908a7d..f212f1f3f 100644 --- a/app/views/games/_game_choose_results.html.erb +++ b/app/views/games/_game_choose_results.html.erb @@ -31,7 +31,7 @@ <%# outputs = ChooseOutputs.where(:challenge_choose_id => choose.id).first %> <% if output.present? %> <%# if choose.choose_outputs.try(:answer) != choose.standard_answer %> - <% if output.try(:actual_output) == choose.standard_answer %> + <% if output.result %> <% else %> @@ -45,7 +45,7 @@ <% if output.try(:actual_output).blank? %>

  • 尚未提交,暂不支持查看
  • <% else %> - <% if output.try(:actual_output) == choose.standard_answer || @game.status == 2 %> + <% if output.result || @game.status == 2 %>
  • 正确选项:<%= choose.standard_answer %>
  • 你的选项:<%= output.try(:actual_output) %>
  • <% else %> From b7bddb17b865a3bac99ca194138a49816af10482 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Wed, 27 Sep 2017 09:19:34 +0800 Subject: [PATCH 34/79] =?UTF-8?q?=E5=AE=9E=E8=AE=AD=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E7=AE=80=E4=BB=8B=E5=92=8C=E5=AD=A6=E4=B9=A0=E9=A1=BB=E7=9F=A5?= =?UTF-8?q?=E9=83=A8=E5=88=86=E7=9A=84=E5=AD=97=E4=BD=93=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/subjects/show.html.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 %>

    教学团队 From 8a41a9aea18e5ce0fcb186d1ed0be938528a03f0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 27 Sep 2017 10:27:51 +0800 Subject: [PATCH 35/79] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E9=80=89=E6=8B=A9=E9=A2=98=E9=9C=80=E8=A6=81=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=85=B3=E5=8D=A1=EF=BC=8C=E5=88=A0=E9=99=A4=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E6=97=B6=EF=BC=8C=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/challenges_controller.rb | 2 ++ app/controllers/games_controller.rb | 14 ++++++++++---- app/views/challenges/_choose_type.html.erb | 2 -- .../_single_or_multiple_question_show.html.erb | 3 ++- app/views/challenges/_task_pass_form.html.erb | 6 ++++++ 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index 8c0143c62..c94759789 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 diff --git a/app/controllers/games_controller.rb b/app/controllers/games_controller.rb index 23d8a220a..cc68070d3 100644 --- a/app/controllers/games_controller.rb +++ b/app/controllers/games_controller.rb @@ -435,11 +435,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/views/challenges/_choose_type.html.erb b/app/views/challenges/_choose_type.html.erb index c4a3ec190..a47d921f9 100644 --- a/app/views/challenges/_choose_type.html.erb +++ b/app/views/challenges/_choose_type.html.erb @@ -81,8 +81,6 @@ } } - - $(".stage-part-2").find(".nav_option li").eq(length-1).after(html); $.ajax({ 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 2db97aac5..7a2503bb1 100644 --- a/app/views/challenges/_single_or_multiple_question_show.html.erb +++ b/app/views/challenges/_single_or_multiple_question_show.html.erb @@ -5,7 +5,8 @@

  • <% 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..092410974 100644 --- a/app/views/challenges/_task_pass_form.html.erb +++ b/app/views/challenges/_task_pass_form.html.erb @@ -46,6 +46,12 @@ \ No newline at end of file diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index 80937d522..70add291f 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -16,7 +16,7 @@ <% @statistics.each do |statistics| %> - <%= link_to image_tag(url_to_avatar(statistics.owner), :width => "36", :height => "36", :alt => "头像", :style => "border-radius:18px;padding-top:15px;"), user_path(statistics.owner), :target => '_blank', :class => ""%> + <%= link_to image_tag(url_to_avatar(statistics.owner), :width => "36", :height => "36", :alt => "头像", :style => "border-radius:18px;margin-top:15px;"), 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" %> diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index 20a16e4b3..f05828f40 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -38,6 +38,7 @@ $(function(){ "
    "+ "
    "+ "
    "+ + "
    "+ "
  • ").appendTo("body"); //Dom:绑定事件的节点对象,ChangeDOM:操作的相关节点, function LeaveTitle(Dom,ChangeDom){ @@ -48,9 +49,21 @@ $(function(){ }).hide(); }) } + LeaveTitle($("[data-tip-top]"),$(".data-tip-top")); LeaveTitle($("[data-tip-down]"),$(".data-tip-down")); LeaveTitle($("[data-tip-right]"),$(".data-tip-left")); LeaveTitle($("[data-tip-left]"),$(".data-tip-right")); + $("[data-tip-top]").live("mouseenter",function(){ + var $tool = $(this).attr("data-tip-top"); + if($tool != ""){ + $(".data-tip-top").show().html($tool); + $desc.show().css({ + left:$(this).offset().left -($desc.width()-$(this).width())/2, + opacity:0.7, + top:$(this).offset().top - 30 + }); + } + }); $("[data-tip-down]").live("mouseenter",function(){ var $tool = $(this).attr("data-tip-down"); if($tool != ""){ diff --git a/public/javascripts/edu/edu_tpi.js b/public/javascripts/edu/edu_tpi.js index 75776911d..3940298d0 100644 --- a/public/javascripts/edu/edu_tpi.js +++ b/public/javascripts/edu/edu_tpi.js @@ -288,12 +288,12 @@ function game_praise(obj_id, obj_type){ praiseStatus = true; //已赞 praise_count.html(data.praise_tread_count); $("#game_praise_tread").children("i").addClass("color-light-green"); - $("#game_praise_tread").attr("data-tip-left", "取消点赞") + $("#game_praise_tread").attr("data-tip-top", "取消点赞") }else{ praiseStatus = false; //取消赞 praise_count.html(data.praise_tread_count); $("#game_praise_tread").children("i").removeClass("color-light-green"); - $("#game_praise_tread").attr("data-tip-left", "点赞") + $("#game_praise_tread").attr("data-tip-top", "点赞") } } }); @@ -314,12 +314,12 @@ function game_tread(obj_id){ treadStatus = true; // 取消踩 tread_count.html(data.praise_tread_count); $("#game_tread").children("i").addClass("color-orange"); - $("#game_tread").attr("data-tip-right", "取消踩") + $("#game_tread").attr("data-tip-top", "取消踩") }else{ treadStatus = false; // 已踩 tread_count.html(data.praise_tread_count); $("#game_tread").children("i").removeClass("color-orange"); - $("#game_tread").attr("data-tip-right", "踩"); + $("#game_tread").attr("data-tip-top", "踩"); } } }); diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index d276d7ca7..c8f74cb8d 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -448,14 +448,12 @@ input::-ms-clear{display:none;} .bor-blue{border:1px solid #5faee3;} /* tip公共样式的设置: - tip整体的背景色的设置在 2、7、10、13行。要统一修改 - tip整体的border的设置在3、8、11、14行。要统一修改 - tip字体的颜色和阴影的设置在第2行。 + */ .-task-title{opacity:0;position:absolute;left:0;top:0;display:none;z-index:9999;} /*1*/ -.data-tip-down,.data-tip-left,.data-tip-right{ position:relative; box-shadow:0px 0px 8px #000; background:#000; color:#fff; max-width:300px;/*2*/ +.data-tip-down,.data-tip-left,.data-tip-right,.data-tip-top{ position:relative; box-shadow:0px 0px 8px #000; background:#000; color:#fff; max-width:300px;/*2*/ word-wrap: break-word; text-align:center; border-radius:4px; padding:0 10px; border:1px solid #000; display:none; }/*3*/ -.data-tip-down:after,.data-tip-down:before,.data-tip-left:before,.data-tip-right:before,.data-tip-left:after,.data-tip-right:after{/*4*/ +.data-tip-down:after,.data-tip-down:before,.data-tip-left:before,.data-tip-right:before,.data-tip-left:after,.data-tip-right:after,.data-tip-top:after,.data-tip-top:before{/*4*/ position: absolute;content:''; width:0; height:0;}/*5*/ .data-tip-down:after,.data-tip-down:before{left: 45%;top:-10px;/*6*/ border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 10px solid #000; }/*7*/ @@ -466,8 +464,9 @@ input::-ms-clear{display:none;} .data-tip-right:after,.data-tip-right:before{right: -10px; top:50%; margin-top:-5px;/*12*/ border-top: 5px solid transparent;border-bottom: 5px solid transparent; border-left: 10px solid #000; }/*13*/ .data-tip-right:before{ right: -12px;border-left: 10px solid #000; }/*14*/ - - +.data-tip-top:after,.data-tip-top:before{left: 45%;bottom:-10px;border-left: 5px solid transparent; + border-right: 5px solid transparent;border-top: 10px solid #000;} +.data-tip-top:before{bottom:-11px;} /*-------------------------圆角-------------------------*/ .bor-radius-upper{border-radius: 4px 4px 0px 0px;} diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 7f741358a..1a6d66e4a 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -420,11 +420,11 @@ html>body #ajax-indicator-base { position: fixed; } /*二次回复的提示语的样式*/ .points-data-tip-top{position:absolute;left:100px;top:-30px;opacity:.7;width:150px;height:30px;z-index:9999;display:none;} -.data-tip-top{position:relative;box-shadow:0px 0px 8px #000;backgund:#000;color:#fff;word-wrap: break-word; +.data-tip-top1{position:relative;box-shadow:0px 0px 8px #000;background:#000;color:#fff;word-wrap: break-word; text-align:center;border-radius:4px;padding:0 10px;border:1px solid #000;} -.data-tip-top:after,.data-tip-top:before{position: absolute;content:'';width:0;height:0;left: 45%;bottom:-10px;border-left: 5px solid transparent; +.data-tip-top1:after,.data-tip-top1:before{position: absolute;content:'';width:0;height:0;left: 45%;bottom:-10px;border-left: 5px solid transparent; border-right: 5px solid transparent;border-top: 10px solid #000;} -.data-tip-top:before{bottom:-11px;} +.data-tip-top1:before{bottom:-11px;} /*选择题tab切换*/ .nav_option li{overflow: hidden;width: 110px; text-align: center;cursor: pointer;height: 38px;line-height: 38px;border-top-right-radius: 5px;border-top-left-radius: 5px;border:1px solid #e2e2e2;border-bottom: 0px;color: #FF7500;border-right: none;} .nav_option li:last-child{border-right: 1px solid #e2e2e2;} From d12b09771619e7a1282175a18e79b9a24e0d92ff Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 28 Sep 2017 10:42:09 +0800 Subject: [PATCH 39/79] =?UTF-8?q?=E5=9B=9E=E5=A4=8D+Issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/games/_choice_question.html.erb | 8 +-- app/views/messages/_common_reply_box.html.erb | 45 ++++++------ .../student_work/_shixun_work_show.html.erb | 8 +-- app/views/student_work/index.html.erb | 69 ++++++++++--------- .../users/_comment_reply_detail.html.erb | 2 +- app/views/users/_course_attachment.html.erb | 2 +- app/views/users/_course_create.html.erb | 2 +- app/views/users/_course_homework.html.erb | 2 +- .../users/_course_journalsformessage.html.erb | 2 +- app/views/users/_course_message.html.erb | 2 +- app/views/users/_course_news.html.erb | 2 +- app/views/users/_course_poll.html.erb | 2 +- app/views/users/_homework_base_info.html.erb | 2 +- public/stylesheets/css/edu-class.css | 2 +- 14 files changed, 77 insertions(+), 73 deletions(-) diff --git a/app/views/games/_choice_question.html.erb b/app/views/games/_choice_question.html.erb index 2255f8cad..0cddf1cf0 100644 --- a/app/views/games/_choice_question.html.erb +++ b/app/views/games/_choice_question.html.erb @@ -91,16 +91,16 @@ //alert($(this).siblings("label").find("span").html()); if($(this).attr("checked")=="checked"){ value=$(this).siblings("label").find("span").html(); - $(this).parents(".problem_single").find("label").removeClass("color-orange05"); - $(this).siblings("label").addClass("color-orange05"); + $(this).parents(".problem_single").find("label").removeClass("color-orange03"); + $(this).siblings("label").addClass("color-orange03"); } }else{ var p=$(this).parents(".problem_single").find("p"); value=""; if($(this).attr("checked")=="checked"){ - $(this).siblings("label").addClass("color-orange05"); + $(this).siblings("label").addClass("color-orange03"); }else{ - $(this).siblings("label").removeClass("color-orange05"); + $(this).siblings("label").removeClass("color-orange03"); } for(var i=0;i< p.length;i++){ if(p.eq(i).find("input").attr("checked")=="checked"){ diff --git a/app/views/messages/_common_reply_box.html.erb b/app/views/messages/_common_reply_box.html.erb index c2313c569..afd027cea 100644 --- a/app/views/messages/_common_reply_box.html.erb +++ b/app/views/messages/_common_reply_box.html.erb @@ -38,6 +38,28 @@ <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %>
    +
    +
    + <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> +
    +

    + <% if is_teacher || comment.creator_user == User.current%> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +

    +
    <% if !comment.parent.nil? && !comment.parent.parent.nil? %> @@ -82,28 +104,7 @@
    -
    -
    - <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> - <%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %> -
    -

    - <% if is_teacher || comment.creator_user == User.current%> - 删除 - <% end %> - | - <%= link_to( - '回复'.html_safe, - {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => activity.class.to_s, :user_activity_id => activity.id}, - :remote => true, - :method => 'get', - :title => l(:button_reply),:class => "color-grey") %> - | - - <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> - -

    -
    +
    diff --git a/app/views/student_work/_shixun_work_show.html.erb b/app/views/student_work/_shixun_work_show.html.erb index 0f99ab2b8..588a489c9 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.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/index.html.erb b/app/views/student_work/index.html.erb index b717c1d8a..bbac8bc48 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -32,9 +32,7 @@ <%= @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 %> +
    @@ -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 %> @@ -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('该检索条件下没有作品,无法下载附件')" %> 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(comment.creator_user), :width => 50, :height => 50, :alt => "用户头像"), user_url_in_org(comment.creator_user), :target => '_blank' %> +
    +
    +
    +
    + <% if !comment.parent.nil? && !comment.parent.parent.nil? %> + <% parents_rely = [] %> + <% parents_rely = get_reply_parents_no_root parents_rely, comment %> + <% length = parents_rely.length %> +
    + <% if length <= 5 %> + <%=render :partial => 'messages/message_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => memo.id, :type => memo.class.to_s} %> + <% else %> +
    +
    +
    +
    +
    + <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[length - 1], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> +
    +
    + + <%= link_to '点击展开隐藏楼层', show_all_replies_users_path(:comment => comment, :type => comment.class, :user_activity_id => memo.id, :parent_id => comment.id),:remote=>true, :class => '' %> +
    + <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[3], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> +
    + <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[2], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> +
    + <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[1], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> +
    + <%=render :partial => 'student_work/homework_reply_detail', :locals => {:comment => parents_rely[0], :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> +
    + <% end %> +
    + <% end %> + +
    +
    <%= comment.content_detail.html_safe %>
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + <%= link_to comment.creator_user.show_real_name, user_url_in_org(comment.creator_user), :class => "content-username hide fl" %> + <%= time_from_now(comment.created_at) %> +
    +

    + <% if comment.creator_user == User.current %> + 删除 + <% end %> + | + <%= link_to( + '回复'.html_safe, + {:controller => 'users' ,:action => 'reply_to',:reply_id => comment.id, :type => memo.class.to_s, :user_activity_id => memo.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply),:class => "color-grey") %> + | + + <%=render :partial=> "praise_tread/edu_praise", :locals => {:activity=>comment, :user_activity_id=>comment.id,:type=>"reply"}%> + +

    +
    +
    +
    +
    + <% end %> + <% end %> +
    + \ No newline at end of file diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index 3e5e69938..086617444 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -1,40 +1,65 @@ -<% @replies.each do |reply| %> - + $(".homepagePostReplyDes").mouseover(function(){ + $(this).find("a[id*='delete_memo_reply']").show(); + }).mouseout(function(){ + $(this).find("a[id*='delete_memo_reply']").hide(); + }); + -
    -
    - <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> -
    -
    -
    - <%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%> -
    -
    -

    <%= reply.content.gsub(/\/script/, "script").gsub(/script/, " script").html_safe %>

    -
    -
    -
    +
    +
    + <%= link_to image_tag(url_to_avatar(reply.author), :width => 33,:height => 33), user_path(reply.author) %> +
    +
    +
    + <%= render :partial => 'users/message_contents', :locals => {:comment => reply, :type => 'Memo', :user_activity_id => @memo.id}%> +
    +
    +

    <%= reply.content.gsub(/\/script/, "script").gsub(/script/, " script").html_safe %>

    +
    +
    +
    <%= render :partial => "praise_tread/praise", :locals => {:activity => reply, :user_activity_id => reply.id, :type => "reply"} %> @@ -58,20 +83,21 @@ :title => l(:button_delete) ) if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %> -
    +
    +
    +
    +
    +
    +
    +
    + <% end %> + <% if @limit_count > @page * @limit + 10 %> +
    +
    + + + <%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %>
    -
    -
    -
    -
    -<% end %> -<% if @limit_count > @page * @limit + 10 %> -
    -
    - - - <%= link_to '点击展开更多回复', forum_memo_path(@memo.forum_id, @memo, :page => @page),:remote=>true %> -
    -
    + <% end %> <% end %> \ No newline at end of file diff --git a/app/views/memos/create.js.erb b/app/views/memos/create.js.erb index 410c82d79..d6405143a 100644 --- a/app/views/memos/create.js.erb +++ b/app/views/memos/create.js.erb @@ -1 +1 @@ -window.location.href='<%= forum_memo_path(:forum_id=>@memo.forum_id,:id=>@memo.id ) %>' \ No newline at end of file +window.location.href='<%= forum_memo_path(:forum_id => @memo.forum_id, :id => @memo.id ) %>'; \ No newline at end of file diff --git a/app/views/memos/message_replies.js.erb b/app/views/memos/message_replies.js.erb new file mode 100644 index 000000000..a4683ca59 --- /dev/null +++ b/app/views/memos/message_replies.js.erb @@ -0,0 +1,9 @@ +<%# if @user_activity_id != @memo.id %> +/* $("#activity_post_reply_<%#= @user_activity_id %>").html("<%#= escape_javascript(render :partial => 'users/course_message_post_reply', + :locals => { :activity => @memo, + :user_activity_id => @user_activity_id}) %>"); + sd_create_editor_from_data(<%#= @user_activity_id%>,"","100%", "UserActivity");*/ +<%# else %> + $("#message_replies_box").html("<%= escape_javascript(render :partial => 'memos/memo_all_replies') %>"); + sd_create_editor_from_data(<%= @memo.id %>,"","100%", "<%= @memo.class.to_s %>"); +<%# end %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index c5cf514a3..e4908b901 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -1,131 +1,206 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> - <%= javascript_include_tag 'forum' %> <% end %> +
    +
    +

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

    +
    +

    <%= h @memo.subject %>

    + +
    +
    +
    +
    + + <%= image_tag(url_to_avatar(@memo.author), :width => 60, :height => 60, :alt=>'用户头像', :class=>"panel-list-img mr15" ) %> + +
    +

    <%= @memo.author.show_name %>

    +

    + 发表于<%= time_from_now @memo.updated_at %> +

    +
    - +
    + + <%= @memo.content.html_safe %> +
    +
      + + <% if @memo.attachments.any?%> + <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %> + <%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %> + <% end %> +
    +
    +
    + <%= render :partial => "memo_all_replies" %> +
    +
    +
    -
    -
    -
    - <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %> -
    -
    - <% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %> -
    -
      -
    • -
        - <% if @memo.author.id == User.current.id || User.current.admin? %> -
      • 编辑
      • - <% end %> - <% if User.current.admin? || User.current == @forum.creator %> - <% if @memo.sticky %> -
      • 取消置顶
      • - <% else %> -
      • 置顶
      • - <% end %> - <% end %> -
      • 删除
      • -
      • -
      -
    • -
    -
    - <% end %> - - <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> -
    -
    - <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
    -
    <%= format_date( @memo.created_at)%>
    -
    -
    - <%= @memo.content.html_safe%> -
    -
    -
    - <% if @memo.attachments.any?%> - <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %> - <%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %> - <% end %> -
    -
    - 更新时间:<%= format_date(@memo.updated_at)%> + + +<% if false %> + <%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: true) %> + <%= javascript_include_tag 'forum' %> + <% end %> + + -
    -
    -
    -
    -
    -
    回复(<%= @reply_count %>)
    -
    -
    -
    - <%= render :partial => 'memos/memo_all_replies' %> -
    -
    -
    -
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    -
    - <% if User.current.logged? %> -
    - <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%> - <%= f.hidden_field :subject, :required => true, value: @memo.subject %> - <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> - <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> - <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> -
    - - -
    -

    - <% end%> -
    - <% else %> - <%= render :partial => "users/show_unlogged" %> - <% end %> + + +
    +
    +
    + <%= link_to image_tag(url_to_avatar(@memo.author),:width=>50,:height => 50,:alt=>'贴吧图像' ),user_path(@memo.author) %> +
    +
    + <% if @memo.author.id == User.current.id || User.current.admin? || User.current == @forum.creator %> +
    +
      +
    • +
        + <% if @memo.author.id == User.current.id || User.current.admin? %> +
      • 编辑
      • + <% end %> + <% if User.current.admin? || User.current == @forum.creator %> + <% if @memo.sticky %> +
      • 取消置顶
      • + <% else %> +
      • 置顶
      • + <% end %> + <% end %> +
      • 删除
      • +
      • +
      +
    • +
    +
    + <% end %> + + <%= render :partial => "memos/praise_tread",:locals => {:obj => @memo,:show_flag => true,:user_id =>User.current.id,:horizontal => true}%> +
    + +
    + <%= link_to @memo.author.show_name, user_path(@memo.author), :class => "linkBlue2", :target=> "_blank"%>
    +
    <%= format_date( @memo.created_at)%>
    +
    +
    + <%= @memo.content.html_safe%> +
    +
    +
    + <% if @memo.attachments.any?%> + <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %> + <%= render :partial => 'attachments_links', :locals => {:attachments => @memo.attachments, :options => options, :is_float => true} %> + <% end %> +
    +
    + 更新时间:<%= format_date(@memo.updated_at)%> +
    +
    +
    +
    回复(<%= @reply_count %>)
    +
    +
    +
    + <%= render :partial => 'memos/memo_all_replies' %> +
    +
    +
    +
    <%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(User.current), :alt => "用户头像" %>
    +
    + <% if User.current.logged? %> +
    + <%= form_for('memo',:url=>forum_memos_path,:method => "post") do |f|%> + <%= f.hidden_field :subject, :required => true, value: @memo.subject %> + <%= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> + <%= f.hidden_field :parent_id, :required => true, value: @memo.id %> + <%= hidden_field_tag :quote,"",:required => false,:style => 'display:none' %> +
    + + +
    +

    + <% end%> +
    + <% else %> + <%= render :partial => "users/show_unlogged" %> + <% end %> +
    +
    +
    +
    +
    +
    +
    + <%= render :partial => "memos/my_show_count_message" %>
    -
    -
    -
    - <%= render :partial => "memos/my_show_count_message" %> -
    - \ No newline at end of file + +<% end %> \ No newline at end of file diff --git a/app/views/praise_tread/_activity_praise.html.erb b/app/views/praise_tread/_activity_praise.html.erb index 8f57ec0b6..8bbb6b6b8 100644 --- a/app/views/praise_tread/_activity_praise.html.erb +++ b/app/views/praise_tread/_activity_praise.html.erb @@ -4,8 +4,9 @@ :user_activity_id => user_activity_id, :type => type }) %>' data-remote="true" class="white-btn orange-btn" title="点赞"> 赞 - <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= (num.nil? ? 0 : num) > 0 ? num : 0 %> + <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> + + <%= get_praise_num(activity) %> <% else %> 赞 - <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= (num.nil? ? 0 : num) > 0 ? num : 0 %> + <%= get_praise_num(activity) %> + <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> + <% end %> \ No newline at end of file diff --git a/app/views/praise_tread/_edu_praise.html.erb b/app/views/praise_tread/_edu_praise.html.erb index afe83633d..0704eebad 100644 --- a/app/views/praise_tread/_edu_praise.html.erb +++ b/app/views/praise_tread/_edu_praise.html.erb @@ -4,8 +4,9 @@ :user_activity_id => user_activity_id, :type => type }) %>' data-remote="true" class="fr mr5 color-grey" title="点赞"> 赞 - <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= (num.nil? ? 0 : num) > 0 ? num : 0 %> + <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> + + <%= get_praise_num(activity) %> <% else %> 赞 - <% num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> - <%= (num.nil? ? 0 : num) > 0 ? num : 0 %> + <%= get_praise_num(activity) %> + <%# num = activity.praise_tread_cache ? activity.praise_tread_cache.praise_num : 0 %> + <% end %> \ No newline at end of file diff --git a/app/views/praise_tread/praise_minus.js.erb b/app/views/praise_tread/praise_minus.js.erb index b187d75dc..3b974fe5c 100644 --- a/app/views/praise_tread/praise_minus.js.erb +++ b/app/views/praise_tread/praise_minus.js.erb @@ -5,6 +5,8 @@ <% else %> $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% end %> + <% elsif @type.to_s == 'Memo' %> + $('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>'); <% else @type.to_s == 'reply' %> <% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %> $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); diff --git a/app/views/praise_tread/praise_plus.js.erb b/app/views/praise_tread/praise_plus.js.erb index beea6afae..082f0bf42 100644 --- a/app/views/praise_tread/praise_plus.js.erb +++ b/app/views/praise_tread/praise_plus.js.erb @@ -5,6 +5,8 @@ <% else %> $('#praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"activity"})%>'); <% end %> + <% elsif @type.to_s == 'Memo' %> + $('#praise_count_<%= @obj.id %>').html('<%= j(render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"})%>'); <% else @type.to_s == 'reply' %> <% if ((@obj_type == 'JournalsForMessage' && @obj.jour_type == 'HomeworkCommon') || @obj_type == 'Message') && @obj_id == @user_activity_id %> $('.reply_praise_count_<%=@user_activity_id %>').html('<%=j(render :partial=> "praise_tread/edu_praise", :locals => {:activity=>@obj, :user_activity_id=>@user_activity_id,:type=>"reply"})%>'); @@ -13,8 +15,8 @@ <% end %> <% end %> <% elsif @obj_type == 'Memo'%> - $('#praise_tread_<%= @obj.id %>').html('<%= j( - render :partial => "/memos/praise_tread",:locals => {:obj => @obj,:user_id => User.current.id,:horizontal => @horizontal} + $('#praise_count__<%= @obj.id %>').html('<%= j( + render :partial => 'praise_tread/activity_praise', :locals => {:activity => @obj, :user_activity_id => @obj.id, :type => "Memo"} )%>'); <% elsif @obj_type == 'Discuss'%> $('#dis_praise_<%= @obj.id %>').html('<%= j( diff --git a/config/routes.rb b/config/routes.rb index 403cf5eaa..18f6cbb08 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -734,6 +734,8 @@ RedmineApp::Application.routes.draw do end member do get "change_sticky" + post "reply" + match "message_replies", :via => [:get, :post] end end end From e07076961368534c3a8f1080af0746a3bd658687 Mon Sep 17 00:00:00 2001 From: miss <994230062@qq.com> Date: Thu, 28 Sep 2017 16:10:26 +0800 Subject: [PATCH 45/79] =?UTF-8?q?tip=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 3 ++- app/views/courses/_course_index_search.html.erb | 2 +- app/views/messages/_course_show.html.erb | 2 +- app/views/shixuns/_statistics_student_list.html.erb | 13 ++++++++----- app/views/shixuns/index.html.erb | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 799dac04f..decfe154c 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -16,7 +16,7 @@ class ShixunsController < ApplicationController def statistics_students - @statistics = @shixun.myshixuns.where("").order("created_at desc") + @statistics = @shixun.myshixuns.order("created_at desc") @statistics_count = @statistics.count @limit = 10 @is_remote = true @@ -24,6 +24,7 @@ class ShixunsController < ApplicationController @offset ||= @statistic_pages.offset @statistics = paginateHelper @statistics, @limit + end # push代码的时候会触发gitlab hook diff --git a/app/views/courses/_course_index_search.html.erb b/app/views/courses/_course_index_search.html.erb index 3a2b60946..5d4827952 100644 --- a/app/views/courses/_course_index_search.html.erb +++ b/app/views/courses/_course_index_search.html.erb @@ -3,7 +3,7 @@
    - × + ×
    diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 2dda26d3b..43e0cd963 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -36,7 +36,7 @@ <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %> <% end %> - + <% if User.current.admin? || User.current.allowed_to?(:as_teacher, @course) || User.current == @topic.author %> <% end %> diff --git a/app/views/shixuns/_statistics_student_list.html.erb b/app/views/shixuns/_statistics_student_list.html.erb index 70add291f..2bad02525 100644 --- a/app/views/shixuns/_statistics_student_list.html.erb +++ b/app/views/shixuns/_statistics_student_list.html.erb @@ -16,19 +16,22 @@ <% @statistics.each do |statistics| %> - <%= link_to image_tag(url_to_avatar(statistics.owner), :width => "36", :height => "36", :alt => "头像", :style => "border-radius:18px;margin-top:15px;"), user_path(statistics.owner), :target => '_blank', :class => ""%> + + <%= 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 %>关 + diff --git a/app/views/shixuns/index.html.erb b/app/views/shixuns/index.html.erb index cdc5fff3b..fc6235d62 100644 --- a/app/views/shixuns/index.html.erb +++ b/app/views/shixuns/index.html.erb @@ -171,7 +171,7 @@
    - × + ×
    From e46c4a57e32f450594f5878a4510f99d0c8b61aa Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 28 Sep 2017 16:20:05 +0800 Subject: [PATCH 46/79] =?UTF-8?q?=E5=8F=91=E5=B8=83=E4=BA=86=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E7=89=88=E6=9C=AC=E4=B9=9F=E4=BC=9A=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index efc80c87a..cf8f107b7 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -114,9 +114,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 + # if @shixun.try(:status).to_i < 2 shixun_modify_status_without_publish(@shixun, 1) - end + # end respond_to do |format| format.js end From c04cc8d8893ec34a43162ee25a1f09cd62c2a799 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 28 Sep 2017 16:51:14 +0800 Subject: [PATCH 47/79] =?UTF-8?q?=E6=88=90=E5=91=98=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/_course_activity_content.html.erb | 83 +++++++++++++++++-- app/views/courses/show.html.erb | 30 +++---- app/views/shixuns/_add_collaborators.html.erb | 9 ++ .../shixuns/_add_collaborators_list.html.erb | 9 +- .../student_work/_shixun_work_show.html.erb | 2 +- public/stylesheets/css/edu-common.css | 8 +- public/stylesheets/css/edu-public.css | 2 +- public/stylesheets/css/structure.css | 12 ++- 8 files changed, 120 insertions(+), 35 deletions(-) diff --git a/app/views/courses/_course_activity_content.html.erb b/app/views/courses/_course_activity_content.html.erb index 7e49d2868..e35a70644 100644 --- a/app/views/courses/_course_activity_content.html.erb +++ b/app/views/courses/_course_activity_content.html.erb @@ -1,15 +1,86 @@ -
    -
    - <%= get_acts_list_type @type %> +
    +
    +
    + <%= get_acts_list_type @type %> +
    + <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> +
    + <% if false %> +
  • + <%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %> + <% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %> + <% if apply_count > 0 %> + <%= apply_count %> + <% end %> +
  • + <% end %> +
    + + 新建 +
      +
    • + <%= link_to '普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-grey" %> +
    • +
    • + <%= link_to '实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-grey", :remote => true %> +
    • +
    • + 资源 +
    • +
    • + <% course_board = @course.boards.where("parent_id is NULL").first %> + <%= link_to '帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-grey" %> +
    • +
    +
    +
    + <% end %>
    -
    +
    <%= link_to "全部", {:controller => "courses", :action => "show", :type => nil}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type.nil? ? 'active' : ''} fl"%> <%= link_to "普通作业", {:controller => "courses", :action => "show", :type => "common_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'common_homework' ? 'active' : ''} fl"%> <%= link_to "实训作业", {:controller => "courses", :action => "show", :type => "shixun_homework"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'shixun_homework' ? 'active' : ''} fl"%> <%= link_to "资源", {:controller => "courses", :action => "show", :type => "attachment"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'attachment' ? 'active' : ''} fl"%> <%= link_to "讨论", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%> + <%= link_to "成员管理", {:controller => "courses", :action => "show", :type => "message"}, :remote => true, :class =>"edu-filter-cir-grey mr15 font-12 #{@type == 'message' ? 'active' : ''} fl"%>
    - +<% if false %> + +
    +
    +
    + 0 +
    +
    +
    + 蔡世申请加入课堂 + 待处理 + 已处理 + 同意 + 拒绝 +
    +
    + 蔡世 + TO + 成员管理 +
    +
    提交时间:2017-09-28 15:44
    +
    + 胡莎莎 已同意 已拒绝 + 处理时间:2017-09-28 15:44 +
    +
    +
    +
    +
    +<% end %> <%= render :partial => 'courses/course_activity', :locals => {:course_activities => @course_activities,:page => 0,:type => @type} %> - + diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 4d7fc2d04..3f232cffd 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -8,20 +8,22 @@
    - <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> -
      -
    • <%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %> - <% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %> - <% if apply_count > 0 %> - <%= apply_count %> - <% end %> -
    • -
    • <%= link_to '+ 发布普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-orange03" %>
    • -
    • <%= link_to '+ 发布实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-orange03", :remote => true %>
    • -
    • + 发布资源
    • - <% course_board = @course.boards.where("parent_id is NULL").first %> -
    • <%= link_to '+ 发布帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-orange03" %>
    • -
    + <% if false %> + <% if User.current.admin? || User.current.allowed_to?(:as_teacher,@course) %> +
      +
    • <%= link_to '成员管理', members_course_path(@course),:class => "color-orange03" %> + <% apply_count = CourseMessage.where(:course_id => @course.id,:course_message_type => 'JoinCourseRequest', :status => 0).count %> + <% if apply_count > 0 %> + <%= apply_count %> + <% end %> +
    • +
    • <%= link_to '+ 发布普通作业'.html_safe, new_homework_common_path(:course => @course.id, :homework_type => 1),:class => "color-orange03" %>
    • +
    • <%= link_to '+ 发布实训作业'.html_safe, shixuns_homework_common_index_path(:course => @course.id),:class => "color-orange03", :remote => true %>
    • +
    • + 发布资源
    • + <% course_board = @course.boards.where("parent_id is NULL").first %> +
    • <%= link_to '+ 发布帖子'.html_safe, new_board_message_path(:board_id => course_board.id),:class => "color-orange03" %>
    • +
    + <% end %> <% end %>
    <%= render :partial => 'courses/course_activity_content', :locals => {:course_activities => @course_activities} %> diff --git a/app/views/shixuns/_add_collaborators.html.erb b/app/views/shixuns/_add_collaborators.html.erb index 03a01b843..dee603ae0 100644 --- a/app/views/shixuns/_add_collaborators.html.erb +++ b/app/views/shixuns/_add_collaborators.html.erb @@ -13,6 +13,15 @@
    +

    + + +

      <%#= 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 index d50ea2a2a..e219ceb7a 100644 --- a/app/views/shixuns/_add_collaborators_list.html.erb +++ b/app/views/shixuns/_add_collaborators_list.html.erb @@ -6,10 +6,11 @@ + <%= user.show_real_name %> + <%= user.login %> + <%= user.identity %> + <%= user.user_extensions.school ? user.user_extensions.school.name : "" %> + <% end %> <% end %> diff --git a/app/views/student_work/_shixun_work_show.html.erb b/app/views/student_work/_shixun_work_show.html.erb index 588a489c9..20d266e12 100644 --- a/app/views/student_work/_shixun_work_show.html.erb +++ b/app/views/student_work/_shixun_work_show.html.erb @@ -6,7 +6,7 @@

      - <%= 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" %>

      diff --git a/public/stylesheets/css/edu-common.css b/public/stylesheets/css/edu-common.css index bcb78ea34..62635f16b 100644 --- a/public/stylesheets/css/edu-common.css +++ b/public/stylesheets/css/edu-common.css @@ -235,8 +235,12 @@ a:hover.link-name-dark{ color:#5faee3;} .edu-txt-w280{ width:280px; display: block;} .edu-txt-w320{ width:320px; display: block;} .edu-txt-w200{ width:200px; display: block;} -a.edu-txt-w140,.edu-txt-w140{ width:141px; display: inline-block;} -a.edu-txt-w100,.edu-txt-w100{ width:100px; display: inline-block;} +a.edu-txt-w190,.edu-txt-w190{ width:190px; display: inline-block;text-align: center} +a.edu-txt-w160,.edu-txt-w160{ width:160px; display: inline-block;text-align: center} +a.edu-txt-w140,.edu-txt-w140{ width:141px; display: inline-block;text-align: center} +a.edu-txt-w130,.edu-txt-w130{ width:130px; display: inline-block;text-align: center} +a.edu-txt-w120,.edu-txt-w120{ width:120px; display: inline-block;text-align: center} +a.edu-txt-w100,.edu-txt-w100{ width:100px; display: inline-block;text-align: center} .edu-txt-w50{ width:50px;} .edu-w245{ width: 245px; } .overellipsis{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;} diff --git a/public/stylesheets/css/edu-public.css b/public/stylesheets/css/edu-public.css index dda1482b1..d179b2a74 100644 --- a/public/stylesheets/css/edu-public.css +++ b/public/stylesheets/css/edu-public.css @@ -57,7 +57,7 @@ $colors: #fff, #0072B5, #2C3E50; .edu-dropdown-menu{ background-color:#fff; text-align: center; border-radius:3px; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); position:absolute; top:25px; left:0px; z-index: 999; display:none;} .edu-dropdown-menu li{ height:30px; line-height:30px; display: block; padding:0 15px; text-align: left;} .edu-dropdown-menu li label{ cursor: pointer;} -.edu-dropdown-menu li:hover{ color: #5faee3!important;} +.edu-dropdown-menu li:hover{ color: #FF7500!important;} /*.edu-dropdown:hover .edu-dropdown-menu{ display: block;}*/ .animate{ -webkit-transition: all .3s; -moz-transition: all .3s; -ms-transition: all .3s; -ms-transition: all .3s; transition: all .3s; backface-visibility:hidden; -webkit-backface-visibility:hidden; /* Chrome and Safari */ -moz-backface-visibility:hidden; /* Firefox */ -ms-backface-visibility:hidden; /* Internet Explorer */} diff --git a/public/stylesheets/css/structure.css b/public/stylesheets/css/structure.css index 7052dd715..dadcc6cf0 100644 --- a/public/stylesheets/css/structure.css +++ b/public/stylesheets/css/structure.css @@ -535,10 +535,8 @@ a.user_editinfo{border-top:1px solid #e5e5e5; height:30px; line-height:30px; tex .flex-cell_homepage:hover{ background-color:#3b94d6;} .feedback_error p{display: inline;} -.activities_btn{border: 1px solid #FF7500;} -.activities_btn li{flex: 1;height: 50px;line-height: 50px;float: left;text-align: center;border-right: 1px solid #FF7500;} -.activities_btn li:last-child{border: none;} -.activities_btn li:hover{color:#fff!important;background: #FF7500;} -.activities_btn li:hover .color-orange03{color: #fff!important;} -.activities_btn li .edu-cir-orange{color: #fff!important;} -.activities_btn li:hover .edu-cir-orange{background: #fff;color: #FF7500!important;} \ No newline at end of file +.activities_btn .activities_item,.activities_btn div{float: left;text-align: center;border-radius: 4px;border: 1px solid #FF7500;padding: 1px 16px;} +.activities_btn .activities_item:hover{color:#fff!important;background: #FF7500;} +.activities_btn .activities_item:hover .color-orange03{color: #fff!important;} +.activities_btn .activities_item .edu-cir-orange{color: #fff!important;} +.activities_btn .activities_item:hover .edu-cir-orange{background: #fff;color: #FF7500!important;} \ No newline at end of file From aa4ec780b75a01864c4190ec56767893d29561d1 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 28 Sep 2017 17:29:36 +0800 Subject: [PATCH 48/79] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=A1=B5=E4=BA=8C=E7=BA=A7=E5=9B=9E=E5=A4=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 16 +++++++++++----- app/controllers/users_controller.rb | 5 +++++ app/views/memos/_common_reply_box.html.erb | 3 ++- app/views/memos/_memo_all_replies.html.erb | 12 ++++++++++++ app/views/memos/destroy.js.erb | 2 ++ app/views/praise_tread/praise_plus.js.erb | 2 ++ app/views/users/_reply_to.html.erb | 13 +++++++++++++ 7 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 app/views/memos/destroy.js.erb diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 047d7bd9b..072025363 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -184,13 +184,13 @@ class MemosController < ApplicationController end def reply - if params[:parent_id] + if params[:memo][:parent_id] 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[:memo][:content] + @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 @@ -210,7 +210,7 @@ class MemosController < ApplicationController # @reply.reply_id = params[:id] end - redirect_to message_replies_forum_memo_path(@memo.forum, @memo) + redirect_to message_replies_forum_memo_path(@memo.forum, @memo, :user_activity_id => params[:user_activity_id]) end def message_replies @@ -231,10 +231,16 @@ class MemosController < ApplicationController def destroy @memo.destroy - respond_to do |format| - # format.html { redirect_to @back_url } + #format.html { redirect_to @back_url } format.html { redirect_to back_memo_or_forum_url } + 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 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/views/memos/_common_reply_box.html.erb b/app/views/memos/_common_reply_box.html.erb index 9234613c8..def25d106 100644 --- a/app/views/memos/_common_reply_box.html.erb +++ b/app/views/memos/_common_reply_box.html.erb @@ -33,6 +33,7 @@ <% length = parents_rely.length %>
      <% if length <= 5 %> + <%#=render :partial => 'users/journal_comment_reply', :locals => {:comment => comment.parent, :type => memo.class.to_s, :user_activity_id => memo.id, :parent_id => comment.id} %> <%=render :partial => 'messages/message_reply', :locals => {:comment => comment.parent, :parent_id => comment.id, :user_activity_id => memo.id, :type => memo.class.to_s} %> <% else %>
      @@ -76,7 +77,7 @@

      <% if comment.creator_user == User.current %> - 删除 + 删除 <% end %> | <%= link_to( diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index 086617444..bcbd73016 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -22,6 +22,18 @@

      + + + + + + + + + + + + <% if false %> <% @replies.each do |reply| %> + + + +<% if false %> +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> +<% end %>
      @@ -118,4 +210,5 @@ $("#memo_classify_tips").attr('style','color: #F00;'); } } - \ No newline at end of file + +<% end %> \ No newline at end of file diff --git a/app/views/memos/_memo_all_replies.html.erb b/app/views/memos/_memo_all_replies.html.erb index bcbd73016..3b9a6ffe1 100644 --- a/app/views/memos/_memo_all_replies.html.erb +++ b/app/views/memos/_memo_all_replies.html.erb @@ -10,7 +10,7 @@ <%#= form_for @memo, :as => :reply, :url => {:action => 'reply', :id => @topic}, :remote => true, :html => {:multipart => true, :id => 'message_form'} do |f| %> <%#= f.hidden_field :subject, :required => true, value: @memo.subject %> <%#= f.hidden_field :forum_id, :required => true, value: @memo.forum_id %> - <%#= f.hidden_field :parent_id, :required => true, value: @memo.id %> + <%#= f.hidden_field :parent_id, :required => true, value: @memo.parent_id %>
      发送 diff --git a/app/views/memos/edit.html.erb b/app/views/memos/edit.html.erb index ed705579b..2799abec4 100644 --- a/app/views/memos/edit.html.erb +++ b/app/views/memos/edit.html.erb @@ -1,60 +1,15 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> - <%= javascript_include_tag 'new_user' %> -<% end %> - - - - - -<%= labelled_form_for(@memo, :url => forum_memo_path(@memo.forum_id, @memo),:html=>{:id => 'new_memo'}) do |f| %> - <%= render :partial => "memos/form", :locals => {:f => f} %> -<% end %> - -
      - <%= render :partial => "memos/my_show_count_message" %> -
      - - \ No newline at end of file +
      +

      + + <%= @user.show_name %> > 讨论 > 编辑 +

      +
      +

      编辑话题

      +
      +
      + <%#= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %> + <%= form_for @memo, :url => forum_memo_path(@memo.forum_id, @memo), :html => {:multipart => true, :id => 'memo-form'} do |f| %> + <%= render :partial => "memos/form", :locals => {:f => f} %> + <% end %> +
      +
      \ No newline at end of file diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index 1d14935ca..be251e67f 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -1,6 +1,29 @@ - -<%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %> - <%= render :partial => "memos/form", :locals => {:f => f} %> -<% end %> +
      +

      + + <%= @user.show_name %> > 讨论 > 新建 +

      +
      +

      新建话题

      +
      +
      + <%#= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %> + <%= form_for @memo, :url => forum_memos_path(@forum), :html => {:multipart => true, :id => 'memo-form'} do |f| %> + <%= render :partial => "memos/form", :locals => {:f => f} %> + <% end %> +
      +
      -<%= render :partial => "forums/my_count_message" %> \ No newline at end of file + + + + +<% if false %> + + <%= labelled_form_for(@memo, :url => forum_memos_path(@forum)) do |f| %> + <%= render :partial => "memos/form", :locals => {:f => f} %> + <% end %> +<%#= render :partial => "forums/my_count_message" %> +<% end %> \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index e4908b901..5937de7fe 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -23,21 +23,28 @@ 发表于<%= time_from_now @memo.updated_at %>

      - - + <% if @user.admin? || @user == @memo.author %> +
      + + +
      + <% end %>
      <%= @memo.content.html_safe %>
      -
        +
          <% if @memo.attachments.any?%> <% options = {:author => true, :deletable => @memo.deleted_attach_able_by?(User.current) } %> From f88832796b0b1f89d8541ea33c37b7b2a972b2f0 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Sep 2017 11:29:09 +0800 Subject: [PATCH 54/79] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E6=8C=89=E7=85=A7?= =?UTF-8?q?=E7=BD=AE=E9=A1=B6=E4=B8=8E=E9=9D=9E=E6=8C=87=E5=AE=9A=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/forums_controller.rb | 4 +++- app/views/forums/index.html.erb | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/forums_controller.rb b/app/controllers/forums_controller.rb index ab17acb3f..337f951aa 100644 --- a/app/controllers/forums_controller.rb +++ b/app/controllers/forums_controller.rb @@ -119,9 +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] @@ -135,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 diff --git a/app/views/forums/index.html.erb b/app/views/forums/index.html.erb index 6a372b22d..d583728d1 100644 --- a/app/views/forums/index.html.erb +++ b/app/views/forums/index.html.erb @@ -35,7 +35,12 @@
          <%= User.find(memo.author_id).try(:show_name) %>

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

          <%= memo.content %>

          From 5eb28b5dfaeaf97ad561c5782b47d90a6e415a6f Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Sep 2017 14:11:21 +0800 Subject: [PATCH 55/79] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/show.html.erb | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index 5937de7fe..afa9a1eff 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -8,7 +8,9 @@ <%= @user.show_name %> > 讨论

          -

          <%= h @memo.subject %>

          +

          + 讨论详情 +

          @@ -18,10 +20,19 @@ <%= image_tag(url_to_avatar(@memo.author), :width => 60, :height => 60, :alt=>'用户头像', :class=>"panel-list-img mr15" ) %>
          -

          <%= @memo.author.show_name %>

          -

          - 发表于<%= time_from_now @memo.updated_at %> -

          +
          +

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

          + +
          +

          <%= @memo.author.show_name %>发表于<%= time_from_now @memo.updated_at %>

          + + +
          <% if @user.admin? || @user == @memo.author %>
          From f6aad05821181ac38cd664313b82217c39986704 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Fri, 29 Sep 2017 15:56:17 +0800 Subject: [PATCH 56/79] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=80=A7=E5=BC=B9=E6=A1=86=E7=9A=84=E6=96=87=E5=AD=97=E8=AF=B7?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=94=B9=E4=B8=BA=E9=BB=91=E8=89=B2333=20?= =?UTF-8?q?=E5=AE=9E=E8=AE=ADTPM=E5=BE=85=E5=AE=A1=E6=A0=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84tip=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/challenges/index.html.erb | 2 +- app/views/shixuns/_shixun_top.html.erb | 2 +- public/javascripts/edu/application.js | 32 +++++++++++++------------- public/stylesheets/css/taskstyle.css | 2 +- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/challenges/index.html.erb b/app/views/challenges/index.html.erb index d877ea5bf..1dc205b89 100644 --- a/app/views/challenges/index.html.erb +++ b/app/views/challenges/index.html.erb @@ -8,7 +8,7 @@
          <% if @shixun.status == 1 && (User.current.manager_of_shixun?(@shixun) || User.current.admin?) %> -
          正在等待管理员的审核。如果需要重新编辑评测设置,请先撤销发布
          +
          正在等待管理员的审核。在审核通过前,可以随时撤销发布
          <% end %>
          diff --git a/app/views/shixuns/_shixun_top.html.erb b/app/views/shixuns/_shixun_top.html.erb index f63f43429..982db89c3 100644 --- a/app/views/shixuns/_shixun_top.html.erb +++ b/app/views/shixuns/_shixun_top.html.erb @@ -39,7 +39,7 @@ <% end %> <% if @shixun.can_copy && User.current.user_extensions.try(:identity) == 0 && User.current.professional_certification %> <%#= link_to "复制", copy_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-green mr15" %> - + <% end %> <% end %>
          diff --git a/public/javascripts/edu/application.js b/public/javascripts/edu/application.js index f05828f40..fb7f18587 100644 --- a/public/javascripts/edu/application.js +++ b/public/javascripts/edu/application.js @@ -265,14 +265,14 @@ function pop_box_new(value, Width, Height){ // 两个按钮 点击确认跳转, 提示信息有两行 function op_confirm_box(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 578, 205); } function op_confirm_box_loading(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 578, 205); @@ -280,7 +280,7 @@ function op_confirm_box_loading(url, str){ // 两个按钮 点击确认跳转, 提示信息有两行 function s_op_confirm_box(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 205); @@ -288,7 +288,7 @@ function s_op_confirm_box(url, str){ //点击删除时的确认弹框: 不走destroy方法 function delete_confirm_box(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -296,7 +296,7 @@ function delete_confirm_box(url, str){ //点击删除时的确认弹框: 走destroy方法,remote为true function delete_confirm_box_2(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -304,7 +304,7 @@ function delete_confirm_box_2(url, str){ //点击删除时的确认弹框: 走destroy方法 function delete_confirm_box_3(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -312,7 +312,7 @@ function delete_confirm_box_3(url, str){ // 点击删除时的确认弹框: 走destroy方法 有“载入中”的提示 function delete_confirm_box_4(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -320,7 +320,7 @@ function delete_confirm_box_4(url, str){ //提示框:只有一个按钮,点击关闭弹框 function notice_sure_box(str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -328,7 +328,7 @@ function notice_sure_box(str){ //提示框:只有一个确定按钮,点击关闭弹框 function notice_box(str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '+ '确定
          '; pop_box_new(htmlvalue, 480, 140); @@ -337,7 +337,7 @@ function notice_box(str){ // 长提示框:只有一个确定按钮,点击关闭弹框 function long_notice_box(str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '+ '确定
          '; pop_box_new(htmlvalue, 575, 140); @@ -345,7 +345,7 @@ function long_notice_box(str){ // 长提示框:只有一个“知道啦”按钮,点击关闭弹框 function yes_notice_box(str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 575, 200); @@ -353,7 +353,7 @@ function yes_notice_box(str){ //提示框:只有一个知道啦按钮,点击打开新窗口 function sure_box_redirect(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -361,7 +361,7 @@ function sure_box_redirect(url, str){ //提示框:只有一个知道啦按钮,点击打开新窗口 function sure_box_redirect_without_newtab(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '; pop_box_new(htmlvalue, 480, 140); @@ -369,7 +369,7 @@ function sure_box_redirect_without_newtab(url, str){ //提示框:只有一个确定按钮,点击跳转 function notice_box_redirect(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '+ '确定
          '; pop_box_new(htmlvalue, 480, 140); @@ -377,7 +377,7 @@ function notice_box_redirect(url, str){ //提示框:只有一个确定按钮,点击跳转(局部刷新) function notice_box_redirect_remote(url, str){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          ' + str + '

          '+ '确定
          '; pop_box_new(htmlvalue, 480, 140); @@ -385,7 +385,7 @@ function notice_box_redirect_remote(url, str){ //重新登录 function re_entry(url){ - var htmlvalue = '

          提示

          '+ + var htmlvalue = '

          提示

          '+ '

          您的会话已退出,请重新登录^_^

          '; pop_box_new(htmlvalue, 480, 140); diff --git a/public/stylesheets/css/taskstyle.css b/public/stylesheets/css/taskstyle.css index 1006df8a3..885a11ceb 100644 --- a/public/stylesheets/css/taskstyle.css +++ b/public/stylesheets/css/taskstyle.css @@ -70,7 +70,7 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top: .panel-inner-title{ font-size: 14px; color: #666; max-width:85%; line-height:30px;word-wrap: break-word; margin-bottom: 10px} .panel-footer{ min-width:1000px; height: 210px!important;} /* 弹框 */ -.task-popup-text-center{ text-align: center; color: #666;} +.task-popup-text-center{ text-align: center; color: #333;} .task-popup-title{ border-bottom: 1px solid #eee; padding:10px 15px; } .task-popup-content{ padding:0px 15px 15px 15px;} .task-popup-submit{ margin: 0 auto 15px; width: 120px;} From 17c145a0f5fd4db151f2fd30af9e4ff6d95bf1f7 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 29 Sep 2017 16:02:08 +0800 Subject: [PATCH 57/79] =?UTF-8?q?=E8=AE=A8=E8=AE=BA=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E5=B1=80=E9=83=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 08ed16723..7e9662563 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -186,7 +186,7 @@ class MemosController < ApplicationController end def reply - if params[:parent_id] || params[:memo][:parent_id] + 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 From cbb648dd402b90c87deded756903fd1d9cf7c76b Mon Sep 17 00:00:00 2001 From: XuCheng642 <287102909@qq.com> Date: Fri, 29 Sep 2017 16:18:41 +0800 Subject: [PATCH 58/79] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/managements_controller.rb | 135 +++++++++- app/models/apply_action.rb | 1 - app/models/school.rb | 2 +- app/views/layouts/base_management.html.erb | 6 +- .../_add_auto_users_trial.html.erb | 91 +++++++ .../_auto_users_authorization_list.html.erb | 14 +- .../managements/_leave_message_list.html.erb | 4 +- .../managements/add_departments_part.html.erb | 70 ++++- .../managements/auto_users_trial.html.erb | 8 +- .../managements/departments_part.html.erb | 1 - .../identity_authentication.html.erb | 2 +- .../reject_authentication_pro.js.erb | 1 + app/views/managements/update_user.html.erb | 249 +++++++++++++----- app/views/my/account.js.erb | 1 - app/views/shixuns/_shixun_top.html.erb | 11 +- config/routes.rb | 4 + .../20170926012936_add_auto_users_trial.rb | 21 ++ public/stylesheets/css/edu-common.css | 9 +- public/stylesheets/css/project.css | 4 +- 19 files changed, 522 insertions(+), 112 deletions(-) create mode 100644 app/views/managements/_add_auto_users_trial.html.erb create mode 100644 app/views/managements/reject_authentication_pro.js.erb create mode 100644 db/migrate/20170926012936_add_auto_users_trial.rb diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 32010e53f..8a7630134 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 @@ -480,15 +554,27 @@ end end def save_school - uploaded_io = params[:logo] + # 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) + # 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 - sl.logo_link = '/images/school/'+sl.id.to_s+'.png' + # sl.logo_link = '/images/school/'+sl.id.to_s+'.png' + # 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 @@ -1105,19 +1191,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 +1456,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 +1474,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 +1484,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 +1518,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") 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/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/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/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..22e8bfa68 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_path(jour.jour_id) %> + <% replys = JournalsForMessage.where(:m_parent_id => jour.id) %> <%= replys.nil? ? 0 : replys.count %> diff --git a/app/views/managements/add_departments_part.html.erb b/app/views/managements/add_departments_part.html.erb index a4d6ea839..8bfe79c6c 100644 --- a/app/views/managements/add_departments_part.html.erb +++ b/app/views/managements/add_departments_part.html.erb @@ -1,13 +1,67 @@
            <%= form_tag save_school_managements_path(),method: "post",:id => "save_school" do %> -
            - - <%= image_tag('', id: "avatar_image", :class=>"school_avatar ml25") %> - 上传图片 - <%= file_field_tag 'logo',:style => "display:none;", :id => "file", :onchange => "showPreview(this)"%> - 删除图片 -
            -
            + + + + + + + + +
            + <%= file_field_tag 'account/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 + } %> + + +选择文件 +
            +
            + +
            + <%= image_tag(url_to_auth_img(0, 'ID'), :width => 200, :height => 150, :id => 'nh_source_id') %> +
            +
            +
            + + + + + + + + + + + + + + + + + +
              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..dbc816c98 100644 --- a/app/views/managements/departments_part.html.erb +++ b/app/views/managements/departments_part.html.erb @@ -3,7 +3,6 @@ 搜索 清除 - <% 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" %>
            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 95c81a191..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 %>
      -
      -
    • - - - -
      - 邮箱格式不正确 -
    • -
    • - - - -
      - 手机号输入不正确 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
    • -
    • - 保存 - 取消 -
    • -
      + + + + + +