diff --git a/app/assets/javascripts/admins/courses/index.js b/app/assets/javascripts/admins/courses/index.js index 0e3473dff..58e962b8c 100644 --- a/app/assets/javascripts/admins/courses/index.js +++ b/app/assets/javascripts/admins/courses/index.js @@ -19,7 +19,7 @@ $(document).on('turbolinks:load', function() { var json = {}; json[s_name] = s_value; $.ajax({ - url: "/admins/courses/" + s_id, + url: "/admins/classrooms/" + s_id, type: "PUT", dataType:'script', data: json diff --git a/app/controllers/course_second_categories_controller.rb b/app/controllers/course_second_categories_controller.rb index b295c0f9f..62cbf83d9 100644 --- a/app/controllers/course_second_categories_controller.rb +++ b/app/controllers/course_second_categories_controller.rb @@ -36,10 +36,13 @@ class CourseSecondCategoriesController < ApplicationController # 更新相应对象的子目录id if @course_module.module_type == "shixun_homework" @category.homework_commons.update_all(course_second_category_id: 0) - @right_url = "/courses/#{@course.id}/shixun_homeworks/#{@course_module.id}" + @right_url = "/classrooms/#{@course.id}/shixun_homeworks/#{@course_module.id}" elsif @course_module.module_type == "attachment" Attachment.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) - @right_url = "/courses/#{@course.id}/files/#{@course_module.id}" + @right_url = "/classrooms/#{@course.id}/files/#{@course_module.id}" + elsif @course_module.module_type == "video" + @course.course_videos.where(course_second_category_id: @category.id).update_all(course_second_category_id: 0) + @right_url = "/classrooms/#{@course.id}/course_videos" end @category.destroy diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 462e06adc..d695a6b00 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -46,13 +46,13 @@ class StudentWork < ApplicationRecord # 匿评次数 def student_comment_num - homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).count : 0 + homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 ? self.student_works_scores.select{|score| score.reviewer_role == 3}.group_by(&:user_id).size : 0 end # 学生评阅作品数 def user_comment_num if homework_common.homework_detail_manual.comment_status > 2 && work_status > 0 - count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).count + count = homework_common.student_works_scores.select{|score| score.reviewer_role == 3 && score.user_id == user_id}.group_by(&:student_work_id).size else count = 0 end diff --git a/app/views/admins/courses/shared/_td.html.erb b/app/views/admins/courses/shared/_td.html.erb index 51cc4b199..87e6f305d 100644 --- a/app/views/admins/courses/shared/_td.html.erb +++ b/app/views/admins/courses/shared/_td.html.erb @@ -1,7 +1,7 @@