试卷的调整

dev_chen
cxt 5 years ago
parent 12dc269fbd
commit 8938b299d5

@ -10,6 +10,7 @@ class ExaminationBanks::SendToCourseService < ApplicationService
ActiveRecord::Base.transaction do
exercise.exercise_name = exam.name
exercise.time = exam.duration.present? ? exam.duration : -1
exercise.is_md = false
exercise.save!
exam.examination_items.each_with_index do |item, index|
@ -18,7 +19,6 @@ class ExaminationBanks::SendToCourseService < ApplicationService
question.question_title = item.name
question.question_number = index + 1
question.question_score = item.score
question.is_md = false
if item.item_type == "PROGRAM"
new_hack = item.container.fork

@ -1,5 +1,4 @@
json.question_id question.id
json.is_md question.is_md
q_positon = question.question_number
if ques_position.present?
q_positon = ques_position

@ -1,5 +1,5 @@
json.exercise do
json.extract! exercise, :id, :exercise_name,:exercise_description,:exercise_status,:answer_open
json.extract! exercise, :id, :exercise_name,:exercise_description,:exercise_status,:answer_open,:is_md
json.student_commit_status student_status #当前为学生且已提交时
end

@ -3,7 +3,7 @@ json.left_banner_name @left_banner_name
json.partial! "commons/success"
json.exercise do
json.extract! @exercise, :id, :exercise_name,:exercise_description,:exercise_status
json.extract! @exercise, :id, :exercise_name,:exercise_description,:exercise_status,:is_md
end
json.partial! "exercises/exercise_scores"

@ -1,7 +1,7 @@
json.partial! "commons/success"
json.exercise do
json.extract! @exercise, :id, :exercise_name,:exercise_description,:exercise_status
json.extract! @exercise, :id, :exercise_name,:exercise_description,:exercise_status,:is_md
end
json.user_permission do

@ -2,7 +2,7 @@ all_question_status = []
json.left_banner_id @left_banner_id
json.left_banner_name @left_banner_name
json.exercise do
json.extract! @exercise,:id,:exercise_name,:exercise_description
json.extract! @exercise,:id,:exercise_name,:exercise_description,:is_md
json.exercise_status @t_user_exercise_status
json.left_time @user_left_time
json.user_exercise_status @user_exercise_status #当前用户的状态

@ -0,0 +1,6 @@
class AddIsMdToExercise < ActiveRecord::Migration[5.2]
def change
remove_column :exercise_questions, :is_md
add_column :exercises, :is_md, :boolean, default: 1
end
end
Loading…
Cancel
Save