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

dev_daiao
杨树林 5 years ago
commit f66f8cdb26

@ -0,0 +1,22 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-examination-authentications-index-page').length > 0) {
var $searchFrom = $('.examination-authentication-list-form');
$searchFrom.find('select[name="status"]').val('pending');
$searchFrom.on('click', '.search-form-tab', function(){
var $link = $(this);
$searchFrom.find('input[name="keyword"]').val('');
$searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show();
} else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending');
}
});
}
});

@ -0,0 +1,22 @@
$(document).on('turbolinks:load', function() {
if ($('body.admins-item-authentications-index-page').length > 0) {
var $searchFrom = $('.item-authentication-list-form');
$searchFrom.find('select[name="status"]').val('pending');
$searchFrom.on('click', '.search-form-tab', function(){
var $link = $(this);
$searchFrom.find('input[name="keyword"]').val('');
$searchFrom.find('select[name="status"]').val('processed');
if($link.data('value') === 'processed'){
$('.batch-action-container').hide();
$searchFrom.find('.status-filter').show();
} else {
$('.batch-action-container').show();
$searchFrom.find('.status-filter').hide();
$searchFrom.find('select[name="status"]').val('pending');
}
});
}
});

@ -0,0 +1,30 @@
class Admins::ExaminationAuthenticationsController < Admins::BaseController
def index
params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyItemBankQuery.call(params.merge(type: "ExaminationBank"))
@applies = paginate applies.preload(user: { user_extension: [:school, :department] })
end
def agree
ActiveRecord::Base.transaction do
exam = ExaminationBank.find current_apply.container_id
current_apply.update!(status: 1)
exam.update!(public: 0)
end
render_success_js
end
def refuse
current_apply.update!(status: 2)
render_success_js
end
private
def current_apply
@_current_apply ||= ApplyAction.find(params[:id])
end
end

@ -0,0 +1,34 @@
class Admins::ItemAuthenticationsController < Admins::BaseController
def index
params[:status] ||= 'pending'
params[:sort_direction] = params[:status] == 'pending' ? 'asc' : 'desc'
applies = Admins::ApplyItemBankQuery.call(params.merge(type: "ItemBank"))
@applies = paginate applies.preload(user: { user_extension: [:school, :department] })
end
def show
@item = ItemBank.find current_apply.container_id
end
def agree
ActiveRecord::Base.transaction do
item = ItemBank.find current_apply.container_id
current_apply.update!(status: 1)
item.update!(public: 0)
end
render_success_js
end
def refuse
current_apply.update!(status: 2)
render_success_js
end
private
def current_apply
@_current_apply ||= ApplyAction.find(params[:id])
end
end

@ -285,7 +285,7 @@ class ApplicationController < ActionController::Base
def user_setup
# # reacct静态资源加载不需要走这一步
return if params[:controller] == "main"
#return if params[:controller] == "main"
# Find the current user
#Rails.logger.info("current_laboratory is #{current_laboratory} domain is #{request.subdomain}")
User.current = find_current_user

@ -28,34 +28,25 @@ class ExaminationBanksController < ApplicationController
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)
new_item.save!
item.increment!(:quotes)
if item.item_type == "PROGRAM"
new_hack = item.container.fork
new_item.update_attributes!(container: new_hack)
else
new_item.examination_item_analysis.create!(analysis: item.analysis)
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
new_item = ExaminationItem.new
new_item.new_item(item, exam, basket.score, basket.position)
end
end
current_user.item_baskets.destroy_all
end
render_ok
rescue ApplicationService::Error => ex
render_error(ex.message)
end
def edit
end
def edit; end
def update
ExaminationBanks::SaveExaminationBankService.call(@exam, form_params)
render_ok
rescue ApplicationService::Error => ex
render_error(ex.message)
end
def destroy
@ -65,7 +56,9 @@ class ExaminationBanksController < ApplicationController
def set_public
tip_exception(-1, "该试卷已公开") if @exam.public?
@exam.update_attributes!(public: 1)
tip_exception(-1, "请勿重复提交申请") if ApplyAction.where(container_id: @exam.id, container_type: "ExaminationBank").exists?
ApplyAction.create!(container_id: @exam.id, container_type: "ExaminationBank", user_id: current_user.id)
# @exam.update_attributes!(public: 1)
render_ok
end

@ -0,0 +1,84 @@
class ExaminationItemsController < ApplicationController
before_action :require_login
before_action :validate_score, only: [:set_score, :batch_set_score]
before_action :find_exam, only: [:create, :batch_set_score, :delete_item_type]
before_action :find_item, except: [:create, :batch_set_score, :delete_item_type]
before_action :edit_auth
def create
ExaminationItems::SaveItemService.call(current_user, create_params, @exam)
render_ok
rescue ApplicationService::Error => ex
render_error(ex.message)
end
def destroy
ActiveRecord::Base.transaction do
@exam.examination_items.where(item_type: @item.item_type).where("position > #{@item.position}").update_all("position = position -1")
@item.destroy!
end
render_ok
end
def delete_item_type
items = @exam.examination_items.where(item_type: params[:item_type])
items.destroy_all
render_ok
end
def set_score
@item.update_attributes!(score: params[:score])
@questions_score = @exam.examination_items.where(item_type: @item.item_type).pluck(:score).sum
@all_score = @exam.examination_items.pluck(:score).sum
render_ok({questions_score: @questions_score, all_score: @all_score})
end
def batch_set_score
@exam.examination_items.where(item_type: params[:item_type]).update_all(score: params[:score])
@questions_score = @exam.examination_items.where(item_type: params[:item_type]).pluck(:score).sum
@all_score = @exam.examination_items.pluck(:score).sum
render_ok({questions_score: @questions_score, all_score: @all_score})
end
def adjust_position
same_items = @exam.examination_items.where(item_type: @item.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 > @item.position
same_items.where("position > #{@item.position} and position <= #{params[:position].to_i}").update_all("position=position-1")
@item.update_attributes!(position: params[:position])
elsif params[:position].to_i < @item.position
same_items.where("position < #{@item.position} and position >= #{params[:position].to_i}").update_all("position=position+1")
@item.update_attributes!(position: params[:position])
else
return normal_status(-1, "排序无变化")
end
end
render_ok
end
private
def find_exam
@exam = ExaminationBank.find_by!(id: params[:exam_id])
end
def create_params
params.permit(item_ids: [])
end
def find_item
@item = ExaminationItem.find_by!(id: params[:id])
@exam = @item.examination_bank
end
def validate_score
tip_exception("分值不能为空") unless params[:score].present?
tip_exception("分值需大于0") unless params[:score].to_f > 0
end
def edit_auth
current_user.admin_or_business? || @exam.user == current_user
end
end

@ -37,7 +37,9 @@ class ItemBanksController < ApplicationController
def set_public
tip_exception(-1, "该试题已公开") if @item.public?
@item.update_attributes!(public: 1)
tip_exception(-1, "请勿重复提交申请") if ApplyAction.where(container_id: @item.id, container_type: 'ItemBank').exists?
ApplyAction.create!(container_id: @item.id, container_type: 'ItemBank', user_id: current_user.id)
# @item.update_attributes!(public: 1)
render_ok
end

@ -1,5 +1,7 @@
class MainController < ApplicationController
skip_before_action :check_sign
skip_before_action :user_setup
skip_before_action :setup_laboratory
def first_stamp
render :json => { status: 0, message: Time.now.to_i }

@ -931,7 +931,7 @@ class ShixunsController < ApplicationController
page = params[:page] || 1
limit = params[:limit] || 20
@user_count = @users.count
@users = @users.page(page).per(limit)
@users = @users.page(page).per(20)
end
@ -995,7 +995,7 @@ class ShixunsController < ApplicationController
@courses = @courses.where(id: current_laboratory.all_courses)
@course_count = @courses.count
@courses = @courses.page(page).per(limit)
@courses = @courses.page(page).per(10)
end
# 将实训发送到课程

@ -16,7 +16,7 @@ class ApplyAction < ApplicationRecord
tidings.create(user_id: user_id, trigger_user_id: 0, status: 1, viewed: 0, tiding_type: 'System',
parent_container_id: container_id, parent_container_type: container_type,
belong_container_id: container_id, belong_container_type: 'User')
else
elsif %w(ApplyShixun ApplySubject TrialAuthorization).include?(container_type)
belong_container_type = if container_type == 'TrialAuthorization'
'User'
else

@ -5,7 +5,7 @@ class ExaminationBank < ApplicationRecord
has_many :tag_discipline_containers, as: :container, dependent: :destroy
has_many :tag_disciplines, through: :tag_discipline_containers
has_many :examination_items, dependent: :destroy
has_many :examination_items, -> {order(position: :asc)}, dependent: :destroy
def question_count
examination_items.size

@ -24,4 +24,22 @@ class ExaminationItem < ApplicationRecord
0
end
# 题库复制
def new_item item, exam, score, position
attributes = {examination_bank: exam, item_bank: item, name: item.name, item_type: item.item_type,
difficulty: item.difficulty, score: score, position: position}
self.update!(attributes)
item.increment!(:quotes)
if item.item_type == "PROGRAM"
new_hack = item.container.fork
self.update!(container: new_hack)
else
ExaminationItemAnalysis.create!(analysis: item.analysis, examination_item_id: self.id)
item.item_choices.each do |choice|
examination_item_choices << ExaminationItemChoice.new(choice_text: choice.choice_text, is_answer: choice.is_answer)
end
end
end
end

@ -4,7 +4,7 @@ class ItemBank < ApplicationRecord
# item_type: 0 单选 1 多选 2 判断 3 填空 4 简答 5 实训 6 编程
belongs_to :user
belongs_to :sub_discipline
belongs_to :sub_discipline, optional: true
has_one :item_analysis, dependent: :destroy
has_many :item_choices, dependent: :destroy
@ -17,4 +17,36 @@ class ItemBank < ApplicationRecord
def analysis
item_analysis&.analysis
end
def type_string
result = case item_type
when "SINGLE"
"单选题"
when "MULTIPLE"
"多选题"
when "JUDGMENT"
"判断题"
when "COMPLETION"
"填空题"
when "SUBJECTIVE"
"简答题"
when "PRACTICAL"
"实训题"
when "PROGRAM"
"编程题"
end
result
end
def difficulty_string
result = case difficulty
when 1
"简单"
when 2
"适中"
when 3
"困难"
end
result
end
end

@ -0,0 +1,34 @@
class Admins::ApplyItemBankQuery < ApplicationQuery
include CustomSortable
attr_reader :params
sort_columns :updated_at, default_by: :updated_at, default_direction: :desc
def initialize(params)
@params = params
end
def call
applies = ApplyAction.where(container_type: params[:type].presence || "ItemBank")
status =
case params[:status]
when 'pending' then 0
when 'processed' then [1, 2]
when 'agreed' then 1
when 'refused' then 2
else 0
end
applies = applies.where(status: status) if status.present?
# 关键字模糊查询
keyword = params[:keyword].to_s.strip
if keyword.present?
applies = applies.joins(user: { user_extension: :school })
.where('CONCAT(lastname,firstname) LIKE :keyword OR schools.name LIKE :keyword', keyword: "%#{keyword}%")
end
custom_sort(applies, params[:sort_by], params[:sort_direction])
end
end

@ -0,0 +1,50 @@
class ExaminationItems::SaveItemService < ApplicationService
attr_reader :user, :params, :exam
def initialize(user, params, exam)
@user = user
@params = params
@exam = exam
end
def call
raise("请选择试题") if params[:item_ids].blank?
# 只能选用公共题库或是自己的题库
items = ItemBank.where(public: 1).or(ItemBank.where(user_id: user.id))
# 已选到过试题篮的不重复选用
item_ids = params[:item_ids] - exam.examination_items.pluck(:item_bank_id)
items.where(id: item_ids).each do |item|
ActiveRecord::Base.transaction do
item_score = item_score item.item_type
item_position = item_position item.item_type
new_item = ExaminationItem.new
new_item.new_item(item, exam, item_score, item_position)
end
end
end
private
def item_score item_type
if exam.examination_items.where(item_type: item_type).last.present?
score = exam.examination_items.where(item_type: item_type).last.score
else
score =
case item_type
when "SINGLE", "MULTIPLE", "JUDGMENT"
5
when "PROGRAM"
10
else
5
end
end
score
end
def item_position item_type
exam.examination_items.where(item_type: item_type).last&.position.to_i + 1
end
end

@ -0,0 +1,30 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('试卷审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 examination-authentication-list-form">
<ul class="nav nav-tabs w-100 search-form-tabs">
<li class="nav-item">
<%= link_to '待审批', admins_examination_authentications_path(status: :pending), remote: true, 'data-value': 'pending',
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
</li>
<li class="nav-item">
<%= link_to '已审批', admins_examination_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
</li>
</ul>
<%= form_tag(admins_examination_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
<label for="status">审核状态:</label>
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container examination-authentication-list-container">
<%= render(partial: 'admins/examination_authentications/shared/list', locals: { applies: @applies }) %>
</div>

@ -0,0 +1 @@
$('.examination-authentication-list-container').html("<%= j( render partial: 'admins/examination_authentications/shared/list', locals: { applies: @applies } ) %>");

@ -0,0 +1,35 @@
<div class="modal fade admin-item-show-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">试题信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mt-2">
<p>题型:<%= item.type_string %></p>
<p>难度:<%= item.difficulty_string %></p>
</div>
<div class="mt-2">
<p><%= item.name %></p>
<% item.item_choices.each do |choice| %>
<div class="form-check ml-3">
<% if item.item_type == "MULTIPLE" %>
<%= check_box_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% elsif item.item_type == "SINGLE" || item.item_type == "JUDGMENT" %>
<%= radio_button_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% else %>
答案:<%= choice.choice_text %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,54 @@
<% is_processed = params[:status].to_s != 'pending' %>
<table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="18%">创建者</th>
<th width="14%">学校</th>
<th width="24%">试卷</th>
<th width="16%">提交时间</th>
<% if !is_processed %>
<th width="16%">操作</th>
<% else %>
<th width="16%">审批结果</th>
<% end %>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<% exam = ExaminationBank.find apply.container_id %>
<tr class="examination-authentication-item examination-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'examination-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
<td>
<%= link_to exam.name, "/paperlibrary/see/#{exam.id}", target: "_blank" %>
</td>
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<% if !is_processed %>
<%= agree_link '同意', agree_admins_examination_authentication_path(apply, element: ".examination-authentication-#{apply.id}"), 'data-confirm': '确认同意该审批?', 'data-disable-with': "提交中..." %>
<%= agree_link '拒绝', refuse_admins_examination_authentication_path(apply, element: ".examination-authentication-#{apply.id}"), 'data-confirm': '确认拒绝该审批?', 'data-disable-with': "拒绝中..." %>
<% else %>
<%= apply.status_text %>
<% end %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/item_authentications/shared/item_show_modal', locals: { item: @item } ) %>");
$('.modal.admin-item-show-modal').modal('show');

@ -0,0 +1,30 @@
<% define_admin_breadcrumbs do %>
<% add_admin_breadcrumb('题库审批') %>
<% end %>
<div class="box search-form-container flex-column mb-0 pb-0 item-authentication-list-form">
<ul class="nav nav-tabs w-100 search-form-tabs">
<li class="nav-item">
<%= link_to '待审批', admins_item_authentications_path(status: :pending), remote: true, 'data-value': 'pending',
class: "nav-link search-form-tab #{params[:status] == 'pending' ? 'active' : ''}" %>
</li>
<li class="nav-item">
<%= link_to '已审批', admins_item_authentications_path(status: :processed), remote: true, 'data-value': 'processed',
class: "nav-link search-form-tab #{params[:status] != 'pending' ? 'active' : ''}" %>
</li>
</ul>
<%= form_tag(admins_item_authentications_path(unsafe_params), method: :get, class: 'form-inline search-form justify-content-end mt-3', remote: true) do %>
<div class="form-group status-filter" style="<%= params[:status] != 'pending' ? '' : 'display: none;' %>">
<label for="status">审核状态:</label>
<% status_options = [['全部', 'processed'], ['已同意', 'agreed'], ['已拒绝', 'refused']] %>
<%= select_tag(:status, options_for_select(status_options), class: 'form-control') %>
</div>
<%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-sm-2 ml-3', placeholder: '姓名/学校/单位检索') %>
<%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %>
<% end %>
</div>
<div class="box admin-list-container item-authentication-list-container">
<%= render(partial: 'admins/item_authentications/shared/list', locals: { applies: @applies }) %>
</div>

@ -0,0 +1 @@
$('.item-authentication-list-container').html("<%= j( render partial: 'admins/item_authentications/shared/list', locals: { applies: @applies } ) %>");

@ -0,0 +1,35 @@
<div class="modal fade admin-item-show-modal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">试题信息</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="mt-2">
<p>题型:<%= item.type_string %></p>
<p>难度:<%= item.difficulty_string %></p>
</div>
<div class="mt-2">
<p><%= item.name %></p>
<% item.item_choices.each do |choice| %>
<div class="form-check ml-3">
<% if item.item_type == "MULTIPLE" %>
<%= check_box_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% elsif item.item_type == "SINGLE" || item.item_type == "JUDGMENT" %>
<%= radio_button_tag(:choice, true, choice.is_answer, class: 'form-check-input') %>
<label class="form-check-label" for="choice"><%= choice.choice_text %></label>
<% else %>
答案:<%= choice.choice_text %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
</div>
</div>

@ -0,0 +1,60 @@
<% is_processed = params[:status].to_s != 'pending' %>
<table class="table table-hover text-center professional-authentication-list-table">
<thead class="thead-light">
<tr>
<th width="4%">序号</th>
<th width="8%">头像</th>
<th width="14%">创建者</th>
<th width="10%">学校</th>
<th width="24%">试题</th>
<th width="8%">题型</th>
<th width="16%">提交时间</th>
<% if !is_processed %>
<th width="16%">操作</th>
<% else %>
<th width="16%">审批结果</th>
<% end %>
</tr>
</thead>
<tbody>
<% if applies.present? %>
<% applies.each_with_index do |apply, index| %>
<% user = apply.user %>
<% item = ItemBank.find apply.container_id %>
<tr class="item-authentication-item item-authentication-<%= apply.id %>">
<td><%= list_index_no((params[:page] || 1).to_i, index) %></td>
<td>
<%= link_to "/users/#{user.login}", class: 'item-authentication-avatar', target: '_blank', data: { toggle: 'tooltip', title: '个人主页' } do %>
<img src="/images/<%= url_to_avatar(user) %>" class="rounded-circle" width="40" height="40" />
<% end %>
</td>
<td><%= user.real_name %></td>
<td><%= raw [user.school_name.presence, user.department_name.presence].compact.join('<br/>') %></td>
<td>
<% if item.item_type == "PROGRAM" %>
<%= link_to item.name, "/problems/#{item.container&.identifier}/edit", target: "_blank" %>
<% else %>
<%= link_to item.name, admins_item_authentication_path(apply), remote: true %>
<% end %>
</td>
<td><%= item.type_string %></td>
<td><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></td>
<td class="action-container">
<% if !is_processed %>
<%= agree_link '同意', agree_admins_item_authentication_path(apply, element: ".item-authentication-#{apply.id}"), 'data-confirm': '确认同意该审批?', 'data-disable-with': "提交中..." %>
<%= agree_link '拒绝', refuse_admins_item_authentication_path(apply, element: ".item-authentication-#{apply.id}"), 'data-confirm': '确认拒绝该审批?', 'data-disable-with': "拒绝中..." %>
<% else %>
<%= apply.status_text %>
<% end %>
</td>
</tr>
<% end %>
<% else %>
<%= render 'admins/shared/no_data_for_table' %>
<% end %>
</tbody>
</table>
<%= render partial: 'admins/shared/paginate', locals: { objects: applies } %>

@ -0,0 +1,2 @@
$('.admin-modal-container').html("<%= j( render partial: 'admins/item_authentications/shared/item_show_modal', locals: { item: @item } ) %>");
$('.modal.admin-item-show-modal').modal('show');

@ -75,6 +75,8 @@
<li><%= sidebar_item(admins_library_applies_path, '教学案例发布', icon: 'language', controller: 'admins-library_applies') %></li>
<li><%= sidebar_item(admins_project_package_applies_path, '众包需求发布', icon: 'joomla', controller: 'admins-project_package_applies') %></li>
<li><%= sidebar_item(admins_video_applies_path, '视频发布', icon: 'film', controller: 'admins-video_applies') %></li>
<li><%= sidebar_item(admins_item_authentications_path, '试题发布', icon: 'question', controller: 'admins-item_authentications') %></li>
<li><%= sidebar_item(admins_examination_authentications_path, '试卷发布', icon: 'file-text-o', controller: 'admins-examination_authentications') %></li>
<% end %>
</li>

@ -1,6 +1,7 @@
json.single_questions do
json.questions @single_questions.each do |question|
json.(question, :id, :position, :score, :item_type)
json.item_id question.item_bank_id
json.partial! "item_banks/item", locals: {item: question.item_bank}
end
json.questions_score @single_questions.map(&:score).sum
@ -10,6 +11,7 @@ end
json.multiple_questions do
json.questions @multiple_questions.each do |question|
json.(question, :id, :position, :score, :item_type)
json.item_id question.item_bank_id
json.partial! "item_banks/item", locals: {item: question.item_bank}
end
json.questions_score @multiple_questions.map(&:score).sum
@ -19,6 +21,7 @@ end
json.judgement_questions do
json.questions @judgement_questions.each do |question|
json.(question, :id, :position, :score, :item_type)
json.item_id question.item_bank_id
json.partial! "item_banks/item", locals: {item: question.item_bank}
end
json.questions_score @judgement_questions.map(&:score).sum
@ -28,6 +31,7 @@ end
json.program_questions do
json.questions @program_questions.each do |question|
json.(question, :id, :position, :score, :item_type)
json.item_id question.item_bank_id
json.partial! "item_banks/item", locals: {item: question.item_bank}
end
json.questions_score @program_questions.map(&:score).sum

@ -83,6 +83,18 @@ Rails.application.routes.draw do
end
end
resources :examination_items do
collection do
delete :delete_item_type
post :batch_set_score
end
member do
post :set_score
post :adjust_position
end
end
resources :hacks, path: :problems, param: :identifier do
collection do
get :unpulished_list
@ -1140,6 +1152,18 @@ Rails.application.routes.draw do
post :refuse
end
end
resources :item_authentications, only: [:index, :show] do
member do
post :agree
post :refuse
end
end
resources :examination_authentications, only: [:index] do
member do
post :agree
post :refuse
end
end
resources :shixuns, only: [:index,:destroy]
resources :shixun_settings, only: [:index,:update]
resources :shixun_feedback_messages, only: [:index]

@ -0,0 +1,5 @@
class MigrateExaminationItemName < ActiveRecord::Migration[5.2]
def change
change_column :examination_items, :name, :text
end
end

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -318,6 +318,16 @@ const Testpaperlibrary= Loadable({
loader: () => import('./modules/testpaper/Testpaperlibrary'),
loading: Loading
})
//试卷编辑
const Paperlibraryeditid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryeditid'),
loading: Loading
})
//试卷查看
const Paperlibraryseeid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryseeid'),
loading: Loading
})
//人工组卷
const Paperreview= Loadable({
loader: () => import('./modules/question/Paperreview'),
@ -744,17 +754,26 @@ class App extends Component {
}
}
/>
<Route path="/myproblems/record_detail/:id"
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
}
/>
<Route
path="/problems/:id/edit"
render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} />
<Route path="/myproblems/record_detail/:id"
render={
(props) => (<RecordDetail {...this.props} {...props} {...this.state} />)
}
/>
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary/see/:id"
render={
(props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/myproblems/:id/:tab?"
render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
@ -772,15 +791,15 @@ class App extends Component {
render={
(props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
} />
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary"
render={
(props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperreview"
render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/>
<Route path="/problems"
render={
(props) => (<Developer {...this.props} {...props} {...this.state} />)

@ -67,9 +67,8 @@ const NewOrEditTask = (props) => {
props.getOJFormById(id);
} else {
// 清空store中的测试用例集合
props.clearOJFormStore();
// props.clearOJFormStore();
}
return () => {}
}, []);

@ -1,7 +1,7 @@
/*
* @Description:
* @Description:
* @Author: tangjiang
* @Github:
* @Github:
* @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-06 16:17:22
@ -75,7 +75,7 @@ class EditTab extends React.Component {
this.setState({
scrollEl: oWrap,
targetEl: oTarget,
offsetTop: offsetTop, // 记录初始位置
offsetTop: offsetTop, // 记录初始位置
scrollHeight,
}, () => {
this.state.scrollEl.addEventListener('scroll', this.handleScroll, false);
@ -89,7 +89,7 @@ class EditTab extends React.Component {
// componentDidUpdate (nextProp) {
// console.log(nextProp);
// }
componentWillUnmount (nextPro) {
this.state.scrollEl.removeEventListener('scroll', this.handleScroll, false);
}
@ -112,7 +112,7 @@ class EditTab extends React.Component {
}
}
// 改变任务名称
// 改变任务名称
handleNameChange = (e) => {
const value = e.target.value;
this.props.validateOJName(value);
@ -167,8 +167,8 @@ class EditTab extends React.Component {
}
render () {
const {
ojForm,
const {
ojForm,
ojFormValidate,
// testCases = [], // 测试用例集合
addTestCase, // 添加测试用例
@ -220,8 +220,8 @@ class EditTab extends React.Component {
return <AddTestDemo
key={`${i}`}
isOpen={openTestCodeIndex.includes(i)}
onSubmitTest={handleSubmitTest}
onDeleteTest={handleDeleteTest}
onSubmitTest={handleSubmitTest}
onDeleteTest={handleDeleteTest}
testCase={item}
testCaseValidate={testCasesValidate[i]}
index={i}
@ -280,7 +280,7 @@ class EditTab extends React.Component {
'bold', 'italic', 'underline', 'strike', // 切换按钮
'blockquote', 'code-block', // 代码块
{align: []}, { 'list': 'ordered' }, { 'list': 'bullet' }, // 列表
{ 'script': 'sub'}, { 'script': 'super' },
{ 'script': 'sub'}, { 'script': 'super' },
{ 'color': [] }, { 'background': [] }, // 字体颜色与背景色
// {font: []},
'image', 'formula', // 数学公式、图片、视频
@ -305,7 +305,7 @@ class EditTab extends React.Component {
});
}
loop(arrs, tempArr);
// 获取选中的下拉值
let choid_ids = [];
// let tempKnowledges = [];
@ -313,17 +313,17 @@ class EditTab extends React.Component {
// debugger;
if (sub_id && t.children) {
t.children.forEach(c => {
if (c.value === sub_id) {
if (c.value === +sub_id) {
choid_ids = [t.value, c.value];
// tempKnowledges = c.children || [];
}
});
}
});
console.log(choid_ids);
return (
<Cascader
<Cascader
placeholder="请选择"
options={tempArr}
expandTrigger="hover"
@ -333,7 +333,7 @@ class EditTab extends React.Component {
/>
)
}
// 知识点
const handleKnowledgeChange = (values= []) => {
const _result = [];
@ -344,11 +344,11 @@ class EditTab extends React.Component {
// 保存选择的知识点
this.props.saveTagDisciplineId(_result);
}
return (
<div className={'editor_area'} id="textCase">
<Form className={'editor_form'}>
<FormItem
<FormItem
className={`input_area flex_50 flex_50_left`}
label={<span>{myLabel(jcLabel['difficult'])}</span>}
validateStatus={ojFormValidate.difficult.validateStatus}
@ -360,7 +360,7 @@ class EditTab extends React.Component {
</Select>
</FormItem>
<FormItem
<FormItem
className={`input_area flex_50 flex_50_right`}
label={<span>{myLabel(jcLabel['sub_discipline_id'], '合理的课程分类有利于快速检索')}</span>}
validateStatus={ojFormValidate.sub_discipline_id.validateStatus}
@ -370,7 +370,7 @@ class EditTab extends React.Component {
{/* <Select onChange={this.handleChangeCategory} value={`${ojForm.category}`}>
{getOptions('category')}
</Select> */}
{/* <Cascader
{/* <Cascader
options={courseQuestions}
expandTrigger="hover"
onChange={this.handleChangeCategory}
@ -383,14 +383,14 @@ class EditTab extends React.Component {
className='input_area flex_100'
label={<span>{myLabel(jcLabel['knowledge'], '', 'nostar')}</span>}
>
<KnowLedge
<KnowLedge
options={knowledges}
values={tag_discipline_id}
onChange={handleKnowledgeChange}
/>
</FormItem>
<FormItem
<FormItem
className={`input_area flex_50 flex_50_left`}
label={<span>{myLabel(jcLabel['timeLimit'], '程序允许时间限制时长,单位:秒')}</span>}
validateStatus={ojFormValidate.timeLimit.validateStatus}
@ -400,7 +400,7 @@ class EditTab extends React.Component {
<InputNumber value={ojForm.timeLimit} min={0} max={5} style={{ width: '100%' }} onChange={this.handleTimeLimitChange}/>
</FormItem>
<FormItem
<FormItem
className={`input_area flex_50 flex_50_right`}
label={<span>{myLabel(jcLabel['language'])}</span>}
validateStatus={ojFormValidate.language.validateStatus}
@ -412,7 +412,7 @@ class EditTab extends React.Component {
</Select>
</FormItem>
<FormItem
<FormItem
className={`input_area flex_100`}
label={<span>{myLabel(jcLabel['name'])}</span>}
validateStatus={ojFormValidate.name.validateStatus}
@ -427,24 +427,24 @@ class EditTab extends React.Component {
onChange={this.handleNameChange}
/>
</FormItem>
<FormItem
<FormItem
className={`input_area flex_100`}
label={<span>{myLabel(jcLabel['description'])}</span>}
validateStatus={ojFormValidate.description.validateStatus}
help={ojFormValidate.description.errMsg}
colon={ false }
>
<QuillForEditor
<QuillForEditor
style={{ height: '200px' }}
placeholder="请输入描述信息"
placeholder="请输入描述信息"
onContentChange={handleContentChange}
options={quillConfig}
value={ojForm.description}
/>
</FormItem>
{/* <FormItem
{/* <FormItem
className={`input_area flex_50 flex_50_right`}
label={<span>{myLabel(jcLabel['openOrNot'], '社区:您的任务将向整个社会公开')}</span>}
validateStatus={ojFormValidate.openOrNot.validateStatus}
@ -455,9 +455,9 @@ class EditTab extends React.Component {
{getOptions('openOrNot')}
</Select>
</FormItem> */}
</Form>
{/* 添加测试用例 */}
<div className={'test_demo_title'} ref={this.headerRef}>
<h2>测试用例</h2>
@ -476,11 +476,11 @@ class EditTab extends React.Component {
const mapStateToProps = (state) => {
const ojFormReducer = state.ojFormReducer;
const {
ojForm,
position,
testCases,
ojForm,
position,
testCases,
openTestCodeIndex,
testCasesValidate,
testCasesValidate,
ojFormValidate,
courseQuestions,
tag_discipline_id,

@ -12,6 +12,7 @@ class Bottomsubmit extends Component {
cannelfun = () => {
// window.location.href=
debugger
if(this.props.Cohetepaperbool===true){
this.props.setCohetepaperbool(false);
}else {

@ -23,7 +23,7 @@ import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor";
import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpapers from "./comthetestpaper/Comthetestpapers";
import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
//人工组卷预览
class Paperreview extends Component {
constructor(props) {
@ -134,6 +134,9 @@ class Paperreview extends Component {
booljupyterurls: true,
})
axios.get((url), {params: data}).then((response) => {
if(response===undefined|| response===null){
return;
}
setTimeout(() => {
this.setState({
booljupyterurls: false,
@ -188,18 +191,12 @@ class Paperreview extends Component {
}
preservation = () => {
debugger
//保存试卷
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
console.log("this.contentMdRef.Getdatas()");
console.log(this.contentMdRef.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
@ -213,13 +210,12 @@ class Paperreview extends Component {
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
if (result.data.status === 0) {
this.props.showNotification(`组卷成功`);
this.props.history.replace('./paperlibrary');
this.props.history.replace('/paperlibrary');
}
}).catch((error) => {
console.log(error);
@ -292,11 +288,11 @@ class Paperreview extends Component {
</Paperreview_item>
:
<Comthetestpapers {...this.state} {...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)}
<Comthetestpaperst {...this.state} {...this.props}
getJudquestio={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}
></Comthetestpapers>
></Comthetestpaperst>
}

@ -21,6 +21,8 @@ import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from './component/PaperDeletModel';
import PaperDeletModels from './component/PaperDeletModels';
import Paperreview_itemModel from './component/Paperreview_itemModel';
import Paperreview_itemModels from './component/Paperreview_itemModels';
import Paperreview_items from './Paperreview_items';
const reorder = (list, startIndex, endIndex) => {
@ -41,6 +43,7 @@ class Paperreview_item extends Component {
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
@ -48,7 +51,9 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无"
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
@ -137,8 +142,8 @@ class Paperreview_item extends Component {
onDragEndsss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const ids = this.props.program_questions.questions[result.source.index].id;
const positions = this.props.program_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json`
var data = {
position: positions
@ -189,6 +194,40 @@ class Paperreview_item extends Component {
})
}
setDownloadys=(value)=>{
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
setmodalsTypedel = (bool, type, names) => {
if (type === 1) {
this.setState({
@ -198,9 +237,29 @@ class Paperreview_item extends Component {
} else {
this.setState({
modalsTypedel: bool,
modalsTypedels: true,
titilesms: names
})
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
//console.log(error);
});
}
}
@ -209,27 +268,19 @@ class Paperreview_item extends Component {
if (type === 1) {
this.setState({
modalsTypedels: bool,
titilesms: ""
})
} else {
}else {
//确定
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: this.state.titilesms
}
})
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete((url))
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功');
this.props.showNotification('试题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
//console.log(error);
});
this.setState({
@ -239,6 +290,14 @@ class Paperreview_item extends Component {
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");
@ -260,6 +319,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
@ -269,6 +330,9 @@ class Paperreview_item extends Component {
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
@ -277,6 +341,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
@ -285,6 +351,9 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
@ -294,14 +363,26 @@ class Paperreview_item extends Component {
this.props.history.replace("/question");
}
showparagraphs = (e) => {
console.log("showparagraphs");
console.log(e);
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
@ -309,7 +390,8 @@ class Paperreview_item extends Component {
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
@ -326,10 +408,17 @@ class Paperreview_item extends Component {
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
}
{
modalsTypeys === true ?
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
: ""
}
{
modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props}
setmodalsTypedels={(bool, type) => this.setmodalsTypedels(bool, type)}></PaperDeletModels>
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
@ -349,9 +438,7 @@ class Paperreview_item extends Component {
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
<div
className="pagertdstcolor w50s xaxisreverseorder">{single_questions && single_questions.questions_count}个试题
</div>
</div>
@ -402,17 +489,23 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
showparagraphs={(e) => this.showparagraphs(e)}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
</div>
)}
</Draggable>
@ -487,14 +580,22 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"MULTIPLE"}
typenamesn={"多选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
@ -566,14 +667,22 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"JUDGMENT"}
typenamesn={"判断题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
@ -650,14 +759,21 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>

@ -0,0 +1,92 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from "./Paperreview_single";
//判断题
class Paperreview_items extends Component {
constructor(props) {
super(props);
this.state = {
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
render() {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
// console.log(object);
console.log("Paperreview_items");
console.log(object.item_id);
return (
<div>
{
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.item_id,true,1)}>删除</div>
<div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div>
</div>
: <div className="xaxisreverseorder mt25 ">
</div>
}
<Paperreview_single paperreviewsingleindex={paperreviewsingleindex}
name={typenames}
key={indexs}
showparagraphs={(e,name) => this.props.showparagraphs(e,name)}
objectsingle={object} key={indexs} indexx={indexs + 1}
indexxy={indexs}
hideparagraphs={() => this.props.hideparagraphs()}></Paperreview_single>
</div>
)
}
}
export default Paperreview_items

@ -62,21 +62,17 @@ class Paperreview_single extends Component {
}
setmodalsTypedels = () => {
}
Singlemagaziness = () => {
}
render() {
let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy} = this.props;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy)} style={{
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
minHeight: "114px",
}}>

@ -8,16 +8,17 @@ import {
Table,
Pagination,
Drawer,
Input
Input,
Tooltip
} from "antd";
import Headplugselection from "./component/Headplugselection";
import Headplugselections from "./component/Headplugselections";
import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
import Contentpart from "./component/Contentpart";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import SiderBar from "../tpm/SiderBar";
import SiderBars from "../question/component/SiderBars";
class Question extends Component {
constructor(props) {
@ -61,6 +62,7 @@ class Question extends Component {
disciplinesdatakc:0,
disciplinesdatazsd:0,
selectallquestionsonthispages:false,
oj_status:null,
}
}
@ -68,7 +70,11 @@ class Question extends Component {
this.setState({
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
})
var data = {
discipline_id:discipline_id,
@ -77,9 +83,10 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
keywords: null,
page: this.state.page,
per_page:10,
oj_status:null
};
this.getdata(data);
@ -88,7 +95,11 @@ class Question extends Component {
setsub_discipline_id=(sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
})
var data = {
discipline_id:this.state.discipline_id,
@ -97,16 +108,21 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
keywords:null,
page: 1,
per_page:10,
oj_status:null
};
this.getdata(data);
}
settag_discipline_id=(tag_discipline_id)=>{
this.setState({
tag_discipline_id:tag_discipline_id
tag_discipline_id:tag_discipline_id,
keywords:"",
page:1,
per_page:10,
oj_status:null
})
var data = {
discipline_id:this.state.discipline_id,
@ -115,9 +131,10 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
keywords: null,
page: 1,
per_page:10,
oj_status:null
};
this.getdata(data);
}
@ -165,13 +182,14 @@ class Question extends Component {
}
});
}
//公共和我的
callback = (key) => {
this.setState({
defaultActiveKey: key,
selectallquestionsonthispages:false,
difficulty:null,
page:1
page:1,
oj_status:null
})
var data = {
discipline_id:this.state.discipline_id,
@ -182,6 +200,7 @@ class Question extends Component {
difficulty: null,
page: 1,
per_page:10,
oj_status:null
};
this.getdata(data);
@ -235,14 +254,22 @@ class Question extends Component {
keywords: this.state.keywords,
page: pageNumber,
per_page:10,
oj_status:this.state.oj_status
};
this.getdata(data);
}
showDrawer = () => {
this.setState({
visible: true,
});
this.getbasket_listdata();
if(this.state.visible===true){
this.setState({
visible: false,
});
}else{
this.setState({
visible: true,
});
this.getbasket_listdata();
}
};
@ -328,6 +355,10 @@ class Question extends Component {
this.setState({
difficulty: difficulty,
visiblemys: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
})
var data = {
@ -337,8 +368,10 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: difficulty,
item_type: this.state.item_type,
page: this.state.page,
keywords:null,
page:1,
per_page:10,
oj_status:null
};
this.getdata(data);
@ -348,6 +381,10 @@ class Question extends Component {
this.setState({
item_type: item_type,
visiblemyss: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
})
var data = {
@ -357,8 +394,10 @@ class Question extends Component {
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
page: this.state.page,
page: 1,
per_page:10,
keywords:null,
oj_status:null
};
this.getdata(data);
@ -425,6 +464,7 @@ class Question extends Component {
keywords: value,
page: this.state.page,
per_page:10,
oj_status:this.state.oj_status
};
this.getdata(data);
@ -628,6 +668,27 @@ class Question extends Component {
}
setoj_status=(oj_status)=>{
//编程题发布未发布
this.setState({
selectallquestionsonthispages:false,
difficulty:null,
oj_status:oj_status
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
oj_status:oj_status
};
this.getdata(data);
}
render() {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
@ -689,18 +750,35 @@ class Question extends Component {
}
<SiderBar
<style>
{
`
.-task-sidebar{
height: 30%;
}
`
}
</style>
<SiderBars
myvisible={visible}
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}/>
{/*顶部*/}
<Headplugselection {...this.props} {...this.state}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
></Headplugselection>
<Headplugselections
disciplinesdata={this.state.disciplinesdata}
{...this.props}
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
getitem_basketss={(id)=>this.getitem_basketss(id)}
@ -709,16 +787,12 @@ class Question extends Component {
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
setitem_types={(e) => this.setitem_types(e)}
handleVisibleChange={(e) => this.handleVisibleChange(e)}
setdifficulty={(e) => this.setdifficulty(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}></Contentpart>
{/*分页*/}
{/*<div className="clearfix mt5">*/}
{/*<div className="educontent mt10 pb20 w1200s">*/}
{/* fenye*/}
callback={(e) => this.callback(e)}
setoj_status={(e)=>this.setoj_status(e)}></Contentpart>
{
items_count&&items_count>10?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
@ -745,6 +819,21 @@ class Question extends Component {
height: 100%;
background:rgba(234,234,234,1);
}
.ant-drawer-close{
height: 40px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color:#ffffff;
}
.ant-drawer-close:hover{
color:#ffffff;
}
.ant-drawer-close:active{
color:#ffffff;
}
`
}
</style>
@ -756,19 +845,21 @@ class Question extends Component {
onClose={() => this.onClose()}
visible={visible}
mask={false}
closable={true}
>
{Datacount && Datacount > 0 ?
<div>
<div className="shitilang">
试题篮
</div>
<div className="mt25 mb26">
</div>
{
single_questions_count === 0 ?
""
: <div className="sortinxdirection" >
: <div className="sortinxdirection " >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">单选题{'('}{single_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}></i></p>
</div>
@ -779,7 +870,7 @@ class Question extends Component {
:
<div className="sortinxdirection" >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">多选题{'('}{multiple_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}></i></p>
</div>
@ -790,7 +881,7 @@ class Question extends Component {
:
<div className="sortinxdirection" >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">判断题{'('}{judgement_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}></i></p>
</div>
@ -801,7 +892,7 @@ class Question extends Component {
:
<div className="sortinxdirection" >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">填空题{'('}{completion_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}></i></p>
</div>
@ -812,7 +903,7 @@ class Question extends Component {
:
<div className="sortinxdirection" >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">简答题{'('}{subjective_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}></i></p>
</div>
@ -823,7 +914,7 @@ class Question extends Component {
:
<div className="sortinxdirection">
<p
className="w50s intermediatecenterysls sortinxdirection font-14">实训题{'('}{practical_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor "></i></p>
</div>
@ -834,7 +925,7 @@ class Question extends Component {
:
<div className="sortinxdirection" >
<p
className="w50s intermediatecenterysls sortinxdirection font-14">编程题{'('}{program_questions_count}{')'}</p>
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}></i></p>
</div>
@ -866,4 +957,12 @@ class Question extends Component {
}
export default SnackbarHOC()(TPMIndexHOC(Question));
{/*<Drawer*/}
{/* className="drawercontainer"*/}
{/* placement={placement}*/}
{/* closable={false}*/}
{/* onClose={() => this.onClose()}*/}
{/* visible={visible}*/}
{/* mask={false}*/}
{/* closable={true}*/}
{/*>*/}

@ -14,18 +14,14 @@ import {
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Choicequestion from './component/Choicequestion';
import SingleEditor from "./component/SingleEditor";
import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor";
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
// var itembankstop=null;
// var singleEditor=null;
// var Judquestio=null;
// var Choques=null;
import { connect } from 'react-redux';
import actions from "../../redux/actions";
class Questionitem_banks extends Component {
constructor(props) {
super(props);
@ -98,7 +94,11 @@ class Questionitem_banks extends Component {
}
// this.props.setOjInitialValue({
// difficult: 1,
// sub_discipline_id: '3',
// tag_discipline_id: [3, 4]
// });
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -212,13 +212,6 @@ class Questionitem_banks extends Component {
}
preservation = () => {
//////console.log("preservation");
// //////console.log(this.contentMdRef);
// //////console.log(this.answerMdRef);
//////console.log("preservation222");
//////console.log(this.contentMdRef.Getdatas());
//////console.log("preservation3333");
//////console.log(this.answerMdRef.onSave());
const params = this.props && this.props.match && this.props.match.params;
var url = "";
var boolnew = true;
@ -232,20 +225,17 @@ class Questionitem_banks extends Component {
// "编辑"
}
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
console.log("preservation");
console.log(this.contentMdRef.Getdatas());
var Getdatasdata=this.contentMdRef.Getdatas();
if (this.state.item_type === null) {
var Getdatasdata=this.contentMdRef.Getdatas();
if (this.state.item_type === null) {
return
}
return
}
if (this.state.item_type === "SINGLE") {
if (this.answerMdRef != null) {
//单选题
@ -464,8 +454,18 @@ class Questionitem_banks extends Component {
}
if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
this.props.setOjInitialValue({
difficult: Getdatasdata[0].rbnd,
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
});
this.props.history.replace('/problems/new');
}
@ -508,7 +508,6 @@ class Questionitem_banks extends Component {
{/*题目头部操作*/}
<Itembankstop
{...this.state}
{...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)}
@ -578,6 +577,14 @@ class Questionitem_banks extends Component {
}
export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks));
const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));

@ -9,7 +9,8 @@ import {
Pagination,
Tabs,
Input,
Popover
Popover,
Tooltip
} from "antd";
import './../questioncss/questioncom.css';
import NoneDatas from '../component/NoneDatas';
@ -72,13 +73,11 @@ class Contentpart extends Component {
width:'93px',
height:'161px',
}}>
<p className="questiontype " onClick={()=>this.props.setdifficulty(null)}>全部</p>
<p className="questiontype " onClick={()=>this.props.setoj_status(null)}>全部</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setdifficulty(1)}>简单</p>
<p className="questiontype " onClick={()=>this.props.setoj_status(0)}>未发布</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setdifficulty(2)}>适中</p>
<p className="questiontypeheng"></p>
<p className="questiontype " onClick={()=>this.props.setdifficulty(3)}>困难</p>
<p className="questiontype " onClick={()=>this.props.setoj_status(1)}>已发布</p>
<p className="questiontypeheng"></p>
</div>
);
@ -95,6 +94,11 @@ class Contentpart extends Component {
<style>
{
`
.contentparttit .ant-tabs-bar{
margin: 0px 0px 0px 0px !important;
}
.contentparttit .ant-tabs-nav .ant-tabs-tab{
margin: 10px 10px 10px 0 !important;
}
@ -121,6 +125,7 @@ class Contentpart extends Component {
<style>
{
`
.xaxisreverseorder .ant-input-group-addon{
width: 60px !important;
@ -151,33 +156,54 @@ class Contentpart extends Component {
</a>
:""
}
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr10">
<div className="subjecttit">
难度
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={content} onVisibleChange={()=>this.props.handleVisibleChanges(true)}>
<div className="sortinxdirection mr40">
<div className="subjecttit">
题型
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
<Search
style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
{
defaultActiveKey===0||defaultActiveKey==="0"?
<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={contents} onVisibleChange={()=>this.props.handleVisibleChange(true)}>
<div className=" sortinxdirection mr30">
<div className="subjecttit">
全部
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
:
""
}
{/*<Popover getPopupContainer={trigger => trigger.parentNode} placement="bottom" trigger="hover" content={content} onVisibleChange={()=>this.props.handleVisibleChanges(true)}>*/}
{/*<div className="sortinxdirection mr40">*/}
{/*<div className="subjecttit">*/}
{/* 题型*/}
{/*</div>*/}
{/* <i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>*/}
{/*</div>*/}
{/*</Popover>*/}
{
defaultActiveKey===0||defaultActiveKey==="0"?
<Search
style={{ width: "347px",marginRight:"30px"}}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
style={{ width: "347px"}}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
}
</div>
</div>

@ -44,7 +44,7 @@ class Contentquestionbank extends Component {
return (
<div className=" clearfix mt5 Contentquestionbankstyle">
<div className="educontent mt10 w100s">
<div className="educontent w100s">
<div className="sortinxdirection w100s" >
<div className="sortinxdirection w50s">
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox>

@ -0,0 +1,342 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import './../questioncss/questioncom.css';
import { Select, Input,Menu, Dropdown,notification,
Spin,
Table,
Pagination} from 'antd';
import 'antd/lib/style/index.css';
import 'antd/lib/select/style/index.css';
import 'antd/lib/input/style/index.css';
import '../../tpm/shixuns/shixunCss/ShixunSearchBar.css';
const $ = window.$;
const Option = Select.Option;
const Search = Input.Search;
class Headplugselections extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
titlestting:"全部",
titlesttingid:null,
titlesttings:null,
titlesttingss:null,
status: undefined,
diff: null,
InputValue: undefined,
shixunhoverData: [],
shixunchildValues:'',
shixunsearchAllvalue:"a",
openStatus:false,
openLevel:false,
tixing:null,
}
}
//初始化
componentDidMount(){
}
//
// setdiscipline_id={(e)=>this.setdiscipline_id(e)}
// setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
// settag_discipline_id={(e)=>this.settag_discipline_id(e)}
settitlestting=(name,id)=>{
//如果全部其他的选项重置
this.setState({
titlestting:name,
titlesttingid:id,
titlesttings:null,
titlesttingsid:null,
titlesttingss:null,
titlesttingssid:null
})
if(name==="全部"){
this.props.setdiscipline_id(null);
}else{
this.props.setdiscipline_id(id);
}
}
shixunsearchall=(id)=>{
this.setState({
shixunsearchAllvalue:id,
shixunchildValues:""
})
try {
this.props.setdiscipline_id(null);
}catch (e) {
}
}
//获取方向
shixunsearchAll = (id) => {
console.log("获取方向");
console.log(id);
if(id!=undefined){
this.setState({
shixunsearchAllvalue:id,
})
try {
this.props.setdiscipline_id(id);
}catch (e) {
}
}
}
//难度筛选
diff_search = (value) => {
this.setState({
diff: value,
openLevel:false
})
try {
this.props.setdifficulty(value);
}catch (e) {
}
}
//题型塞选
settixingtixing=(value)=>{
this.setState({
tixing: value,
})
try {
this.props.setitem_types(value);
}catch (e) {
}
}
getshixunchildValue = (id,ids) => {
console.log("getshixunchildValue");
console.log(id);
debugger
if(id!=undefined ||ids!=undefined){
this.setState({
shixunsearchAllvalue:ids
})
try {
this.props.setsub_discipline_id(id);
}catch (e) {
}
}
}
render() {
let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
let {disciplinesdata} = this.props;
let overlaymenu=(item,id)=>(
<Menu>
{
item&&item.map((list,k)=>{
return(
<Menu.Item >
<div className="mt5 subshaicontent-part" key={k}>
<a style={{ height: '20px' }} className={ "mb15 shixun_repertoire color-dark intermediatecenterysls textcen "} name={list.id} id={list.id} onClick={()=>this.getshixunchildValue(list.id,id)}>{list.name}</a>
</div>
</Menu.Item>
)
})
}
</Menu>
)
return (
<div className=" clearfix mt21 ">
<div className="educontent w1200dbl">
<div className="clearfix edu-back-white tophomss">
{/*课程*/}
<div className="edu-back-white" >
<div className="educontent">
<div >
<div className="clearfix mb10 shaiContent sortinxdirection">
<span className=" fl mt3">方向</span>
<span>
<li className={shixunsearchAllvalue==="a"?"shaiItem shixun_repertoire active ":"shaiItem shixun_repertoire "} value= "a" onClick={()=>this.shixunsearchall("a")}>全部</li>
</span>
<style>
{
`
.shaiAllItem{
max-width: 930px!important;
}
`
}
</style>
<div className="fl pr shaiAllItem ">
<style>
{
`
.ant-dropdown{
width: 800px;
}
.shixun_repertoire{
text-align: center;
cursor: pointer;
float: left;
color: #999;
cursor: pointer;
margin-bottom: 10px;
}
.ant-dropdown-menu-item, .ant-dropdown-menu-submenu-title{
padding: 0px 12px;
}
.ant-dropdown-menu-item:hover, .ant-dropdown-menu-submenu-title:hover{
background:transparent !important;
}
.dingbus .ant-dropdown ul{
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.shaiItem{
padding: 3px 14px;
}
.active{
border-radius:16px !important;
}
.shaiContent li.shaiItem:hover {
border-radius:16px !important;
}
`
}
</style>
<div className="dingbus">
{
disciplinesdata&&disciplinesdata.map((item,key)=>{
return(
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}>
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunsearchAll(item.id)}>
{item.name}
</li>
</Dropdown>
)
})
}
</div>
</div>
</div>
{/*题型*/}
<div className="clearfix">
<span className=" fl mt6">题型</span>
{
<style>
{`
.shaiItems{
padding: 3px 15px;
float: left;
border-radius: 4px;
color: #4C4C4C;
cursor: pointer;
margin-right: 15px;
display: block;
float:left;
}
.shaiItems.active {
background-color: #4CACFF!important;
color: #fff!important;
}
`}
</style>
}
<div className="fl pr shaiAllItem mt1">
<li className={this.state.tixing===null?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing(null)}>全部</li>
<li className={this.state.tixing==="PROGRAM"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("PROGRAM")}>编程题</li>
<li className={this.state.tixing==="SINGLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("SINGLE")}>单选题</li>
<li className={this.state.tixing==="MULTIPLE"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("MULTIPLE")}>多选题</li>
<li className={this.state.tixing==="JUDGMENT"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("JUDGMENT")}>判断题</li>
</div>
</div>
{/*题型结尾*/}
{/*难度*/}
<div className="clearfix mb10">
<span className=" fl mt6">难度</span>
{
<style>
{`
.shaiItems{
padding: 3px 15px;
float: left;
border-radius: 4px;
color: #4C4C4C;
cursor: pointer;
margin-right: 15px;
display: block;
float:left;
}
.shaiItems.active {
background-color: #4CACFF!important;
color: #fff!important;
}
`}
</style>
}
<div className="fl pr shaiAllItem mt1">
<li className={this.state.diff===null?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(null)}>全部</li>
<li className={this.state.diff===1?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(1)}>简单</li>
<li className={this.state.diff===2?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(2)}>适中</li>
<li className={this.state.diff===3?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(3)}>困难</li>
</div>
</div>
{/*难度结尾*/}
</div>
</div>
</div>
{/*课程尾巴*/}
</div>
</div>
</div>
)
}
}
export default Headplugselections ;

@ -16,7 +16,7 @@ import {
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag
} from "antd";
import './../questioncss/questioncom.css';
import Newknledpots from './Newknledpots'
const InputGroup = Input.Group;
const {Option} = Select;
const options = [
@ -45,14 +45,15 @@ const options = [
class Itembankstop extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
options: [],
NewknTypedel:false
}
}
@ -64,29 +65,55 @@ class Itembankstop extends Component {
}
this.setState({
options: this.props.disciplmy
})
// knowledgepoints:this.props.knowledgepoints,
////console.log("componentDidMount");
////console.log(this.state);
////console.log(this.props);
// let homeworkid = this.props.match.params.homeworkid;
// let url = "/homework_commons/" + homeworkid + "/end_groups.json";
// axios.get(url).then((response) => {
// if (response.status === 200) {
// this.setState({})
// }
// }).catch((error) => {
// ////console.log(error)
// });()
// 题型
options: this.props.disciplmy,
})
}
componentDidUpdate(prevProps) {
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
const _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}
}catch (e) {
}
}
//编辑的时候
if (prevProps.item_banksedit !== this.props.item_banksedit) {
if (this.props.item_banksedit.item_type) {
this.handleFormtixing(this.props.item_banksedit.item_type);
@ -97,75 +124,76 @@ class Itembankstop extends Component {
if (this.props.item_banksedit.tag_disciplines) {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
}
if (this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline) {
try {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}catch (e) {
}
}
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
this.getdatasmys();
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
if(this.props.item_banksedit.tag_disciplines.length===0){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (name.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (title.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
}
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
})
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
}
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
this.setState({
rbzsd:sju,
Knowpoints:data,
})
this.props.form.setFieldsValue({
@ -174,6 +202,8 @@ class Itembankstop extends Component {
}catch (e) {
}
}
onChange = (e) => {
@ -236,6 +266,10 @@ class Itembankstop extends Component {
//课程
////console.log("课程");
////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined;
this.props.form.setFieldsValue({
rbzsd: value,
@ -249,17 +283,20 @@ class Itembankstop extends Component {
}
}
var tmp = JSON.parse(JSON.stringify(this.state.knowledgepoints));
for (var i = 0; i < tmp.length; i++) {
if (tmp[i].id === value) {
this.state.knowledgepoints.splice(i, 1);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
console.log("guonue");
console.log(item);
_result.push(item);
}
}
});
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
@ -307,6 +344,7 @@ class Itembankstop extends Component {
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
})
this.props.form.setFieldsValue({
@ -334,19 +372,11 @@ class Itembankstop extends Component {
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
var arr = this.state.Knowpoints;
for (let data of arr) {
if (data.id === item.id) {
this.state.knowledgepoints.push(data);
}
}
var tmp = JSON.parse(JSON.stringify(this.state.Knowpoints));
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i >= index) {
var pos = this.state.Knowpoints.indexOf(tmp[i]);
this.state.Knowpoints.splice(pos, 1);
if (i ===index) {
tmp.splice(i,1);
}
}
@ -354,11 +384,16 @@ class Itembankstop extends Component {
rbzsd: this.state.Knowpoints,
});
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
rbzsd: undefined,
@ -377,14 +412,70 @@ class Itembankstop extends Component {
}
NewknTypedeldel=(bool)=>{
this.setState({
NewknTypedel:bool
})
}
NewknTypedeltyoedel=(value)=>{
if(value===null||value===""){
this.props.showNotification(`请输入知识点`);
return
}
if(value.length===0){
this.props.showNotification(`请输入知识点`);
return
}
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
}
const url="/tag_disciplines.json";
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}).catch((error) => {
//console.log(error);
})
this.setState({
NewknTypedel:false
})
}
render() {
let {page, options} = this.state;
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
//console.log("renderrenderrender");
//console.log(this.props.item_banksedit);
//console.log("renderrenderrendersssss");
//console.log(this.state.rbtx);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -418,6 +509,15 @@ class Itembankstop extends Component {
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<Form.Item
@ -429,30 +529,11 @@ class Itembankstop extends Component {
}
)(
<div className="sortinxdirection">
<InputGroup compact>
<InputGroup >
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
{/*<div className="sortinxdirection" style={{*/}
{/* height: "33px",*/}
{/* lineHeight: "28px",*/}
{/*}}>*/}
{/* {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {*/}
{/* return (*/}
{/* <div className="mytags" style={{*/}
{/* position: "relative",*/}
{/* }}>*/}
{/* <p className="w100s stestcen lh32">{object}</p>*/}
{/* <i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss" onClick={()=>this.deletesobject(object,index)}></i>*/}
{/* </div>*/}
{/* )*/}
{/* })}*/}
{/*</div>*/}
</div>
)}
</Form.Item>
@ -462,16 +543,22 @@ class Itembankstop extends Component {
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={this.state.rbzsd} onChange={this.handleFormkechen}
<InputGroup >
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{this.state.knowledgepoints && this.state.knowledgepoints.map((object, index) => {
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
<Option value={object.id}>{object.name}</Option>
<Option key={object.id} value={object.id}>{object.name}</Option>
)
})}
</Select>
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection" style={{
height: "33px",
lineHeight: "28px",
@ -480,16 +567,20 @@ class Itembankstop extends Component {
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div className="mytags" style={{
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<i className="iconfont icon-roundclose font-25 lg ml7 icondowncolorss"
onClick={() => this.deletesobject(object, index)}></i>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
</div>
)}
@ -503,7 +594,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择题型'}],
}
)(
<InputGroup compact>
<InputGroup >
<Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}
placeholder="请选择...">
<Option value="SINGLE">单选题</Option>
@ -576,7 +667,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group value={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Group initialValue={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>
@ -584,12 +675,6 @@ class Itembankstop extends Component {
)}
</Form.Item>
</div>
{/*<Form.Item>*/}
{/* <Button type="primary" htmlType="submit" className="login-form-button">*/}
{/* 提交*/}
{/* </Button>*/}
{/*</Form.Item>*/}
</Form>
<div className="h20"></div>
</div>

@ -77,7 +77,7 @@ class Listjihe extends Component {
return (
<div className={chakanjiexiboolindex===keindex?"w100s borderwds283 pd20 mb20":"w100s borderwds pd20 mb20"}>
<div key={keindex} className={chakanjiexiboolindex===keindex?"w100s borderwds283 pd20 mb20 listjihecolors":"w100s borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/}
<div className="w100s sortinxdirection">
<div className="listjihetixingstitsy">
@ -149,7 +149,13 @@ class Listjihe extends Component {
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
:""
}
{
items.item_type==="PROGRAM"?
items.program_attr.status===0?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
:""
:""
}
</div>
<div className="w50s xaxisreverseorder">
{
@ -158,9 +164,22 @@ class Listjihe extends Component {
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>撤销</span></p>
:
items.item_type==="PROGRAM"?
items.program_attr.status===0?
<p className="selectionys jinzhixiaoshou" >
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span>
</p>
:
<p className="selection xiaoshou" onClick={()=>this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span>
</p>
:
<p className="selection xiaoshou" onClick={()=>this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr10"></i>
<span>选用</span></p>
<span>选用</span>
</p>
}
{
defaultActiveKey===0||defaultActiveKey==="0"?
@ -169,16 +188,41 @@ class Listjihe extends Component {
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
{
items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
{
items.public===false?
items.item_type==="PROGRAM"?
items.program_attr.status===0?
""
:
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
""
}
</div>
:""
}
@ -206,6 +250,11 @@ class Listjihe extends Component {
>
</p>
</div>
{
items&&items.analysis?
""
:""
}
<div className=" sortinxdirection mt15 yldxtit" >
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML("解析:"+items.analysis).replace(/▁/g, "▁▁▁")}}

@ -0,0 +1,50 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Input} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class PaperDeletModel extends Component {
constructor(props) {
super(props);
this.state={
newkntypeinput:""
}
}
handleChange=(e)=>{
this.setState({
newkntypeinput: e.target.value
})
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="新增知识点"
centered={true}
visible={this.props.NewknTypedel===undefined?false:this.props.NewknTypedel}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}>
<Input onInput={this.handleChange} />
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.NewknTypedeldel(false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.NewknTypedeltyoedel(this.state.newkntypeinput)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default PaperDeletModel;

@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModel extends Component {
constructor(props) {
@ -14,7 +13,7 @@ class Paperreview_itemModel extends Component {
}
onChange=(value)=>{
console.log("Paperreview_itemModel");
console.log("设置批量得分");
console.log(value);
this.setState({
value:value,

@ -0,0 +1,68 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModels extends Component {
constructor(props) {
super(props);
this.state={
value:0,
}
}
onChange=(value)=>{
console.log("Paperreview_itemModels");
console.log(value);
this.setState({
value:value,
})
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="设置分数"
centered={true}
visible={this.props.modalsTypeys===undefined?false:this.props.modalsTypeys}
width="442px"
>
<style>
{
`
.yslzxueshisanfd .ant-input-number{
height: 35px !important;
width: 124px !important;
}
`
}
</style>
<div className="educouddiv intermediatecenter">
<div className={"tabeltext-alignleft mt10 sortinxdirection yslzxueshisanfd"}>
<p className="titiles lh35">
{this.props.titilesm}</p>
<InputNumber min={0}
step={0.1}
onChange={this.onChange} />
<p className="titiles ml5 lh35">
/
</p>
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazines(false,null)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloadys(this.state.value)}>确定</a>
</div>
</div>
</Modal>
)
}
}
export default Paperreview_itemModels;

@ -0,0 +1,175 @@
import React, { Component } from 'react';
import { getImageUrl} from 'educoder';
import {Tooltip} from 'antd';
import '../../tpm/TPMIndex.css';
const $ = window.$;
const poiindex=0;
$(window).resize(function(){
rightSlider();
});
$(window).scroll(function(){
if($(".gotop").length>0){
if($(document).scrollTop()>0){
$(".-task-sidebar .gotop").show();
$(".gotop").click(function(){
$("html,body").scrollTop(0);
});
}
if($(document).scrollTop()==0){
$(".-task-sidebar .gotop").hide();
}
}
});
function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-81;
// console.log(parseInt($(window).width())+" "+poi);
if(poi>0){
$(".-task-sidebar").css("right",poi);
}else{
$(".-task-sidebar").css("right","0px");
}
$(".-task-sidebar").show();
}
function _initSider() {
var $descSide = $("<div class='-task-desc'></div>").appendTo("body");
$(".-task-sidebar>div").hover(function(){
//移入显示二维码
if($(this).hasClass("scan")){
$(".scan_ewm").show().css({right:"75px",opacity:0}).stop().animate({
right:"45px",opacity:1
})
return;
}
var $tool = $(this).attr("tooltips");
$descSide.html($tool+"<div><img src='/images/edu_user/jt.png'></div>");
$descSide.data('_dom', this)
$descSide.show().css({
left:$(this).offset().left - $descSide.width()-30,
opacity:0,
top:$(this).offset().top
}).stop().animate({
left:$(this).offset().left - $descSide.width()-5,
opacity:1
},400);
},function(){
if($(this).hasClass("scan")){
$(".scan_ewm").stop().animate({right:"75px",opacity:0},200).hide();
}
$descSide.stop().animate({
left:$(this).offset().left - $descSide.width()-30,
opacity:0
},200).hide();
});
rightSlider();
$(window).scroll(function() {
if ($descSide.height()) {
var hoverIcon = $descSide.data('_dom')
$descSide.css('top', $(hoverIcon).offset().top)
}
})
}
class SiderBars extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
_initSider()
}
render() {
// console.log("SiderBar");
// console.log(this.props);
var mypath= this.props&&this.props.match&&this.props.match.path;
let{myvisible}=this.props;
return (
<div className={myvisible===true?"-task-sidebar mystask-sidebar":"-task-sidebar mystask-sidebars"} >
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
{
mypath&&mypath==="/question"?
<Tooltip placement="left" title={"试题库"}>
<div className="feedback feedbackdivcolor xiaoshou shitikus" onClick={()=>this.props.showDrawer()} >
<a target="_blank" className="color_white xiaoshou" >
<i className="iconfont icon-shitilan color-white xiaoshou"></i>
</a>
<p className="color-white font-12 xiaoshou">试题库</p>
</div>
</Tooltip>
:""
}
<Tooltip placement="right" title={"返回顶部"}>
<div className="gotop">
<a>
<i className="iconfont icon-shangjiantou color-white"></i>
</a>
</div>
</Tooltip>
<Tooltip placement="right" title={"意见反馈"}>
<div className="feedback">
<a target="_blank" className="color_white" href="/help/feedback">
<i className="iconfont icon-yijianfankui color-white font-22"></i>
</a>
</div>
</Tooltip>
<div className="scan pr">
<Tooltip placement="right" title={
<pre>
<p className="scan_ewm">
<p className="pr padding10">
<style>
{
`
.WeChatstyle{
margin-bottom: 0 !important;
}
`
}
</style>
<img src={getImageUrl("images/educoder/EWM.jpg")} width="158px" height="158px" />
<p className={"WeChatstyle wechatcenter"}>微信扫一扫</p>
<p className={"WeChatstyle wechatcenter"}>关注公众号</p>
</p>
</p>
</pre>
}>
<span className="inline erweima"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
</Tooltip>
</div>
<Tooltip placement="right" title={"在线咨询"}>
<div className="consult">
<a target="_blank" className="color_white" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">
<i className="iconfont icon-qqzaixianzixun color-white font-22"></i>
</a>
</div>
</Tooltip>
</div>:""}
</div>
);
}
}
export default SiderBars;

@ -5,6 +5,7 @@ import {
Slider, Button, Upload, Icon, Rate, Checkbox, message,
Row, Col, Select, Modal, Tooltip
} from 'antd';
import QuillForEditor from '../../../common/quillForEditor';
import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios'
import update from 'immutability-helper'
@ -252,6 +253,10 @@ class SingleEditor extends Component{
toShowMode = () => {
}
onContentChange=(e)=>{
console.log(e);
}
render() {
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
let { question_id, index, exerciseIsPublish,
@ -308,6 +313,14 @@ class SingleEditor extends Component{
></TPMMDEditor>
{/*<QuillForEditor*/}
{/* style={{ height: '155px'}}*/}
{/* placeholder="请您输入题干"*/}
{/* value={question_title}*/}
{/* options={['code-block', 'image', 'formula']}*/}
{/* onContentChange={this.onContentChange}*/}
{/*/>*/}
<div className="mb10 sortinxdirection">
{/* {!question_id ? '新建' : '编辑'} */}
<span className="xingcolor font-16 fl mr4">*</span>
@ -322,7 +335,7 @@ class SingleEditor extends Component{
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
<span class={`option-item fr mr10 color-grey select-choice ${bg} `}
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={true}>
<ConditionToolTip title={standard_answers[index] ? '' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
</ConditionToolTip>
</span>

@ -375,8 +375,6 @@ class Comthetestpapers extends Component {
addonAfteronelens3=String(addonAfterthree).length;
}
console.log("Comthetestpapers.js");
console.log(this.props);
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
@ -537,27 +535,27 @@ class Comthetestpapers extends Component {
<span className="ant-form-text"> 分钟</span>
</Form.Item>
</div>
<div className="tixing">
<Form.Item
label="题型:"
>
{getFieldDecorator("rbtx",
{
rules: [{required: true, message: '请选择题型'}],
}
)(
<InputGroup compact>
<Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}
placeholder="请选择...">
<Option value="SINGLE">单选题</Option>
<Option value="MULTIPLE">多选题</Option>
<Option value="JUDGMENT">判断题</Option>
<Option value="PROGRAM">编程题</Option>
</Select>
</InputGroup>
)}
</Form.Item>
</div>
{/*<div className="tixing">*/}
{/*<Form.Item*/}
{/* label="题型:"*/}
{/*>*/}
{/* {getFieldDecorator("rbtx",*/}
{/* {*/}
{/* rules: [{required: true, message: '请选择题型'}],*/}
{/* }*/}
{/* )(*/}
{/* <InputGroup compact>*/}
{/* <Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}*/}
{/* placeholder="请选择...">*/}
{/* <Option value="SINGLE">单选题</Option>*/}
{/* <Option value="MULTIPLE">多选题</Option>*/}
{/* <Option value="JUDGMENT">判断题</Option>*/}
{/* <Option value="PROGRAM">编程题</Option>*/}
{/* </Select>*/}
{/* </InputGroup>*/}
{/* )}*/}
{/*</Form.Item>*/}
{/*</div>*/}
<style>
{

@ -0,0 +1,818 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox,
Form,
Input,
Select,
Cascader,
Col, Row, InputNumber, DatePicker, AutoComplete, Button, Tag
} from "antd";
import './../questioncss/questioncom.css';
import Newknledpots from '../component/Newknledpots'
const InputGroup = Input.Group;
const {Option} = Select;
const options = [
{
value: '方向',
label: '方向',
children: [
{
value: '课程',
label: '课程',
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
},
],
},
];
class Comthetestpaperst extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
rbtx: undefined,
rbkc: undefined,
knowledgepoints: [],
knowledgepoints2:[],
options: [],
NewknTypedel:false
}
}
//初始化
componentDidMount() {
try {
this.props.getJudquestio(this);
} catch (e) {
}
this.setState({
options: this.props.disciplmy,
})
}
componentDidUpdate(prevProps) {
//编辑的时候
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
if (prevProps.item_banksedit !== this.props.item_banksedit) {
// if (this.props.item_banksedit.item_type) {
// this.handleFormtixing(this.props.item_banksedit.item_type);
// }
if (this.props.item_banksedit.difficulty) {
this.handleFormLayoutChange(this.props.item_banksedit.difficulty);
}
if (this.props.item_banksedit.tag_disciplines) {
this.handletag_disciplinesChange(this.props.item_banksedit.tag_disciplines);
}
try {
this.handdisciplinesChange(this.props.item_banksedit.discipline,this.props.item_banksedit.sub_discipline);
}catch (e) {
}
try {
if(this.props.item_banksedit.name){
this.props.form.setFieldsValue({
// course:value,
classroom:this.props.item_banksedit.name,
})
}
}catch (e) {
}
try {
if(this.props.item_banksedit.duration){
this.props.form.setFieldsValue({
// course:value,
kssc:this.props.item_banksedit.duration,
})
}
}catch (e) {
}
this.getdatasmys();
}
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
})
this.props.form.setFieldsValue({
rbkc: [name.id,title.id],
});
}
handleSearch=(value)=>{
if(value!=""){
this.props.form.setFieldsValue({
classroom:value,
// course:value
});
// this.Searchvalue(value)
}
};
handleChange=(e)=>{
console.log(e);
this.props.form.setFieldsValue({
// course:value,
classroom:e.target.value,
})
if(e.target.value){
if(e.target.value.length>60){
this.setState({
bordebool:true,
})
}else if(e.target.value.length===0){
this.setState({
bordebool:true,
})
}else{
this.setState({
bordebool:false,
})
}
}else{
this.setState({
bordebool:true
})
}
};
handletag_disciplinesChange = (data) => {
//是否选中的知识点
try {
var sju=data[data.length-1].name;
this.setState({
Knowpoints:data,
})
this.props.form.setFieldsValue({
rbzsd: sju,
});
}catch (e) {
}
}
onChange = (e) => {
}
Getdatas = () => {
return this.handleSubmits();
}
handleSubmits = () => {
var data = [];
this.props.form.validateFields((err, values) => {
data = [];
if (!err) {
data.push({
rbnd: parseInt(values.rbnd)
})
data.push({
rbtx: null
})
data.push({
rbzsd: this.state.Knowpoints
})
data.push({
rbkc: values.rbkc
})
data.push({
classroom:values.classroom
})
data.push({
kssc:values.kssc
})
}
});
return data;
}
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
////console.log("获取的form 数据");
////console.log(values);
}
});
}
handleFormLayoutChange = (value) => {
//难度塞选
////console.log("难度塞选");
////console.log(value);
this.props.form.setFieldsValue({
rbnd: value + "",
});
this.setState({
rbnd: value + "",
})
}
handleFormkechen = (value) => {
//课程
////console.log("课程");
////console.log(value);
if(this.state.Knowpoints.length>4){
this.props.showNotification(`知识点最多选择5个`);
return
}
var valuename = undefined;
this.props.form.setFieldsValue({
rbzsd: value,
});
var arr = this.state.knowledgepoints;
for (let data of arr) {
if (data.id === value) {
this.state.Knowpoints.push(data);
valuename = data.name;
}
}
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
console.log("guonue");
console.log(item);
_result.push(item);
}
});
this.setState({
rbzsd: valuename,
Knowpoints: this.state.Knowpoints,
knowledgepoints2: _result,
})
}
handleFormzhishidian = (value) => {
console.log("handleFormzhishidian 课程");
console.log(value);
//课程
this.props.form.setFieldsValue({
rbkc: value,
});
this.setState({
rbkc:value,
})
// console.log("handleFormzhishidian");
// console.log(this.props.disciplinesdata);
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (value[0] === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (value[1] === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
this.setState({
Knowpoints: [],
knowledgepoints: knowledgepointsdata,
knowledgepoints2:knowledgepointsdata,
})
this.props.form.setFieldsValue({
rbzsd: undefined,
});
this.setState({
rbzsd: undefined,
})
}
handleFormtixing = (value) => {
//题型
//console.log("题型");
//console.log(value);
this.setState({
rbtx: value + "",
})
this.props.form.setFieldsValue({
rbtx: value + "",
});
this.props.setitem_type(value);
}
preventDefault = (e) => {
e.preventDefault();
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
tmp.splice(i,1);
}
}
this.props.form.setFieldsValue({
rbzsd: this.state.Knowpoints,
});
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints2:_result,
})
if (this.state.Knowpoints.length === 0) {
this.setState({
rbzsd: undefined,
})
} else if (this.state.Knowpoints.length > 0) {
try {
const myknowda = this.state.Knowpoints;
this.setState({
rbzsd: myknowda[this.state.Knowpoints.length - 1].name,
})
} catch (e) {
}
}
}
NewknTypedeldel=(bool)=>{
this.setState({
NewknTypedel:bool
})
}
NewknTypedeltyoedel=(value)=>{
if(value===null||value===""){
this.props.showNotification(`请输入知识点`);
return
}
if(value.length===0){
this.props.showNotification(`请输入知识点`);
return
}
if(this.state.rbkc===undefined || this.state.rbkc===null || this.state.rbkc===""){
this.props.showNotification(`请选择课程方向`);
return;
}
var data={
name:value,
sub_discipline_id:this.state.rbkc[1]
}
const url="/tag_disciplines.json";
axios.post(url,data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`新增知识点成功!`);
var leydata={
id: result.data.tag_discipline_id,
name:value,
}
this.state.knowledgepoints.push(leydata);
const _result =[];
this.state.knowledgepoints.filter(item => {
if (this.state.Knowpoints.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
Knowpoints: this.state.Knowpoints,
knowledgepoints: this.state.knowledgepoints,
knowledgepoints2: _result,
})
}
}).catch((error) => {
//console.log(error);
})
this.setState({
NewknTypedel:false
})
}
render() {
let {page, options,NewknTypedel,knowledgepoints,knowledgepoints2,Knowpoints} = this.state;
const {getFieldDecorator} = this.props.form;
const optionss = this.state.searchlist && this.state.searchlist.map(d => <Option key={d.name} value={d.name}>{d.name}</Option>);
var addonAfterthree=this.props.form&&this.props.form.getFieldValue('classroom');
var addonAfteronelens3=0;
if(addonAfterthree){
addonAfteronelens3=String(addonAfterthree).length;
}
return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200fpx mt19">
<style>
{
`
.ant-form-item{
margin-bottom: 0px !important;
}
.ant-form-explain{
padding-left:0px !important;
margin-top: 3px !important;
}
.ant-select-selection{
height: 33px !important;
}
.ant-input-group{
width:258px !important;
}
.ant-input {
height: 33px !important;
}
.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within {
outline: 0px solid rgba(24, 144, 255, 0.06) !important;
}
`
}
</style>
<div className="h12"></div>
{
NewknTypedel?
<Newknledpots {...this.state} {...this.props}
NewknTypedeldel={(bool)=>this.NewknTypedeldel(bool)}
NewknTypedeltyoedel={(value)=>this.NewknTypedeltyoedel(value)}
></Newknledpots>
:""
}
<Form onSubmit={this.handleSubmit}>
<Form.Item
label="课程"
>
{getFieldDecorator("rbkc",
{
rules: [{required: true, message: '请选择课程'}],
}
)(
<div className="sortinxdirection">
<InputGroup compact>
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
</div>
)}
</Form.Item>
<Form.Item
label="知识点"
>
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
<Option key={object.id} value={object.id}>{object.name}</Option>
)
})}
</Select>
</InputGroup>
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection" style={{
height: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
</div>
)}
</Form.Item>
<style>
{
`
.ml19{
margin-left:19px;
}
`
}
</style>
<div className="stud-class-set ">
<style>{
`
.yslzxueshis .ant-input{
border-right: none !important;
height: 38px !important;
width: 970px !important;
}
.yslzxueshisy span .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
.yslzxueshisy .ant-input-group-addon{
width: 65px !important;
background-color: #fafafa!important;
}
`
}</style>
<div className="sjmc">
<Form.Item label="试卷名称:">
{getFieldDecorator('classroom', {
rules: [{required: true, message: "不能为空"}],
})(
<AutoComplete
onSearch={this.handleSearch}
className={"fl construction yslzxueshis "}
dataSource={optionss}
>
<Input className="yslzxueshisy " placeholder="例如:数据结构" onInput={this.handleChange} addonAfter={String(addonAfteronelens3)+"/60"} maxLength={60} />
</AutoComplete>
)}
<div id='isclassroom'></div>
</Form.Item>
</div>
</div>
<style>
{
`
.kssc .ant-form-item-label{
line-height: 38px !important;
}
`
}
</style>
<div className="kssc">
<Form.Item label="考试时长:">
{getFieldDecorator('kssc')(<InputNumber
min={0}
step={0.1}
></InputNumber>)}
<span className="ant-form-text"> 分钟</span>
</Form.Item>
</div>
<style>
{
`
.rbndclass .ant-radio-button-wrapper{
width:106px !important;
height:33px !important;
background:#EEEEEE;
border-radius:17px !important;
color:#333333;
text-align: center !important;
border:0px !important;
margin-right: 27px !important;
margin-top: 6px !important;
}
.rbndclass .ant-radio-button-wrapper-checked {
width: 106px !important;
height: 33px !important;
background: #4CACFF !important;
border-radius: 17px !important;
text-align: center !important;
border:0px !important;
color: #ffffff !important;
margin-right: 27px !important;
margin-top: 6px!important;
}
.rbndclass .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important;
width:0px !important;
}
.rbndclass .ant-radio-button-wrapper{
border:0px !important;
}
.rbndclass .ant-radio-group{
border:0px !important;
}
.rbndclass .ant-radio-group label{
border:0px !important;
}
.rbndclass .ant-radio-group span{
border:0px !important;
}
ant-radio-button-wrapper:focus-within {
outline: 0px solid #ffffff;
}
`
}
</style>
<div className="rbndclass">
<Form.Item label="难度">
{getFieldDecorator('rbnd',
{
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group initialValue={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>
</Radio.Group>,
)}
</Form.Item>
</div>
</Form>
<div className="h20"></div>
</div>
)
}
}
const Comthetestpapersts = Form.create({name: 'Comthetestpaperst'})(Comthetestpaperst);
export default Comthetestpapersts;

@ -129,6 +129,11 @@
padding-left: 26px;
padding-right: 26px;
}
.tophomss{
padding-top: 15px;
padding-left: 15px;
padding-right: 15px;
}
.borderwd{
border: 1px solid #000000;
}
@ -216,6 +221,11 @@
top: -20px;
right: -16px;
}
.icondowncolorssy{
position: absolute;
top: -15px;
right: -11px;
}
.questiontype{
width: 100%;
@ -350,6 +360,15 @@
line-height: 30px;
color: #FFFFFF;
}
.selectionys{
width:88px;
height:30px;
background:#CCCCCC;
border-radius:4px;
text-align: center;
line-height: 30px;
color: #FFFFFF;
}
.selectionss{
width:88px;
height:30px;
@ -807,3 +826,59 @@
.mr2{
margin-right: 2px;
}
.ml22{
margin-left: 22px;
}
.zjzsdian{
width: 20px;
height: 20px;
margin-top: 5px;
}
.textcen{
text-align: center;
}
.listjihecolors:hover{
background: #F9F9F9;
background-color: #F9F9F9;
}
.nofabu{
width:46px;
height: 20px;
line-height: 20px;
background:rgba(255,102,1,1);
border-radius:10px;
color: #ffffff;
text-align: center;
}
.jinzhixiaoshou{
cursor:no-drop
}
.shitilang{
height: 40px;
background: #606060;
color: #FFFFFF;
position: absolute;
top: -2px;
width: 100%;
left: 0px;
font-size:14px;
text-align: center;
line-height: 40px;
}
.xiaoshoums:hover{
color:#4CACFF;
}
.shitikus{
width: 40px !important;
position: absolute;
border-radius: 4px;
top: -50%;
}

@ -0,0 +1,270 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertits from "./component/Seeoagertits";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss';
import JudquestionEditor from "../question/component/JudquestionEditor";
//人工组卷预览
class Paperlibraryeditid extends Component {
constructor(props) {
super(props);
this.Judquestio = React.createRef();
this.state = {
paperlibrartdata: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
item_banksedit: []
}
}
getJudquestio = (Ref) => {
console.log("子组件对象");
console.log(Ref);
this.Judquestio = Ref;
}
//初始化
componentDidMount() {
this.getdata();
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
})
if (response.data) {
if (response.data.disciplines) {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
const zsddata = fxdidata[j].tag_disciplines;
childern.push(
{
value: fxdidata[j].id,
label: fxdidata[j].name,
}
)
for (var k = 0; k < zsddata.length; k++) {
//知识点
this.state.knowledgepoints.push(zsddata[k]);
}
}
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
}
this.state.disciplmy.push(datakec);
}
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy: this.state.disciplmy,
})
}
}
}
});
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
item_banksedit: response.data.exam,
})
}
});
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
//保存试卷
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks/${this.props.match.params.id}.json`;
var data={
difficulty:this.Judquestio.Getdatas()[0].rbnd,
name:this.Judquestio.Getdatas()[4].classroom,
duration:this.Judquestio.Getdatas()[5].kssc,
discipline_id: this.Judquestio.Getdatas()[3].rbkc[0],
sub_discipline_id: this.Judquestio.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
axios.put(url, data)
.then((result) => {
if (result.data.status === 0) {
this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary');
}
}).catch((error) => {
console.log(error);
})
}
setitem_type = (item_type) => {
}
setCohetepaperbool = (bool) => {
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb>
</div>
<Comthetestpaperst {...this.state} {...this.props}
item_banksedit={this.state.item_banksedit}
getJudquestio={(ref) => this.getJudquestio(ref)}
></Comthetestpaperst>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertits
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
>
</Seeoagertits>
<Paperlibraryseeid_itemss
{...this.state}
{...this.props}
getdata={() => this.getdata()}
single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null}
multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions
&& paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null
}
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null
}
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
}
></Paperlibraryseeid_itemss>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Paperlibraryeditid));

@ -0,0 +1,185 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertit from "./component/Seeoagertit";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
//人工组卷预览
class Paperlibraryseeid extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
}
}
//初始化
componentDidMount() {
console.log("Paperlibraryseeid");
this.getdata();
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
})
}
});
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
//保存试卷
}
setitem_type = (item_type) => {
}
setCohetepaperbool =(bool)=>{
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
</div>
<div className="seesjtit intermediatecenter mt16">
{paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.name}
</div>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertit all_score={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_score}
>
</Seeoagertit>
<Paperlibraryseeid_item
{...this.state}
{...this.props}
getdata={()=>this.getdata()}
single_questions={paperlibrartdata&&paperlibrartdata.single_questions&&paperlibrartdata.single_questions.questions.length>0?paperlibrartdata.single_questions:null}
multiple_questions={paperlibrartdata&&paperlibrartdata.multiple_questions
&&paperlibrartdata.multiple_questions.questions.length>0?paperlibrartdata.multiple_questions:null
}
judgement_questions={paperlibrartdata&&paperlibrartdata.judgement_questions
&&paperlibrartdata.judgement_questions.questions.length>0?paperlibrartdata.judgement_questions:null
}
program_questions={paperlibrartdata&&paperlibrartdata.program_questions
&&paperlibrartdata.program_questions.questions.length>0?paperlibrartdata.program_questions:null
}
>
</Paperlibraryseeid_item>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Paperlibraryseeid));

@ -15,7 +15,7 @@ import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import Contentpart from "./component/Contentpart";
import SiderBar from "../tpm/SiderBar";
import Headplugselection from "../question/component/Headplugselection";
import Headplugselections from "../question/component/Headplugselections";
import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
class Testpaperlibrary extends Component {
@ -189,14 +189,17 @@ class Testpaperlibrary extends Component {
this.setState({
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null
tag_discipline_id:null,
keywords:null,
page: 1,
per_page:10,
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
public: this.state.defaultActiveKey,
difficulty: null,
difficulty: this.props.difficulty,
keywords: null,
page: 1,
per_page:10,
@ -207,14 +210,17 @@ class Testpaperlibrary extends Component {
setsub_discipline_id=(sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null
tag_discipline_id:null,
keywords:null,
page:1,
per_page:10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
public: this.state.defaultActiveKey,
difficulty: null,
difficulty: this.state.difficulty,
keywords: null,
page:1,
per_page:10,
@ -224,14 +230,17 @@ class Testpaperlibrary extends Component {
settag_discipline_id=(tag_discipline_id)=>{
this.setState({
tag_discipline_id:tag_discipline_id
tag_discipline_id:tag_discipline_id,
keywords:null,
page:1,
per_page:10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: null,
difficulty: this.state.difficulty,
keywords: null,
page: 1,
per_page:10,
@ -336,6 +345,13 @@ class Testpaperlibrary extends Component {
})
};
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`);
}
showmodelysl = (id) => {
this.setState({
modalsType: true,
@ -350,6 +366,9 @@ class Testpaperlibrary extends Component {
this.setState({
difficulty: difficulty,
visiblemys: false,
keywords:"",
page: 1,
per_page:10,
})
var data = {
@ -358,8 +377,8 @@ class Testpaperlibrary extends Component {
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: difficulty,
keywords: this.state.keywords,
page: this.state.page,
keywords:null,
page:1,
per_page:10,
};
@ -367,6 +386,35 @@ class Testpaperlibrary extends Component {
}
setitem_types = (item_type) => {
this.setState({
item_type: item_type,
visiblemyss: false,
keywords:null,
page: 1,
per_page:10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
keywords:"",
page: 1,
per_page:10,
};
this.getdata(data);
}
render() {
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
return (
@ -390,16 +438,19 @@ class Testpaperlibrary extends Component {
showDrawer={() => this.showDrawer()}
Headertop={Headertop}/>
{/*顶部*/}
<Headplugselection {...this.props} {...this.state}
<Headplugselections {...this.props} {...this.state}
disciplinesdata={this.state.disciplinesdata}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
></Headplugselection>
setitem_types={(e) => this.setitem_types(e)}
setdifficulty={(e) => this.setdifficulty(e)}
></Headplugselections>
{/*头部*/}
<Contentpart
{...this.props}
{...this.state}
Testpapereditor={(e)=>this.Testpapereditor(e)}
setdifficulty={(e)=>this.setdifficulty(e)}
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}

@ -65,6 +65,9 @@ class Contentpart extends Component {
<style>
{
`
.contentparttit .ant-tabs-bar{
margin: 0px 0px 0px 0px !important;
}
.contentparttit .ant-tabs-nav .ant-tabs-tab{
margin: 10px 10px 10px 0 !important;
}
@ -121,21 +124,13 @@ class Contentpart extends Component {
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
<Popover placement="bottom" trigger="hover" content={contents} >
<div className=" sortinxdirection mr10">
<div className="subjecttitys">
难度
</div>
<i className="iconfont icon-sanjiaoxing-down font-12 lg ml7 icondowncolor"></i>
</div>
</Popover>
onSearch={ (value)=>this.props.setdatafuns(value)}
value={this.props.keywords}
/>
<div className="xaxisreverseorder" style={{
width:"388px"
width:"50%"
}}>
<a href={'/question/newitem'}>
@ -166,7 +161,6 @@ class Contentpart extends Component {
<div className=" w100s mb10" style={
{
position:"relative",
top:" -8px",
}
}>
{
@ -197,6 +191,7 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
>

@ -57,7 +57,9 @@ class Listjihe extends Component {
}
gotoseesj=(id)=>{
this.props.history.push(`/paperlibrary/see/${id}`);
}
render() {
@ -72,13 +74,13 @@ class Listjihe extends Component {
const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name;
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter"}>
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s">
<div className="sjimg ">
<img src={getImageUrl("images/educoder/shijuans.png ")} width={80}/>
</div>
<div className="w100s verticallayout ml20" >
<div className="w100s"> <p className="sjtitle">{names}</p></div>
<div className="w100s " > <p className="sjtitle xiaoshou" onClick={()=>this.gotoseesj(items.id)}>{names}</p></div>
<div className="w100s sortinxdirection mt9">
<p className="sjtitles">试题数<span >{question_counts}</span></p>
<p className="sjtitles ml48">总分<span >{total_scores}</span></p>
@ -108,20 +110,24 @@ class Listjihe extends Component {
{
defaultActiveKey===0||defaultActiveKey==="0"?
<div className="w35s xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodelysl(items.id)}>
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
<a >
<p className="viewparsings xiaoshou mr25" >
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.Testpapereditor(items.id)}>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
<p className="viewparsings xiaoshou mr25" onClick={()=>this.props.showmodels(items.id)} >
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
{
items.public === false ?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:""
}
</div>
:""}

@ -0,0 +1,640 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import Paperlibraryseeid_items from './Paperlibraryseeid_items';
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
class Paperreview_item extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
//初始化
componentDidMount() {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
onDragEnd = (result) => {
console.log("单选题");
console.log(result);
const ids = this.props.single_questions.questions[result.source.index].id;
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds = (result) => {
console.log("多选题");
console.log(result);
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss = (result) => {
console.log("判断题");
console.log(result);
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
debugger
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss = (result) => {
console.log("编程题");
console.log(result);
const ids = this.props.program_questions.questions[result.source.index].id;
const positions = this.props.program_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata();
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazine = (name, bool) => {
if (bool === true) {
this.setState({
modalsTypey: true,
titilesm: name
})
} else {
this.setState({
modalsTypey: false,
titilesm: ""
})
}
}
setDownloady = (fenshu) => {
const url = "/item_baskets/batch_set_score.json";
var data = {
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
console.log(error);
})
}
setDownloadys=(value)=>{
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
hideparagraph = (name) => {
console.log("hideparagraph");
}
hideparagraphs = () => {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
showparagraph = (name) => {
console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
<div className=" w100s">
<div className="w100s " >
{/*单选题*/}
{
single_questions && single_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mt20 mb20 postitonrelati">
<div
className={ "w100s sortinxdirection intermediatecenterysls mb20"}
>
<p className={"yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEnd}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
single_questions && single_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"SINGLE"}
typenamesn={"单选题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
multiple_questions && multiple_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20"}
>
<p
className={"yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
<p
className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEnds}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions && multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"MULTIPLE"}
typenamesn={"多选题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
{
judgement_questions && judgement_questions ?
<div className={ "backgroudwhites"} style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20 "}
>
<p
className={ "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEndss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions && judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
typenames={"JUDGMENT"}
typenamesn={"判断题"}
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
program_questions && program_questions ?
<div className={ "backgroudwhites"} style={{
position: "relative",
}}>
<div className="w100s mb20 postitonrelati">
<div
className={"w100s sortinxdirection intermediatecenterysls mb20"}
>
<p className={ "yldxtit"}>
{single_questions === null && multiple_questions === null && program_questions === null ? "一"
: single_questions === null && multiple_questions === null && program_questions !== null ? "二"
: single_questions !== null && multiple_questions === null && program_questions === null ? "二"
: single_questions === null && multiple_questions !== null && program_questions === null ? "二"
: single_questions !== null && multiple_questions !== null && program_questions === null ? "三"
: single_questions === null && multiple_questions !== null && program_questions !== null ? "三"
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
<DragDropContext onDragEnd={this.onDragEndsss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions && program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_items
key={index}
indexs={index}
indexx={index+1}
indexxy={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
objectsingle={object}
>
</Paperlibraryseeid_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div>
)
}
}
export default Paperreview_item

@ -0,0 +1,171 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb,
Radio
} from "antd";
import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
//单选题
class Paperlibraryseeid_items extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
showparagraph = (indexx) => {
}
Singlemagaziness = () => {
}
render() {
let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
// console.log("objectsingle");
// console.log(objectsingle);
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
style={{
minHeight: "114px",
}}>
{/*顶部*/}
<div className="w100s sortinxdirection ">
<div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p>
</div>
<style>
{
`
.markdown-body{
color: #333333;
font-size: 14px !important;
line-height: 28px;
}
.markdown-body p {
color: #333333;
font-size: 14px !important;
line-height: 28px;
}
`
}
</style>
{
this.props.typenames==="PROGRAM"?
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML( objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
:
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
}
</div>
{/*内容*/}
<div className="w100s sortinxdirection">
{
objectsingle.item_type === "JUDGMENT" ?
<p className="w100s listjihetixingstits sortinxdirection ">
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "} key={index}>
<Radio checked={object.is_answer}>
{object.choice_text}
</Radio>
</p>
)
})
}
</p>
:
objectsingle.item_type === "PROGRAM" ?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"}>
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.program_attr.description).replace(/▁/g, "▁▁▁")}}></p>
</p>
</p>
:
<p className="w100s listjihetixingstits verticallayout ">
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} key={index}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
</p>
)
})
}
</p>
}
</div>
</div>
)
}
}
export default Paperlibraryseeid_items

@ -0,0 +1,790 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../../question/questioncss/questioncom.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from '../../question/component/PaperDeletModel';
import PaperDeletModels from '../../question/component/PaperDeletModels';
import Paperreview_itemModel from '../../question/component/Paperreview_itemModel';
import Paperreview_itemModels from '../../question/component/Paperreview_itemModels';
import Paperlibraryseeid_itemsss from './Paperlibraryseeid_itemsss';
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
//这不是唯一的 试题库还有 Paperreview_item.js
class Paperlibraryseeid_itemss extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
onDragEnd = (result) => {
const ids = this.props.single_questions.questions[result.source.index].id;
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds = (result) => {
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url =`/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss = (result) => {
const ids = this.props.program_questions.questions[result.source.index].id;
const positions = this.props.program_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazine = (name, bool) => {
if (bool === true) {
this.setState({
modalsTypey: true,
titilesm: name
})
} else {
this.setState({
modalsTypey: false,
titilesm: ""
})
}
}
setDownloady = (fenshu) => {
const url = "/examination_items/batch_set_score.json";
var data = {
exam_id:this.props.match.params.id,
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
console.log(error);
})
}
setDownloadys=(value)=>{
const url = `/examination_items/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
setmodalsTypedel = (bool, type, names) => {
if (type === 1) {
this.setState({
modalsTypedel: bool,
titilesms: names
})
} else {
this.setState({
modalsTypedel: bool,
titilesms: names
})
const url = `/examination_items/delete_item_type.json`;
axios.delete((url), {
data: {
exam_id:this.props.match.params.id,
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
//console.log(error);
});
}
}
setmodalsTypedels = (bool, type) => {
if (type === 1) {
this.setState({
modalsTypedels: bool,
})
}else {
//确定
const url = `/examination_items/${this.state.item_bank_id}.json`;
axios.delete((url))
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.catch(function (error) {
});
this.setState({
modalsTypedels: bool,
})
}
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");
}
hideparagraphs = () => {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
showparagraph = (name) => {
console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
// console.log("showparagraphs");
// console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
<div className=" w100s ">
{
modalsTypedel === true ?
<PaperDeletModel {...this.state} {...this.props}
setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
: ""
}
{
modalsTypey === true ?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs) => this.setDownloady(fs)}
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
}
{
modalsTypeys === true ?
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
: ""
}
{
modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props}
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
{/*单选题*/}
{
single_questions && single_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mt20 mb20 postitonrelati">
<div
className={singlebool === true ? "w100s sortinxdirection borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}>
<p className={singlebool === true ? "ml18 yldxtit" : "yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
{
singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div>
</div> : ""
}
<DragDropContext onDragEnd={this.onDragEnd}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
single_questions && single_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
multiple_questions && multiple_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={multiplebool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("MULTIPLE")}
onMouseLeave={() => this.hideparagraph("MULTIPLE")}>
<p
className={multiplebool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
<p
className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
</div>
{
multiplebool === true ?
<div className="postitonrelatisss xaxisreverseorder ">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEnds}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions && multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"MULTIPLE"}
typenamesn={"多选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
{
judgement_questions && judgement_questions ?
<div className={judgmentbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={judgmentbool === true ? "w100s sortinxdirection borderwdswuhques mt10 intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls "}
onMouseEnter={() => this.showparagraph("JUDGMENT")}
onMouseLeave={() => this.hideparagraph("JUDGMENT")}>
<p
className={judgmentbool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
{
judgmentbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div>
</div>
: ""}
<DragDropContext onDragEnd={this.onDragEndss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions && judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"JUDGMENT"}
typenamesn={"判断题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
program_questions && program_questions ?
<div className={programbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={programbool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("PROGRAM")}
onMouseLeave={() => this.hideparagraph("PROGRAM")}>
<p className={programbool === true ? "ml18 yldxtit" : "yldxtit"}>
{single_questions === null && multiple_questions === null && program_questions === null ? "一"
: single_questions === null && multiple_questions === null && program_questions !== null ? "二"
: single_questions !== null && multiple_questions === null && program_questions === null ? "二"
: single_questions === null && multiple_questions !== null && program_questions === null ? "二"
: single_questions !== null && multiple_questions !== null && program_questions === null ? "三"
: single_questions === null && multiple_questions !== null && program_questions !== null ? "三"
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
{
programbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("编程题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEndsss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions && program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperlibraryseeid_itemsss
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperlibraryseeid_itemsss>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div>
)
}
}
export default Paperlibraryseeid_itemss

@ -0,0 +1,88 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../../question/questioncss/questioncom.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from "../../question/Paperreview_single";
//判断题
//这不是唯一的 试题库还有Paperreview_items
class Paperlibraryseeid_itemsss extends Component {
constructor(props) {
super(props);
this.state = {
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
render() {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
return (
<div>
{
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.id,true,1)}>删除</div>
<div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div>
</div>
: <div className="xaxisreverseorder mt25 ">
</div>
}
<Paperreview_single paperreviewsingleindex={paperreviewsingleindex}
name={typenames}
key={indexs}
showparagraphs={(e,name) => this.props.showparagraphs(e,name)}
objectsingle={object} key={indexs} indexx={indexs + 1}
indexxy={indexs}
hideparagraphs={() => this.props.hideparagraphs()}></Paperreview_single>
</div>
)
}
}
export default Paperlibraryseeid_itemsss

@ -0,0 +1,56 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox
} from "antd";
import './../testioncss/testioncss.css';
class Seeoagertit extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
onChange=(e)=> {
}
render() {
return (
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s sortinxdirection">
<div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstotal lh34">总分{this.props.all_questions_count}</p>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
</div>
</div>
)
}
}
export default Seeoagertit ;

@ -0,0 +1,70 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Checkbox
} from "antd";
import './../testioncss/testioncss.css';
class Seeoagertit extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
onChange=(e)=> {
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
render() {
return (
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s sortinxdirection">
<div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstishu lh34">总分<span className="questionstotal">{this.props.all_questions_count}</span></p>
<p className="ml58 questionstishu lh34">难度<span className="questionstotal">
{this.props.difficulty===undefined?"":
this.props.difficulty===1?"简单":this.props.difficulty===2?"适中":this.props.difficulty===3?"困难":""
}
</span></p>
</div>
<div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.jixuxuantioncli()}>
继续选题
</div>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
</div>
</div>
)
}
}
export default Seeoagertit ;

@ -405,6 +405,9 @@
.xiaoshout{
cursor:default;
}
.shubiao{
cursor:default;
}
.mt40{
margin-top: 40px;
}
@ -843,3 +846,41 @@
.ml37{
margin-left: 37px;
}
.listjihecolor:hover{
background: #F9F9F9;
background-color: #F9F9F9;
}
.seesjtit{
height:27px;
font-size:19px;
color:#333333;
line-height:27px;
}
.mt16{
margin-top: 16px;
}
.mb20{
margin-bottom: 20px;
}
.fudonxianshi{
position: relative;
}
.fudonxianshis{
position:absolute;
z-index: 700;
}
.sjtitle:hover{
color: #4CACFF;
}
.nofabu{
width:46px;
height:20px;
background:rgba(255,102,1,1);
border-radius:10px;
color: #ffffff;
text-align: center;
line-height: 20px;
}

@ -1051,35 +1051,6 @@ submittojoinclass=(value)=>{
{/* </Popover>*/}
{/*</li>*/}
{/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
{/*<li className={`${coursestype === true ? 'pr active' : 'pr'}`}>*/}
{/* /!*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*!/*/}
{/* <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>*/}
{/*</li>*/}
{/*<li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>*/}
{/* <Link to="/shixuns">实训项目</Link>*/}
{/* <img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
{/* </img>*/}
{/*</li>*/}
{/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
{/*<li className="">*/}
{/* <a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>*/}
{/* <img className="roundedRectangles"*/}
{/* src={require('./roundedRectangle.png')}*/}
{/* />*/}
{/*</li>*/}
{/*<li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li>*/}
{/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/}
{/*<Link to={'/crowdsourcing'}>众包创新</Link>*/}
{/*</li>*/}
{/*<li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>*/}
<li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth === null ? 'none' : 'block'}}
><a href={this.props.Headertop === undefined ? "" : this.props.Headertop.auth}>工程认证</a></li>
@ -1104,65 +1075,6 @@ submittojoinclass=(value)=>{
</li>
</ul>
</div>
// :mygetHelmetapi2===undefined||mygetHelmetapi2.navbar===null||mygetHelmetapi2.navbar===undefined||mygetHelmetapi2.navbar.length===0?
// <div className="head-nav pr" id={"head-navpre2"}>
//
// <ul id="header-nav">
// {/*<li className={`${activeIndex === true ? 'active' : ''}`}><a href="/">首页</a></li>*/}
//
// {/*<li><a href={this.props.Headertop===undefined?"":this.props.Headertop.shixun_paths_url}>实训路径</a></li>*/}
// <li className={`${activePaths === true ? 'pr active' : 'pr'}`}>
// <Link to={this.props.Headertop===undefined?"":'/paths'}>实践课程</Link>
// </li>
//
// {/*<li><a href={this.props.Headertop===undefined?"":'/courses'}>课堂</a></li>*/}
// <li className={`${coursestype === true ? 'pr active' : 'pr'}`}>
// {/*<a href={this.props.Headertop===undefined?"":this.props.Headertop.course_url}>课堂</a>*/}
// <Link to={this.props.Headertop===undefined?"":'/courses'}>翻转课堂</Link>
// </li>
//
// <li className={`${activeShixuns === true ? 'pr active' : 'pr'}`}>
// <Link to="/shixuns">实训项目</Link>
// {/*<img src={getImageUrl("images/educoder/hot-h.png")} className="nav-img">*/}
// {/*</img>*/}
// </li>
//
// <li className="fl edu-menu-panel careershover "
// style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
// <a>职业路径</a>
// <div
// style={{display: this.props.Headertop === undefined ?'none' : this.props.Headertop.career_url.length > 0 ? 'block' : 'none'}}>
// <ul className="edu-menu-list edu-menu-listnew " style={{top:'60px'}}>
// {this.props.Headertop === undefined ? "" : this.props.Headertop.career_url.map((item, key) => {
// return(
// <li key={key}><i className="iconfont icon-java left careersiconfont"
// style={{color: '#000 important'}}
// ></i><a style={{width: '83%'}}
// href={item.url}>{item.name}</a></li>
// )
// })
// }
// </ul>
// </div>
// </li>
//
// {/*<li className=""><a href={"/libraries"}>教学案例</a></li>*/}
// <li className="">
// <a href={this.props.Headertop===undefined?"":this.props.Headertop.competitions_url}>在线竞赛</a>
// {/*<img className="roundedRectangles"*/}
// {/* src={require('./roundedRectangle.png')}*/}
// {/*/>*/}
// </li>
// <li className={`${activeMoopCases === true ? 'pr active' : 'pr'}`}> <Link to={`/moop_cases`}>教学案例</Link></li>
// {/*<li className={`${activePackages === true ? 'pr active' : 'pr'}`}>*/}
// {/*<Link to={'/crowdsourcing'}>众包创新</Link>*/}
// {/*</li>*/}
// <li className={`${activeForums === true ? 'active' : ''}`}> <Link to={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</Link></li>
// <li
// style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth===null? 'none' : 'block'}}
// ><a href={this.props.Headertop===undefined?"":this.props.Headertop.auth}>工程认证</a></li>
// </ul>
// </div>
:
<div className="head-nav pr" id={"head-navpre3"}>

@ -98,6 +98,9 @@ class SiderBar extends Component {
<div className={"-task-sidebar"} >
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
<Tooltip placement="right" title={"返回顶部"}>
<div className="gotop">
<a>
@ -106,19 +109,6 @@ class SiderBar extends Component {
</div>
</Tooltip>
{
mypath&&mypath==="/question"?
<Tooltip placement="right" title={"试题库"}>
<div className="feedback feedbackdivcolor xiaoshou" onClick={()=>this.props.showDrawer()} >
<a target="_blank" className="color_white xiaoshou" >
<i className="iconfont icon-shitilan color-white xiaoshou"></i>
</a>
<p className="color-white font-12 xiaoshou">试题库</p>
</div>
</Tooltip>
:""
}
<Tooltip placement="right" title={"意见反馈"}>

@ -267,3 +267,9 @@ body>.-task-title {
height:1px;
background: #EEEEEE;
}
.mystask-sidebar{
right: 210px !important;
}
.mystask-sidebars{
right: 10px !important;
}

@ -115,8 +115,6 @@ shixunsearchAll = (e) => {
//选择Tab页详情
getshixunchildValue = (e) => {
debugger
let id = e.target.name;
let newid=e.target.id;
let list=[{'tag_level':2},{'tag_id':id}];

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 16:40:54
* @LastEditTime : 2020-01-03 17:39:32
*/
import types from './actionTypes';
import CONST from '../../constants';
@ -675,14 +675,31 @@ export const updateOpenTestCaseIndex = (value) => {
// 获取课程题库
export const getQuestion = (params) => {
return (dispatch) => {
fetchQuestion(params).then(res => {
return (dispatch, getState) => {
const {ojForm: {sub_discipline_id}} = getState().ojFormReducer;
fetchQuestion(params, ).then(res => {
const { data = {} } = res;
const { disciplines = [] } = data;
dispatch({
type: types.GET_COURSE_QUESTION,
payload: disciplines
})
});
let temp_knowledges = [];
// console.log('选择的课程: =====>>>>>>', sub_discipline_id);
disciplines.forEach(c => {
if (sub_discipline_id && c.sub_disciplines) {
c.sub_disciplines.forEach(sub => {
if (+sub.id === +sub_discipline_id) {
temp_knowledges = sub.tag_disciplines || [];
}
});
}
});
dispatch({
type: types.CHANGE_KNOWLEDGES,
payload: temp_knowledges
});
})
}
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:40:32
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 16:39:09
* @LastEditTime : 2020-01-03 17:38:50
*/
import { Base64 } from 'js-base64';
import types from '../actions/actionTypes';
@ -231,7 +231,7 @@ const ojFormReducer = (state = initialState, action) => {
courseQuestions.forEach(c => {
if (sub_discipline_id && c.sub_disciplines) {
c.sub_disciplines.forEach(sub => {
if (+sub.id === sub_discipline_id) {
if (+sub.id === +sub_discipline_id) {
temp_knowledges = sub.tag_disciplines || [];
}
});

Loading…
Cancel
Save