试卷的调整

dev_jupyter
cxt 5 years ago
parent b9b24dfbef
commit c91552399b

@ -23,7 +23,11 @@ class ItemBankQuery < ApplicationQuery
items = items.joins(:sub_discipline).where(sub_disciplines: {discipline_id: params[:discipline_id]})
end
items = items.where(item_type: params[:item_type].to_i) if params[:item_type].present?
if params[:oj_status].present? && params[:item_type] == "PROGRAM"
items = items.joins("join hacks on hacks.id=item_banks.container_id and item_banks.container_type='Hack'").where(hacks: {status: params[:oj_status]})
end
items = items.where(item_type: params[:item_type]) if params[:item_type].present?
items = items.where(difficulty: params[:difficulty].to_i) if params[:difficulty].present?
items = items.where("name like ?", "%#{params[:keyword].strip}%") if params[:keyword].present?

@ -6,6 +6,6 @@ json.choices item.item_choices do |choice|
end
if item.item_type == "PROGRAM"
json.program_attr do
json.(item.container, :description, :language, :difficult)
json.(item.container, :description, :language, :difficult, :status, :identifier)
end
end
Loading…
Cancel
Save