+ 基本使用情况 +
+ {/*基本使用情况1*/} ++ 教师 +
++ 学生 +
++ 课堂 +
++ 共建实训 +
++ 实习报告 +
++ 学员实战时间 +
++ 课堂 +
+ { + courses===null? ++ 教师排名 +
+ { + teachers===null? ++ 在线实训情况 +
+ { + shixun_chart_data===null? ++ 学生排名 +
+ { + students === null ? ++ 最热评测 +
+ { + studentionsnames===null? +基本使用情况
From 66d3ad03568e923f5480239c88bbb58dbf3d63ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 19 Dec 2019 15:16:42 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=96=B0=E7=89=88=E5=AD=A6=E9=99=A2?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/college/College.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/react/src/college/College.js b/public/react/src/college/College.js index 44649c3cf..eaed9747c 100644 --- a/public/react/src/college/College.js +++ b/public/react/src/college/College.js @@ -299,11 +299,11 @@ class College extends Component { render: (text, record) => ( { - record.id===1? + record.id===1? :record.id===2? - + :record.id===3? - + :record.id } From 04d1d7095d3e980c49ccaebd8efbff2180324f68 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 19 Dec 2019 15:31:19 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 51a8b7123..2be7f3cd4 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -158,7 +158,7 @@ class CollegesController < ApplicationController return true if current_user.admin_or_business? # 超级管理员|运营 return true if current_college.is_a?(Department) && current_college.member?(current_user) # 部门管理员 return true if current_user.is_teacher? && current_user.school_id == current_school.id # 学校老师 - return true if current_school.customers.exists? && current_user.partner&.partner_customers&.exists?(customer_id: current_school.customer_id) + # return true if current_school.customers.exists? && current_user.partner&.partner_customers&.exists?(customer_id: current_school.customer_id) false end From 9c3bff5e9f96170f1b714c199b0760c5bb9aef7f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 19 Dec 2019 15:37:04 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E5=AD=A6=E6=A0=A1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/colleges_controller.rb | 8 ++++---- app/views/colleges/student_shixun.json.jbuilder | 2 +- app/views/colleges/teachers.json.jbuilder | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/controllers/colleges_controller.rb b/app/controllers/colleges_controller.rb index 2be7f3cd4..707255866 100644 --- a/app/controllers/colleges_controller.rb +++ b/app/controllers/colleges_controller.rb @@ -44,8 +44,8 @@ class CollegesController < ApplicationController (SELECT count(c.id) FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.user_id=users.id AND m.role in (1,2,3) and c.school_id = #{current_school.id} AND c.is_delete = 0) as course_count FROM `users`, user_extensions ue where ue.school_id=#{current_school.id} and users.id=ue.user_id and ue.identity=0 ORDER BY publish_shixun_count desc, course_count desc, id desc LIMIT 10") # ).order("publish_shixun_count desc, experience desc").limit(10) - @teacher_count = UserExtension.where(school_id: current_school.id) - .select('SUM(IF(identity=0, 1, 0)) AS teachers_count').first.teachers_count + # @teacher_count = UserExtension.where(school_id: current_school.id) + # .select('SUM(IF(identity=0, 1, 0)) AS teachers_count').first.teachers_count @teachers = @teachers.map do |teacher| course_ids = Course.find_by_sql("SELECT c.id FROM courses c, course_members m WHERE c.id != 1309 and m.course_id = c.id AND m.role in (1,2,3) AND m.user_id=#{teacher.id} AND c.is_delete = 0 and c.school_id = #{current_school.id}") @@ -99,7 +99,7 @@ class CollegesController < ApplicationController @course_count = courses.size courses = courses.left_joins(practice_homeworks: { student_works: { myshixun: :games } }) - .select('courses.id, courses.name, courses.is_end, sum(games.evaluate_count) evaluating_count') + .select('courses.id, courses.name, courses.is_end, IFNULL(sum(games.evaluate_count), 0) evaluating_count') .group('courses.id').order('is_end asc, evaluating_count desc') @courses = paginate courses @@ -117,7 +117,7 @@ class CollegesController < ApplicationController # 学生实训 def student_shixun - @student_count = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).count + # @student_count = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).count @students = User.joins(:user_extension).where(user_extensions: { school_id: current_school.id, identity: 1 }).includes(:user_extension).order('experience desc').limit(10) student_ids = @students.map(&:id) diff --git a/app/views/colleges/student_shixun.json.jbuilder b/app/views/colleges/student_shixun.json.jbuilder index 431603afa..97e418148 100644 --- a/app/views/colleges/student_shixun.json.jbuilder +++ b/app/views/colleges/student_shixun.json.jbuilder @@ -7,4 +7,4 @@ json.teachers @students do |student| json.grade student.grade json.experience student.experience end -json.student_count @student_count \ No newline at end of file +# json.student_count @student_count \ No newline at end of file diff --git a/app/views/colleges/teachers.json.jbuilder b/app/views/colleges/teachers.json.jbuilder index 29b383fa4..1308f0cf4 100644 --- a/app/views/colleges/teachers.json.jbuilder +++ b/app/views/colleges/teachers.json.jbuilder @@ -8,4 +8,4 @@ json.teachers @teachers do |teacher| json.complete_rate teacher['complete_rate'] json.publish_shixun_count teacher['publish_shixun_count'] end -json.teacher_count @teacher_count \ No newline at end of file +# json.teacher_count @teacher_count \ No newline at end of file From 3130adbb319c0d0416e5df5864b60bcd23ce0799 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 19 Dec 2019 15:54:11 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E7=9A=84=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 8a1c07ddf..638971dfc 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -167,7 +167,11 @@ class HomeworkCommonsController < ApplicationController if params[:work_status].present? params_work_status = params[:work_status] work_status = params_work_status.map{|status| status.to_i} - @student_works = @student_works.where(compelete_status: work_status) + if @homework.homework_type == "practice" + @student_works = @student_works.where(compelete_status: work_status) + else + @student_works = @student_works.where(work_status: work_status) + end end # 分班情况 From 6567a517cf16f4e07bada8f1b0748d4bd4dc1e3d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 19 Dec 2019 16:36:14 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E9=A2=98=E5=BA=93=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=BB=93=E6=9E=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/curriculum.rb | 4 ---- app/models/curriculum_direction.rb | 4 ---- app/models/item_bank.rb | 2 -- app/models/knowledge_point.rb | 5 ----- app/models/knowledge_point_container.rb | 3 --- .../20191218070922_create_curriculum_directions.rb | 9 --------- db/migrate/20191218071017_create_curriculums.rb | 10 ---------- db/migrate/20191218071111_create_knowledge_points.rb | 11 ----------- ...191218071343_create_knowledge_point_containers.rb | 12 ------------ spec/models/curriculum_direction_spec.rb | 5 ----- spec/models/curriculum_spec.rb | 5 ----- spec/models/knowledge_point_container_spec.rb | 5 ----- spec/models/knowledge_point_spec.rb | 5 ----- 13 files changed, 80 deletions(-) delete mode 100644 app/models/curriculum.rb delete mode 100644 app/models/curriculum_direction.rb delete mode 100644 app/models/knowledge_point.rb delete mode 100644 app/models/knowledge_point_container.rb delete mode 100644 db/migrate/20191218070922_create_curriculum_directions.rb delete mode 100644 db/migrate/20191218071017_create_curriculums.rb delete mode 100644 db/migrate/20191218071111_create_knowledge_points.rb delete mode 100644 db/migrate/20191218071343_create_knowledge_point_containers.rb delete mode 100644 spec/models/curriculum_direction_spec.rb delete mode 100644 spec/models/curriculum_spec.rb delete mode 100644 spec/models/knowledge_point_container_spec.rb delete mode 100644 spec/models/knowledge_point_spec.rb diff --git a/app/models/curriculum.rb b/app/models/curriculum.rb deleted file mode 100644 index 0b78814bc..000000000 --- a/app/models/curriculum.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Curriculum < ApplicationRecord - belongs_to :curriculum_direction - has_many :knowledge_points, dependent: :destroy -end diff --git a/app/models/curriculum_direction.rb b/app/models/curriculum_direction.rb deleted file mode 100644 index 1c9211559..000000000 --- a/app/models/curriculum_direction.rb +++ /dev/null @@ -1,4 +0,0 @@ -class CurriculumDirection < ApplicationRecord - has_many :curriculums - has_many :knowledge_points -end diff --git a/app/models/item_bank.rb b/app/models/item_bank.rb index 32c349e34..8078a55e0 100644 --- a/app/models/item_bank.rb +++ b/app/models/item_bank.rb @@ -3,8 +3,6 @@ class ItemBank < ApplicationRecord # item_type: 0 单选 1 多选 2 判断 3 填空 4 简答 5 实训 6 编程 enum item_type: { SINGLE: 0, MULTIPLE: 1, JUDGMENT: 2, COMPLETION: 3, SUBJECTIVE: 4, PRACTICAL: 5, PROGRAM: 6 } - belongs_to :curriculum - belongs_to :curriculum_direction belongs_to :user has_one :item_analysis, dependent: :destroy diff --git a/app/models/knowledge_point.rb b/app/models/knowledge_point.rb deleted file mode 100644 index 3d75b66a1..000000000 --- a/app/models/knowledge_point.rb +++ /dev/null @@ -1,5 +0,0 @@ -class KnowledgePoint < ApplicationRecord - belongs_to :curriculum_direction - belongs_to :curriculum - has_many :knowledge_point_containers, dependent: :destroy -end diff --git a/app/models/knowledge_point_container.rb b/app/models/knowledge_point_container.rb deleted file mode 100644 index ea73d00e7..000000000 --- a/app/models/knowledge_point_container.rb +++ /dev/null @@ -1,3 +0,0 @@ -class KnowledgePointContainer < ApplicationRecord - belongs_to :knowledge_point -end diff --git a/db/migrate/20191218070922_create_curriculum_directions.rb b/db/migrate/20191218070922_create_curriculum_directions.rb deleted file mode 100644 index 9203aa435..000000000 --- a/db/migrate/20191218070922_create_curriculum_directions.rb +++ /dev/null @@ -1,9 +0,0 @@ -class CreateCurriculumDirections < ActiveRecord::Migration[5.2] - def change - create_table :curriculum_directions do |t| - t.string :name - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071017_create_curriculums.rb b/db/migrate/20191218071017_create_curriculums.rb deleted file mode 100644 index 885f2a676..000000000 --- a/db/migrate/20191218071017_create_curriculums.rb +++ /dev/null @@ -1,10 +0,0 @@ -class CreateCurriculums < ActiveRecord::Migration[5.2] - def change - create_table :curriculums do |t| - t.string :name - t.references :curriculum_direction, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071111_create_knowledge_points.rb b/db/migrate/20191218071111_create_knowledge_points.rb deleted file mode 100644 index 2f748d266..000000000 --- a/db/migrate/20191218071111_create_knowledge_points.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateKnowledgePoints < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_points do |t| - t.string :name - t.references :curriculum_direction, index: true - t.references :curriculum, index: true - - t.timestamps - end - end -end diff --git a/db/migrate/20191218071343_create_knowledge_point_containers.rb b/db/migrate/20191218071343_create_knowledge_point_containers.rb deleted file mode 100644 index 0b6944ea7..000000000 --- a/db/migrate/20191218071343_create_knowledge_point_containers.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CreateKnowledgePointContainers < ActiveRecord::Migration[5.2] - def change - create_table :knowledge_point_containers do |t| - t.references :knowledge_point - t.integer :container_id - t.string :container_type - - t.timestamps - end - add_index :knowledge_point_containers, [:knowledge_point_id, :container_id, :container_type], name: "container_index", unique: true - end -end diff --git a/spec/models/curriculum_direction_spec.rb b/spec/models/curriculum_direction_spec.rb deleted file mode 100644 index 40cab64ca..000000000 --- a/spec/models/curriculum_direction_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe CurriculumDirection, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/curriculum_spec.rb b/spec/models/curriculum_spec.rb deleted file mode 100644 index b03089a91..000000000 --- a/spec/models/curriculum_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe Curriculum, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_container_spec.rb b/spec/models/knowledge_point_container_spec.rb deleted file mode 100644 index 3e151062f..000000000 --- a/spec/models/knowledge_point_container_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePointContainer, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/knowledge_point_spec.rb b/spec/models/knowledge_point_spec.rb deleted file mode 100644 index d85138a0f..000000000 --- a/spec/models/knowledge_point_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe KnowledgePoint, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end