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 @@ <%= list_index_no((params[:page] || 1).to_i, no) %> <%= course.id %> - <%= link_to(course.name, "/courses/#{course.id}", target: '_blank') %> + <%= link_to(course.name, "/classrooms/#{course.id}", target: '_blank') %> <%= course.course_members_count %> <%= get_attachment_count(course, 0) %> diff --git a/app/views/colleges/_course_statistics.html.erb b/app/views/colleges/_course_statistics.html.erb index e10739fb2..e544cf660 100644 --- a/app/views/colleges/_course_statistics.html.erb +++ b/app/views/colleges/_course_statistics.html.erb @@ -17,7 +17,7 @@ <% if @courses.present? %> <% @courses.each do |course| %> - <%= course.name %> + <%= course.name %> <% teacher_names = course.teacher_users.map(&:real_name).join('、') %> diff --git a/app/views/course_groups/destroy.json.jbuilder b/app/views/course_groups/destroy.json.jbuilder index 0fbd93d7f..a45cbd750 100644 --- a/app/views/course_groups/destroy.json.jbuilder +++ b/app/views/course_groups/destroy.json.jbuilder @@ -1,3 +1,3 @@ json.status 0 json.message "删除成功" -json.right_url "/courses/#{@course.id}/students" \ No newline at end of file +json.right_url "/classrooms/#{@course.id}/students" \ No newline at end of file diff --git a/app/views/courses/left_banner.json.jbuilder b/app/views/courses/left_banner.json.jbuilder index f3b80b4f5..ecd8fe127 100644 --- a/app/views/courses/left_banner.json.jbuilder +++ b/app/views/courses/left_banner.json.jbuilder @@ -21,7 +21,7 @@ json.course_modules @course_modules.each do |mod| json.position board.position json.category_count board.messages_count json.category_type "messages" - json.second_category_url "/courses/#{@course.id}/boards/#{board.id}" + json.second_category_url "/classrooms/#{@course.id}/boards/#{board.id}" end end else diff --git a/app/views/users/get_navigation_info.json.jbuilder b/app/views/users/get_navigation_info.json.jbuilder index 8af3691f3..a9f835501 100644 --- a/app/views/users/get_navigation_info.json.jbuilder +++ b/app/views/users/get_navigation_info.json.jbuilder @@ -4,11 +4,11 @@ json.top do json.course_url "/courses" json.competitions_url "#{@old_domain}/competitions" json.topic_url "/forums" - json.new_course_url "/courses/new" + json.new_course_url "/classrooms/new" json.new_shixun_url "/shixuns/new" json.new_shixun_path_url "/paths/new" json.new_project_url "#{@old_domain}/projects/new" - json.join_course_url "/courses/join_course_multi_role" + json.join_course_url "/classrooms/join_course_multi_role" json.join_project_url "#{@old_domain}/applied_project/applied_project_info" json.message_url "#{@user_url}/user_tidings" json.new_message @new_message