Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

chromesetting
杨树林 5 years ago
commit 92cb389e71

@ -1501,8 +1501,12 @@ class HomeworkCommonsController < ApplicationController
@user = @student_work.user
tip_exception("当前用户无作品可以显示") if @student_work.nil?
# 查询最新一次的查重标识query_id
group_id = @course.course_members.where(user_id: params[:user_id]).pluck(:course_group_id).first
query_id = @homework.homework_group_reviews.where(:course_group_id => group_id).last.try(:query_id)
group_id = @course.students.where(user_id: params[:user_id]).pluck(:course_group_id).first
homework_group_review = @homework.homework_group_reviews.where(:course_group_id => group_id).last || @homework.homework_group_reviews.last
query_id = homework_group_review.try(:query_id)
Rails.logger.info("##################------query_id: #{query_id}")
tip_exception(-1, "query_id有误") unless query_id.present?
results = ReviewService.query_result({user_id: params[:user_id], query_id: query_id})
@shixun = @homework.shixuns.take
if results.status == 0

@ -1,4 +0,0 @@
class Curriculum < ApplicationRecord
belongs_to :curriculum_direction
has_many :knowledge_points, dependent: :destroy
end

@ -1,4 +0,0 @@
class CurriculumDirection < ApplicationRecord
has_many :curriculums
has_many :knowledge_points
end

@ -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

@ -1,5 +0,0 @@
class KnowledgePoint < ApplicationRecord
belongs_to :curriculum_direction
belongs_to :curriculum
has_many :knowledge_point_containers, dependent: :destroy
end

@ -1,3 +0,0 @@
class KnowledgePointContainer < ApplicationRecord
belongs_to :knowledge_point
end

@ -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

@ -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

@ -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

@ -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

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe CurriculumDirection, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe Curriculum, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe KnowledgePointContainer, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end

@ -1,5 +0,0 @@
require 'rails_helper'
RSpec.describe KnowledgePoint, type: :model do
pending "add some examples to (or delete) #{__FILE__}"
end
Loading…
Cancel
Save