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

dev_jupyter
杨树明 5 years ago
commit cb29262ed9

@ -400,7 +400,7 @@ class ApplicationController < ActionController::Base
end end
rescue Exception => e rescue Exception => e
uid_logger("--uri_exec: exception #{e.message}") uid_logger("--uri_exec: exception #{e.message}")
raise Educoder::TipException.new("实训平台繁忙繁忙等级84") raise Educoder::TipException.new(message)
end end
end end
@ -603,7 +603,7 @@ class ApplicationController < ActionController::Base
end end
def paginate(relation) def paginate(relation)
limit = params[:limit].to_i.zero? ? 20 : params[:limit].to_i limit = (params[:limit].to_i.zero? || params[:limit].to_i > 20) ? 20 : params[:limit].to_i
page = params[:page].to_i.zero? ? 1 : params[:page].to_i page = params[:page].to_i.zero? ? 1 : params[:page].to_i
offset = (page - 1) * limit offset = (page - 1) * limit

@ -0,0 +1,51 @@
class ExaminationBanksController < ApplicationController
before_action :require_login
def index
exams = ExaminationBankQuery.call(params)
@exams_count = exams.size
@exams = paginate exams.includes(:user, :examination_items)
end
def show
end
def create
ActiveRecord::Base.transaction do
exam = ExaminationBank.new(user: current_user)
# 保存试卷基础信息
exam = ExaminationBanks::SaveExaminationBankService.call(exam, form_params)
# 将试题篮中的试题发送到试卷,试卷的题目与试题独立
current_user.item_baskets.includes(:item_bank).each do |basket|
item = basket.item_bank
if item.present?
new_item = ExaminationItem.new(examination_bank: exam, item_bank: item, name: item.name, item_type: item.item_type,
difficulty: item.difficulty, score: basket.score, position: basket.position)
if new_item.save!
item.increment!(:quotes)
if item.item_choices.present?
item.item_choices.each do |choice|
new_item.examination_item_choices << ExaminationItemChoice.new(choice_text: choice.choice_text, is_answer: choice.is_answer)
end
end
end
end
end
current_user.item_baskets.destroy_all
end
render_ok
end
def edit
end
private
def form_params
params.permit(:discipline_id, :sub_discipline_id, :difficulty, :name, :duration, tag_discipline_id: [])
end
end

@ -100,7 +100,7 @@ class HacksController < ApplicationController
@hack.update_attribute(:status, 1) @hack.update_attribute(:status, 1)
base_attrs = { base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id, trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackPublish" parent_container_type: "HackPublish", extra: @hack.identifier
} }
@hack.tidings.create!(base_attrs) @hack.tidings.create!(base_attrs)
render_ok render_ok
@ -111,7 +111,7 @@ class HacksController < ApplicationController
@hack.update_attribute(:status, 0) @hack.update_attribute(:status, 0)
base_attrs = { base_attrs = {
trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id, trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id,
parent_container_type: "HackUnPublish" parent_container_type: "HackUnPublish", extra: @hack.identifier
} }
@hack.tidings.create!(base_attrs) @hack.tidings.create!(base_attrs)
render_ok render_ok

@ -1,5 +1,7 @@
class ItemBasketsController < ApplicationController class ItemBasketsController < ApplicationController
before_action :require_login before_action :require_login
before_action :validate_score, only: [:set_score, :batch_set_score]
helper_method :current_basket
def index def index
@item_baskets = current_user.item_baskets @item_baskets = current_user.item_baskets
@ -41,9 +43,48 @@ class ItemBasketsController < ApplicationController
render_ok render_ok
end end
def set_score
current_basket.update_attributes!(score: params[:score])
@questions_score = current_user.item_baskets.where(item_type: current_basket.item_type).pluck(:score).sum
@all_score = current_user.item_baskets.pluck(:score).sum
end
def batch_set_score
current_user.item_baskets.where(item_type: params[:item_type]).update_all(score: params[:score])
@questions_score = current_user.item_baskets.where(item_type: params[:item_type]).pluck(:score).sum
@all_score = current_user.item_baskets.pluck(:score).sum
end
def adjust_position
same_items = current_user.item_baskets.where(item_type: current_basket.item_type)
max_position = same_items.size
tip_exception("position超出范围") unless params[:position].present? && params[:position].to_i <= max_position && params[:position].to_i >= 1
ActiveRecord::Base.transaction do
if params[:position].to_i > current_basket.position
same_items.where("position > #{current_basket.position} and position <= #{params[:position].to_i}").update_all("position=position-1")
current_basket.update_attributes!(position: params[:position])
elsif params[:position].to_i < current_basket.position
same_items.where("position < #{current_basket.position} and position >= #{params[:position].to_i}").update_all("position=position+1")
current_basket.update_attributes!(position: params[:position])
else
return normal_status(-1, "排序无变化")
end
end
render_ok
end
private private
def create_params def create_params
params.permit(item_ids: []) params.permit(item_ids: [])
end end
def current_basket
@_current_basket = current_user.item_baskets.find_by!(id: params[:id])
end
def validate_score
tip_exception("分值不能为空") unless params[:score].present?
tip_exception("分值需大于0") unless params[:score].to_f > 0
end
end end

@ -4,7 +4,8 @@ class ShixunListsController < ApplicationController
end end
private private
def search_params def search_params
params.permit(:keyword, :type, :page, :limit, :order, :status, :diff, :sort) params.permit(:keyword, :type, :page, :limit, :order, :status, :diff, :sort, :no_jupyter)
end end
end end

@ -795,12 +795,12 @@ class ShixunsController < ApplicationController
rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path) rep_url = Base64.urlsafe_encode64(repo_ip_url @repo_path)
uri = "#{cloud_bridge}/bridge/game/openGameInstance" uri = "#{cloud_bridge}/bridge/game/openGameInstance"
params = {tpiID: "#{@myshixun.id}", tpmGitURL: rep_url, tpiRepoName: @myshixun.repo_name.split("/").last} params = {tpiID: "#{@myshixun.id}", tpmGitURL: rep_url, tpiRepoName: @myshixun.repo_name.split("/").last}
interface_post uri, params, 83, "实训云平台繁忙繁忙等级83" interface_post uri, params, 83, "服务器出现问题,请重置环境"
end end
end end
rescue => e rescue => e
uid_logger_error(e.message) uid_logger_error(e.message)
tip_exception("服务器出现问题,请重置环境") tip_exception(e.message)
end end
end end

@ -226,7 +226,8 @@ module TidingDecorator
end end
def discuss_content def discuss_content
I18n.t(locale_format(parent_container_type, container.parent_id.present?)) % message_content_helper(container.content) I18n.t(locale_format(parent_container_type, container.parent_id.present?)) %
(parent_container_type == 'Hack' ? container.content : message_content_helper(container.content))
end end
def grade_content def grade_content

@ -0,0 +1,12 @@
class ExaminationBanks::SaveExamForm
include ActiveModel::Model
attr_accessor :discipline_id, :sub_discipline_id, :difficulty, :name, :duration, :tag_discipline_id
validates :discipline_id, presence: true
validates :sub_discipline_id, presence: true
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
validates :name, presence: true, length: { maximum: 60 }
validates :duration, numericality: { only_integer: true, greater_than: 0 }
end

@ -56,14 +56,16 @@ class Discuss < ApplicationRecord
send_user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id send_user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id
parent_container_type = 'Challenge' parent_container_type = 'Challenge'
challenge_id = challenge_id challenge_id = challenge_id
extra = ''
elsif dis_type == 'Hack' elsif dis_type == 'Hack'
send_user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id send_user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id
parent_container_type = 'Hack' parent_container_type = 'Hack'
challenge_id = dis_id challenge_id = dis_id
extra = HackUserLastestCode.where(user_id: user_id, hack_id: dis_id).first&.identifier
end end
base_attrs = { base_attrs = {
trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type, trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type,
belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment' belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment', extra: extra
} }
tidings.create!(base_attrs.merge(user_id: send_user_id)) tidings.create!(base_attrs.merge(user_id: send_user_id))
end end

@ -0,0 +1,17 @@
class ExaminationBank < ApplicationRecord
belongs_to :user
belongs_to :sub_discipline
has_many :tag_discipline_containers, as: :container, dependent: :destroy
has_many :tag_disciplines, through: :tag_discipline_containers
has_many :examination_items, dependent: :destroy
def question_count
examination_items.size
end
def total_score
examination_items.pluck(:score).sum
end
end

@ -0,0 +1,6 @@
class ExaminationItem < ApplicationRecord
belongs_to :examination_bank, touch: true
belongs_to :item_bank, optional: true
has_many :examination_item_choices, dependent: :destroy
end

@ -0,0 +1,3 @@
class ExaminationItemChoice < ApplicationRecord
belongs_to :examination_item
end

@ -0,0 +1,32 @@
class ExaminationBankQuery < ApplicationQuery
include CustomSortable
attr_reader :params
sort_columns :updated_at, default_by: :updated_at, default_direction: :desc, default_table: 'examination_banks'
def initialize(params)
@params = params
end
def call
if params[:public].to_i == 1
exams = ExaminationBank.where(public: 1)
elsif params[:public].to_i == 0
exams = ExaminationBank.where(user_id: User.current.id)
end
if params[:tag_discipline_id].present?
exams = exams.joins(:tag_discipline_containers).where(tag_discipline_containers: {tag_discipline_id: params[:tag_discipline_id]})
elsif params[:sub_discipline_id].present?
exams = exams.where(sub_discipline_id: params[:sub_discipline_id])
elsif params[:discipline_id].present?
exams = exams.joins(:sub_discipline).where(sub_disciplines: {discipline_id: params[:discipline_id]})
end
exams = exams.where(difficulty: params[:difficulty].to_i) if params[:difficulty].present?
exams = exams.where("name like ?", "%#{params[:keyword].strip}%") if params[:keyword].present?
custom_sort(exams, params[:sort_by], params[:sort_direction])
end
end

@ -9,7 +9,7 @@ module ElasticsearchAble
highlight: highlight_options, highlight: highlight_options,
body_options: body_options, body_options: body_options,
page: page, page: page,
per_page: per_page per_page: 20
} }
end end
@ -37,7 +37,7 @@ module ElasticsearchAble
def per_page def per_page
per_page = params[:per_page].to_s.strip.presence || params[:limit].to_s.strip.presence per_page = params[:per_page].to_s.strip.presence || params[:limit].to_s.strip.presence
per_page.to_i <= 0 ? 20 : per_page.to_i per_page.to_i <= 0 || per_page.to_i > 20 ? 20 : per_page.to_i
end end
def page def page

@ -0,0 +1,30 @@
class ExaminationBanks::SaveExaminationBankService < ApplicationService
attr_reader :exam, :params
def initialize(exam, params)
@exam = exam
@params = params
end
def call
ExaminationBanks::SaveExamForm.new(params).validate!
exam.name = params[:name].to_s.strip
exam.difficulty = params[:difficulty]
exam.duration = params[:duration]
exam.sub_discipline_id = params[:sub_discipline_id]
exam.save!
# 知识点的创建
new_tag_discipline_ids = params[:tag_discipline_id] || []
old_tag_discipline_ids = exam.tag_discipline_containers.pluck(:tag_discipline_id)
delete_tag_discipline_ids = old_tag_discipline_ids - new_tag_discipline_ids
create_tag_discipline_ids = new_tag_discipline_ids - old_tag_discipline_ids
exam.tag_discipline_containers.where(tag_discipline_id: delete_tag_discipline_ids).destroy_all
create_tag_discipline_ids.each do |tag_id|
exam.tag_discipline_containers << TagDisciplineContainer.new(tag_discipline_id: tag_id)
end
exam
end
end

@ -15,7 +15,7 @@ class ItemBanks::SaveItemService < ApplicationService
item.item_type = params[:item_type] if new_record item.item_type = params[:item_type] if new_record
item.difficulty = params[:difficulty] item.difficulty = params[:difficulty]
item.sub_discipline_id = params[:sub_discipline_id] item.sub_discipline_id = params[:sub_discipline_id]
item.name = params[:name].strip item.name = params[:name].to_s.strip
item.save! item.save!
analysis = item.item_analysis || ItemAnalysis.new(item_bank_id: item.id) analysis = item.item_analysis || ItemAnalysis.new(item_bank_id: item.id)

@ -0,0 +1,11 @@
json.exams @exams.each do |exam|
json.(exam, :id, :name, :difficulty, :quotes)
json.question_count exam.question_count
json.total_score exam.total_score
json.update_time exam.updated_at&.strftime("%Y-%m-%d %H:%M")
json.author do
json.login exam.user&.login
json.name exam.user&.full_name
end
end
json.exam_count @exams_count

@ -0,0 +1,3 @@
json.status 0
json.questions_score @questions_score
json.all_score @all_score

@ -0,0 +1,3 @@
json.status 0
json.questions_score @questions_score
json.all_score @all_score

@ -1,5 +1,5 @@
json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type, json.extract! tiding, :id, :status, :viewed, :user_id, :tiding_type, :container_id, :container_type,
:parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type :parent_container_id, :parent_container_type, :belong_container_id, :belong_container_type, :extra
json.content tiding.content json.content tiding.content
json.identifier tiding.identifier json.identifier tiding.identifier

@ -66,9 +66,18 @@ Rails.application.routes.draw do
collection do collection do
get :basket_list get :basket_list
delete :delete_item_type delete :delete_item_type
post :batch_set_score
end
member do
post :set_score
post :adjust_position
end end
end end
resources :examination_banks do
end
resources :hacks, path: :problems, param: :identifier do resources :hacks, path: :problems, param: :identifier do
collection do collection do

@ -0,0 +1,15 @@
class CreateExaminationBanks < ActiveRecord::Migration[5.2]
def change
create_table :examination_banks do |t|
t.string :name
t.integer :difficulty, default: 1
t.references :user, index: true
t.boolean :public, default: 0
t.integer :quotes, default: 0
t.references :sub_discipline, index: true
t.integer :duration
t.timestamps
end
end
end

@ -0,0 +1,15 @@
class CreateExaminationItems < ActiveRecord::Migration[5.2]
def change
create_table :examination_items do |t|
t.references :examination_bank, index: true
t.references :item_bank, index: true
t.string :name
t.integer :item_type, default: 0
t.integer :difficulty, default: 1
t.float :score, default: 0
t.integer :position, default: 0
t.timestamps
end
end
end

@ -0,0 +1,11 @@
class CreateExaminationItemChoices < ActiveRecord::Migration[5.2]
def change
create_table :examination_item_choices do |t|
t.references :examination_item, index: true
t.text :choice_text
t.boolean :is_answer, default: 0
t.timestamps
end
end
end

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = { module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools. // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
//devtool: "cheap-module-eval-source-map", devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
//devtool: "source-map", // 开启调试 //devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.

@ -326,8 +326,8 @@ module.exports = {
comments: false comments: false
}, },
compress: { compress: {
drop_debugger: true, drop_debugger: false,
drop_console: true drop_console: false
} }
} }
}), }),

@ -1806,6 +1806,12 @@
<div class="code-name">&amp;#xe70e;</div> <div class="code-name">&amp;#xe70e;</div>
</li> </li>
<li class="dib">
<span class="icon iconfont">&#xe710;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe710;</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2> <h2 id="unicode-">Unicode 引用</h2>
@ -4520,6 +4526,15 @@
</div> </div>
</li> </li>
<li class="dib">
<span class="icon iconfont icon-fuzhi3"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi3
</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="font-class-">font-class 引用</h2> <h2 id="font-class-">font-class 引用</h2>
@ -6917,6 +6932,14 @@
<div class="code-name">#icon-shitilan</div> <div class="code-name">#icon-shitilan</div>
</li> </li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi3"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi3</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2> <h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2076,6 +2076,13 @@
"font_class": "shitilan", "font_class": "shitilan",
"unicode": "e70e", "unicode": "e70e",
"unicode_decimal": 59150 "unicode_decimal": 59150
},
{
"icon_id": "12568379",
"name": "复制",
"font_class": "fuzhi3",
"unicode": "e710",
"unicode_decimal": 59152
} }
] ]
} }

@ -908,6 +908,9 @@ Created by iconfont
<glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" /> <glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" />
<glyph glyph-name="fuzhi3" unicode="&#59152;" d="M648.533333-128h-477.866666C75.093333-128 0-52.906667 0 42.666667v477.866666C0 616.106667 75.093333 691.2 170.666667 691.2h477.866666C744.106667 691.2 819.2 616.106667 819.2 520.533333v-477.866666c0-95.573333-75.093333-170.666667-170.666667-170.666667z m-477.866666 750.933333C116.053333 622.933333 68.266667 575.146667 68.266667 520.533333v-477.866666c0-54.613333 47.786667-102.4 102.4-102.4h477.866666c54.613333 0 102.4 47.786667 102.4 102.4v477.866666c0 54.613333-47.786667 102.4-102.4 102.4h-477.866666zM955.733333 110.933333c-20.48 0-34.133333 13.653333-34.133333 34.133334V691.2c0 54.613333-47.786667 102.4-102.4 102.4H273.066667c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h546.133333c95.573333 0 170.666667-75.093333 170.666667-170.666667v-546.133333c0-20.48-13.653333-34.133333-34.133334-34.133334z" horiz-adv-x="1024" />
</font> </font>

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 374 KiB

@ -721,6 +721,14 @@ class CoursesBanner extends Component {
.ant-breadcrumb-separator{ .ant-breadcrumb-separator{
color: rgba(255,255,255,0.3) !important; color: rgba(255,255,255,0.3) !important;
} }
.ant-tooltip-inner{
background: #FFFFFF !important;
opacity: 0.2 !important;
}
.ant-tooltip-arrow::before{
background: #FFFFFF !important;
opacity: 0.2 !important;
}
`} `}
</style> </style>
<Breadcrumb separator="|" className={"mt5"}> <Breadcrumb separator="|" className={"mt5"}>

@ -126,7 +126,6 @@ class Sendresource extends Component{
this.props.Cancel() this.props.Cancel()
} }
Saves=()=>{ Saves=()=>{
let {fileList,description,is_public,datatime,Radiovalue} =this.state; let {fileList,description,is_public,datatime,Radiovalue} =this.state;
let newfileList=[]; let newfileList=[];

@ -1750,3 +1750,7 @@ input.ant-input-number-input:focus {
color: #F79946 !important; color: #F79946 !important;
text-decoration: underline !important; text-decoration: underline !important;
} }
.pointertooltip{
background: #DDDDDD;
}

@ -95,7 +95,7 @@ class SiderBar extends Component {
var mypath= this.props&&this.props.match&&this.props.match.path; var mypath= this.props&&this.props.match&&this.props.match.path;
return ( return (
<div className={mypath&&mypath==="/question"?"-task-sidebar myrigthsiderbar":"-task-sidebar"} > <div className={"-task-sidebar"} >
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div> {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
<Tooltip placement="right" title={"返回顶部"}> <Tooltip placement="right" title={"返回顶部"}>

@ -103,8 +103,18 @@ class TPMDataset extends Component {
}} onClick={() => { }} onClick={() => {
jsCopy("file_path"+record.id) jsCopy("file_path"+record.id)
}}> }}>
复制 <i className="iconfont icon-fuzhi3 font-18 ml2 questiontype" style={{
<input id={"file_path"+record.id} className={"file_path_input"} value={record.file_path}/> color:"#A0A7B4"
}} ></i>
<div
style={{
overflow: 'hidden',
height: "1px",
width: "1px"
}}
>
<input id={"file_path"+record.id} value={record.file_path}/>
</div>
</div> </div>
) )
}, },

@ -232,7 +232,7 @@ body>.-task-title {
} }
.myrigthsiderbar{ .myrigthsiderbar{
right: 15% !important; right: 9% !important;
} }
.feedbackdivcolor{ .feedbackdivcolor{

@ -127,3 +127,14 @@
background: #FFFFFF; background: #FFFFFF;
} }
.file_path_input{
position: absolute;
right: -50%;
}
.questiontype:hover{
color: #4CACFF !important;
}
.questiontype:active{
color: #4CACFF !important;
}

@ -137,8 +137,10 @@ class SearchPage extends Component{
margin-right: 4px; margin-right: 4px;
font-size: 16px !important; font-size: 16px !important;
} }
.shixundetailtopcss{
}
`}</style> `}</style>
<div className="shixunDetail_top " > <div className="shixunDetail_top shixundetailtopcss" >
{/*<div style={{height:"53px"}}></div>*/} {/*<div style={{height:"53px"}}></div>*/}
<div className="intermediatecenter" style={{ width: "100%"}}> <div className="intermediatecenter" style={{ width: "100%"}}>
<Search <Search

@ -178,9 +178,10 @@
.ml9{ .ml9{
margin-left: 9px; margin-left: 9px;
} }
.shixunDetail_top{width: 100%;background-image: url("/images/educoder/searchforbackres.jpg"); height: 240px; .shixunDetail_top{width: 100%;background-image: url("/images/educoder/searchforbackres.jpg"); height: 160px;
justify-content: center;align-items: center;display: -webkit-flex; justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover; background-size: cover;
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
padding-top: 0px !important;
} }

@ -1806,6 +1806,12 @@
<div class="code-name">&amp;#xe70e;</div> <div class="code-name">&amp;#xe70e;</div>
</li> </li>
<li class="dib">
<span class="icon iconfont">&#xe710;</span>
<div class="name">复制</div>
<div class="code-name">&amp;#xe710;</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2> <h2 id="unicode-">Unicode 引用</h2>
@ -4520,6 +4526,15 @@
</div> </div>
</li> </li>
<li class="dib">
<span class="icon iconfont icon-fuzhi3"></span>
<div class="name">
复制
</div>
<div class="code-name">.icon-fuzhi3
</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="font-class-">font-class 引用</h2> <h2 id="font-class-">font-class 引用</h2>
@ -6917,6 +6932,14 @@
<div class="code-name">#icon-shitilan</div> <div class="code-name">#icon-shitilan</div>
</li> </li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-fuzhi3"></use>
</svg>
<div class="name">复制</div>
<div class="code-name">#icon-fuzhi3</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2> <h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2076,6 +2076,13 @@
"font_class": "shitilan", "font_class": "shitilan",
"unicode": "e70e", "unicode": "e70e",
"unicode_decimal": 59150 "unicode_decimal": 59150
},
{
"icon_id": "12568379",
"name": "复制",
"font_class": "fuzhi3",
"unicode": "e710",
"unicode_decimal": 59152
} }
] ]
} }

@ -908,6 +908,9 @@ Created by iconfont
<glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" /> <glyph glyph-name="shitilan" unicode="&#59150;" d="M816.118519-128H184.019753c-69.530864 0-126.419753 56.888889-126.419753 126.419753V756.938272C57.6 826.469136 114.488889 883.358025 184.019753 883.358025h568.888889l189.62963-189.62963v-695.308642c0-69.530864-56.888889-126.419753-126.419753-126.419753zM727.624691 820.148148H184.019753c-37.925926 0-63.209877-25.283951-63.209876-63.209876v-758.518519c0-37.925926 25.283951-63.209877 63.209876-63.209876h632.098766c37.925926 0 63.209877 25.283951 63.209876 63.209876V668.444444L727.624691 820.148148zM955.180247 662.123457h-189.62963c-25.283951 0-44.246914 18.962963-44.246913 44.246913l6.320987 189.62963 227.555556-233.876543z m-170.666667 82.172839v-18.962963h18.962963l-18.962963 18.962963zM670.735802 567.308642H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 630.518519 329.402469 630.518519h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604939s-12.641975-31.604938-31.604939-31.604938zM670.735802 314.469136H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938S310.439506 377.679012 329.402469 377.679012h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938zM670.735802 61.62963H329.402469c-18.962963 0-31.604938 12.641975-31.604938 31.604938s12.641975 31.604938 31.604938 31.604938h341.333333c18.962963 0 31.604938-12.641975 31.604939-31.604938s-12.641975-31.604938-31.604939-31.604938z" horiz-adv-x="1024" />
<glyph glyph-name="fuzhi3" unicode="&#59152;" d="M648.533333-128h-477.866666C75.093333-128 0-52.906667 0 42.666667v477.866666C0 616.106667 75.093333 691.2 170.666667 691.2h477.866666C744.106667 691.2 819.2 616.106667 819.2 520.533333v-477.866666c0-95.573333-75.093333-170.666667-170.666667-170.666667z m-477.866666 750.933333C116.053333 622.933333 68.266667 575.146667 68.266667 520.533333v-477.866666c0-54.613333 47.786667-102.4 102.4-102.4h477.866666c54.613333 0 102.4 47.786667 102.4 102.4v477.866666c0 54.613333-47.786667 102.4-102.4 102.4h-477.866666zM955.733333 110.933333c-20.48 0-34.133333 13.653333-34.133333 34.133334V691.2c0 54.613333-47.786667 102.4-102.4 102.4H273.066667c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h546.133333c95.573333 0 170.666667-75.093333 170.666667-170.666667v-546.133333c0-20.48-13.653333-34.133333-34.133334-34.133334z" horiz-adv-x="1024" />
</font> </font>

Before

Width:  |  Height:  |  Size: 373 KiB

After

Width:  |  Height:  |  Size: 374 KiB

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

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

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