From eb6cee3e615491fcf3f8274b421f38c6d583c445 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 18 Mar 2020 20:31:34 +0800
Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=80=81=E5=B8=88?=
=?UTF-8?q?=E5=90=8D=E7=A7=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/courses_controller.rb | 2 +-
app/controllers/weapps/courses_controller.rb | 1 +
app/controllers/weapps/homes_controller.rb | 2 +-
app/views/courses/index.json.jbuilder | 1 -
app/views/weapps/courses/show.json.jbuilder | 3 ++-
app/views/weapps/homes/show.json.jbuilder | 1 +
6 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index 48f644a14..46ac514b4 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -99,7 +99,7 @@ class CoursesController < ApplicationController
limit = params[:limit] || 16
@courses = @courses.page(page).per(limit)
- @courses = @courses.preload(:school, :none_hidden_course_modules, :teacher_users, teacher: :user_extension)
+ @courses = @courses.preload(:school, :none_hidden_course_modules, teacher: :user_extension)
end
def course_videos
diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb
index 2a375a7fb..1dec62201 100644
--- a/app/controllers/weapps/courses_controller.rb
+++ b/app/controllers/weapps/courses_controller.rb
@@ -76,6 +76,7 @@ class Weapps::CoursesController < Weapps::BaseController
def show
@course = current_course
@current_user = current_user
+ @teacher_users = @course.teacher_users.where.not(user_id: @course.tea_id).map(&:real_name)[0..2]
end
def shixun_homework_category
diff --git a/app/controllers/weapps/homes_controller.rb b/app/controllers/weapps/homes_controller.rb
index e53923fa8..3e94354a2 100644
--- a/app/controllers/weapps/homes_controller.rb
+++ b/app/controllers/weapps/homes_controller.rb
@@ -19,7 +19,7 @@ class Weapps::HomesController < Weapps::BaseController
@courses = @courses.where(id: current_laboratory.all_courses)
@course_count = @courses.count
order_str = "course_members.sticky=1 desc, course_members.sticky_time desc, courses.created_at desc"
- @courses = paginate(@courses.order(order_str).includes(:teacher, :school))
+ @courses = paginate(@courses.order(order_str).includes(:teacher_users, :teacher, :school))
@user = current_user
end
end
\ No newline at end of file
diff --git a/app/views/courses/index.json.jbuilder b/app/views/courses/index.json.jbuilder
index a8b70c435..f9bceebb8 100644
--- a/app/views/courses/index.json.jbuilder
+++ b/app/views/courses/index.json.jbuilder
@@ -13,6 +13,5 @@ json.courses @courses do |course|
json.is_end course.is_end
json.first_category_url module_url(course.none_hidden_course_modules.first, course)
json.excellent course.excellent
- json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师
end
json.courses_count @courses_count
diff --git a/app/views/weapps/courses/show.json.jbuilder b/app/views/weapps/courses/show.json.jbuilder
index c22b24426..cf58315b4 100644
--- a/app/views/weapps/courses/show.json.jbuilder
+++ b/app/views/weapps/courses/show.json.jbuilder
@@ -1,4 +1,5 @@
json.(@course, :id, :name, :course_members_count, :credit, :invite_code_halt)
json.teachers_count @course.teachers.count
json.students_count @course.students.count
-json.course_identity @current_user.course_identity(@course)
\ No newline at end of file
+json.course_identity @current_user.course_identity(@course)
+json.teacher_users @teacher_users
\ No newline at end of file
diff --git a/app/views/weapps/homes/show.json.jbuilder b/app/views/weapps/homes/show.json.jbuilder
index f307d64fe..5d0e35e05 100644
--- a/app/views/weapps/homes/show.json.jbuilder
+++ b/app/views/weapps/homes/show.json.jbuilder
@@ -26,5 +26,6 @@ json.courses @courses.each do |course|
course_member = @category == "study" ? course.students.where(user_id: @user.id).first : course.teachers.where(user_id: @user.id).first
json.sticky course_member.sticky
json.course_identity current_user.course_identity(course)
+ json.teacher_users course.teacher_users.select{|u| u.id != course.tea_id }.map(&:real_name)[0..2] # 取前3名老师
end
From c24e5cf774c823a1c91865c291b0846166e1e0f5 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Wed, 18 Mar 2020 20:38:55 +0800
Subject: [PATCH 2/5] =?UTF-8?q?=E5=8D=8F=E4=BD=9C=E8=80=81=E5=B8=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/application_controller.rb | 2 +-
app/controllers/weapps/courses_controller.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index ccf52049c..15e795bdb 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -330,7 +330,7 @@ class ApplicationController < ActionController::Base
end
if !User.current.logged? && Rails.env.development?
- User.current = User.find 8825
+ User.current = User.find 1
end
diff --git a/app/controllers/weapps/courses_controller.rb b/app/controllers/weapps/courses_controller.rb
index 1dec62201..3a1b22cc4 100644
--- a/app/controllers/weapps/courses_controller.rb
+++ b/app/controllers/weapps/courses_controller.rb
@@ -76,7 +76,7 @@ class Weapps::CoursesController < Weapps::BaseController
def show
@course = current_course
@current_user = current_user
- @teacher_users = @course.teacher_users.where.not(user_id: @course.tea_id).map(&:real_name)[0..2]
+ @teacher_users = @course.teacher_users.where.not(id: @course.tea_id).map(&:real_name)[0..2]
end
def shixun_homework_category
From 7a28b31a468914174a50123f178f53283cb4be56 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 18 Mar 2020 20:47:26 +0800
Subject: [PATCH 3/5] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E9=87=8D=E5=81=9A?=
=?UTF-8?q?=E7=9A=84=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/myshixuns_controller.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb
index a96a2a79f..8713bebf3 100644
--- a/app/controllers/myshixuns_controller.rb
+++ b/app/controllers/myshixuns_controller.rb
@@ -18,7 +18,8 @@ class MyshixunsController < ApplicationController
# 强制重置实训
# 前段需要按照操作过程提示
def reset_my_game
- unless (current_user.admin? || current_user.id == @myshixun.user_id)
+ course = Course.find_by(id: params[:course_id])
+ unless (current_user.admin_or_business? || current_user.id == @myshixun.user_id) || (course.present? && current_user.course_identity(course) < Course::STUDENT)
tip_exception("403", "")
end
begin
From f56574a926c594d3b0fb86925d5de606152773f9 Mon Sep 17 00:00:00 2001
From: cxt <853663049@qq.com>
Date: Wed, 18 Mar 2020 20:48:37 +0800
Subject: [PATCH 4/5] =?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/views/student_works/shixun_work_report.json.jbuilder | 1 +
1 file changed, 1 insertion(+)
diff --git a/app/views/student_works/shixun_work_report.json.jbuilder b/app/views/student_works/shixun_work_report.json.jbuilder
index d8ab98a3f..c6596d1ee 100644
--- a/app/views/student_works/shixun_work_report.json.jbuilder
+++ b/app/views/student_works/shixun_work_report.json.jbuilder
@@ -1,4 +1,5 @@
json.homework_common_id @homework.id
+json.course_id @homework.course_id
json.category @homework.category_info
json.course_name @course.name
json.work_id @work.id
From d73d3a02494fc460968f95b735e2753955cac107 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 18 Mar 2020 21:31:55 +0800
Subject: [PATCH 5/5] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/busyWork/CommonWorkList.js | 23 +++++++++++--------
.../courses/shixunHomework/Chongzuomodel.js | 2 +-
2 files changed, 15 insertions(+), 10 deletions(-)
diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js
index 4c53a8362..e45d016bb 100644
--- a/public/react/src/modules/courses/busyWork/CommonWorkList.js
+++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js
@@ -1,6 +1,6 @@
import React,{Component} from "react";
-import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip,Spin, Pagination} from "antd";
-import {WordsBtn, ConditionToolTip, queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
+import { Form, Table,Tooltip,Spin, Pagination} from "antd";
+import { queryString, publicSearchs, on, off, NoneData, sortDirections} from 'educoder';
import axios from 'axios';
import CheckAllGroup from '../common/button/CheckAllGroup'
import moment from 'moment';
@@ -11,7 +11,6 @@ import ModulationModal from "../coursesPublic/ModulationModal";
import AccessoryModal from "../coursesPublic/AccessoryModal";
import LeaderIcon from './common/LeaderIcon'
const $ = window.$;
-const Search = Input.Search;
function renderScore(score, content) {
let color = '#747A7F'
@@ -369,18 +368,24 @@ function buildColumns(that, student_works, studentData) {
{/* 0 未提交 */}
{/*