Conflicts:
	public/react/scripts/build.js
video_transcode
杨树明 5 years ago
commit 2bdb8b1da0

@ -95,13 +95,13 @@ class ApplicationController < ActionController::Base
check_account check_account
tip_exception(@course.excellent ? 410 : 409, "您没有权限进入") tip_exception(@course.excellent ? 410 : 409, "您没有权限进入")
end end
if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id # if @user_course_identity > Course::CREATOR && @user_course_identity <= Course::STUDENT && @course.tea_id != current_user.id
# 实名认证和职业认证的身份判断 # # 实名认证和职业认证的身份判断
tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication && # tip_exception(411, "你的实名认证和职业认证审核未通过") if @course.authentication &&
@course.professional_certification && (!current_user.authentication && !current_user.professional_certification) # @course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication # tip_exception(411, "你的实名认证审核未通过") if @course.authentication && !current_user.authentication
tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification # tip_exception(411, "你的职业认证审核未通过") if @course.professional_certification && !current_user.professional_certification
end # end
uid_logger("###############user_course_identity:#{@user_course_identity}") uid_logger("###############user_course_identity:#{@user_course_identity}")
end end

@ -25,7 +25,7 @@ module GitHelper
decode_content = decode_content =
if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8 if cd["encoding"] == 'GB18030' && cd['confidence'] > 0.8
content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '}) content.encode('UTF-8', 'GBK', {:invalid => :replace, :undef => :replace, :replace => ' '})
elsif cd['encoding'].blank? elsif cd['encoding'].blank? && !content.blank?
raise("ERROR_UTF8") raise("ERROR_UTF8")
else else
content.force_encoding('UTF-8') content.force_encoding('UTF-8')
@ -36,7 +36,7 @@ module GitHelper
rescue Exception => e rescue Exception => e
Rails.logger.error(e.message) Rails.logger.error(e.message)
error_msg = e.message == "ERROR_UTF8" ? "文件无法预览" : "文档内容获取异常" error_msg = e.message == "ERROR_UTF8" ? "文件编码异常请将文件编码设置为UTF-8" : "文档内容获取异常"
error_status = e.message == "ERROR_UTF8" ? -2 : -1 error_status = e.message == "ERROR_UTF8" ? -2 : -1
raise Educoder::TipException.new(error_status, error_msg) raise Educoder::TipException.new(error_status, error_msg)
end end

@ -153,8 +153,8 @@ class CoursesController < ApplicationController
begin begin
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
@course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit], @course = Course.new(name: params[:name], class_period: params[:class_period], credit: params[:credit],
end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id, end_date: params[:end_date], is_public: params[:is_public], school_id: @school.id)
authentication: params[:authentication], professional_certification: params[:professional_certification]) # authentication: params[:authentication], professional_certification: params[:professional_certification])
@course.tea_id = current_user.id @course.tea_id = current_user.id
if params[:subject_id].blank? if params[:subject_id].blank?
@ -219,8 +219,8 @@ class CoursesController < ApplicationController
extra_params[:is_end] = 1 extra_params[:is_end] = 1
end end
extra_params[:authentication] = params[:authentication] # extra_params[:authentication] = params[:authentication]
extra_params[:professional_certification] = params[:professional_certification] # extra_params[:professional_certification] = params[:professional_certification]
if @course.subject if @course.subject
@course.start_date = params[:start_date] @course.start_date = params[:start_date]
@ -1157,10 +1157,10 @@ class CoursesController < ApplicationController
return normal_status(-1, "课堂已结束,无法加入") if course.is_end return normal_status(-1, "课堂已结束,无法加入") if course.is_end
# 实名认证和职业认证的身份判断 # 实名认证和职业认证的身份判断
return normal_status(-2, "该课堂要求成员完成实名和职业认证") if course.authentication && # return normal_status(-2, "该课堂要求成员完成实名和职业认证") if course.authentication &&
course.professional_certification && (!current_user.authentication && !current_user.professional_certification) # course.professional_certification && (!current_user.authentication && !current_user.professional_certification)
return normal_status(-2, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication # return normal_status(-2, "该课堂要求成员完成实名认证") if course.authentication && !current_user.authentication
return normal_status(-2, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification # return normal_status(-2, "该课堂要求成员完成职业认证") if course.professional_certification && !current_user.professional_certification
# 身份验证 # 身份验证
if params[:professor].blank? && params[:assistant_professor].blank? && params[:student].blank? if params[:professor].blank? && params[:assistant_professor].blank? && params[:student].blank?
@ -1452,6 +1452,7 @@ class CoursesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through. # Never trust parameters from the scary internet, only allow the white list through.
def course_params def course_params
params.require(:course).permit(:name, :class_period, :credit, :end_date, :is_public, :authentication, :professional_certification) params.require(:course).permit(:name, :class_period, :credit, :end_date, :is_public, :authentication, :professional_certification)
# params.require(:course).permit(:name, :class_period, :credit, :end_date, :is_public, :authentication, :professional_certification)
end end
def validate_course_name def validate_course_name

@ -36,8 +36,8 @@ class ExaminationBanksController < ApplicationController
end end
current_user.item_baskets.destroy_all current_user.item_baskets.destroy_all
render_ok({exam_id: exam.id})
end end
render_ok
rescue ApplicationService::Error => ex rescue ApplicationService::Error => ex
render_error(ex.message) render_error(ex.message)
end end

@ -289,21 +289,14 @@ class HomeworkCommonsController < ApplicationController
def update_score def update_score
tip_exception("作业还未发布,暂不能计算成绩") if @homework.publish_time.nil? || @homework.publish_time > Time.now tip_exception("作业还未发布,暂不能计算成绩") if @homework.publish_time.nil? || @homework.publish_time > Time.now
begin
@homework.update_homework_work_score @homework.update_homework_work_score
normal_status("更新成功") normal_status("更新成功")
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
def update_student_score def update_student_score
work = @homework.student_works.find_by(user_id: current_user.id) work = @homework.student_works.find_by(user_id: current_user.id)
myshixun = Myshixun.find_by(shixun_id: params[:shixun_id], user_id: current_user.id) myshixun = Myshixun.find_by(shixun_id: params[:shixun_id], user_id: current_user.id)
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
if work && myshixun if work && myshixun
challenge_settings = @homework.homework_challenge_settings challenge_settings = @homework.homework_challenge_settings
games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id)) games = myshixun.games.where(challenge_id: challenge_settings.pluck(:challenge_id))
@ -312,11 +305,6 @@ class HomeworkCommonsController < ApplicationController
else else
normal_status("还未开启挑战,暂不能更新成绩") normal_status("还未开启挑战,暂不能更新成绩")
end end
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
end end
@ -382,7 +370,6 @@ class HomeworkCommonsController < ApplicationController
end end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
@homework = HomeworkCommon.new(homework_params) @homework = HomeworkCommon.new(homework_params)
@homework.reference_answer = params[:reference_answer].to_s.strip @homework.reference_answer = params[:reference_answer].to_s.strip
@homework.homework_type = @homework_type @homework.homework_type = @homework_type
@ -413,11 +400,6 @@ class HomeworkCommonsController < ApplicationController
else else
tip_exception("创建失败") tip_exception("创建失败")
end end
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
end end
@ -432,7 +414,6 @@ class HomeworkCommonsController < ApplicationController
end end
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
@homework.update_attributes!(homework_params) @homework.update_attributes!(homework_params)
@homework.reference_answer = params[:reference_answer].to_s.strip @homework.reference_answer = params[:reference_answer].to_s.strip
@ -451,11 +432,7 @@ class HomeworkCommonsController < ApplicationController
Attachment.associate_container(params[:reference_attachment_ids], @homework.id, @homework.class, 2) if params[:reference_attachment_ids] Attachment.associate_container(params[:reference_attachment_ids], @homework.id, @homework.class, 2) if params[:reference_attachment_ids]
normal_status(0, "更新成功") normal_status(0, "更新成功")
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
end end
@ -467,7 +444,6 @@ class HomeworkCommonsController < ApplicationController
end end
def update_settings def update_settings
begin
# 课堂结束后不能再更新 # 课堂结束后不能再更新
unless @course.is_end unless @course.is_end
@ -760,11 +736,6 @@ class HomeworkCommonsController < ApplicationController
# uid_logger(ex.message) # uid_logger(ex.message)
# render_error(ex.message) # render_error(ex.message)
# raise ActiveRecord::Rollback # raise ActiveRecord::Rollback
rescue Exception => e
uid_logger(e.backtrace)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
# 选用实训 # 选用实训
@ -935,16 +906,14 @@ class HomeworkCommonsController < ApplicationController
if params[:detail].blank? if params[:detail].blank?
tip_exception("缺少截止时间参数") if params[:end_time].blank? tip_exception("缺少截止时间参数") if params[:end_time].blank?
tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now) tip_exception("截止时间不能早于当前时间") if params[:end_time] <= strf_time(Time.now)
tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if tip_exception("截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
@course.end_date.present? && params[:end_time] > strf_time(@course.end_date.end_of_day)
else else
tip_exception("缺少分班截止时间参数") if params[:group_end_times].blank? tip_exception("缺少分班截止时间参数") if params[:group_end_times].blank?
group_end_times = params[:group_end_times].reject(&:blank?)&.map {|time| time.to_time} group_end_times = params[:group_end_times].reject(&:blank?)&.map {|time| time.to_time}
tip_exception("截止时间和分班参数的个数不一致") if group_end_times.length != group_ids.length tip_exception("截止时间和分班参数的个数不一致") if group_end_times.length != group_ids.length
group_end_times.each do |time| group_end_times.each do |time|
tip_exception("分班截止时间不能早于当前时间") if time <= Time.now tip_exception("分班截止时间不能早于当前时间") if time <= Time.now
tip_exception("分班截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if tip_exception("分班截止时间不能晚于课堂结束时间(#{@course.end_date.end_of_day.strftime("%Y-%m-%d %H:%M")}") if @course.end_date.present? && time > @course.end_date.end_of_day
@course.end_date.present? && time > @course.end_date.end_of_day
end end
end end
@ -955,7 +924,6 @@ class HomeworkCommonsController < ApplicationController
publish_groups = charge_group_ids & group_ids if group_ids publish_groups = charge_group_ids & group_ids if group_ids
# ActiveRecord::Base.transaction do # ActiveRecord::Base.transaction do
begin
homeworks.each do |homework| homeworks.each do |homework|
# 作业未发布时 # 作业未发布时
if homework.homework_detail_manual.try(:comment_status) == 0 if homework.homework_detail_manual.try(:comment_status) == 0
@ -1038,11 +1006,7 @@ class HomeworkCommonsController < ApplicationController
# HomeworkPublishUpdateWorkStatusJob.perform_later(tiding_group_ids, homework.id) # HomeworkPublishUpdateWorkStatusJob.perform_later(tiding_group_ids, homework.id)
end end
normal_status(0, "发布成功") normal_status(0, "发布成功")
rescue Exception => e
uid_logger(e.message)
tip_exception("发布失败")
raise ActiveRecord::Rollback
end
# end # end
end end
@ -1074,7 +1038,6 @@ class HomeworkCommonsController < ApplicationController
group_ids = params[:group_ids]&.reject(&:blank?)&.map(&:to_i) group_ids = params[:group_ids]&.reject(&:blank?)&.map(&:to_i)
end_groups = charge_group_ids & group_ids if group_ids end_groups = charge_group_ids & group_ids if group_ids
begin
homeworks.each do |homework| homeworks.each do |homework|
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
homework_detail_manual = homework.homework_detail_manual homework_detail_manual = homework.homework_detail_manual
@ -1119,11 +1082,6 @@ class HomeworkCommonsController < ApplicationController
HomeworkEndUpdateScoreJob.perform_later(homework.id) if !homework.allow_late && homework.end_time <= time HomeworkEndUpdateScoreJob.perform_later(homework.id) if !homework.allow_late && homework.end_time <= time
end end
normal_status(0, "更新成功") normal_status(0, "更新成功")
rescue Exception => e
uid_logger(e.message)
tip_exception("操作失败")
raise ActiveRecord::Rollback
end
end end
def set_public def set_public
@ -1156,7 +1114,6 @@ class HomeworkCommonsController < ApplicationController
# 删除多个作业 # 删除多个作业
def multi_destroy def multi_destroy
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
homeworks = @course.homework_commons.where(id: params[:homework_ids]) homeworks = @course.homework_commons.where(id: params[:homework_ids])
homeworks.destroy_all homeworks.destroy_all
@ -1164,11 +1121,6 @@ class HomeworkCommonsController < ApplicationController
StudentWork.where(homework_common_id: homeworks.pluck(:id)).destroy_all StudentWork.where(homework_common_id: homeworks.pluck(:id)).destroy_all
normal_status(0, "删除成功") normal_status(0, "删除成功")
rescue Exception => e
uid_logger(e.message)
tip_exception("删除失败")
raise ActiveRecord::Rollback
end
end end
end end
@ -1178,7 +1130,6 @@ class HomeworkCommonsController < ApplicationController
homeworks.each do |homework| homeworks.each do |homework|
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
begin
homework_bank = current_user.homework_banks.find_by(homework_common_id: homework.id) homework_bank = current_user.homework_banks.find_by(homework_common_id: homework.id)
if homework_bank.present? if homework_bank.present?
# 如果作业加入过题库则更新参数 # 如果作业加入过题库则更新参数
@ -1208,11 +1159,6 @@ class HomeworkCommonsController < ApplicationController
homework.update_attributes!(homework_bank_id: new_homework_bank.id) homework.update_attributes!(homework_bank_id: new_homework_bank.id)
end end
rescue Exception => e
uid_logger(e.message)
tip_exception(e.message)
raise ActiveRecord::Rollback
end
end end
end end
normal_status(0, "加入成功") normal_status(0, "加入成功")

@ -135,6 +135,7 @@ class PollsController < ApplicationController
:course_id => @course.id, :course_id => @course.id,
:polls_status => 1, :polls_status => 1,
:polls_type => "Course", :polls_type => "Course",
:un_anonymous => true
} }
@poll = Poll.create!(poll_options) @poll = Poll.create!(poll_options)
end end

@ -27,7 +27,7 @@ class Weapps::AttendancesController < ApplicationController
tip_exception(403) if @user_course_identity >= Course::STUDENT tip_exception(403) if @user_course_identity >= Course::STUDENT
current_date = Date.current current_date = Date.current
current_end_time = Time.current.strftime("%H:%M:%S") current_end_time = Time.current.strftime("%H:%M:%S")
@current_attendance = @course.course_attendances.where("attendance_date = '#{current_date}' and end_time > '#{current_end_time}'") @current_attendance = @course.course_attendances.where("attendance_date > '#{current_date}' or (attendance_date = '#{current_date}' and end_time > '#{current_end_time}')")
.order("attendance_date asc, start_time asc") .order("attendance_date asc, start_time asc")
all_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')") all_attendances = @course.course_attendances.where("attendance_date < '#{current_date}' or (attendance_date = '#{current_date}' and end_time < '#{current_end_time}')")

@ -1,8 +1,8 @@
class HackSet < ApplicationRecord class HackSet < ApplicationRecord
validates_length_of :input, maximum: 1000, message: "不能超过1000个字符" validates_length_of :input, maximum: 1000, message: "不能超过1000个字符"
validates_length_of :output, maximum: 1000, message: "不能超过1000个字符" validates_length_of :output, maximum: 1000, message: "不能超过1000个字符"
validates :input, presence: { message: "测试集输入不能为空" } #validates :input, presence: { message: "测试集输入不能为空" }
validates :output, presence: { message: "测试集输出不能为空" } validates_presence_of :output, message: "不能为空"
validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同" validates_uniqueness_of :input, scope: [:hack_id, :input], message: "多个测试集的输入不能相同"
# 编程题测试集 # 编程题测试集
belongs_to :hack belongs_to :hack

@ -2,7 +2,7 @@ class Schools::SchoolStatisticService < ApplicationService
attr_reader :school attr_reader :school
def initialize(school) def initialize(school)
@school = school.includes(:courses, user_extensions: :user) @school = school
@user_extensions = school.user_extensions @user_extensions = school.user_extensions
end end
@ -26,14 +26,14 @@ class Schools::SchoolStatisticService < ApplicationService
@user_extensions.map{|ue| ue.user.last_login_on&.between?(1.weeks.ago, Time.now)}.size @user_extensions.map{|ue| ue.user.last_login_on&.between?(1.weeks.ago, Time.now)}.size
end end
# 活跃用户(近3个月有登录) # 活跃用户(近1个月有登录)
def acitve_user_1_months_count def acitve_user_1_months_count
@user_extensions.map{|ue| ue.user.last_login_on&.between?(1.months.ago, Time.now)}.size @user_extensions.joins(:user).map{|ue| ue.user.last_login_on&.between?(1.months.ago, Time.now)}.size
end end
# 活跃用户近3个月有登录 # 活跃用户近3个月有登录
def acitve_user_3_months_count def acitve_user_3_months_count
@user_extensions.map{|ue| ue.user.last_login_on&.between?(3.months.ago, Time.now)}.size @user_extensions.map{|ue| ue.user&.last_login_on&.between?(3.months.ago, Time.now)}.size
end end
# 活跃用户(进半年有登录记录) # 活跃用户(进半年有登录记录)
@ -52,10 +52,15 @@ class Schools::SchoolStatisticService < ApplicationService
end end
# 实训作业数目 # 实训作业数目
def hom_shixuns_count def homw_shixuns_count
@school.courses.joins(:homework_commons).where(homework_commons: {homework_type: 'practice'}).size @school.courses.joins(:homework_commons).where(homework_commons: {homework_type: 'practice'}).size
end end
# 其他类型作业
def homw_other_count
@school.courses.joins(:homework_commons).where.not(homework_commons: {homework_type: 'practice'}).size
end
# 资源数 # 资源数
def sources_count def sources_count
@school.courses.joins(:attachments).size @school.courses.joins(:attachments).size
@ -67,7 +72,7 @@ class Schools::SchoolStatisticService < ApplicationService
end end
# 制作实训数 # 制作实训数
def shixun_count def shixuns_count
@user_extensions.joins(user: :shixuns).size @user_extensions.joins(user: :shixuns).size
end end
@ -83,17 +88,17 @@ class Schools::SchoolStatisticService < ApplicationService
# 挑战的关卡数 # 挑战的关卡数
def games_count def games_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 0..2}) @user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 0..2}).size
end end
# 通关的关卡数 # 通关的关卡数
def pass_games_count def pass_games_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 2}) @user_extensions.joins("join games on games.user_id = user_extensions.user_id").where(games: {status: 2}).size
end end
# 评测总数 # 评测总数
def evalute_count def evaluate_count
@user_extensions.joins("join games on games.user_id = user_extensions.user_id").sum(:evalute_count) @user_extensions.joins("join games on games.user_id = user_extensions.user_id").sum(:evaluate_count).to_i
end end

@ -0,0 +1,5 @@
class AddIndexForStaAll < ActiveRecord::Migration[5.2]
def change
add_index :sta_alls, :school_id, :unique => true
end
end

@ -0,0 +1,5 @@
class AddUserIdIndexForGames < ActiveRecord::Migration[5.2]
def change
add_index :games, :user_id
end
end

@ -0,0 +1,274 @@
commit 8e0cf3730ba50f5fb95773d7ed3bfeab51cff640 (HEAD -> forge)
Author: dingyongkang <837816638@qq.com>
Date: Tue Feb 25 17:14:50 2020 +0800
合并请求模块
commit b0d10c14dd86c0db5bfa37da24587687e7570b60
Merge: ba41688b4 8a3afcbf0
Author: dingyongkang <837816638@qq.com>
Date: Wed Feb 19 20:02:46 2020 +0800
工单模块
commit ba41688b4b6116d677585a826e53ee0a7c3c3f7d
Author: dingyongkang <837816638@qq.com>
Date: Wed Feb 19 19:33:48 2020 +0800
工单部分
commit 8a3afcbf00835d67725ea9464b9abac16eb2a89c
Merge: 57415df2a 30ef541d4
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Wed Feb 19 19:12:18 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 57415df2aa48aebc0b29a3d4725a06dcdb63d742
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Wed Feb 19 19:11:50 2020 +0800
issue的问题修复及pull_request的问题修复
commit 30ef541d40a1c7063a20423e3b95c73da8e9bf8c
Merge: 21ce82e9c ded428147
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 17:38:45 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 21ce82e9c15724fc3b10c02ab3d0b5ed6670e86e
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 17:38:41 2020 +0800
动态列表
commit ded4281470613992a416be8b383e863136e2cd81
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Wed Feb 19 17:30:53 2020 +0800
修改csv的乱码问题
commit a5a5add7d662377ebd0a8b3796b761f043232f4a
Merge: d4132a802 b435933a5
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Wed Feb 19 15:12:01 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit d4132a802e5afa2d5f79d4540827348b8395edb1
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Wed Feb 19 15:10:56 2020 +0800
分支切换添加loading
commit b435933a54709da3ab4e167d1657348cea359de1
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 15:04:46 2020 +0800
动态-分页
commit b10091130e3bea8ff989ccd018505d19eb4dec29
Merge: 92fea708c 0d060af2f
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 11:59:48 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 92fea708c48a27cd2fddb7ebb096dddc248129ca
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 11:59:45 2020 +0800
文件
commit a93837a062dacec33a277d50f504de9bf037f687
Author: caicai8 <1149225589@qq.com>
Date: Wed Feb 19 11:59:35 2020 +0800
动态
commit 0d060af2f926dc92482a76346abfc94d09cd32d1
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Tue Feb 18 18:43:56 2020 +0800
前端bug修复和后端问题
commit 42e8a78477525c32d98d2299c3826f0dc4f6e38f
Merge: 64d920039 d9e89e6fb
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Tue Feb 18 16:16:49 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 64d920039a51196fff20b813938969e3c326e1c6
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Tue Feb 18 16:16:24 2020 +0800
一些bug修改
commit d9e89e6fb7934d9e215dc1e7c7d1f61093154b9a
Author: caicai8 <1149225589@qq.com>
Date: Tue Feb 18 16:12:18 2020 +0800
branch
commit 43e9c90439890056c94a2265296bda2626aef447
Author: caicai8 <1149225589@qq.com>
Date: Tue Feb 18 14:56:09 2020 +0800
从分支页面跳转到分支提交页面
commit 2e42ad82cafa3c3a96813e517253d825dddf8e27
Merge: 9a2dd0456 d3a9af7bb
Author: caicai8 <1149225589@qq.com>
Date: Tue Feb 18 13:34:48 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 9a2dd0456eb2e25490d697ad539ac0ccf7a047cf
Author: caicai8 <1149225589@qq.com>
Date: Tue Feb 18 13:34:43 2020 +0800
package
commit d3a9af7bb3b4e0600f5bb7a26a349fe87eb49bc5
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Tue Feb 18 10:54:38 2020 +0800
前端样式修改
commit 5feb1f6e53b325822d305bbfcd4a6c644d9039dd
Author: caicai8 <1149225589@qq.com>
Date: Mon Feb 17 16:38:53 2020 +0800
clone_url
commit 2eefb0ed381211ec250470202e686c2465807c7d
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Fri Feb 14 19:03:58 2020 +0800
前端部分修改
commit 9990e3b5c50aa0c9a2c1e9f7442fa85208fa6211
Merge: 0f97b2edd 6a41049e1
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Fri Feb 14 14:46:52 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 0f97b2eddae2551be9c155adf318d800f5dd8e58
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Fri Feb 14 14:46:17 2020 +0800
前端样式修复
commit 6a41049e1de36eda58d728e7eba2285db2ac68fa
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 22:48:40 2020 +0800
ADD some count
commit 36860fe5c2995331e87d6437c48cacd9155f3a16
Merge: 1f2a0c0e6 00cb5c061
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 22:44:17 2020 +0800
Merge branch 'forge' of http://bdgit.educoder.net/Hjqreturn/educoder into forge
commit 00cb5c0610f63eae6d4139a9cf1c536f5e048833
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 18:53:01 2020 +0800
修改entry的错误
commit 1f2a0c0e61ad320d6c54de0721c46c02677c43b6
Merge: a72b4f682 5a8fcf994
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 18:51:14 2020 +0800
fic bug
commit 5a8fcf994fcce0829e620cb5dd507de93606ee33
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 18:09:10 2020 +0800
修改
commit a72b4f68276babbf6c65ea877266af4251ba3410
Merge: 9a2ff48de 36ccf249b
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 18:01:51 2020 +0800
FIC merge bug
commit 9a2ff48de8c3a3f9f9958489bbe235b1f72319f7
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 17:59:20 2020 +0800
FIX 404 page bug
commit 36ccf249bf68542b4b9324d89c478789db12887b
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:53:16 2020 +0800
注释current_laboratory
commit adc7da1a3c541ed263daf8793bdb9af1e736900c
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:47:49 2020 +0800
修改appconfig.js
commit 6e6649aa096921a994bed0119eafc288d5ac5a29
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:40:39 2020 +0800
注释get_user_info里的current_laboratory
commit a447a0d10229275ad6c51903762c2175b2afb743
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:23:57 2020 +0800
change current_laboratory is nill error
commit 567d20caea58782d1e99058cb76fb1e1307f7b09
Merge: d66c0c2f3 0408f89cb
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:15:29 2020 +0800
Merge branch 'forge' of https://bdgit.educoder.net/Hjqreturn/educoder into forge
commit d66c0c2f31b717ed3fed6bcff74318a682768635
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 17:14:59 2020 +0800
修改settings/show.json
commit 0408f89cb37041a92deea969619873849198d99c
Merge: ef807c8ec 8933a1a91
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 17:12:02 2020 +0800
Merge branch 'forge' of http://bdgit.educoder.net/Hjqreturn/educoder into forge
commit ef807c8ecfc5fd5f1129d6ab4d2f1a6c16333dbd
Author: Jasder <2053003901@@qq.com>
Date: Thu Feb 13 17:10:23 2020 +0800
ADD 工单pull_requests 数据统计
commit 8933a1a916baa4805ac45c1970542d25a447f703
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 16:45:27 2020 +0800
build
commit 05266a3c3ff2e03573337965c4580d7cc771e4fb
Author: sylor_huang@126.com <sylor_huang@126.com>
Date: Thu Feb 13 16:33:23 2020 +0800
issue标签和里程碑
commit e2550b9d741835e1e59eed25a17e004d62dd0919
Author: dingyongkang <837816638@qq.com>
Date: T

@ -1,8 +0,0 @@
#coding=utf-8
desc "同步高校数据"
namespace :school_statistic do
task sync_records: :environment do
end
end

@ -2,15 +2,24 @@ desc "统计每个学校使用数据"
namespace :static_all do namespace :static_all do
task :repo => :environment do task :repo => :environment do
School.find_each(batch_size: 100) do |school| school_alls = School.includes(courses: [:homework_commons, :attachments, :course_videos], user_extensions: :user).all
User.joins(:user_extension).where(school_id: school.id) proc_num = ENV['processes'].blank? ? 5 : ENV['processes'].to_i
school_alls.find_in_batches(batch_size: 50) do |schools|
Parallel.each(schools, in_processes: proc_num) do |school|
report = StaAll.find_or_initialize_by(school_id: school.id) puts("school_id: #{school.id}")
data = Schools::SchoolStatisticService.new(school)
report.shixun_evaluate_count = evaluate_count sta_all = StaAll.find_or_initialize_by(school_id: school.id)
attrs = {tea_count: data.teacher_count, stu_count: data.student_count, courses_count: data.courses_count,
report.save active_users_count: data.acitve_user_3_months_count, curr_courses_count: data.curr_courses_count,
homw_shixuns_count: data.homw_shixuns_count, homw_other_count: data.homw_other_count,
sources_count: data.sources_count, videos_count: data.videos_count, shixuns_count: data.shixuns_count,
myshixuns_count: data.myshixuns_count, mys_passed_count: data.pass_myshixun_count,
games_count: data.games_count, games_passed_count: data.pass_games_count, build_count: data.evaluate_count}
puts "sta_all: #{attrs}"
sta_all.assign_attributes(attrs)
sta_all.save!
end
end end
end end
end end

@ -221,12 +221,12 @@ function generateNewIndexJsp() {
// <script type="text/javascript" src="/js/js_min_all.js"></script> // <script type="text/javascript" src="/js/js_min_all.js"></script>
var result = data var result = data
.replace(jsMinAllRegex, code) .replace(jsMinAllRegex, code)
.replace(flvMinAllRegex,'')
// .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`) // .replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`) // .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
// ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot // ${cdnHost} 加了cdn后这个文件里的字体文件加载会有跨域的报错 ../fonts/fontawesome-webfont.eot
// TODO tpi 评测结果关闭也使用了fontawesome // TODO tpi 评测结果关闭也使用了fontawesome
.replace(flvMinAllRegex,``)
.replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`) .replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`)
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`) .replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)
.replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`) .replace(/\/js\/create_kindeditor.js/g, `${cdnHost}/react/build/js/create_kindeditor.js?v=${newVersion}`)

@ -1,6 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './public-path'; import './public-path';
import logo from './logo.svg';
import './App.css'; import './App.css';
import { ConfigProvider } from 'antd' import { ConfigProvider } from 'antd'
import zhCN from 'antd/lib/locale-provider/zh_CN'; import zhCN from 'antd/lib/locale-provider/zh_CN';
@ -21,9 +20,7 @@ import Trialapplicationreview from './modules/user/Trialapplicationreview';
import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import Addcourses from "./modules/courses/coursesPublic/Addcourses";
import AccountProfile from "./modules/user/AccountProfile"; import AccountProfile from "./modules/user/AccountProfile";
import Accountnewprofile from './modules/user/Accountnewprofile'; import Accountnewprofile from './modules/user/Accountnewprofile';
import Trialapplication from './modules/login/Trialapplication';
import Certifiedprofessional from './modules/modals/Certifiedprofessional'; import Certifiedprofessional from './modules/modals/Certifiedprofessional';
import NotFoundPage from './NotFoundPage'
import Loading from './Loading' import Loading from './Loading'
@ -103,24 +100,6 @@ const CommentComponent = Loadable({
loading: Loading, loading: Loading,
}) })
// const TestMaterialDesignComponent = Loadable({
// loader: () => import('./modules/test/md/TestMaterialDesign'),
// loading: Loading,
// })
// const TestCodeMirrorComponent = Loadable({
// loader: () => import('./modules/test/codemirror/TestCodeMirror'),
// loading: Loading,
// })
// const TestComponent = Loadable({
// loader: () => import('./modules/test/TestRC'),
// loading: Loading,
// })
// const TestUrlQueryComponent = Loadable({
// loader: () => import('./modules/test/urlquery/TestUrlQuery'),
// loading: Loading,
// })
const TPMIndexComponent = Loadable({ const TPMIndexComponent = Loadable({
loader: () => import('./modules/tpm/TPMIndex'), loader: () => import('./modules/tpm/TPMIndex'),
loading: Loading, loading: Loading,
@ -701,29 +680,18 @@ class App extends Component {
(props) => (<TPMIndexComponent {...this.props} {...props} {...this.state}></TPMIndexComponent>) (props) => (<TPMIndexComponent {...this.props} {...props} {...this.state}></TPMIndexComponent>)
} }
></Route> ></Route>
{/*列表页 实训项目列表*/}
{/*<Route path="/shixuns" component={TPMShixunsIndexComponent}/>*/}
<Route path="/shixuns" <Route path="/shixuns"
render={ render={
(props) => (<TPMShixunsIndexComponent {...this.props} {...props} {...this.state}></TPMShixunsIndexComponent>) (props) => (<TPMShixunsIndexComponent {...this.props} {...props} {...this.state}></TPMShixunsIndexComponent>)
} }
></Route> ></Route>
{/*实训课程(原实训路径)*/} {/*实训课程(原实训路径)*/}
<Route path="/paths" component={ShixunPaths}></Route> <Route path="/paths" component={ShixunPaths}></Route>
<Route path="/search" <Route path="/search"
render={ render={
(props) => (<SearchPage {...this.props} {...props} {...this.state}></SearchPage>) (props) => (<SearchPage {...this.props} {...props} {...this.state}></SearchPage>)
} }
></Route> ></Route>
{/*课堂*/} {/*课堂*/}
<Route path="/courses" component={CoursesIndex} {...this.props} {...this.state}></Route> <Route path="/courses" component={CoursesIndex} {...this.props} {...this.state}></Route>
@ -793,37 +761,37 @@ class App extends Component {
render={ render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />) (props) => (<Paperreview {...this.props} {...props} {...this.state} />)
} /> } />
{/*<Route path="/paperlibrary/edit/:id"*/} <Route path="/paperlibrary/edit/:id"
{/* render={*/} render={
{/* (props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)*/} (props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
{/* }/>*/} } />
{/*<Route path="/paperlibrary/see/:id"*/} <Route path="/paperlibrary/see/:id"
{/* render={*/} render={
{/* (props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)*/} (props) => (<Paperlibraryseeid {...this.props} {...props} {...this.state} />)
{/* }/>*/} } />
<Route path="/myproblems/:id/:tab?" <Route path="/myproblems/:id/:tab?"
render={ render={
(props) => (<StudentStudy {...this.props} {...props} {...this.state} />) (props) => (<StudentStudy {...this.props} {...props} {...this.state} />)
} /> } />
{/*<Route path="/question/edit/:id"*/} <Route path="/problemset/edit/:id"
{/* render={*/} render={
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/} (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
{/* } />*/} } />
{/*<Route path="/question/newitem"*/} <Route path="/problemset/newitem"
{/* render={*/} render={
{/* (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)*/} (props) => (<Questionitem_banks {...this.props} {...props} {...this.state} />)
{/* } />*/} } />
{/*<Route path="/question/:type"*/} <Route path="/problemset/:type"
{/* render={*/} render={
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/} (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
{/* } />*/} } />
{/*<Route path="/paperlibrary"*/} <Route path="/paperlibrary"
{/* render={*/} render={
{/* (props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)*/} (props) => (<Testpaperlibrary {...this.props} {...props} {...this.state} />)
{/* }/>*/} } />
<Route path="/Integeneration" <Route path="/Integeneration"
render={ render={
@ -835,19 +803,15 @@ class App extends Component {
(props) => (<Developer {...this.props} {...props} {...this.state} />) (props) => (<Developer {...this.props} {...props} {...this.state} />)
} /> } />
{/*<Route path="/question"*/} <Route path="/problemset"
{/* render={*/} render={
{/* (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)*/} (props) => (<Headplugselection {...this.props} {...props} {...this.state} />)
{/* }/>*/} } />
{/*<Route path="/wxcode/:identifier?" component={WXCode}*/} {/*<Route path="/wxcode/:identifier?" component={WXCode}*/}
{/* render={*/} {/* render={*/}
{/* (props)=>(<WXCode {...this.props} {...props} {...this.state}></WXCode>)*/} {/* (props)=>(<WXCode {...this.props} {...props} {...this.state}></WXCode>)*/}
{/* }*/} {/* }*/}
{/*/>*/} {/*/>*/}
<Route exact path="/" <Route exact path="/"
// component={ShixunsHome} // component={ShixunsHome}
render={ render={

@ -258,16 +258,10 @@ export function initAxiosInterceptors(props) {
} }
// //
// console.log(config); // console.log(config);
if (config.method === "post") { if (requestMap[config.url] === true) {
if (requestMap[config.url] === true) { // 避免重复的请求 导致页面f5刷新 也会被阻止 显示这个方法会影响到定制信息
// console.log(config);
// console.log(JSON.parse(config));
// console.log(config.url);
// console.log("被阻止了是重复请求=================================");
return false; return false;
} }
} // // 非file_update请求
// 非file_update请求
if (config.url.indexOf('update_file') === -1) { if (config.url.indexOf('update_file') === -1) {
requestMap[config.url] = true; requestMap[config.url] = true;

@ -0,0 +1,66 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
font-family:SimSun !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
font-family:SimHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
font-family:Microsoft YaHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
font-family:KaiTi !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋";
font-family:FangSong !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
font-family:Arial !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
font-family:Times New Roman !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif";
font-family:sans-serif !important;
}
.ql-font-SimSun {
font-family:SimSun !important;
}
.ql-font-SimHei {
font-family:SimHei !important;
}
.ql-font-Microsoft-YaHei {
font-family:Microsoft YaHei !important;
}
.ql-font-KaiTi {
font-family:KaiTi !important;
}
.ql-font-FangSong {
font-family:FangSong !important;
}
.ql-font-Arial {
font-family:Arial !important;
}
.ql-font-Times-New-Roman {
font-family:Times New Roman !important;
}
.ql-font-sans-serif {
font-family:sans-serif !important;
}

@ -11,6 +11,7 @@ import 'quill/dist/quill.core.css'; // 核心样式
import 'quill/dist/quill.snow.css'; // 有工具栏 import 'quill/dist/quill.snow.css'; // 有工具栏
import 'quill/dist/quill.bubble.css'; // 无工具栏 import 'quill/dist/quill.bubble.css'; // 无工具栏
import 'katex/dist/katex.min.css'; // katex 表达式样式 import 'katex/dist/katex.min.css'; // katex 表达式样式
import './font.css'
import React, { useState, useRef, useEffect } from 'react'; import React, { useState, useRef, useEffect } from 'react';
import Quill from 'quill'; import Quill from 'quill';
import katex from 'katex'; import katex from 'katex';
@ -19,12 +20,12 @@ import { fetchUploadImage } from '../../services/ojService.js';
import { getImageUrl } from 'educoder' import { getImageUrl } from 'educoder'
import ImageBlot from './ImageBlot'; import ImageBlot from './ImageBlot';
import FillBlot from './FillBlot'; import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size'); var Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font');
// const Color = Quill.import('attributes/style/color'); // const Color = Quill.import('attributes/style/color');
Size.whitelist = ['14px', '16px', '18px', '20px', false]; Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; var fonts = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong'];
var Font = Quill.import('formats/font');
Font.whitelist = fonts; //将字体加入到白名单
window.Quill = Quill; window.Quill = Quill;
window.katex = katex; window.katex = katex;
Quill.register(ImageBlot); Quill.register(ImageBlot);
@ -59,7 +60,7 @@ function QuillForEditor ({
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表 {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'}, {script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] }, { 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}, { 'font': []},
{header: [1,2,3,4,5,false]}, {header: [1,2,3,4,5,false]},
'blockquote', 'code-block', 'blockquote', 'code-block',
'link', 'image', 'video', 'link', 'image', 'video',

@ -0,0 +1,18 @@
.ql-editor .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei";
}
.ql-editor .ql-font-SimSun {
font-family: "SimSun";
}
.ql-editor .ql-font-SimHei {
font-family: "SimHei";
}
.ql-editor .ql-font-KaiTi {
font-family: "KaiTi";
}
.ql-editor .ql-font-Arial {
font-family: "Arial";
}
.ql-editor .Times-New-Roman {
font-family: "Times New Roman";
}

@ -0,0 +1,28 @@
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: '微软雅黑';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
}

@ -1,28 +1,22 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getImageUrl } from 'educoder'; import { getImageUrl } from 'educoder';
import { Modal } from 'antd'; import { Modal } from 'antd';
import axios from 'axios';
import '../modules/user/account/common.css'; import '../modules/user/account/common.css';
import './gotoqqgroup.css' import './gotoqqgroup.css'
class GotoQQgroup extends Component { class GotoQQgroup extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state={
}
} }
modalCancel = () => { modalCancel = () => {
try { try {
this.props.setgoshowqqgtounp(false); this.props.setgoshowqqgtounp(false);
} catch (e) { } catch (e) {
} }
} }
setDownload = () => { setDownload = () => {
//立即联系
try { try {
this.props.setgoshowqqgtounp(false); this.props.setgoshowqqgtounp(false);
} catch (e) { } catch (e) {

@ -98,12 +98,12 @@ class Boards extends Component{
this.fetchBoards() this.fetchBoards()
this.fetchAll() this.fetchAll()
on('updateNavSuccess', this.updateNavSuccess) // on('updateNavSuccess', this.updateNavSuccess)
} }
componentWillUnmount() { // componentWillUnmount() {
off('updateNavSuccess', this.updateNavSuccess) // off('updateNavSuccess', this.updateNavSuccess)
} // }
updateNavSuccess = () => { updateNavSuccess = () => {
this.fetchBoards() this.fetchBoards()
if (this.props.match.params.boardId == this.state.boardid) { if (this.props.match.params.boardId == this.state.boardid) {
@ -112,7 +112,7 @@ class Boards extends Component{
} }
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if ( prevProps.match.params.boardId != this.props.match.params.boardId ) { if ( prevProps.match.params.boardId !== this.props.match.params.boardId ) {
this.setState({ this.setState({
isSpin:true isSpin:true
}) })

@ -499,7 +499,6 @@ class Coursesleftnav extends Component{
} }
cannerNavmoda=()=>{ cannerNavmoda=()=>{
this.setState({ this.setState({
Navmodalnametype:false, Navmodalnametype:false,
NavmodalValuetype:false, NavmodalValuetype:false,
@ -525,6 +524,7 @@ class Coursesleftnav extends Component{
} }
saveNavmodapost=(url,value,positiontype,coursesId)=>{ saveNavmodapost=(url,value,positiontype,coursesId)=>{
axios.post(url, axios.post(url,
{name:value}).then((result)=>{ {name:value}).then((result)=>{
if(result!=undefined){ if(result!=undefined){
@ -539,13 +539,13 @@ class Coursesleftnav extends Component{
if(positiontype==="files"){ if(positiontype==="files"){
this.updasaveNavmoda() this.updasaveNavmoda()
trigger('updateNavSuccess') trigger('updateNavSuccess')
window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`);
} }
if(positiontype==="boards"){ if(positiontype==="boards"){
this.updasaveNavmoda() this.updasaveNavmoda()
trigger('updateNavSuccess') trigger('updateNavSuccess')
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; this.props.history.push(`/courses/${coursesId}/boards/${result.data.category_id}`);
} }
if(positiontype!="course_groups"){ if(positiontype!="course_groups"){
@ -585,7 +585,6 @@ class Coursesleftnav extends Component{
} }
saveNavmoda=()=>{ saveNavmoda=()=>{
debugger;
let {Navmodaltypename,setnavid,NavmodalValue}=this.state; let {Navmodaltypename,setnavid,NavmodalValue}=this.state;
let id =setnavid; let id =setnavid;
@ -950,8 +949,7 @@ class Coursesleftnav extends Component{
{/* ""*/} {/* ""*/}
{/*}*/} {/*}*/}
{ <style>
Navmodalnametype===true?<style>
{ {
` `
body { body {
@ -959,8 +957,7 @@ class Coursesleftnav extends Component{
} }
` `
} }
</style>:"" </style>
}
<Modal <Modal
keyboard={false} keyboard={false}
title={Navmodalname} title={Navmodalname}

@ -268,14 +268,20 @@ class Addcourses extends Component{
if (response.data.course_id == 2704) { if (response.data.course_id == 2704) {
this.props.history.push('/courses/2704/boards/8367/messages/42072') this.props.history.push('/courses/2704/boards/8367/messages/42072')
return; return;
}
if(response.data.course_id!=undefined){
this.submitasyn(response.data.course_id)
} }
notification.open({ notification.open({
message:"提示", message:"提示",
description:response.data.message description:response.data.message
}); });
if(response.data.course_id!=undefined){
this.submitasyn(response.data.course_id)
}
// else{
// // 无返回课程id则是选择的教师或者助教身份成功后跳转到课堂首页
// // console.log(this.props);
// // console.log(this.props.history.push);
// window.location.href="/courses";
// }
if(Addcoursestype===true){ if(Addcoursestype===true){
this.props.hideAddcoursestype(); this.props.hideAddcoursestype();
} }

@ -73,8 +73,8 @@ class CoursesNew extends Component {
period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"", period: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period+"",
credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"", credit: data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit+"",
checkboxgroup: data.course_module_types, checkboxgroup: data.course_module_types,
Realnamecertification: data.authentication, // Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification, // Professionalcertification:data.professional_certification,
endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat), endtime: data.end_date === undefined ? "" : moment(data.end_date, dateFormat),
school:data.school school:data.school
@ -84,8 +84,8 @@ class CoursesNew extends Component {
datatime: data.end_date, datatime: data.end_date,
dataname:data.name, dataname:data.name,
is_public: data.is_public === 1 ? true : false, is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication, // Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification, // Professionalcertification:data.professional_certification,
addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period, addonAfteronelenone: data.class_period===undefined?'':data.class_period===null?'':data.class_period===null?'':data.class_period==="null"?'':data.class_period,
addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit, addonAfteronelentwo:data.credit===undefined?'':data.credit===null?'':data.credit===null?'':data.credit==="null"?'':data.credit,
@ -237,8 +237,8 @@ class CoursesNew extends Component {
end_date: datatime===undefined?"":datatime, end_date: datatime===undefined?"":datatime,
is_public: is_public === true || is_public === 1 ? 1 : 0, is_public: is_public === true || is_public === 1 ? 1 : 0,
course_module_types: values.checkboxgroup, course_module_types: values.checkboxgroup,
authentication: this.state.Realnamecertification, // authentication: this.state.Realnamecertification,
professional_certification: this.state.Professionalcertification, // professional_certification: this.state.Professionalcertification,
school:values.school school:values.school
} }
).then((response) => { ).then((response) => {
@ -313,8 +313,8 @@ class CoursesNew extends Component {
end_date: datatime===undefined?"":datatime, end_date: datatime===undefined?"":datatime,
is_public: is_public === true || is_public === 1 ? 1 : 0, is_public: is_public === true || is_public === 1 ? 1 : 0,
course_module_types: values.checkboxgroup, course_module_types: values.checkboxgroup,
authentication: this.state.Realnamecertification, // authentication: this.state.Realnamecertification,
professional_certification: this.state.Professionalcertification, // professional_certification: this.state.Professionalcertification,
school:values.school school:values.school
} }
).then((response) => { ).then((response) => {
@ -953,7 +953,7 @@ class CoursesNew extends Component {
)} )}
</Form.Item> </Form.Item>
</div> </div>
<div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox height100px" > {/* <div className="stud-class-set bor-bottom-greyE padding10200 coursenavbox height100px" >
<span className={"fl"}> <span className={"fl"}>
<Form.Item <Form.Item
label="加入课堂条件" label="加入课堂条件"
@ -978,7 +978,7 @@ class CoursesNew extends Component {
)} )}
</Form.Item> </Form.Item>
</span> </span>
</div> </div> */}
<div className="stud-class-set padding10200 coursenavbox bor-bottom-greyE"> <div className="stud-class-set padding10200 coursenavbox bor-bottom-greyE">
<Form.Item <Form.Item
label="公开设置" label="公开设置"

@ -121,7 +121,7 @@ const NewOrEditTask = (props) => {
// 清空描述信息 // 清空描述信息
toStore('oj_description', ''); toStore('oj_description', '');
// props.history.push('/problems'); // props.history.push('/problems');
props.history.push(`/question?${props.searchParams}`); props.history.push(`/problemset?${props.searchParams}`);
} }
// 发布 // 发布

@ -151,8 +151,6 @@ const AddTestDemo = (props) => {
<Form> <Form>
<FormItem <FormItem
label={<span className={'label_text'}>输入</span>} label={<span className={'label_text'}>输入</span>}
validateStatus={testCaseValidate.input.validateStatus}
help={testCaseValidate.input.errMsg}
colon={ false } colon={ false }
> >
<TextArea <TextArea

@ -48,6 +48,17 @@ function StudentStudy (props) {
// 保存当前的id // 保存当前的id
saveUserProgramIdentifier(id); saveUserProgramIdentifier(id);
// startProgramQuestion(id); // startProgramQuestion(id);
// console.log("getUserProgramDetail(id)");
// console.log(id);
// console.log(id.charAt(id.length-1));
try {
if(id.charAt(id.length-1)==="?"){
id = id.substring(0, id.length - 1);
}
}catch (e) {
}
getUserProgramDetail(id); getUserProgramDetail(id);
const $searchs = window.location.search && window.location.search.substring(1); const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) { if ($searchs) {
@ -108,7 +119,7 @@ function StudentStudy (props) {
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(''); props.saveEditorCodeForDetail('');
props.clearOjForUserReducer(); props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit?{searchParams}`); props.history.push(`/problems/${identifier}/edit`);
} }
// 处理退出 // 处理退出
const handleClickQuit = () => { const handleClickQuit = () => {
@ -118,7 +129,7 @@ function StudentStudy (props) {
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(''); props.saveEditorCodeForDetail('');
// props.history.push('/problems'); // props.history.push('/problems');
props.history.push(`/question?${searchParams}`); props.history.push(`/problemset?${searchParams}`);
} }
return ( return (

@ -12,11 +12,15 @@ class Bottomsubmit extends Component {
cannelfun = () => { cannelfun = () => {
// window.location.href= // window.location.href=
try {
if(this.props.Cohetepaperbool===true){ if(this.props.Cohetepaperbool===true){
this.props.setCohetepaperbool(false); this.props.setCohetepaperbool(false);
}else { }else {
this.props.history.replace(this.props.url); this.props.history.replace(this.props.url);
} }
}catch (e) {
this.props.history.replace(this.props.url);
}
} }

@ -7,6 +7,8 @@ import UpgradeModals from '../modals/UpgradeModals';
import Pagination from '@icedesign/base/lib/pagination'; import Pagination from '@icedesign/base/lib/pagination';
import '@icedesign/base/lib/pagination/style.js'; import '@icedesign/base/lib/pagination/style.js';
import './ShixunPaths.css'; import './ShixunPaths.css';
import KeywordList from '../tpm/shixuns/shixun-keyword-list';
import btnUrl from '../tpm/shixuns/btn-new.png';
class ShixunPathSearch extends Component { class ShixunPathSearch extends Component {
constructor(props) { constructor(props) {
@ -26,19 +28,17 @@ class ShixunPathSearch extends Component{
} }
} }
//适配器
//切换列表状态 onChangeLabel(value) {
changeStatus=(value)=>{ let rs = value === 'new' ? 'updated_at' : 'myshixuns_scount'
let { discipline_id, sub_discipline_id } = this.state; let { discipline_id, sub_discipline_id } = this.state;
this.setState({ this.setState({
order:value, order: rs,
page: 1 page: 1
}) })
this.getList(value,discipline_id,sub_discipline_id,1); this.getList(rs, discipline_id, sub_discipline_id, 1)
} }
//选择页数 //选择页数
onChange = (pageNumber) => { onChange = (pageNumber) => {
@ -83,9 +83,11 @@ class ShixunPathSearch extends Component{
getdisciplines = () => { getdisciplines = () => {
let url = '/disciplines.json'; let url = '/disciplines.json';
axios.get(url,{params:{ axios.get(url, {
params: {
source: "subject" source: "subject"
}}).then((result)=>{ }
}).then((result) => {
if (result.status == 200) { if (result.status == 200) {
// console.log(result.data.disciplines) // console.log(result.data.disciplines)
this.setState({ this.setState({
@ -97,17 +99,29 @@ class ShixunPathSearch extends Component{
}) })
} }
getList=(order,discipline_id,sub_discipline_id,page )=>{ OnSearchInput = (value, type) => {
this.setState({
search: value,
page: 1
})
const { order, discipline_id, sub_discipline_id } = this.state
this.getList(order, discipline_id, sub_discipline_id, 1, value)
}
getList = (order, discipline_id, sub_discipline_id, page, keyword = '') => {
let url = '/paths.json'; let url = '/paths.json';
axios.get(url,{params:{ axios.get(url, {
params: {
sort: "desc", sort: "desc",
limit: 16, limit: 16,
order: order, order: order,
keyword,
page: page, page: page,
discipline_id: discipline_id, discipline_id: discipline_id,
sub_discipline_id: sub_discipline_id sub_discipline_id: sub_discipline_id
}}).then((result)=>{ }
}).then((result) => {
if (result.status == 200) { if (result.status == 200) {
this.setState({ this.setState({
pathList: result.data.subjects, pathList: result.data.subjects,
@ -120,7 +134,7 @@ class ShixunPathSearch extends Component{
} }
//头部获取是否已经登录了 //头部获取是否已经登录了
getUser=(url,type)=>{ getUser = (url) => {
if (this.props.checkIfLogin() === false) { if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog() this.props.showLoginDialog()
return return
@ -238,26 +252,8 @@ class ShixunPathSearch extends Component{
</ul> </ul>
</div> </div>
</div> </div>
<div className="mt20 educontent mb20 clearfix mainPageArray"> <KeywordList btnUrl={btnUrl} onChangeLabel={this.onChangeLabel.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)} onNewHandler={this.getUser.bind(this, '/paths/new')} btnStyle={{ top: '92px' }} />
{/*<a href="javascript:void(0)" className={ order == "publish_time" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("publish_time")}>全部</a>*/}
{/*<a href="javascript:void(0)" className={ order == "mine" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("mine")}>我的</a>*/}
<span className={ order == "updated_at" ? "active" : ""} onClick={ () => this.changeStatus("updated_at")}>最新</span>
<span className={ order == "myshixuns_count" ? "active" : ""} onClick={ () => this.changeStatus("myshixuns_count")}>最热</span>
{this.props.user&&this.props.user.main_site===false?"":this.props.Headertop===undefined?"":<a className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/paths/new")}>+新建实践课程</a>}
{this.props.user&&this.props.user.main_site===true?"":this.props.Headertop===undefined?"":
pathstype===true?"":this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?<a className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/paths/new")}>+新建实践课程</a>:""
}
{/*<div className="fr mr5 search-new">*/}
{/*/!* <Search*/}
{/*placeholder="请输入路径名称进行搜索"*/}
{/*id="subject_search_input"*/}
{/*value={search}*/}
{/*onInput={this.inputSearchValue}*/}
{/*onSearch={this.searchValue}*/}
{/*autoComplete="off"*/}
{/*></Search> *!/*/}
{/*</div>*/}
</div>
<PathCard {...this.props} {...this.state}></PathCard> <PathCard {...this.props} {...this.state}></PathCard>
{ {
this.state.pathList === null ? "" : total_count > 16 && this.state.pathList === null ? "" : total_count > 16 &&

@ -23,7 +23,7 @@ const App = (props) => {
total, total,
staticList, staticList,
changeParams, changeParams,
initTotal initTotal,
} = props; } = props;
// const [datas, setDatas] = useState([]); // const [datas, setDatas] = useState([]);
// const [sortedInfo, setSortedInfo] = useState({}); // const [sortedInfo, setSortedInfo] = useState({});
@ -213,9 +213,11 @@ const App = (props) => {
} }
]; ];
useEffect(() => { useEffect(() => {
changeParams({ changeParams({
page: 1 page: 1,
type: "subject_info"
}); });
pathId && staticList(pathId); pathId && staticList(pathId);
}, []); }, []);
@ -224,6 +226,7 @@ const App = (props) => {
pathId && staticList(pathId); pathId && staticList(pathId);
} }
// const { // const {
// study_count, // study_count,
// course_study_count, // course_study_count,
@ -334,8 +337,9 @@ const mapStateToProps = (state) => {
return { return {
subject_info, subject_info,
other_info, other_info,
total total,
} }
}; };
const mapDispatchToProps = (dispatch) => ({ const mapDispatchToProps = (dispatch) => ({

@ -23,6 +23,7 @@ import Bottomsubmit from "../modals/Bottomsubmit";
import QuestionModalys from "./component/QuestionModalys"; import QuestionModalys from "./component/QuestionModalys";
//exam_id 试卷的id //exam_id 试卷的id
var Undoclickable=true;
class NewMyShixunModel extends Component { class NewMyShixunModel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -162,11 +163,32 @@ class NewMyShixunModel extends Component {
//初始化 //初始化
componentDidMount() { componentDidMount() {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props; let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey; var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
}else{ }else{
@ -206,12 +228,33 @@ class NewMyShixunModel extends Component {
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) { if(prevProps.current_user !== this.props.current_user) {
debugger let isysladmins=false;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props; let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey; var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
}else{ }else{
@ -219,6 +262,12 @@ class NewMyShixunModel extends Component {
} }
this.callback(defaultActiveKeys); this.callback(defaultActiveKeys);
} }
if(prevProps.Contentdata !== this.props.Contentdata){
this.setState({
Contentdata:this.props.Contentdata,
})
}
} }
//公共和我的 //公共和我的
@ -680,7 +729,35 @@ class NewMyShixunModel extends Component {
} }
//选用
// 不选用 Question.js页面也有个
NOgetitem_baskets=(data)=>{
let url="/examination_banks/cancel_items.json";
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
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,
keyword: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
})
}
//选用 Question.js页面也有个
getitem_baskets=(data)=>{ getitem_baskets=(data)=>{
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url=""; let url="";
@ -694,7 +771,6 @@ class NewMyShixunModel extends Component {
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`选用成功`);
var data = { var data = {
discipline_id:this.state.discipline_id, discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id, sub_discipline_id:this.state.sub_discipline_id,
@ -709,9 +785,6 @@ class NewMyShixunModel extends Component {
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
// this.setState({
// visible:true
// })
} }
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
@ -719,8 +792,11 @@ class NewMyShixunModel extends Component {
} }
// 撤销 // 撤销
getitem_basketss=(id)=>{ getitem_basketss=(id)=>{
let url=""; let url="";
if(this.props.exam_id===undefined){ if(this.props.exam_id===undefined){
if(Undoclickable===true) {
Undoclickable = false;
url = `/item_baskets/${id}.json`; url = `/item_baskets/${id}.json`;
axios.delete(url) axios.delete(url)
.then((result) => { .then((result) => {
@ -741,14 +817,26 @@ class NewMyShixunModel extends Component {
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); setTimeout(()=>{
Undoclickable=true;
},1000);
}) })
}
}else{ }else{
if(Undoclickable===true) {
Undoclickable = false;
url = `/examination_banks/${this.props.exam_id}/revoke_item.json`; url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: { axios.delete(url, {
data: {
item_id: id === undefined ? "" : parseInt(id), item_id: id === undefined ? "" : parseInt(id),
}}) }
})
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`); // this.props.showNotification(`撤销成功`);
@ -767,15 +855,21 @@ class NewMyShixunModel extends Component {
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); setTimeout(()=>{
Undoclickable=true;
},1000);
}) })
} }
}
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=(bool)=>{
var item_idsdata=[]; var item_idsdata=[];
var arr= this.state.Contentdata.items; var arr= this.state.Contentdata.items;
@ -783,6 +877,10 @@ class NewMyShixunModel extends Component {
if(data.item_type==="PROGRAM"){ if(data.item_type==="PROGRAM"){
//编程题 //编程题
if(data.choosed===true){ if(data.choosed===true){
if(data.program_attr.status===1){
//已发布
item_idsdata.push(data.id);
}
}else{ }else{
//未选用 //未选用
@ -796,7 +894,7 @@ class NewMyShixunModel extends Component {
}else{ }else{
//不是编程题 //不是编程题
if(data.choosed===true){ if(data.choosed===true){
item_idsdata.push(data.id);
}else{ }else{
//未选用 //未选用
item_idsdata.push(data.id); item_idsdata.push(data.id);
@ -808,10 +906,21 @@ class NewMyShixunModel extends Component {
item_ids:item_idsdata, item_ids:item_idsdata,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
} }
if(bool===false){
this.getitem_baskets(data); this.getitem_baskets(data);
this.setState({ this.setState({
selectallquestionsonthispages:true, selectallquestionsonthispages:true,
}) })
}else{
this.NOgetitem_baskets(data);
this.setState({
selectallquestionsonthispages:false,
})
}
} }
//全选的状态 //全选的状态
@ -884,7 +993,7 @@ class NewMyShixunModel extends Component {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list, page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools, program_questions_count, single_questions_count, subjective_questions_count,selectionbools,
modalsTypeInaudit modalsTypeInaudit,Contentdata
} = this.state; } = this.state;
const Datacount = completion_questions_count + judgement_questions_count const Datacount = completion_questions_count + judgement_questions_count
@ -893,6 +1002,8 @@ class NewMyShixunModel extends Component {
+ single_questions_count + single_questions_count
+ subjective_questions_count; + subjective_questions_count;
// console.log("弹出框");
// console.log(Contentdata)
return ( return (
<div className="newMain clearfix " ref={this.saveContainer}> <div className="newMain clearfix " ref={this.saveContainer}>
@ -962,12 +1073,13 @@ class NewMyShixunModel extends Component {
/> />
{/*头部*/} {/*头部*/}
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
Contentdata={Contentdata}
exam_id={this.props.exam_id} exam_id={this.props.exam_id}
Isitapopup={"true"} Isitapopup={"true"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)}
getitem_baskets={(e)=>this.getitem_baskets(e)} getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)} setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)} setdatafunsval={(e) => this.setdatafunsval(e)}

@ -27,6 +27,7 @@ import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
import NewMyShixunModel from "../question/NewMyShixunModel"; import NewMyShixunModel from "../question/NewMyShixunModel";
import IntelligentModel from "../question/component/IntelligentModel" import IntelligentModel from "../question/component/IntelligentModel"
//人工组卷预览 //人工组卷预览
let Changes=true;
class Paperreview extends Component { class Paperreview extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -235,7 +236,9 @@ class Paperreview extends Component {
.then((result) => { .then((result) => {
if (result.data.status === 0) { if (result.data.status === 0) {
// this.props.showNotification(`组卷成功`); // this.props.showNotification(`组卷成功`);
this.props.history.replace('/paperlibrary'); // console.log(result.data.exam_id);
//本来调试卷库首页的
this.props.history.replace('/paperlibrary/see/'+result.data.exam_id);
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); //console.log(error);
@ -331,6 +334,8 @@ class Paperreview extends Component {
} }
//换题 //换题
Changingtopics=(id)=>{ Changingtopics=(id)=>{
if(Changes===true){
Changes=false;
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`; const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data={ let data={
item_id:id, item_id:id,
@ -342,11 +347,19 @@ class Paperreview extends Component {
var data = {} var data = {}
this.getdata(data); this.getdata(data);
} }
setTimeout(()=>{
Changes=true;
},1000);
}).catch((error) => { }).catch((error) => {
//console.log(error); //console.log(error);
setTimeout(()=>{
Changes=true;
},1000);
}) })
} }
}
setIntelligentformation=(bool)=>{ setIntelligentformation=(bool)=>{
this.setState({ this.setState({
Intelligentformation:bool Intelligentformation:bool
@ -384,7 +397,7 @@ class Paperreview extends Component {
{ {
newmyshixunmodelbool===true? newmyshixunmodelbool===true?
<div className="fangdatwo"> <div className="fangdatwo">
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel> <NewMyShixunModel {...this.props} {...this.state} Contentdata={this.state.Contentdata} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div> </div>
: :
"" ""
@ -407,7 +420,7 @@ class Paperreview extends Component {
artificialtype==="artificial"? artificialtype==="artificial"?
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item >试题库</Breadcrumb.Item> <Breadcrumb.Item >试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"} href="/question">人工组卷</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshou"} href="/problemset">人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
: :
@ -418,7 +431,7 @@ class Paperreview extends Component {
</Breadcrumb> </Breadcrumb>
: :
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item> <Breadcrumb.Item href="/problemset">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>新增试卷</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshou"}>新增试卷</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
} }
@ -427,11 +440,12 @@ class Paperreview extends Component {
{ {
Cohetepaperbool===false? Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}> <Paperreview_item {...this.state} {...this.props} artificialtype={artificialtype} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}>
</Paperreview_item> </Paperreview_item>
: :
<Comthetestpaperst {...this.state} {...this.props} <Comthetestpaperst {...this.state} {...this.props}
getJudquestio={(ref) => this.getcontentMdRef(ref)} getJudquestio={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)} setitem_type={(item) => this.setitem_type(item)}
@ -449,7 +463,8 @@ class Paperreview extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)} setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={ artificialtype==="artificial"?'/question':'/paperlibrary'}></Bottomsubmit> Cohetepaperbool={this.state.Cohetepaperbool}
onSubmits={() => this.preservation()} url={ artificialtype==="artificial"?'/problemset':'/paperlibrary'}></Bottomsubmit>
</div> </div>
) )

@ -85,9 +85,17 @@ class Paperreview_item extends Component {
const positions = this.props.single_questions.questions[result.destination.index].position; const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = { var data = {
position: positions position: positions
} }
}
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
@ -104,9 +112,19 @@ class Paperreview_item extends Component {
const ids = this.props.multiple_questions.questions[result.source.index].id; const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position; const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = { var data = {
position: positions position: positions
} }
}
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
@ -125,9 +143,19 @@ class Paperreview_item extends Component {
const ids = this.props.judgement_questions.questions[result.source.index].id; const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position; const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = { var data = {
position: positions position: positions
} }
}
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
@ -145,9 +173,19 @@ class Paperreview_item extends Component {
const ids = this.props.program_questions.questions[result.source.index].id; const ids = this.props.program_questions.questions[result.source.index].id;
const positions = this.props.program_questions.questions[result.destination.index].position; const positions = this.props.program_questions.questions[result.destination.index].position;
const url = `/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = { var data = {
position: positions position: positions
} }
}
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
@ -176,6 +214,25 @@ class Paperreview_item extends Component {
} }
setDownloady = (fenshu) => { setDownloady = (fenshu) => {
if(this.props.match.params.type==="Intelligence") {
//智能选题
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" : '',
exam_setting_id:this.props.match.params.id,
}
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);
})
}else{
const url = "/item_baskets/batch_set_score.json"; const url = "/item_baskets/batch_set_score.json";
var data = { var data = {
score: fenshu, score: fenshu,
@ -194,6 +251,8 @@ class Paperreview_item extends Component {
}) })
} }
}
setDownloadys=(value)=>{ setDownloadys=(value)=>{
const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`; const url = `/item_baskets/${this.state.set_scoreid}/set_score.json`;
var data = { var data = {
@ -239,6 +298,29 @@ class Paperreview_item extends Component {
modalsTypedel: bool, modalsTypedel: bool,
titilesms: names titilesms: names
}) })
if(this.props.match.params.type==="Intelligence") {
//智能组卷
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names,
exam_setting_id:this.props.match.params.id,
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
////console.log(error);
});
}else{
const url = `/item_baskets/delete_item_type.json`; const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), { axios.delete((url), {
data: { data: {
@ -257,6 +339,8 @@ class Paperreview_item extends Component {
.catch(function (error) { .catch(function (error) {
////console.log(error); ////console.log(error);
}); });
}
@ -271,8 +355,12 @@ class Paperreview_item extends Component {
}) })
}else { }else {
//确定 //确定
if(this.props.match.params.type==="Intelligence"){
//智能组卷
const url = `/item_baskets/${this.state.item_bank_id}.json`; const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete((url)) axios.delete(url, { data: {
exam_setting_id: this.props.match.params.id,
}})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
// this.props.showNotification('试题删除成功'); // this.props.showNotification('试题删除成功');
@ -282,6 +370,20 @@ class Paperreview_item extends Component {
.catch(function (error) { .catch(function (error) {
}); });
}else{
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.getdata({});
}
})
.catch(function (error) {
});
}
this.setState({ this.setState({
modalsTypedels: bool, modalsTypedels: bool,
@ -291,7 +393,8 @@ class Paperreview_item extends Component {
} }
showsetmodalsTypedels=(id,bool,type)=>{ showsetmodalsTypedels=(id,bool,type)=>{
debugger console.log("Paperreview_item");
this.setState({ this.setState({
item_bank_id:id, item_bank_id:id,
}) })
@ -360,7 +463,7 @@ class Paperreview_item extends Component {
} }
jixuxuantioncli = () => { jixuxuantioncli = () => {
this.props.history.replace("/question"); this.props.history.replace("/problemset");
} }
showparagraphs = (e,name) => { showparagraphs = (e,name) => {
@ -394,6 +497,8 @@ class Paperreview_item extends Component {
modalsTypeys modalsTypeys
} = this.state; } = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props; let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
console.log("this.props");
console.log(this.props);
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
{ {

@ -61,6 +61,9 @@ class Paperreview_items extends Component {
// //console.log(object); // //console.log(object);
// //console.log("Paperreview_items"); // //console.log("Paperreview_items");
// //console.log(object.item_id); // //console.log(object.item_id);
//这里换题修改过
//这里删除修改过
// /Integeneration/Intelligence/ 换题item_id 删除item_id
return ( return (
<div> <div>
{ {

@ -18,6 +18,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css'; import '../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../common/quillForEditor"; import QuillForEditor from "../../common/quillForEditor";
import QuestionModalPicture from "./component/QuestionModalPicture";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -35,6 +36,8 @@ class Paperreview_single extends Component {
questions: 0, questions: 0,
totalscore: 0, totalscore: 0,
total: 0, total: 0,
url: ""
} }
} }
@ -67,9 +70,20 @@ class Paperreview_single extends Component {
Singlemagaziness = () => { Singlemagaziness = () => {
} }
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
render() { render() {
let {questions, totalscore, total, items} = this.state; let {questions, totalscore, total, items,url} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
@ -94,12 +108,30 @@ class Paperreview_single extends Component {
const options = [ const options = [
'bold', // 加粗 'bold', // 加粗
] ]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{ onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
minHeight: "114px", minHeight: "114px",
}}> }}>
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
<style>{ <style>{
` `
.programquill .ql-editor{ .programquill .ql-editor{
@ -183,6 +215,7 @@ class Paperreview_single extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemssname} value={itemssname}
showUploadImage={this.handleShowUploadImage}
/> />
} }
@ -226,6 +259,7 @@ class Paperreview_single extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemsnamesy} value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/> />
} }
@ -257,6 +291,7 @@ class Paperreview_single extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={string} value={string}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
: :

@ -21,7 +21,9 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars"; import SiderBars from "../question/component/SiderBars";
import QuestionModalys from "./component/QuestionModalys"; import QuestionModalys from "./component/QuestionModalys";
import Certifiedprofessional from "../modals/Certifiedprofessional";
var Undoclickable=true;
class Question extends Component { class Question extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -69,6 +71,11 @@ class Question extends Component {
isVisible: false, isVisible: false,
selectionbools:false, selectionbools:false,
chakanjiexiboolindex:"无", chakanjiexiboolindex:"无",
mydisplay:false,
occupation:2,
} }
} }
@ -230,11 +237,9 @@ class Question extends Component {
} }
axios.get((url), {params: data}).then((response) => { axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({ this.setState({
booljupyterurls:false, booljupyterurls:false,
}) })
},1000);
if (response === null || response === undefined) { if (response === null || response === undefined) {
return return
@ -287,7 +292,10 @@ class Question extends Component {
}) })
this.getdataslen(response.data.items); this.getdataslen(response.data.items);
// Undoclickable=true;
}).catch((error) => { }).catch((error) => {
// Undoclickable=true;
}); });
} }
@ -634,6 +642,7 @@ class Question extends Component {
single_questions_count: result.data.single_questions_count, single_questions_count: result.data.single_questions_count,
subjective_questions_count: result.data.subjective_questions_count, subjective_questions_count: result.data.subjective_questions_count,
}) })
// Undoclickable=true;
}).catch((error) => { }).catch((error) => {
// ////console.log(error); // ////console.log(error);
@ -646,12 +655,41 @@ class Question extends Component {
single_questions_count: 0, single_questions_count: 0,
subjective_questions_count: 0, subjective_questions_count: 0,
}) })
// Undoclickable=true;
}) })
} }
// 不选用 NewMyShixunModel.js 页面也有个
NOgetitem_baskets=(data)=>{
let url="/examination_banks/cancel_items.json";
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`选用成功`);
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,
keyword: this.state.keywords,
page: this.state.page,
per_page:10,
};
this.getdatasy(data);
this.getbasket_listdata();
// this.setState({
// visible:true
// })
}
}).catch((error) => {
////console.log(error);
})
}
//选用 //选用 NewMyShixunModel.js 页面也有个
getitem_baskets=(data)=>{ getitem_baskets=(data)=>{
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url="/item_baskets.json"; let url="/item_baskets.json";
@ -683,6 +721,11 @@ class Question extends Component {
} }
// 撤销 // 撤销
getitem_basketss=(id)=>{ getitem_basketss=(id)=>{
this.setState({
})
if(Undoclickable===true){
Undoclickable=false;
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url=`/item_baskets/${id}.json`; let url=`/item_baskets/${id}.json`;
@ -704,12 +747,26 @@ class Question extends Component {
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
} }
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
}) })
}else{
return
}
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=(bool)=>{
var item_idsdata=[]; var item_idsdata=[];
var arr= this.state.Contentdata.items; var arr= this.state.Contentdata.items;
@ -717,7 +774,10 @@ class Question extends Component {
if(data.item_type==="PROGRAM"){ if(data.item_type==="PROGRAM"){
//编程题 //编程题
if(data.choosed===true){ if(data.choosed===true){
if(data.program_attr.status===1){
//已发布
item_idsdata.push(data.id);
}
}else{ }else{
//未选用 //未选用
if(data.program_attr.status===1){ if(data.program_attr.status===1){
@ -730,7 +790,7 @@ class Question extends Component {
}else{ }else{
//不是编程题 //不是编程题
if(data.choosed===true){ if(data.choosed===true){
item_idsdata.push(data.id);
}else{ }else{
//未选用 //未选用
item_idsdata.push(data.id); item_idsdata.push(data.id);
@ -741,10 +801,18 @@ class Question extends Component {
const data={ const data={
item_ids:item_idsdata item_ids:item_idsdata
} }
if(bool===false){
this.getitem_baskets(data); this.getitem_baskets(data);
this.setState({ this.setState({
selectallquestionsonthispages:true, selectallquestionsonthispages:true,
}) })
}else{
this.NOgetitem_baskets(data);
this.setState({
selectallquestionsonthispages:false,
})
}
} }
//全选的状态 //全选的状态
@ -778,11 +846,38 @@ class Question extends Component {
}); });
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
//跳转 //跳转
gotopaperreview=()=>{ gotopaperreview=()=>{
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(this.props.current_user.professional_certification===false&&isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.replace("/paperreview/artificial"); this.props.history.replace("/paperreview/artificial");
} }
@ -817,7 +912,7 @@ class Question extends Component {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list, page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count, completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools, program_questions_count, single_questions_count, subjective_questions_count,selectionbools,
modalsTypeInaudit modalsTypeInaudit,mydisplay
} = this.state; } = this.state;
const Datacount = completion_questions_count + judgement_questions_count const Datacount = completion_questions_count + judgement_questions_count
@ -825,23 +920,62 @@ class Question extends Component {
+ program_questions_count + program_questions_count
+ single_questions_count + single_questions_count
+ subjective_questions_count; + subjective_questions_count;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
}catch (e) {
}
return ( return (
<div className="newMain clearfix" ref={this.saveContainer}> <div className="newMain clearfix" ref={this.saveContainer}>
{ <style>{
visible===true?
<style>
{
` `
.newHeaders{ .newHeaders{
position: fixed; position: fixed;
top: 0px; top: 0px;
z-index: 999 !important; z-index: 999 !important;
} }
`
}</style>
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
{
visible===true?
<style>
{
`
.ant-drawer { .ant-drawer {
z-index: 800 !important; z-index: 800 !important;
} }
@ -853,18 +987,17 @@ class Question extends Component {
position: relative; position: relative;
z-index: 9999999 ; z-index: 9999999 ;
} }
` `
} }
</style> </style>
:"" :""
} }
{
visible===true?
<div <div
style={{ style={{
marginTop: "60px" marginTop: "81px"
}}></div> }}></div>
:""}
{ {
modalsTypes===true? modalsTypes===true?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()} <QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
@ -895,19 +1028,7 @@ class Question extends Component {
` `
} }
</style> </style>
{
isysladmins===true?
<SiderBars
Datacount={Datacount}
myvisible={visible}
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}
/>
:
is_teacher===true&&professional_certification===true?
<SiderBars <SiderBars
Datacount={Datacount} Datacount={Datacount}
myvisible={visible} myvisible={visible}
@ -917,11 +1038,6 @@ class Question extends Component {
Headertop={Headertop} Headertop={Headertop}
/> />
:
""
}
{/*顶部*/} {/*顶部*/}
@ -943,7 +1059,7 @@ class Question extends Component {
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()} selectallquestionsonthispage={(bool)=>this.selectallquestionsonthispage(bool)}
getitem_baskets={(e)=>this.getitem_baskets(e)} getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)} setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)} setdatafunsval={(e) => this.setdatafunsval(e)}
@ -974,7 +1090,7 @@ class Question extends Component {
{ {
` `
.ant-drawer-content-wrapper{ .ant-drawer-content-wrapper{
width: 200px !important; width: 160px !important;
overflowhidden; overflowhidden;
margin-top: 62px; margin-top: 62px;
} }
@ -1022,8 +1138,8 @@ class Question extends Component {
"" ""
: <div className="sortinxdirection " > : <div className="sortinxdirection " >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}></i></p>
</div> </div>
} }
@ -1033,8 +1149,8 @@ class Question extends Component {
: :
<div className="sortinxdirection" > <div className="sortinxdirection" >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}></i></p>
</div> </div>
} }
@ -1044,8 +1160,8 @@ class Question extends Component {
: :
<div className="sortinxdirection" > <div className="sortinxdirection" >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}></i></p>
</div> </div>
} }
@ -1055,8 +1171,8 @@ class Question extends Component {
: :
<div className="sortinxdirection" > <div className="sortinxdirection" >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}></i></p>
</div> </div>
} }
@ -1066,8 +1182,8 @@ class Question extends Component {
: :
<div className="sortinxdirection" > <div className="sortinxdirection" >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}></i></p>
</div> </div>
} }
@ -1077,8 +1193,8 @@ class Question extends Component {
: :
<div className="sortinxdirection"> <div className="sortinxdirection">
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">实训题{'('}{practical_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor "></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor "></i></p>
</div> </div>
} }
@ -1088,8 +1204,8 @@ class Question extends Component {
: :
<div className="sortinxdirection" > <div className="sortinxdirection" >
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p> className="w80s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w20s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}></i></p>
</div> </div>
} }

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink,Prompt} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
@ -22,6 +22,7 @@ import JudquestionEditor from "./component/JudquestionEditor";
import Bottomsubmit from "../../modules/modals/Bottomsubmit"; import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import actions from "../../redux/actions"; import actions from "../../redux/actions";
var restricte=false;
class Questionitem_banks extends Component { class Questionitem_banks extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -37,6 +38,7 @@ class Questionitem_banks extends Component {
knowledgepoints: [], knowledgepoints: [],
disciplmy:[], disciplmy:[],
pages:1, pages:1,
} }
} }
@ -172,6 +174,20 @@ class Questionitem_banks extends Component {
} }
componentWillMount () {
// 拦截判断是否离开当前页面
window.addEventListener('beforeunload', this.beforeunload);
}
componentWillUnmount () {
// 销毁拦截判断是否离开当前页面
window.removeEventListener('beforeunload', this.beforeunload);
}
beforeunload (e) {
let confirmationMessage = '你确定离开此页面吗?';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
}
getdata = (data) => { getdata = (data) => {
// const url=`/item_banks.json`; // const url=`/item_banks.json`;
@ -295,7 +311,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增单选题成功`); // this.props.showNotification(`新增单选题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -306,7 +323,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑单选题成功`); // this.props.showNotification(`编辑单选题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
@ -373,7 +391,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增多选题成功`); // this.props.showNotification(`新增多选题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
@ -386,7 +405,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑多选题成功`); // this.props.showNotification(`编辑多选题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
@ -440,7 +460,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增判断题成功`); // this.props.showNotification(`新增判断题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -452,7 +473,8 @@ class Questionitem_banks extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑判断题成功`); // this.props.showNotification(`编辑判断题成功`);
this.props.history.replace('/question'); this.restricte=true;
this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -473,17 +495,24 @@ class Questionitem_banks extends Component {
myrbkc.push(myda.id); myrbkc.push(myda.id);
} }
this.props.setOjInitialValue({ // this.props.setOjInitialValue({
difficult: Getdatasdata[0].rbnd, // difficult: Getdatasdata[0].rbnd,
sub_discipline_id: Getdatasdata[3].rbkc[1], // sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc, // tag_discipline_id: myrbkc,
}); // });
let arrays=myrbkc.join(','); let arrays=myrbkc.join(',');
// console.log("开始打印了"); // console.log("开始打印了");
// console.log(arrays); // console.log(arrays);
this.restricte=true;
window.open(`/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`); window.open(`/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
setTimeout(() => {
this.restricte=true;
}, 1000);
// this.props.history.replace( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
} }
@ -498,13 +527,23 @@ class Questionitem_banks extends Component {
} }
render() { render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state; let {page, limit, count, Headertop, visible, placement, modalsType, item_type,restricte} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params); // ////console.log(params);
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
> >
{
restricte===false?
<Prompt
when={true}
message={() => '你确定离开此页面吗?'}
/>
:
""
}
<style> <style>
{ {
@ -522,7 +561,7 @@ class Questionitem_banks extends Component {
<div className="w1200mss"> <div className="w1200mss">
<div className="w100s mt30"> <div className="w100s mt30">
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item> <Breadcrumb.Item href="/problemset">试题库</Breadcrumb.Item>
<Breadcrumb.Item>{JSON.stringify(params) === "{}" ? "新增" : "编辑"}试题</Breadcrumb.Item> <Breadcrumb.Item>{JSON.stringify(params) === "{}" ? "新增" : "编辑"}试题</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</div> </div>
@ -588,7 +627,7 @@ class Questionitem_banks extends Component {
"" ""
: :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit> onSubmits={() => this.preservation()} url={'/problemset'}></Bottomsubmit>
} }
</div> </div>
) )
@ -598,14 +637,15 @@ class Questionitem_banks extends Component {
} }
const mapStateToProps = (state) => ({}); // const mapStateToProps = (state) => ({});
const mapDispatchToProps = (dispatch) => ({ // const mapDispatchToProps = (dispatch) => ({
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params)) // setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
}); // });
//
export default connect( // export default connect(
mapStateToProps, // mapStateToProps,
mapDispatchToProps // mapDispatchToProps
)(SnackbarHOC()(TPMIndexHOC(Questionitem_banks))); // )(SnackbarHOC()(TPMIndexHOC(Questionitem_banks)));
export default SnackbarHOC()(TPMIndexHOC(Questionitem_banks));

@ -9,6 +9,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor'; import QuillForEditor from '../../../common/quillForEditor';
const { TextArea } = Input; const { TextArea } = Input;
@ -230,15 +231,26 @@ class ChoquesEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
texts=JSON.stringify(value);
}catch (e) {
texts=""; texts="";
}
} else { } else {
if(_text.length>=500){
var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value); value = JSON.stringify(value);
if(value.length>=500){
let a=value.length-500;
let b=_text.length-a;
var result = _text.substring(0,b);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else{
texts=value; texts=value;
} }
}
}
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts; question_choices[index] = texts;
//console.log(question_choices); //console.log(question_choices);
@ -260,29 +272,36 @@ class ChoquesEditor extends Component{
toShowMode = () => { toShowMode = () => {
} }
isNull=( str )=>{
if ( str == "" ) return true;
var regu = "^[ ]+$";
var re = new RegExp(regu);
//为空或纯空格为 true 有值为false
console.log(re.test(str))
return re.test(str);
}
onContentChange=(value,quill)=>{ onContentChange=(value,quill)=>{
// debugger // debugger
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
this.setState({
question_titleysl: JSON.stringify(value)
})
}catch (e) {
this.setState({ this.setState({
question_titleysl:"" question_titleysl:""
}) })
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
let texts=""; try {
texts = JSON.stringify(value); let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts
}) })
}catch (e) {
this.setState({
question_titleysl:""
})
}
} }
} }
onContentChanges=(value,quill)=>{ onContentChanges=(value,quill)=>{
@ -290,23 +309,22 @@ class ChoquesEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({
question_titlesysl:""
})
} else {
// 提交到后台的内容需要处理一下;
try { try {
let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titlesysl: JSON.stringify(value) question_titlesysl:texts
}) })
}catch (e) { }catch (e) {
this.setState({ this.setState({
question_titlesysl:"" question_titlesysl:""
}) })
} }
} else {
// 提交到后台的内容需要处理一下;
let texts="";
texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
} }
} }
@ -333,10 +351,7 @@ class ChoquesEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula']
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}> <div className="padding20-30 signleEditor duoxuano" id={qNumber}>
<style>{` <style>{`
@ -362,6 +377,10 @@ class ChoquesEditor extends Component{
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font { .signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px; line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
} }
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
@ -408,7 +427,7 @@ class ChoquesEditor extends Component{
autoFocus={false} autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入选项"
options={options} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
@ -418,7 +437,7 @@ class ChoquesEditor extends Component{
autoFocus={false} autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入选项"
options={options} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}

@ -17,6 +17,8 @@ import NoneDatas from '../component/NoneDatas';
import LoadingSpin from '../../../common/LoadingSpin'; import LoadingSpin from '../../../common/LoadingSpin';
import Contentquestionbank from "./Contentquestionbank"; import Contentquestionbank from "./Contentquestionbank";
import Listjihe from "./Listjihe"; import Listjihe from "./Listjihe";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
import QuestionModalPicture from '../component/QuestionModalPicture.js'
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Search = Input.Search; const Search = Input.Search;
class Contentpart extends Component { class Contentpart extends Component {
@ -25,25 +27,114 @@ class Contentpart extends Component {
this.state = { this.state = {
page:1, page:1,
chakanjiexibool:false, chakanjiexibool:false,
mydisplay:false,
occupation:2,
url: "",
isysladmins:false,
} }
} }
//初始化 //初始化
componentDidMount(){ componentDidMount(){
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
} }
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
chakanjiexibool=(index)=>{ chakanjiexibool=(index)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.chakanjiexibool(index); this.props.chakanjiexibool(index);
} }
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodels(e)
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelsInaudit(e)
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelysl(e)
}
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) { if(prevProps.current_user !== this.props.current_user) {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props; let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey; var defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
this.setState({
isysladmins:isysladmins
})
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
}else{ }else{
@ -52,7 +143,26 @@ class Contentpart extends Component {
this.props.callback(defaultActiveKeys); this.props.callback(defaultActiveKeys);
} }
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
xinzenw=(e)=>{ xinzenw=(e)=>{
//只限制了教师
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
var urls=""; var urls="";
if(this.props.discipline_id){ if(this.props.discipline_id){
// if(urls==="?"){ // if(urls==="?"){
@ -91,17 +201,36 @@ class Contentpart extends Component {
} }
this.props.history.push("/question/newitem?pages="+this.props.pages+urls); this.props.history.push("/problemset/newitem?pages="+this.props.pages+urls);
} }
render() { render() {
let {page}=this.state; let {page,mydisplay,url}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props; let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const defaultActiveKeys=defaultActiveKey+''; const defaultActiveKeys=defaultActiveKey+'';
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
}catch (e) {
}
const content = ( const content = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
@ -137,11 +266,37 @@ class Contentpart extends Component {
// console.log("Contentpart.js"); // console.log("Contentpart.js");
//console.log(this.props.defaultActiveKey); // console.log(this.props.current_user.professional_certification);
return ( return (
<div className=" clearfix mt25"> <div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s"> <div className="educontent mt10 pb20 w1200s">
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="w1200ms contentparttit" style={{ <div className="w1200ms contentparttit" style={{
position: "relative", position: "relative",
}}> }}>
@ -166,7 +321,7 @@ class Contentpart extends Component {
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}> <Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
@ -192,12 +347,13 @@ class Contentpart extends Component {
` `
.xaxisreverseorder .ant-input-group-addon{ .xaxisreverseorder .ant-input-group-addon{
width: 60px !important; width: 48px !important;
} }
.xaxisreverseorder .ant-input-lg { .xaxisreverseorder .ant-input-wrapper .ant-input-group-addon button .ant-input-lg {
height: 41px !important;} height: 39px !important;
}
.xaxisreverseorder .ant-popover{ .xaxisreverseorder .ant-popover{
top: 30px !important; top: 30px !important;
@ -214,7 +370,7 @@ class Contentpart extends Component {
<div className="xaxisreverseorder"> <div className="xaxisreverseorder">
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
@ -247,7 +403,7 @@ class Contentpart extends Component {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
<Search <Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"0px"}:{marginRight:"0px"}} style={isysladmins===true||is_teacher===true?{ marginRight:"0px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"} className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
enterButton enterButton
@ -256,7 +412,7 @@ class Contentpart extends Component {
onSearch={ (value)=>this.props.setdatafuns(value)} /> onSearch={ (value)=>this.props.setdatafuns(value)} />
: :
<Search <Search
style={isysladmins===true||(is_teacher===true&&professional_certification)?{ marginRight:"30px"}:{marginRight:"0px"}} style={isysladmins===true||is_teacher===true?{ marginRight:"30px"}:{marginRight:"0px"}}
className={"xaxisreverseorder searchwidth"} className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
enterButton enterButton
@ -285,12 +441,12 @@ class Contentpart extends Component {
<div className=" w100s mb10"> <div className=" w100s mb10">
{ {
defaultActiveKey===1||defaultActiveKey==="1"? defaultActiveKey===1||defaultActiveKey==="1"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={()=>this.props.selectallquestionsonthispage()} ></Contentquestionbank> <Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={(bool)=>this.props.selectallquestionsonthispage(bool)} ></Contentquestionbank>
:"" :""
} }
{ {
defaultActiveKey===0||defaultActiveKey==="0"? defaultActiveKey===0||defaultActiveKey==="0"?
<Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={()=>this.props.selectallquestionsonthispage()}></Contentquestionbank> <Contentquestionbank {...this.props} {...this.state} selectallquestionsonthispage={(bool)=>this.props.selectallquestionsonthispage(bool)}></Contentquestionbank>
:"" :""
} }
</div> </div>
@ -320,9 +476,12 @@ class Contentpart extends Component {
pages={this.props.pages} pages={this.props.pages}
getitem_basketss={(id)=>this.props.getitem_basketss(id)} getitem_basketss={(id)=>this.props.getitem_basketss(id)}
getitem_baskets={(e)=>this.props.getitem_baskets(e)} getitem_baskets={(e)=>this.props.getitem_baskets(e)}
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)} showmodelysl={(e)=>this.showmodelysl(e)}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}
handleShowUploadImage={(e)=>this.handleShowUploadImage(e)}
handleClose={()=>this.handleClose()}
> >
</Listjihe> </Listjihe>

@ -50,9 +50,9 @@ class Contentquestionbank extends Component {
<div className="sortinxdirection w50s"> <div className="sortinxdirection w50s">
{ {
selectionbools===true? selectionbools===true?
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()} disabled></Checkbox> <Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)} ></Checkbox>
: :
<Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage()}></Checkbox> <Checkbox checked={this.props.selectallquestionsonthispages} onChange={()=>this.props.selectallquestionsonthispage(this.props.selectallquestionsonthispages)}></Checkbox>
} }
<p className="setequesbank ml20">选用本页全部试题</p> <p className="setequesbank ml20">选用本页全部试题</p>

@ -260,7 +260,7 @@ class Headplugselections extends Component {
disciplinesdata&&disciplinesdata.map((item,key)=>{ disciplinesdata&&disciplinesdata.map((item,key)=>{
return( return(
item.sub_disciplines.length>0? item.sub_disciplines.length>0?
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={"bottomRight"}> <Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement="bottomLeft">
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunserdchAlls(item.sub_disciplines,item.id)}> <li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunserdchAlls(item.sub_disciplines,item.id)}>
{item.name} {item.name}
</li> </li>
@ -305,7 +305,7 @@ class Headplugselections extends Component {
} }
<div className="fl pr shaiAllItem mt1"> <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===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==="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==="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==="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> <li className={this.state.tixing==="JUDGMENT"?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.settixingtixing("JUDGMENT")}>判断题</li>

@ -805,7 +805,7 @@ class Itembankstop extends Component {
)( )(
<Select style={{width: '270px'}} disabled={this.state.boolnews} onChange={this.handleFormtixing} <Select style={{width: '270px'}} disabled={this.state.boolnews} onChange={this.handleFormtixing}
placeholder="请选择..."> placeholder="请选择...">
<Option value="PROGRAM">编程题</Option> {/*<Option value="PROGRAM">编程题</Option>*/}
<Option value="SINGLE">单选题</Option> <Option value="SINGLE">单选题</Option>
<Option value="MULTIPLE">多选题</Option> <Option value="MULTIPLE">多选题</Option>
<Option value="JUDGMENT">判断题</Option> <Option value="JUDGMENT">判断题</Option>

@ -9,6 +9,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
import QuillForEditor from '../../../common/quillForEditor'; import QuillForEditor from '../../../common/quillForEditor';
@ -287,62 +288,65 @@ class JudquestionEditor extends Component{
}) })
} }
isNull=( str )=>{
if ( str == "" ) return true;
var regu = "^[ ]+$";
var re = new RegExp(regu);
//为空或纯空格为 true 有值为false
console.log(re.test(str))
return re.test(str);
}
onContentChange=(value,quill)=>{ onContentChange=(value,quill)=>{
// console.log("这是题干赋值"); // console.log("这是题干赋值");
// console.log(value); // console.log(value);
// console.log(quill); // console.log(quill);
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
// console.log(_text);
// console.log(_text.length);
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
this.setState({
question_titleysl:JSON.stringify(value)
})
}catch (e) {
this.setState({ this.setState({
question_titleysl:"" question_titleysl:""
}) })
}
// console.log("空"); // console.log("空");
} else { } else {
// console.log("有");
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
let texts=""; try {
texts = JSON.stringify(value); let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts
}) })
}catch (e) {
this.setState({
question_titleysl:""
})
}
} }
} }
onContentChanges=(value,quill)=>{ onContentChanges=(value,quill)=>{
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
this.setState({
question_titlesysl:JSON.stringify(value)
})
}catch (e) {
this.setState({ this.setState({
question_titlesysl:"" question_titlesysl:""
}) })
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
let texts=""; try {
texts = JSON.stringify(value); let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titlesysl:texts question_titlesysl:texts
}) })
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} }
} }
render() { render() {
@ -368,10 +372,7 @@ class JudquestionEditor extends Component{
// ////////console.log(answerTagArray); // ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish); // ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params; const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula']
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{` <style>{`
@ -397,6 +398,10 @@ class JudquestionEditor extends Component{
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font { .signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px; line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
} }
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">

@ -8,10 +8,12 @@ import {
Table, Table,
Pagination, Pagination,
Radio, Radio,
Tooltip Tooltip,
Icon
} from "antd"; } from "antd";
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import QuillForEditor from "../../../common/quillForEditor"; import QuillForEditor from "../../../common/quillForEditor";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -23,6 +25,28 @@ const tagArrays = [
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
const questionType = [
{
type:'SINGLE',
color:'typeGreen',
name:'单选题'
},
{
type:'MULTIPLE',
color:'typeBlue',
name:'多选题'
},
{
type:'JUDGMENT',
color:'typeRed',
name:'判断题'
},
{
type:'PROGRAM',
color:'typeYellow',
name:'编程题'
}
]
//Paperreview_single.js Paperlibraryseeid_items.js //Paperreview_single.js Paperlibraryseeid_items.js
class Listjihe extends Component { class Listjihe extends Component {
constructor(props) { constructor(props) {
@ -31,15 +55,46 @@ class Listjihe extends Component {
page: 1, page: 1,
name: "单选题", name: "单选题",
nd: "简单", nd: "简单",
url: "",
mydisplay:false,
occupation:2,
isysladmins:false,
} }
} }
//初始化 //初始化
componentDidMount() { componentDidMount() {
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
}
handleShowUploadImage = (url) => {
try {
this.props.handleShowUploadImage(url);
}catch (e) {
} }
}
handleClose=()=>{
try {
this.props.handleClose();
}catch (e) {
}
}
//选用 //选用
Selectingpracticaltraining = (id) => { Selectingpracticaltraining = (id) => {
let data = {} let data = {}
@ -53,8 +108,15 @@ class Listjihe extends Component {
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id), exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
} }
} }
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.getitem_baskets(data);
}
getitem_baskets=(data)=>{
this.props.getitem_baskets(data); this.props.getitem_baskets(data);
} }
//撤销 //撤销
Selectingpracticaltrainings = (id) => { Selectingpracticaltrainings = (id) => {
@ -63,8 +125,29 @@ class Listjihe extends Component {
} }
seturls(url){
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.replace(url);
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
render() { render() {
let {page, name, nd} = this.state; let {page, name, nd,url,mydisplay} = this.state;
let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props; let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props;
// 编程答案 // 编程答案
@ -132,7 +215,7 @@ class Listjihe extends Component {
}catch (e) { }catch (e) {
} }
if(itemssname===undefined){ if(itemssname===undefined){
itemssname=items.name itemssname=items.name+""
} }
@ -141,7 +224,8 @@ class Listjihe extends Component {
itemsnamesy= JSON.parse(items&&items.program_attr&&items.program_attr.description); itemsnamesy= JSON.parse(items&&items.program_attr&&items.program_attr.description);
}catch (e) { }catch (e) {
itemsnamesy=items&&items.program_attr&&items.program_attr.description; itemsnamesy=items&&items.program_attr&&items.program_attr.description+"";
} }
var analysisnames=""; var analysisnames="";
@ -149,7 +233,7 @@ class Listjihe extends Component {
analysisnames= JSON.parse(items&&items.analysis); analysisnames= JSON.parse(items&&items.analysis);
}catch (e) { }catch (e) {
analysisnames=items&&items.analysis; analysisnames=items&&items.analysis+"";
} }
// console.log(items.name); // console.log(items.name);
// console.log(itemsnamesy); // console.log(itemsnamesy);
@ -158,10 +242,61 @@ class Listjihe extends Component {
const options = [ const options = [
'bold', // 加粗 'bold', // 加粗
] ]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
const types = questionType.filter(item=>item.type === items.item_type);
return ( return (
<div key={keindex} <div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}> className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/} {/*顶部*/}
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<style>
{
`
`
}
</style>
{/* 显示上传的图片信息 */}
{/*<div className="show_upload_image" style={{ display: url ? 'block' : 'none'}}>*/}
{/* <Icon type="close" className="image_close" onClick={()=>this.handleClose()}/>*/}
{/* <div className="image_info">*/}
{/* <img className="image" src={url} alt=""/>*/}
{/* </div>*/}
{/*</div>*/}
<style> <style>
{ {
` .markdown-body .ql-editor{ ` .markdown-body .ql-editor{
@ -188,6 +323,7 @@ class Listjihe extends Component {
} }
</style> </style>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<span className={`typesBtn ${types && types[0].color}`}>{types && types[0].name}</span>
<div className="listjihetixingstitsy" style={{ <div className="listjihetixingstitsy" style={{
fontWeight:"bold" fontWeight:"bold"
}} > }} >
@ -197,11 +333,11 @@ class Listjihe extends Component {
</div> </div>
{ {
items.item_type==="PROGRAM"? items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}> <a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)} className="ml10 flex1 mt2">
<div className="ml10 w100s " style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div> <div style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a> </a>
: :
<div className="ml10 w100s markdown-body" style={{wordBreak: "break-word",fontWeight:"bold"}}> <div className="ml10 flex1 markdown-body mt2" style={{wordBreak: "break-word",fontWeight:"bold"}}>
{ items===undefined||items===null||items===""?"": { items===undefined||items===null||items===""?"":
items.name === undefined || items.name === null || items.name === "" ? items.name === undefined || items.name === null || items.name === "" ?
@ -212,6 +348,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemssname} value={itemssname}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
} }
@ -249,6 +386,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemsnamesy} value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/> />
} }
</p> </p>
@ -282,6 +420,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={string} value={string}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
@ -369,7 +508,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit?editoj=1&pages=`+this.props.pages}> <a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)}>
<p className="viewparsings xiaoshou mr25"> <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
@ -379,7 +518,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a target="_blank" href={`/question/edit/${items.id}`}> <a onClick={()=>this.seturls(`/problemset/edit/${items.id}`)}>
<p className="viewparsings xiaoshou mr25"> <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
@ -401,7 +540,10 @@ class Listjihe extends Component {
: :
( (
items.public==true? items.public==true?
"" <p className="viewparsings xiaoshou mr25" >
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
: :
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}> <p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
@ -425,7 +567,10 @@ class Listjihe extends Component {
</p> </p>
) )
: :
"" <p className="viewparsings mr25" >
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
} }
</div> </div>
@ -493,6 +638,7 @@ class Listjihe extends Component {
imgAttrs={{width: '60px', height: '30px'}} imgAttrs={{width: '60px', height: '30px'}}
readOnly={true} readOnly={true}
value={analysisnames} value={analysisnames}
showUploadImage={this.handleShowUploadImage}
/> />
: :
"暂无解析" "暂无解析"

@ -0,0 +1,58 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,Icon} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
import './../../../common/components/comment/index.scss';
//立即申请试用
class QuestionModalPicture extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={true}
footer={null}
destroyOnClose={true}
title=""
centered={true}
visible={this.props.url?true:false}
onCancel={this.props.handleClose}
>
{/* 显示上传的图片信息 */}
<style>
{
`
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
`
}
</style>
<div className="show_upload_image intermediatecenter" style={{ display: this.props.url ? 'block' : 'none'}}>
{/*<Icon type="close" className="image_close" onClick={this.props.handleClose}/>*/}
<div className="image_info intermediatecenter">
<img className="image" style={{
width:"100%"
}} src={ this.props.url} alt=""/>
</div>
</div>
</Modal>
)
}
}
export default QuestionModalPicture;

@ -94,6 +94,22 @@ class SiderBars extends Component {
var mypath= this.props&&this.props.match&&this.props.match.path; var mypath= this.props&&this.props.match&&this.props.match.path;
let{myvisible,Datacount,animateStyle}=this.props; let{myvisible,Datacount,animateStyle}=this.props;
let swsilan=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
swsilan=true;
}
else if(this.props.current_user.business){
swsilan=true;
}
else if(this.props.current_user.is_teacher){
swsilan=true;
}else if(this.props.current_user.user_identity !=="学生") {
swsilan=true;
}
}
}
return ( return (
<div className={myvisible===true?"-task-sidebar mystask-sidebar":Datacount&&Datacount>0?"-task-sidebar mystask-sidebars":"-task-sidebar mystask-sidebarss"} > <div className={myvisible===true?"-task-sidebar mystask-sidebar":Datacount&&Datacount>0?"-task-sidebar mystask-sidebars":"-task-sidebar mystask-sidebarss"} >
@ -101,7 +117,7 @@ class SiderBars extends Component {
{this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div> {this.props.mygetHelmetapi&&this.props.mygetHelmetapi.main_site===true?<div>
{ {
mypath&&mypath==="/question"? mypath&&mypath==="/problemset"&&swsilan===true?
<Tooltip placement="left" title={"试题库"}> <Tooltip placement="left" title={"试题库"}>
<div className="feedback feedbackdivcolor xiaoshou shitikus" onClick={()=>this.props.showDrawer()} > <div className="feedback feedbackdivcolor xiaoshou shitikus" onClick={()=>this.props.showDrawer()} >
@ -117,7 +133,7 @@ class SiderBars extends Component {
<a target="_blank" className="color_white xiaoshou" > <a target="_blank" className="color_white xiaoshou" >
<i className="iconfont icon-shitilan color-white xiaoshou"></i> <i className="iconfont icon-shitilan color-white xiaoshou"></i>
</a> </a>
<p className="color-white font-12 xiaoshou">试题</p> <p className="color-white font-12 xiaoshou">试题</p>
</div> </div>
</Tooltip> </Tooltip>
:"" :""

@ -10,6 +10,7 @@ import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
import axios from 'axios' import axios from 'axios'
import update from 'immutability-helper' import update from 'immutability-helper'
import './../questioncss/questioncom.css'; import './../questioncss/questioncom.css';
import '../questioncss/font.css';
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder'; import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
const { TextArea } = Input; const { TextArea } = Input;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -139,7 +140,13 @@ class SingleEditor extends Component{
// this.refs['titleEditor'].showError() // this.refs['titleEditor'].showError()
this.props.showNotification('请您输入题干'); this.props.showNotification('请您输入题干');
return editordata; return editordata;
}else{
console.log("question_titleysl");
console.log(question_titleysl);
} }
for(let i = 0; i < question_choices.length; i++) { for(let i = 0; i < question_choices.length; i++) {
if (!question_choices[i]) { if (!question_choices[i]) {
// this.refs[`optionEditor${i}`].showError() // this.refs[`optionEditor${i}`].showError()
@ -243,6 +250,7 @@ class SingleEditor extends Component{
this.setState({ standard_answers }) this.setState({ standard_answers })
} }
onOptionContentChange = (value,quill,index) => { onOptionContentChange = (value,quill,index) => {
debugger
if (index >= this.state.question_choices.length) { if (index >= this.state.question_choices.length) {
// TODO 新建然后删除CD选项再输入题干会调用到这里且index是3 // TODO 新建然后删除CD选项再输入题干会调用到这里且index是3
return; return;
@ -252,15 +260,26 @@ class SingleEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
texts= JSON.stringify(value)
}catch (e) {
texts=""; texts="";
}
} else { } else {
if(_text.length>=500){
var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value); value = JSON.stringify(value);
if(value.length>=500){
let a=value.length-500;
let b=_text.length-a;
var result = _text.substring(0,b);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else{
texts=value; texts=value;
} }
}
}
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts; question_choices[index] = texts;
this.setState({ question_choices }); this.setState({ question_choices });
@ -280,50 +299,61 @@ class SingleEditor extends Component{
toShowMode = () => { toShowMode = () => {
} }
isNull=( str )=>{
if ( str == "" ) return true;
var regu = "^[ ]+$";
var re = new RegExp(regu);
//为空或纯空格为 true 有值为false
console.log(re.test(str))
return re.test(str);
}
onContentChange=(value,quill)=>{ onContentChange=(value,quill)=>{
var _text = quill.getText(); var _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({
question_titleysl:""
})
} else {
try { try {
let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titleysl: JSON.stringify(value) question_titleysl:texts===undefined|| null?"":texts
}) })
}catch (e) { }catch (e) {
this.setState({ this.setState({
question_titleysl:"" question_titleysl:""
}) })
} }
} else {
let texts = JSON.stringify(value);
this.setState({
question_titleysl:texts
})
} }
} }
onContentChanges=(value,quill)=>{ onContentChanges=(value,quill)=>{
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({
question_titlesysl:""
})
} else {
try { try {
let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titlesysl:JSON.stringify(value) question_titlesysl:texts===undefined|| null?"":texts
}) })
}catch (e) { }catch (e) {
this.setState({ this.setState({
question_titlesysl:"" question_titlesysl:""
}) })
} }
} else {
let texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
} }
} }
handleShowImage = (url) => { handleShowImage = (url) => {
@ -354,9 +384,7 @@ class SingleEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']}, const options=['code-block', 'image', 'formula'
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
] ]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -384,6 +412,10 @@ class SingleEditor extends Component{
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font { .signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px; line-height: 20px;
min-width: 150px;
}
.signleEditor .quill_editor_for_react_area .ql-container .ql-editor p{
font-family: MicrosoftYaHei;
} }
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
@ -428,7 +460,7 @@ class SingleEditor extends Component{
autoFocus={false} autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入选项"
options={options} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
@ -438,7 +470,7 @@ class SingleEditor extends Component{
autoFocus={false} autoFocus={false}
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入选项"
options={options} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}

@ -0,0 +1,67 @@
@charset "utf-8";
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
font-family:SimSun !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
font-family:SimHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
font-family:Microsoft YaHei !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
font-family:KaiTi !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=FangSong]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=FangSong]::before {
content: "仿宋";
font-family:FangSong !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
font-family:Arial !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
font-family:Times New Roman !important;
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=sans-serif]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=sans-serif]::before {
content: "sans-serif";
font-family:sans-serif !important;
}
.ql-font-SimSun {
font-family:SimSun !important;
}
.ql-font-SimHei {
font-family:SimHei !important;
}
.ql-font-Microsoft-YaHei {
font-family:Microsoft YaHei !important;
}
.ql-font-KaiTi {
font-family:KaiTi !important;
}
.ql-font-FangSong {
font-family:FangSong !important;
}
.ql-font-Arial {
font-family:Arial !important;
}
.ql-font-Times-New-Roman {
font-family:Times New Roman !important;
}
.ql-font-sans-serif {
font-family:sans-serif !important;
}

@ -271,6 +271,12 @@
width:30%; width:30%;
} }
.w80s{
width:80%;
}
.w20s{
width:20%;
}
.w50s{ .w50s{
width: 50%; width: 50%;
@ -323,7 +329,7 @@
.listjihetixingstitsy { .listjihetixingstitsy {
color: #333333; color: #333333;
font-size: 14px; font-size: 14px;
line-height: 20px !important; line-height: 25px !important;
height: 25px !important; height: 25px !important;
} }
@ -413,10 +419,10 @@
color: #4CACFF; color: #4CACFF;
} }
.xiaoshou{ .xiaoshou{
cursor:pointer; cursor:pointer !important;
} }
.xiaoshout{ .xiaoshout{
cursor:default; cursor:default !important;
} }
.mt40{ .mt40{
margin-top: 40px; margin-top: 40px;
@ -913,7 +919,7 @@
width: 40px !important; width: 40px !important;
position: absolute; position: absolute;
border-radius: 4px; border-radius: 4px;
top: -50%; top: -79%;
} }
.shitikussmys{ .shitikussmys{
width:29px !important; width:29px !important;
@ -1112,3 +1118,27 @@
.text-indents50{ .text-indents50{
text-indent: 50px text-indent: 50px
} }
.typesBtn{
padding:0px 10px;
height:24px;
line-height:24px;
border-radius:2px;
margin-right:10px;
font-size: 13px;
}
.typeGreen{
color:#15DB7A;
border:1px solid #15DB7A;
}
.typeBlue{
color:#0CB9F1;
border:1px solid #0CB9F1;
}
.typeRed{
color:#FF5555;
border:1px solid #FF5555;
}
.typeYellow{
color:#FFB538;
border:1px solid #FFB538;
}

@ -0,0 +1,18 @@
.ql-editor .ql-font-Microsoft-YaHei {
font-family: "Microsoft YaHei";
}
.ql-editor .ql-font-SimSun {
font-family: "SimSun";
}
.ql-editor .ql-font-SimHei {
font-family: "SimHei";
}
.ql-editor .ql-font-KaiTi {
font-family: "KaiTi";
}
.ql-editor .ql-font-Arial {
font-family: "Arial";
}
.ql-editor .Times-New-Roman {
font-family: "Times New Roman";
}

@ -0,0 +1,28 @@
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
content: '微软雅黑';
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Microsoft-YaHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Microsoft-YaHei]::before {
content: "微软雅黑";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimSun]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimSun]::before {
content: "宋体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=SimHei]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=SimHei]::before {
content: "黑体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=KaiTi]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=KaiTi]::before {
content: "楷体";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Arial]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Arial]::before {
content: "Arial";
}
.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=Times-New-Roman]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=Times-New-Roman]::before {
content: "Times New Roman";
}

@ -282,6 +282,34 @@ class Intecomponents extends Component {
} }
preservation = () => { preservation = () => {
let mylistcour=1;
try {
mylistcour=this.state.single_question_count+this.state.multiple_question_count+this.state.judgement_question_count+this.state.program_question_count
}catch (e) {
}
if(mylistcour===0){
this.props.showNotification(`没有题不能组卷`);
return;
}
let arraycour=1;
try {
arraycour=this.Judquestio.Getdatas()[3].rbdxt+this.Judquestio.Getdatas()[4].rbdxtx+ this.Judquestio.Getdatas()[5].rbpdt+this.Judquestio.Getdatas()[6].rbbct
}catch (e) {
}
if(arraycour===0){
this.props.showNotification(`没有设置题型及数量不能组卷`);
return;
}
if (this.Judquestio.Getdatas().length === 0) { if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid"); this.scrollToAnchor("Itembankstopid");
return; return;

@ -31,7 +31,7 @@ class Paperlibraryeditid extends Component {
super(props); super(props);
this.Judquestio = React.createRef(); this.Judquestio = React.createRef();
this.state = { this.state = {
paperlibrartdata: [], Contentdata: [],
disciplinesdata: [], disciplinesdata: [],
knowledgepoints: [], knowledgepoints: [],
disciplmy: [], disciplmy: [],
@ -139,7 +139,7 @@ class Paperlibraryeditid extends Component {
axios.get(urls).then((response) => { axios.get(urls).then((response) => {
if (response) { if (response) {
this.setState({ this.setState({
paperlibrartdata: response.data, Contentdata: response.data,
item_banksedit: response.data.exam, item_banksedit: response.data.exam,
}) })
} }
@ -188,7 +188,7 @@ class Paperlibraryeditid extends Component {
.then((result) => { .then((result) => {
if (result.data.status === 0) { if (result.data.status === 0) {
// this.props.showNotification(`试卷更新成功`); // this.props.showNotification(`试卷更新成功`);
this.props.history.push('/paperlibrary'); this.props.history.push('/paperlibrary/see/'+this.props.match.params.id);
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); //console.log(error);
@ -227,7 +227,7 @@ class Paperlibraryeditid extends Component {
} }
render() { render() {
let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state; let {Contentdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`; let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
@ -248,7 +248,7 @@ class Paperlibraryeditid extends Component {
{ {
newmyshixunmodelbool===true? newmyshixunmodelbool===true?
<div className="fangdatwo"> <div className="fangdatwo">
<NewMyShixunModel {...this.state} {...this.props} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel> <NewMyShixunModel {...this.state} {...this.props} Contentdata={this.state.Contentdata} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div> </div>
: :
"" ""
@ -291,9 +291,9 @@ class Paperlibraryeditid extends Component {
<div className={"seeoagertitscss"}> <div className={"seeoagertitscss"}>
<Seeoagertits <Seeoagertits
setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count} all_score={Contentdata && Contentdata.exam && Contentdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score} all_questions_count={Contentdata && Contentdata.exam && Contentdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty} difficulty={Contentdata && Contentdata.exam && Contentdata.exam.difficulty}
> >
</Seeoagertits> </Seeoagertits>
</div> </div>
@ -301,15 +301,15 @@ class Paperlibraryeditid extends Component {
{...this.state} {...this.state}
{...this.props} {...this.props}
getdata={() => this.getdata()} getdata={() => this.getdata()}
single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null} single_questions={Contentdata && Contentdata.single_questions && Contentdata.single_questions.questions.length > 0 ? Contentdata.single_questions : null}
multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions multiple_questions={Contentdata && Contentdata.multiple_questions
&& paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null && Contentdata.multiple_questions.questions.length > 0 ? Contentdata.multiple_questions : null
} }
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions judgement_questions={Contentdata && Contentdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null && Contentdata.judgement_questions.questions.length > 0 ? Contentdata.judgement_questions : null
} }
program_questions={paperlibrartdata && paperlibrartdata.program_questions program_questions={Contentdata && Contentdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null && Contentdata.program_questions.questions.length > 0 ? Contentdata.program_questions : null
} }
></Paperlibraryseeid_itemss> ></Paperlibraryseeid_itemss>

@ -164,11 +164,9 @@ class Testpaperlibrary extends Component {
} }
axios.get((url), {params: data}).then((response) => { axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({ this.setState({
booljupyterurls:false, booljupyterurls:false,
}) })
},1000);
if (response === null || response === undefined) { if (response === null || response === undefined) {
return return
@ -304,7 +302,7 @@ class Testpaperlibrary extends Component {
tag_discipline_id:this.state.tag_discipline_id, tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey, public: this.state.defaultActiveKey,
difficulty: this.state.difficulty, difficulty: this.state.difficulty,
keyword: this.state.keywords, keyword: this.state.keyword,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
}; };
@ -330,7 +328,7 @@ class Testpaperlibrary extends Component {
tag_discipline_id:this.state.tag_discipline_id, tag_discipline_id:this.state.tag_discipline_id,
public: this.state.defaultActiveKey, public: this.state.defaultActiveKey,
difficulty: this.state.difficulty, difficulty: this.state.difficulty,
keyword: this.state.keywords, keyword: this.state.keyword,
page: this.state.page, page: this.state.page,
per_page:10, per_page:10,
}; };

@ -17,6 +17,7 @@ import NoneDatas from '../component/NoneDatas';
import Contentquestionbank from "./Contentquestionbank"; import Contentquestionbank from "./Contentquestionbank";
import LoadingSpin from '../../../common/LoadingSpin'; import LoadingSpin from '../../../common/LoadingSpin';
import Listjihe from "./Listjihe"; import Listjihe from "./Listjihe";
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const { TabPane } = Tabs; const { TabPane } = Tabs;
const Search = Input.Search; const Search = Input.Search;
class Contentpart extends Component { class Contentpart extends Component {
@ -25,6 +26,10 @@ class Contentpart extends Component {
this.state = { this.state = {
page:1, page:1,
defaultActiveKeyss:"0", defaultActiveKeyss:"0",
mydisplay:false,
occupation:2,
isysladmins:false,
} }
} }
@ -50,21 +55,56 @@ class Contentpart extends Component {
} }
} }
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
} }
//跳转人工组卷 //跳转人工组卷
Mantegeneration=()=>{ Mantegeneration=()=>{
this.props.history.push('/question'); this.props.history.push('/problemset');
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) { if(prevProps.current_user !== this.props.current_user) {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props; let {defaultActiveKey} = this.props;
let defaultActiveKeys=defaultActiveKey; let defaultActiveKeys=defaultActiveKey;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
}else{ }else{
@ -86,15 +126,120 @@ class Contentpart extends Component {
this.props.callback(defaultActiveKeys,false); this.props.callback(defaultActiveKeys,false);
} }
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
xinzenw=(url)=>{
//只限制了教师
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.push(url);
}
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
Testpapereditor=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.Testpapereditor(e)
}
showmodels=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodels(e)
}
showmodelysl=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelysl(e)
}
showmodelsInaudit=(e)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.showmodelsInaudit(e)
}
render() { render() {
let {page,defaultActiveKeyss}=this.state; let {page,defaultActiveKeyss,mydisplay}=this.state;
let {defaultActiveKey,defaultActiveKeybool}=this.props; let {defaultActiveKey,defaultActiveKeybool}=this.props;
let defaultActiveKeys=defaultActiveKey+''; let defaultActiveKeys=defaultActiveKey+'';
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; let isysladmins=false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; let is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
try {
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
if(is_teacher===false){
if(this.props.current_user.user_identity !=="学生"){
//专业人士
is_teacher=true
}
}
}catch (e) {
}
const contents = ( const contents = (
<div className="questiontypes" style={{ <div className="questiontypes" style={{
@ -125,6 +270,27 @@ class Contentpart extends Component {
return ( return (
<div className=" clearfix mt25"> <div className=" clearfix mt25">
<div className="educontent mt10 pb20 w1200s"> <div className="educontent mt10 pb20 w1200s">
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="w1200ms contentparttit" style={{ <div className="w1200ms contentparttit" style={{
position: "relative", position: "relative",
}}> }}>
@ -149,7 +315,7 @@ class Contentpart extends Component {
</style> </style>
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}> <Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
@ -172,7 +338,7 @@ class Contentpart extends Component {
{ {
` `
.sortinxdirection .ant-input-group-addon{ .sortinxdirection .ant-input-group-addon{
width: 60px !important; width: 48px !important;
} }
@ -186,7 +352,7 @@ class Contentpart extends Component {
` `
} }
</style> </style>
<div className={isysladmins===true||(is_teacher===true&&professional_certification===true)?"sortinxdirection":"xaxisreverseorder"}> <div className={isysladmins===true||is_teacher===true?"sortinxdirection":"xaxisreverseorder"}>
<Search <Search
style={{ width: "347px",marginRight:"60px",}} style={{ width: "347px",marginRight:"60px",}}
placeholder="请输入题目名称、内容" placeholder="请输入题目名称、内容"
@ -194,26 +360,32 @@ class Contentpart extends Component {
size="large" size="large"
onInput={(e)=>this.props.setdatafunsval(e)} onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} onSearch={ (value)=>this.props.setdatafuns(value)}
value={this.props.keywords} value={this.props.keyword}
/> />
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||is_teacher===true?
<div className="xaxisreverseorder" style={{ <div className="xaxisreverseorder" style={{
width:"50%" width:"50%"
}}> }}>
<a onClick={()=>this.xinzenw('/problemset')}>
<a href={'/Integeneration'}>
<div className="newbutoonss"> <div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p>
</div>
</a>
<a href={'/question'} >
<div className="newbutoons mr39">
<p className="newbutoontess" >人工组卷</p> <p className="newbutoontess" >人工组卷</p>
</div> </div>
</a> </a>
{/*<a onClick={()=>this.xinzenw('/Integeneration')}>*/}
{/* <div className="newbutoonss">*/}
{/* <p className="newbutoontess" >智能组卷</p>*/}
{/* </div>*/}
{/*</a>*/}
{/*<a onClick={()=>this.xinzenw('/problemset')}>*/}
{/* <div className="newbutoons mr39">*/}
{/* <p className="newbutoontess" >人工组卷</p>*/}
{/* </div>*/}
{/*</a>*/}
</div> </div>
:"" :""
} }
@ -260,9 +432,9 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => { : this.props.Contentdata.exams.map((object, index) => {
return ( return (
<Listjihe {...this.state} {...this.props} items={object} key={index} <Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)} Testpapereditor={(e)=>this.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)} showmodelysl={(e)=>this.showmodelysl(e)}
Isitapopup={this.props.Isitapopup} Isitapopup={this.props.Isitapopup}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)} showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
> >

@ -10,6 +10,7 @@ import {
Radio Radio
} from "antd"; } from "antd";
import './../testioncss/testioncss.css'; import './../testioncss/testioncss.css';
import Certifiedprofessional from "../../modals/Certifiedprofessional";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
@ -23,12 +24,27 @@ class Listjihe extends Component {
name:"单选题", name:"单选题",
nd:"简单", nd:"简单",
chakanjiexibool:false, chakanjiexibool:false,
mydisplay:false,
occupation:2,
isysladmins:false,
} }
} }
//初始化 //初始化
componentDidMount(){ componentDidMount(){
let isysladmins=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
isysladmins=true;
}
else if(this.props.current_user.business){
isysladmins=true;
}
}
}
this.setState({
isysladmins:isysladmins
})
} }
chakanjiexibool=()=>{ chakanjiexibool=()=>{
@ -55,15 +71,31 @@ class Listjihe extends Component {
this.props.getitem_basketss(id); this.props.getitem_basketss(id);
} }
HideAddcoursestypess=(i)=>{
console.log("调用了");
this.setState({
mydisplay:true,
occupation:i,
})
}
mydisplayHidedel=()=>{
this.setState({
mydisplay:false,
})
}
gotoseesj=(id)=>{ gotoseesj=(id)=>{
if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){
this.HideAddcoursestypess(2);
return
}
this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`); this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
} }
render() { render() {
let {page,name,nd,chakanjiexibool}=this.state; let {page,name,nd,chakanjiexibool,mydisplay}=this.state;
let {defaultActiveKey,items}=this.props; let {defaultActiveKey,items}=this.props;
const names= items&&items.name&&items.name; const names= items&&items.name&&items.name;
@ -77,12 +109,33 @@ class Listjihe extends Component {
return ( return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} > <div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
<div className="sortinxdirection w100s"> <div className="sortinxdirection w100s">
<div className="sjimg intermediatecenter"> <div className="sjimg intermediatecenter">
<img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/> <img src={getImageUrl("images/educoder/shijuans.png")} className="imgtp"/>
</div> </div>
<div className="w100s verticallayout ml20" > <div className="w100s verticallayout ml20" >
<div className="w100s " > <a className="sjtitle xiaoshou " title={names} onClick={()=>this.gotoseesj(items.id)}><p className="maxnamewidth100s">{names}</p></a></div> <div className="w100s " > <a className="sjtitle xiaoshou " title={names} onClick={()=>this.gotoseesj(items.id)}><p className="maxnamewidth100s xiaoshou">{names}</p></a></div>
<div className="w100s sortinxdirection mt9"> <div className="w100s sortinxdirection mt9">
<p className="sjtitles">试题数<span >{question_counts}</span></p> <p className="sjtitles">试题数<span >{question_counts}</span></p>
<p className="sjtitles ml48">总分<span >{total_scores}</span></p> <p className="sjtitles ml48">总分<span >{total_scores}</span></p>
@ -135,21 +188,22 @@ class Listjihe extends Component {
} }
{ {
items.public==true?
<p className="viewparsings mr25 ">
<i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>已公开</span>
</p>
:
items.apply===false? items.apply===false?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}> <p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span> <span>公开</span>
</p> </p>
: :
(
items.public==true?
""
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}> <p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span> <span>公开审核中</span>
</p> </p>
)
} }
</div> </div>
:""} :""}
@ -159,7 +213,9 @@ class Listjihe extends Component {
</div> </div>
</div> </div>
<div className="sjfqks reversedirection"> <div className="sjfqks reversedirection" style={{
display: "none"
}}>
<div className="newbutoonss"> <div className="newbutoonss">
<p className="newbutoontess" >发起考试</p> <p className="newbutoontess" >发起考试</p>
</div> </div>

@ -286,7 +286,7 @@ class Paperreview_item extends Component {
} }
jixuxuantioncli = () => { jixuxuantioncli = () => {
this.props.history.replace("/question"); this.props.history.replace("/problemset");
} }
showparagraphs = (e,name) => { showparagraphs = (e,name) => {

@ -16,6 +16,7 @@ import {
import '../testioncss/testioncss.css'; import '../testioncss/testioncss.css';
import '../../tpm/newshixuns/css/Newshixuns.css'; import '../../tpm/newshixuns/css/Newshixuns.css';
import QuillForEditor from "../../../common/quillForEditor"; import QuillForEditor from "../../../common/quillForEditor";
import QuestionModalPicture from "../../question/component/QuestionModalPicture";
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
@ -33,6 +34,7 @@ class Paperlibraryseeid_items extends Component {
questions: 0, questions: 0,
totalscore: 0, totalscore: 0,
total: 0, total: 0,
url: ""
} }
} }
@ -65,9 +67,20 @@ class Paperlibraryseeid_items extends Component {
Singlemagaziness = () => { Singlemagaziness = () => {
} }
handleShowUploadImage = (url) => {
// console.log('==============>>>>>>>>>>>>',url);
// setUrl(url);
this.setState({
url:url
})
}
handleClose=()=>{
this.setState({
url:'',
})
}
render() { render() {
let {questions, totalscore, total, items} = this.state; let {questions, totalscore, total, items,url} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props; let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
@ -90,12 +103,30 @@ class Paperlibraryseeid_items extends Component {
const options = [ const options = [
'bold', // 加粗 'bold', // 加粗
] ]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
style={{ style={{
minHeight: "114px", minHeight: "114px",
}}> }}>
{url?
<QuestionModalPicture {...this.props} {...this.state} handleClose={()=>this.handleClose()}></QuestionModalPicture>
:
""
}
<style>{ <style>{
` `
.programquill .ql-editor{ .programquill .ql-editor{
@ -179,6 +210,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemssname} value={itemssname}
showUploadImage={this.handleShowUploadImage}
/> />
} }
@ -221,6 +254,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemsnamesy} value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/> />
} }
@ -251,6 +286,8 @@ class Paperlibraryseeid_items extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={string} value={string}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
: :

@ -291,7 +291,8 @@ class Paperlibraryseeid_itemss extends Component {
} }
showsetmodalsTypedels=(id,bool,type)=>{ showsetmodalsTypedels=(id,bool,type)=>{
debugger console.log("Paperlibraryseeid_itemss");
this.setState({ this.setState({
item_bank_id:id, item_bank_id:id,
}) })
@ -360,7 +361,7 @@ class Paperlibraryseeid_itemss extends Component {
} }
jixuxuantioncli = () => { jixuxuantioncli = () => {
this.props.history.replace("/question"); this.props.history.replace("/problemset");
} }
showparagraphs = (e,name) => { showparagraphs = (e,name) => {

@ -26,7 +26,7 @@ class Seeoagertit extends Component {
onChange=(e)=> { onChange=(e)=> {
} }
jixuxuantioncli = () => { jixuxuantioncli = () => {
this.props.history.replace("/question"); this.props.history.replace("/problemset");
} }
render() { render() {

@ -400,13 +400,13 @@
color: #4CACFF; color: #4CACFF;
} }
.xiaoshou{ .xiaoshou{
cursor:pointer; cursor:pointer !important;
} }
.xiaoshout{ .xiaoshout{
cursor:default; cursor:default !important;
} }
.shubiao{ .shubiao{
cursor:default; cursor:default !important;
} }
.mt40{ .mt40{
margin-top: 40px; margin-top: 40px;
@ -544,7 +544,7 @@
margin-top: 19px; margin-top: 19px;
} }
.mytags{ .mytags{
width:106px; min-width:106px;
height:32px; height:32px;
border-radius:2px; border-radius:2px;
border:1px solid #DDDDDD; border:1px solid #DDDDDD;

@ -940,11 +940,34 @@ submittojoinclass=(value)=>{
width:'93px', width:'93px',
height:'80px', height:'80px',
}}> }}>
<a href={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></a> <Link to={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></Link>
<p className="questiontypeheng"></p> <p className="questiontypeheng"></p>
<a href={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></a> <Link to={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></Link>
</div> </div>
); );
// console.log("头部");
// console.log(this.props);
//判断平台身份
let Periofters=false;
if(this.props){
if(this.props.current_user){
if(this.props.current_user.admin){
Periofters=true;
}
else if(this.props.current_user.business){
Periofters=true;
}
else if(this.props.current_user.is_teacher){
Periofters=true;
}else if(this.props.current_user.user_identity !=="学生") {
Periofters=true;
}
}
}
return ( return (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
@ -1043,7 +1066,7 @@ submittojoinclass=(value)=>{
color:#010101 !important; color:#010101 !important;
} }
.queyppors { .queyppors {
top: 63px !important; top: 42px !important;
} }
.questionbanks .ant-popover-inner-content { .questionbanks .ant-popover-inner-content {
@ -1052,6 +1075,8 @@ submittojoinclass=(value)=>{
` `
} }
</style> </style>
{/*{*/}
{/* Periofters===true?*/}
{/* <li className={`pr questionbanks`} >*/} {/* <li className={`pr questionbanks`} >*/}
{/* <Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >*/} {/* <Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >*/}
{/* <div className=" sortinxdirection mr10">*/} {/* <div className=" sortinxdirection mr10">*/}
@ -1063,6 +1088,9 @@ submittojoinclass=(value)=>{
{/* </div>*/} {/* </div>*/}
{/* </Popover>*/} {/* </Popover>*/}
{/* </li>*/} {/* </li>*/}
{/* :""*/}
{/*}*/}
<li <li
style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth === null ? 'none' : 'block'}} style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.auth === null ? 'none' : 'block'}}
@ -1240,6 +1268,8 @@ submittojoinclass=(value)=>{
{shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>} {shixuntype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训项目</Link></li>}
{pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>} {pathstype===true?"":<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>{this.props.user&&this.props.user.main_site===false?"我的课程":"我的实践课程"}</Link></li>}
{this.props.user&&this.props.user.main_site===true?<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li>:""} {this.props.user&&this.props.user.main_site===true?<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的开发项目</Link></li>:""}
{ Periofters === true &&<li><Link to ={`/problemset`}>我的试题库</Link></li> }
{ Periofters === true &&<li><Link to ={`/paperlibrary`}>我的试卷库</Link></li> }
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/} {/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}> <li style={{display: this.props.Headertop === undefined ? 'none' : this.props.Headertop.customer_management_url===null || this.props.Headertop.customer_management_url===""? 'none' : 'block'}}>
<a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a> <a href={this.props.Headertop === undefined ? '' : this.props.Headertop.customer_management_url}>客户管理</a>

@ -268,7 +268,7 @@ body>.-task-title {
background: #EEEEEE; background: #EEEEEE;
} }
.mystask-sidebar{ .mystask-sidebar{
right: 220px !important; right: 181px !important;
} }
.mystask-sidebars{ .mystask-sidebars{
right: 20px !important; right: 20px !important;

@ -769,7 +769,7 @@ export function TPMIndexHOC(WrappedComponent) {
{...this.dialogObj} {...this.dialogObj}
/>:""} />:""}
{ {
mypath&&mypath==="/question"? mypath&&mypath==="/problemset"?
"" ""
: :
<SiderBar <SiderBar

@ -53,8 +53,11 @@ class RepositoryAddFileupload_files extends Component {
if(info.file.response){ if(info.file.response){
if(info.file.response.status===-1) { if(info.file.response.status===-1) {
this.props.showNotification(info.file.response.message) this.props.showNotification(info.file.response.message);
return return
}else{
this.props.showNotification("上传成功!");
return;
} }
} }
@ -62,7 +65,6 @@ class RepositoryAddFileupload_files extends Component {
fileList = fileList.map(file => { fileList = fileList.map(file => {
if (file.response) { if (file.response) {
if (file.response.status===0) { if (file.response.status===0) {
} }
} }
return file; return file;
@ -73,11 +75,13 @@ class RepositoryAddFileupload_files extends Component {
}; };
onAttachmentRemove=(info)=>{ onAttachmentRemove=(info)=>{
console.log(info);
if(info.response){
let shixunId = this.props.match.params.shixunId; let shixunId = this.props.match.params.shixunId;
let {message,filspath}=this.state; let {message,filspath}=this.state;
if(message===""||message===undefined){ if(message===""||message===undefined){
this.props.showNotification('删除文件请先填写提交信息'); this.props.showNotification('删除文件请先填写提交信息');
return return;
} }
let matchpath =this.props.match.path; let matchpath =this.props.match.path;
@ -105,13 +109,20 @@ class RepositoryAddFileupload_files extends Component {
secret_repository:Repositoryflag secret_repository:Repositoryflag
}}) }})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status === 0) {
this.props.showNotification("删除成功") let fileList = this.state.fileList.filter(item=>item.uid !== info.uid);
this.setState({
fileList
})
this.props.showNotification("删除成功");
} }
}) })
.catch(function (error) { .catch(function (error) {
console.log(error); console.log(error);
}); });
}else{
this.props.showNotification("还未上传完成,无法进行删除操作!");
}
} }
FormInput=(e)=>{ FormInput=(e)=>{
@ -195,7 +206,7 @@ class RepositoryAddFileupload_files extends Component {
return false return false
} }
this.props.showNotification("上传成功") // this.props.showNotification("上传成功");
}, },
}; };

@ -1,244 +0,0 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { Rating ,Pagination} from "@icedesign/base";
import {getImageUrl,setImagesUrl, toPath,getUrl} from 'educoder';
import { Spin,Icon,Tooltip ,Rate} from 'antd';
import LoadingSpin from '../../../common/LoadingSpin';
import './shixunCss/shixunCard.css';
// 引入业务组件样式
import axios from 'axios';
const $ = window.$;
class ShixunCard extends Component {
constructor(props) {
super(props)
this.state = {
startValue:[],
order_by:"",
page:1,
limit:16,
keyword:"",
status:0,
diff:0,
hideme:false,
tag_level:3,
tag_id:''
}
}
PaginationonChange=(pageNumber)=> {
this.props.shixunsPage(pageNumber);
}
render() {
let {middleshixundata, pagination, typepvisible, pages, totalcount} = this.props;
const MyRate = ({ defaultValue, ...rest }) => {
let myValue = defaultValue;
// console.log(myValue-Math.floor(myValue))
// if (myValue < Math.ceil(myValue)) {
// myValue = Math.floor(myValue) + 0.5;
// }
return <Rating {...rest} value={myValue} />;
};
return (
<div className="educontent mb80">
<Spin spinning={typepvisible} tip="正在获取相关数据..." size="large" style={{marginTop:'15%'}}>
{ middleshixundata === undefined?"":middleshixundata.length === 0 ?<div className="edu-tab-con-box clearfix edu-txt-center">
<style>
{`
.edu-tab-con-box{
padding:100px 0px;
}
.ant-modal-body .edu-tab-con-box{
padding:0px!important;
}
img.edu-nodata-img{
margin: 40px auto 20px;
}
`}
</style>
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div>:""}
<div className="mb20 clearfix"
// style={{display: middleshixundata === undefined || middleshixundata.length === 0 ? "none" : "block"}}
>
<style>
{
`
.square-list{
margin-top:5px;
}
`
}
</style>
<div className="shixun_list_content">
<div className="square-list clearfix">
{middleshixundata === undefined || middleshixundata.length === 0?" ":middleshixundata.map((item,key)=>{
return(
<div className="square-Item" key={key} id={item.id}>
<style>
{
`
.tag-green {
position: absolute;
left: 10px;
bottom: 125px;
}
.tag-org{
position: absolute;
left: 0px;
top: 20px;
}
.tag-org-name{
width:66px;
height:28px;
background:#FF6802;
width:66px;
height:28px;
border-radius:0px 20px 20px 0px;
}
.tag-org-name-test{
width:45px;
height:23px;
font-size:14px;
color:#FFFFFF;
line-height:19px;
margin-right: 6px;
}
.intermediatecenter{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
`
}
</style>
{
item.tag_name === null ? "":
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
{/*<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>*/}
</div>
}
{
item.is_jupyter===true?
<div className="tag-org">
<p className="tag-org-name intermediatecenter"> <span className="tag-org-name-test">Jupyter</span></p>
{/*<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>*/}
</div>
:""}
<div className={item.power === false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/>
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<a href={"/shixuns/"+item.identifier+"/challenges"} className="square-img" target="_blank">
{/*<img src={getImageUrl("images/"+item.pic+"?1540534846")}/>*/}
<img src={setImagesUrl(`${item.pic}`)}/>
</a>
{/*target="_blank"*/}
<div className="square-main">
<p className="task-hide">
<a href={"/shixuns/"+item.identifier+"/challenges"} className="justify color-grey-name" title={item.name} target="_blank">
{item.name}
</a>
</p>
{/*target="_blank"*/}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.anticon-star{*/}
{/*font-size:16px;*/}
{/*}*/}
{/*.pathInfo{*/}
{/*margin-right:-5px;*/}
{/*}*/}
{/*.ant-rate{*/}
{/*color: #FFA800;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
<p className="clearfix mt8 ml-3">
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
{/*<Rate allowHalf value={item.score_info===null?5:item.score_info} disabled key={key} />*/}
<MyRate key={key} allowHalf defaultValue={item.score_info===null?5:item.score_info} disabled/>
</span>
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt5">{item.score_info===null?"5分":item.score_info+"分"}</span>
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
{item.is_jupyter===false?<Tooltip placement="bottom" title={"关卡"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span>
</Tooltip>:""}
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan">*/}
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
{/*</span>*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":"block"}}>
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
</span>
</Tooltip>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
</p>
</div>
</div>
)
})
}
</div>
<div className="both"></div>
{/*totalcount*/}
<div className={"ml425"}
//className={totalcount < 22 ? "ml425" : "ml425"}
style={{display: pagination ? "block" : "none"}}>
{/*<Pagination showQuickJumper defaultCurrent={1} current={pages} total={totalcount} pageSize={12} onChange={this.PaginationonChange} />*/}
{/* 不加参数请求的时候,没返回总数了。加了个比较大的数字,让他可以翻页 */}
<Pagination defaultCurrent={1} current={pages} total={ totalcount || 1299 } type="mini" pageSize={16} onChange={this.PaginationonChange} />
</div>
</div>
</div>
</Spin>
</div>
)
}
}
export default ShixunCard;

@ -1,316 +0,0 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route} from "react-router-dom";
import { Switch ,Input,Tooltip,Icon} from 'antd';
import PropTypes from 'prop-types';
import classNames from 'classnames'
import 'antd/lib/switch/style/index.css'
import './shixunCss/ShixunCardList.css';
import GotoQQgroup from '../../../modal/GotoQQgroup'
import { on, off } from 'educoder'
const $ = window.$;
const Search = Input.Search;
class ShixunCardList extends Component {
constructor(props) {
super(props);
this.state={
allevent:"desc",
mine:0,
InputValue: props.keyword || "",
typemy:0,
hots:0,
news:0,
shixunid:"",
upcircle:false,
typekeyid:undefined,
goshowqqgtounp:false,
}
}
componentDidUpdate = (prevProps, prevState) => {
if (this.props.keyword != prevProps.keyword) {
this.setState({
InputValue: this.props.keyword
})
}
}
componentDidMount = () => {
on('searchKeywordChange', (event, data) => {
// console.log(data)
this.Input_search(data)
})
}
componentWillUnmount = () => {
off('searchKeywordChange')
}
latestHot=(e,key)=>{
let{upcircle,typekeyid}=this.state;
let id = e.target.id;
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let type;
// if(id==="all"){
// type="publish_time";
// }
if(id==="hot"){
type="hot";
}else if(id==="new"){
type="new";
}
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
// this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true,
})
// this.props.Shixunsupcircles("desc")
}
}else{
this.setState({
typekeyid:key
})
}
this.props.ShixunsState(false,type,"desc");
}
onSwitchChange=(e,key)=>{
let id=e.target.id
$("#"+id).siblings().removeClass("active");
$("#"+id).addClass("active");
let {typemy,upcircle,typekeyid}=this.state;
if(typekeyid===key){
if(upcircle===true){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(upcircle===false){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}else{
this.setState({
typekeyid:key
})
}
if(typemy===0){
this.setState({
typemy:1
})
}else{
this.setState({
typemy:0
})
}
// allevent
this.props.ShixunsSwitch();
}
//输入框搜索
Input_search = (value) => {
this.setState({
InputValue: value
})
this.props.OnSearchInput(value,true);
}
Input_searchs = (e) => {
this.setState({
InputValue: e.target.value
})
this.props.OnSearchInput(e.target.value,false);
}
upcircles=(val)=>{
if(val==="asc"){
this.setState({
upcircle:false,
})
this.props.Shixunsupcircles("desc")
}else if(val==="desc"){
this.setState({
upcircle:true
})
this.props.Shixunsupcircles("asc")
}
}
//头部获取是否已经登录了
getUser=(url,type)=>{
if(this.props.checkIfLogin()===false){
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
this.props.showProfileCompleteDialog()
return
}
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.setgoshowqqgtounp(true);
return;
}
if(url !== undefined || url!==""){
window.location.href = url;
}
}
// 处理弹框
setgoshowqqgtounp=(bool)=>{
this.setState({
goshowqqgtounp:bool
})
}
render(){
let {mine,InputValue,upcircle,goshowqqgtounp}=this.state;
// console.log("NewHeadermygetHelmetapi123123123123");
let shixuntype=false;
if(this.props&&this.props.mygetHelmetapi!=null){
let shixun="/shixuns";
let paths="/paths";
let courses="/courses";
this.props.mygetHelmetapi.navbar.map((item,key)=>{
var reg = RegExp(item.link);
if(shixun.match(reg)){
if(item.hidden===true){
shixuntype=true
}
}
})
}
return (
<div className="educontent mt20">
<div className="clearfix">
{
goshowqqgtounp===true?
<GotoQQgroup {...this.state} {...this.props} setgoshowqqgtounp={(bool)=>this.setgoshowqqgtounp(bool)}></GotoQQgroup>
:
""
}
{/*<div className="fl mr20 font-16 bestChoose shixun_repertoire active"*/}
{/*id={"all"}*/}
{/*onClick={(e)=>this.latestHot(e,1)}>全部*/}
{/*</div>*/}
{/*<div className="fl mr20 font-16 bestChoose shixun_repertoire"*/}
{/*id={mine}*/}
{/*onClick={(e)=>this.onSwitchChange(e,2)}>我的*/}
{/*</div>*/}
<div className="fl mr20 font-16 bestChoose shixun_repertoire active"
id="new"
onClick={(e)=>this.latestHot(e,4)}>最新
</div>
<div className="fl font-16 bestChoose shixun_repertoire"
id="hot"
onClick={(e)=>this.latestHot(e,3)}>最热
</div>
{shixuntype===true?"":<span className={ "fr font-16 bestChoose color-blue" } onClick={(url)=>this.getUser("/shixuns/new")}>+新建实训项目</span>}
<div className="fr mr20 mt3">
{
this.props.middleshixundata&&this.props.middleshixundata.search_tags
}
</div>
{/*<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"*/}
{/*style={{display:upcircle===true?"block":"none"}}*/}
{/*// onClick={()=>this.upcircles("asc")}*/}
{/*>*/}
{/*<Tooltip placement="bottom" title={"升序"}>*/}
{/*<Icon type="up-circle" theme="twoTone" />*/}
{/*/!*<Icon type="sort-descending" />*!/*/}
{/*</Tooltip>*/}
{/*</div>*/}
{/*<div className="fl font-16 bestChoose shixun_repertoire ml20 mt1"*/}
{/*// onClick={()=>this.upcircles("desc")}*/}
{/*style={{display:upcircle===true?"none":"block"}}*/}
{/*>*/}
{/*<Tooltip placement="bottom" title={"降序"}>*/}
{/*<Icon type="down-circle" theme="twoTone" />*/}
{/*/!*<Icon type="sort-ascending" />*!/*/}
{/*</Tooltip>*/}
{/*</div>*/}
{/*<div className="fr mt3">*/}
{/*<Search*/}
{/*style={{ width: 300 }}*/}
{/*className="search-new-input fl"*/}
{/*placeholder="请输入创建者/实训/关卡名称进行搜索"*/}
{/*value={InputValue}*/}
{/*onInput={this.Input_searchs}*/}
{/*onSearch={value => this.Input_search(value)}*/}
{/*enterButton*/}
{/*/>*/}
{/* <Search
style={{ width: 300 }}
className="fl"
placeholder="请输入创建者/实训/关卡名称进行搜索"
value={InputValue}
onInput={this.Input_searchs}
onSearch={value => this.Input_search(value)}
autoComplete="off"
></Search> */}
{/*</div>*/}
{/*<div className="fr">*/}
{/*<span className="fl color-grey-6 mr30 font-16 mt5" id="search_name">{*/}
{/*this.props.search_tags === null ? "" : this.props.search_tags*/}
{/*}</span>*/}
{/*<div className="fl mr5" style={{marginTop:'1px'}}>*/}
{/*/!* <div className="controlblue"></div>*/}
{/*<span className="controlring"></span> *!/*/}
{/*<Switch*/}
{/*className="controlbtn mr10 mt10 pr"*/}
{/*size="small"*/}
{/*style={{marginTop:'1px'}}*/}
{/*onChange={this.onSwitchChange}*/}
{/*/>*/}
{/*</div>*/}
{/*<span className="fl font-16 cdefault" data-tip-down="隐藏我学习的实训">隐藏我的</span>*/}
{/*</div>*/}
{/*<span className="fr color-grey-6 mr30 font-16" id="search_name"></span>*/}
</div>
</div>
);
}
}
export default ShixunCardList;

@ -1,301 +0,0 @@
import React, { Component } from 'react';
import { Select, Input,Menu, Dropdown } from 'antd';
import 'antd/lib/style/index.css';
import 'antd/lib/select/style/index.css';
import 'antd/lib/input/style/index.css';
import './shixunCss/ShixunSearchBar.css';
import axios from 'axios';
const $ = window.$;
const Option = Select.Option;
const Search = Input.Search;
class ShixunSearchBar extends Component {
constructor(props) {
super(props)
this.state = {
status: undefined,
diff: 0,
InputValue: undefined,
shixunhoverData: [],
shixunchildValues:'',
shixunsearchAllvalue:"a",
openStatus:false,
openLevel:false
}
}
//状态筛选
status_search = (value) => {
let newvalue = value;
if (newvalue === "0") {
newvalue = " "
} else if (newvalue === "1") {
newvalue = 2
} else if (newvalue === "2") {
newvalue = 1
} else if (newvalue === "3") {
newvalue = 3
}
this.setState({
status: newvalue,
openStatus:false
})
let list = [{'type': 1}, {'value': newvalue}];
this.props.StatusEnquiry(list);
}
//难度筛选
diff_search = (value) => {
this.setState({
diff: value,
openLevel:false
})
let list=[{'type':2},{'value':value}];
this.props.StatusEnquiry(list);
}
//输入框搜索
Input_search = (value) => {
this.setState({
InputValue: value
})
this.props.OnSearchInput(value);
}
//查询
shixunsearchAll = (e) => {
let{shixunsearchAllvalue}=this.state;
let id = e.target.value;
if(shixunsearchAllvalue===id){
return
}
if(id===0){
id=" "
this.setState({
InputValue: " "
})
this.props.OnSearchInput("");
}
let list=[{'tag_level':1},{'tag_id':id}];
if(id!=undefined){
this.setState({
shixunsearchAllvalue:id,
shixunchildValues:""
})
this.props.Updatasearchlist(list);
}
}
shixunsearchall=(e)=>{
let{shixunsearchAllvalue}=this.state;
let id = "a";
if(shixunsearchAllvalue===id){
return
}
this.setState({
shixunsearchAllvalue:"a",
shixunchildValues:""
})
this.props.allUpdatashixunlist();
}
//选择Tab页详情
getshixunchildValue = (e) => {
let id = e.target.name;
let newid=e.target.id;
let list=[{'tag_level':2},{'tag_id':id}];
if(id!=undefined||newid!=undefined){
this.setState({
shixunsearchAllvalue:newid
})
this.props.Updatasearchlist(list);
}
}
getshixunchildValues = (e) => {
let id = e.target.id;
let newid=e.target.name;
let list=[{'tag_level':3},{'tag_id':id}];
if(id!=undefined||newid!=undefined){
this.setState({
shixunchildValues:id,
shixunsearchAllvalue:newid
})
this.props.Updatasearchlist(list);
}
}
componentDidMount() {
let hoverUrlArr = [];
let hoverUrl = `/shixuns/menus.json`;
axios.get(hoverUrl
).then((response) => {
hoverUrlArr = response.data;
// hoverUrlArr.reverse();
this.setState({
shixunhoverData: hoverUrlArr
})
}).catch((error) => {
console.log(error)
})
}
render() {
let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
let {typepvisible} = this.props;
// //实训首页筛选的移入和点击事件
// $(".shaiItem").hover(function(){
// var hei=parseInt($(".shaiAllItem").height())-2;
// $(this).find(".subshaicontent").css("top", '34px');
// $(this).find(".subshaicontent").show();
// },function(){
// $(this).find(".subshaicontent").hide();
// });
//
// $(".shaiItem").live("click",function(){
// $(".shaiItem").removeClass("active");
// $(this).addClass("active");
// $(".subshaicontent").hide();
// });
//
// $(".subshaicontent").live("click", function(event){
// $(".subshaicontent").hide();
// event.stopPropagation();
// });
let overlaymenu=(item,id)=>(
<Menu>
{
item.map((list,k)=>{
return(
<Menu.Item>
<div className="mt5 subshaicontent-part" key={k}>
<a style={{ height: '20px' }} className={ "mb15 shixun_repertoire color-dark"} name={list.id} id={id} onClick={this.getshixunchildValue}>{list.name}</a>
<div className="sub-Item clearfix">
{
list.tags.map((tag,e)=>{
return(
<a className={parseInt(shixunchildValues)===tag.id?"shixun_repertoire active":"shixun_repertoire"} key={e} id={tag.id} name={id} rel="subshaicontent" onClick={this.getshixunchildValues}>{tag.name}</a>
)
})
}
</div>
</div>
</Menu.Item>
)
})
}
</Menu>
)
return (
<div className="edu-back-white" >
<div className="educontent">
<div className="pt_b_26">
<div className="clearfix mb20 shaiContent">
<span className="shaiTitle fl">方向</span>
<div className="fl pr shaiAllItem">
<li className={shixunsearchAllvalue==="a"?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value= "a" onClick={this.shixunsearchall}>全部</li>
<style>
{
`
.ant-dropdown{
width: 800px;
}
.shixun_repertoire{
cursor: pointer;
float: left;
margin-right: 20px;
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;
}
`
}
</style>
{
shixunhoverData.map((item,key)=>{
return(
<Dropdown overlay={overlaymenu(item.sub_repertoires,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.name}
</li>
</Dropdown>
)
})
}
</div>
</div>
<div className="clearfix">
<span className="shaiTitle fl">筛选</span>
{
<style>
{`
.shaiContent li.shaiItem{
padding:0px 15px;
line-height:32px;
height:32px
}
.shaiTitle{
height:32px;
line-height:32px;
}
.shaiItems{
padding:0px 15px;
line-height:32px;
height:32px;
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===0?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(0)}>全部难度</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>
<li className={this.state.diff===4?"shaiItems shixun_repertoire active":"shaiItems shixun_repertoire"} onClick={()=>this.diff_search(4)}>高级</li>
</div>
</div>
</div>
</div>
</div>
);
}
}
export default ShixunSearchBar;

@ -1,34 +1,20 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import axios from 'axios'; import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC'; import { TPMIndexHOC } from '../TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder'; import { SnackbarHOC, getImageUrl } from 'educoder';
import ShixunCardList from './shixun-keyword-list';
import ShixunCardList from './ShixunCardList'; import ShixunSearchBar from './shixun-search-bar';
import ShixunCard from './shixun-card';
import ShixunSearchBar from './ShixunSearchBar';
import ShixunCard from './ShixunCard';
import UpgradeModals from '../../modals/UpgradeModals'; import UpgradeModals from '../../modals/UpgradeModals';
import GotoQQgroup from '../../../modal/GotoQQgroup'
const queryString = require('query-string'); const queryString = require('query-string');
import btnUrl from './btn-new.png'
const $ = window.$;
class ShixunsIndex extends Component { class ShixunsIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
order_by: "new", order_by: "new",
showQQ: false,
page: 1, page: 1,
limit: 16, limit: 16,
keyword: "", keyword: "",
@ -173,8 +159,6 @@ class ShixunsIndex extends Component {
} }
StatusEnquiry = (key) => { StatusEnquiry = (key) => {
let Vrl=`/shixuns.json`;
let newstatus; let newstatus;
let newdiff; let newdiff;
if (key[0].type === 1) { if (key[0].type === 1) {
@ -296,7 +280,7 @@ class ShixunsIndex extends Component {
console.log(error) console.log(error)
}); });
} }
ShixunsState=(val,type,sorts)=>{ ShixunsState = (type, sorts) => {
// sort, // sort,
let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state; let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort = sorts ? sorts : sort; let newsort = sorts ? sorts : sort;
@ -359,8 +343,30 @@ class ShixunsIndex extends Component {
this.shixunresultend(params) this.shixunresultend(params)
} }
onNewHandler() {
const { checkIfLogin, showLoginDialog, checkIfProfileCompleted, showProfileCompleteDialog, current_user } = this.props
if (!checkIfLogin()) {
showLoginDialog()
return
}
if (!checkIfProfileCompleted()) {
showProfileCompleteDialog()
return
}
if (current_user && current_user.is_shixun_marker === false) {
this.setState(
{ showQQ: true }
)
return
}
window.location.href = '/shixuns/new'
}
setShowQQ(v) {
this.setState({
showQQ: v
})
}
shixunresultend = (params) => { shixunresultend = (params) => {
let Url = `/shixuns.json`; let Url = `/shixuns.json`;
@ -381,7 +387,7 @@ class ShixunsIndex extends Component {
}); });
} }
render() { render() {
let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state; let { middleshixundata, typepvisible, pages, search_tags, keyword, parsedid, newtag_level, newpalce, showQQ } = this.state;
// console.log(this.state.updata) // console.log(this.state.updata)
return ( return (
@ -418,7 +424,6 @@ class ShixunsIndex extends Component {
"" ""
} }
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar <ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)} Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist} allUpdatashixunlist={this.allUpdatashixunlist}
@ -432,13 +437,16 @@ class ShixunsIndex extends Component {
{...this.state} {...this.state}
/> />
{
showQQ ? <GotoQQgroup goshowqqgtounp={showQQ} setgoshowqqgtounp={this.setShowQQ.bind(this)}></GotoQQgroup> :
""
}
<ShixunCardList <ShixunCardList
ShixunsState={this.ShixunsState.bind(this)} onChangeLabel={this.ShixunsState.bind(this)}
ShixunsSwitch={this.ShixunsSwitch.bind(this)} ShixunsSwitch={this.ShixunsSwitch.bind(this)}
Shixunsupcircles={this.Shixunsupcircles.bind(this)} Shixunsupcircles={this.Shixunsupcircles.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist} onNewHandler={this.onNewHandler.bind(this)}
{...this.props} btnUrl={btnUrl}
{...this.state}
OnSearchInput={this.OnSearchInput.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)}
/> />
{/*下方图片*/} {/*下方图片*/}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

@ -0,0 +1,97 @@
import React from 'react';
import { getImageUrl, setImagesUrl, getUrl } from 'educoder';
import { Spin, Tooltip, Rate, Pagination } from 'antd';
import './shixunCss/shixunCard.scss';
export default ({ middleshixundata, pagination, typepvisible, pages, totalcount, shixunsPage }) => {
function onPageChange(number) {
shixunsPage(number)
}
return (
<div className="educontent mb80 shixun-card">
<Spin spinning={typepvisible} tip="正在获取相关数据..." size="large" style={{ marginTop: '15%' }}>
{middleshixundata === undefined ? "" : middleshixundata.length === 0 ? <div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getUrl("/images/educoder/nodata.png")} />
<p className="edu-nodata-p mb20">暂时还没有相关数据哦</p>
</div> : ""}
<div className="mb20 clearfix">
<div className="shixun_list_content">
<div className="square-list clearfix">
{middleshixundata === undefined || middleshixundata.length === 0 ? " " : middleshixundata.map((item, key) => {
return (
<div className="square-Item" key={item.id} id={item.id}>
{
item.tag_name === null ? "" :
<div className="tag-green">
<span className="tag-name"> {item.tag_name}</span>
</div>
}
{
item.is_jupyter === true ?
<div className="tag-org">
<p className="tag-org-name intermediatecenter"> <span className="tag-org-name-test">Jupyter</span></p>
</div>
: ""}
<div className={item.power === false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25" />
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<a href={"/shixuns/" + item.identifier + "/challenges"} className="square-img" target="_blank">
<img src={setImagesUrl(`${item.pic}`)} />
</a>
<div className="square-main">
<p className="task-hide">
<a href={"/shixuns/" + item.identifier + "/challenges"} className="justify color-grey-name" title={item.name} target="_blank">
{item.name}
</a>
</p>
<p className="clearfix mt8 ml-3">
<span className="rateYoStar fl" style={{ padding: '0px', height: '20px', lineHeight: '19px', cursor: 'default' }} title="">
<Rate key={key} allowHalf defaultValue={item.score_info === null ? 5 : item.score_info} disabled />
</span>
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt5">{item.score_info === null ? "5分" : item.score_info + "分"}</span>
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
{item.is_jupyter === false ? <Tooltip placement="bottom" title={"关卡"}>
<span className="mr10 fl squareIconSpan">
<i className="iconfont icon-shixunguanqia fl mr3"></i>{item.challenges_count}
</span>
</Tooltip> : ""}
<Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan" style={{ display: item.stu_num === 0 ? "none" : "block" }}>
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
</span>
</Tooltip>
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
</p>
</div>
</div>
)
})
}
</div>
<div className="both"></div>
<div className={"ml425"}
style={{ display: pagination ? "block" : "none" }}>
<Pagination defaultCurrent={1} current={pages} total={totalcount || 1299} type="mini" pageSize={16} onChange={onPageChange} />
</div>
</div>
</div>
</Spin>
</div>
)
}

@ -0,0 +1,61 @@
import React, { useState, Fragment } from 'react';
import { Input, Icon } from 'antd'
import './shixun-keyword-list.scss'
function AddonAfter({ callback }) {
return <a className='btn-search' onClick={callback}>
<Icon type='search' />
<span>搜索</span>
</a>
}
export default ({ onChangeLabel, btnUrl, OnSearchInput, onNewHandler, btnStyle =
{} }) => {
const [data, setData] = useState({
type: 'new',
keyword: '',
})
function onChangeTag(e) {
const id = e.target.id
setData({ ...data, type: id })
onChangeLabel(id, "desc")
}
function onSetKeyword(e) {
setData({ ...data, keyword: e.target.value })
}
function callback() {
if (keyword) {
OnSearchInput(keyword, true)
}
}
function onNewShiXun() {
if (onNewHandler) {
onNewHandler()
return
}
}
const { type, keyword } = data
return (
<Fragment>
<div className="wrapper">
<div className="educontent search-keyword-container">
<div className="btn-groups">
<a id='new' className={type === 'new' ? 'active' : ''} onClick={onChangeTag} title='最新'>最新</a>
<a id='hot' className={type === 'hot' ? 'active' : ''} onClick={onChangeTag} title='最热'>最热</a>
</div>
<div className='search-container'>
<Input onChange={onSetKeyword} value={keyword} addonAfter={<AddonAfter callback={callback} />} defaultValue="" placeholder='请输入课程名称进行搜索' />
</div>
</div>
<a className="btn-new" onClick={onNewShiXun} style={btnStyle}>
<img src={btnUrl} width={40} alt="创建实训" />
</a>
</div>
</Fragment>
)
}

@ -0,0 +1,70 @@
.search-keyword-container {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
padding: 20px 0;
.ant-input-group-addon {
background-color: #4CACFF;
}
.ant-input:focus+.ant-input-group-addon {
background-color: #4CACFF !important;
}
.search-container {
width: 320px;
}
.btn-search {
display: block;
text-align: center;
color: #fff;
span {
margin-left: 5px;
}
}
.btn-groups {
display: flex;
flex-flow: row nowrap;
align-items: center;
justify-content: start;
a {
display: block;
width: 60px;
border-radius: 14px;
text-align: center;
height: 28px;
line-height: 28px;
&:first-child {
margin-right: 20px;
}
color: #999;
background-color: #eee;
&.active {
color: #fff;
background-color: #4CACFF;
}
}
}
}
.wrapper {
position: relative;
}
.btn-new {
position: absolute;
width: 40px;
right: 39px;
top: 76px;
z-index: 10;
}

@ -0,0 +1,11 @@
import React from 'react'
export default ({
activeId, id, callback, text
}) => {
function onClickHandler() {
callback(id)
}
return (
<a className={id === activeId ? "shaiItems shixun_repertoire active" : "shaiItems shixun_repertoire"} onClick={onClickHandler}>{text}</a>
)
}

@ -0,0 +1,121 @@
import React, { useState, useEffect } from 'react'
import { Menu, Dropdown } from 'antd'
import 'antd/lib/style/index.css';
import '../shixunCss/shixun-search-bar.scss'
import axios from 'axios'
import A from './A.jsx'
const DiffObject = [
{ id: 0, text: '全部难度' },
{ id: 1, text: '初级' },
{ id: 2, text: '中级' },
{ id: 3, text: '中高级' },
{ id: 4, text: '高级' }
]
export default ({ StatusEnquiry, allUpdatashixunlist, Updatasearchlist }) => {
const [data, setData] = useState({
diff: 0,
searchValue: 'a',
navs: [],
searchKey: '',
childValue: ''
})
const { diff, searchValue, navs, childValue, searchKey } = data
function diffSearch(diff) {
setData({
...data,
diff
})
StatusEnquiry([{ 'type': 2 }, { 'value': diff }])
}
function onSearchAll() {
if (searchValue !== 'a') {
setData({ ...data, searchValue: 'a', childValue: '' })
allUpdatashixunlist()
}
}
function getChildValue(e) {
let id = e.target.name
let newid = e.target.id
if (id || newid) {
setData({ ...data, searchValue: newid })
Updatasearchlist([{ 'tag_level': 2 }, { 'tag_id': id }])
}
}
function getChildValues(e) {
let id = e.target.id;
let newid = e.target.name;
if (id || newid) {
setData({ ...data, searchValue: newid, childValue: id })
Updatasearchlist([{ 'tag_level': 3 }, { 'tag_id': id }])
}
}
function onSearchBranch(e) {
const id = e.target.value
if (id != searchValue) {
setData({ ...data, searchValue: id, childValue: '' })
Updatasearchlist([{ 'tag_level': 1 }, { 'tag_id': id }])
}
}
function overlayMenu(item, id) {
return <Menu>
{
item.map((list, k) => <Menu.Item>
<div className="mt5 subshaicontent-part" key={k}>
<a style={{ height: '20px' }} className={"mb15 shixun_repertoire color-dark"} name={list.id} id={id} onClick={getChildValue}>{list.name}</a>
<div className="sub-Item clearfix">
{
list.tags.map((tag, e) => <a className={childValue === tag.id ? "shixun_repertoire active" : "shixun_repertoire"} key={e} id={tag.id} name={id} rel="subshaicontent" onClick={getChildValues}>{tag.name}</a>
)
}
</div>
</div>
</Menu.Item>
)
}
</Menu>
}
useEffect(() => {
async function init() {
const response = await axios.get('/shixuns/menus.json')
setData({ ...data, navs: response.data })
}
init()
}, [])
return (
<div className="edu-back-white shixun-search-bar" >
<div className="educontent">
<div className="pt_b_26">
<div className="clearfix mb20 shaiContent">
<span className="shaiTitle fl">方向</span>
<div className="fl pr shaiAllItem">
<a className={searchValue === "a" ? "shaiItem shixun_repertoire active" : "shaiItem shixun_repertoire"} value="a" onClick={onSearchAll}>全部</a>
{
navs.map((item, key) => {
return (
<Dropdown overlay={overlayMenu(item.sub_repertoires, item.id)} key={key} placement={item.id < 4 ? "bottomRight" : item.id >= 8 ? "bottomLeft" : "bottomCenter"}>
<li key={item.id} className={searchValue == item.id ? "shaiItem shixun_repertoire active" : "shaiItem shixun_repertoire"} value={item.id} onClick={onSearchBranch}>
{item.name}
</li>
</Dropdown>
)
})
}
</div>
</div>
<div className="clearfix">
<span className="shaiTitle fl">筛选</span>
<div className="fl pr shaiAllItem mt1">
{DiffObject.map(item => <A {...item} callback={diffSearch} activeId={diff} />)}
</div>
</div>
</div>
</div>
</div>
)
}

@ -4,6 +4,7 @@
right: 3px; right: 3px;
top: 0px; top: 0px;
} }
.pt_b_26 { .pt_b_26 {
padding: 26px 0px; padding: 26px 0px;
} }
@ -11,13 +12,15 @@
.diffSelect { .diffSelect {
margin-left: 20px !important; margin-left: 20px !important;
} }
.ant-input-search-button { .ant-input-search-button {
/*margin-right: 10px;*/
border: 1px solid transparent; border: 1px solid transparent;
} }
.Mousebox { .Mousebox {
width: 800px !important; width: 800px !important;
} }
.subshaicontent a { .subshaicontent a {
height: 30px; height: 30px;
} }

@ -0,0 +1,78 @@
.iconfontShixunSearchBar {
z-index: 1000;
position: absolute;
right: 3px;
top: 0px;
}
.pt_b_26 {
padding: 26px 0px;
}
.diffSelect {
margin-left: 20px !important;
}
.ant-input-search-button {
border: 1px solid transparent;
}
.Mousebox {
width: 800px !important;
}
.subshaicontent a {
height: 30px;
}
.ant-dropdown {
width: 800px;
}
.shixun_repertoire {
cursor: pointer;
float: left;
margin-right: 20px;
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;
}
.shaiContent li.shaiItem {
padding: 0px 15px;
line-height: 32px;
height: 32px
}
.shaiTitle {
height: 32px;
line-height: 32px;
}
.shaiItems {
padding: 0px 15px;
line-height: 32px;
height: 32px;
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;
}

@ -9,9 +9,11 @@
.square-img { .square-img {
min-height: 210px; min-height: 210px;
} }
.task-hide { .task-hide {
margin-bottom: 0em; margin-bottom: 0em;
} }
.backFAFAFA { .backFAFAFA {
background: #FAFAFA; background: #FAFAFA;
} }
@ -22,6 +24,7 @@
text-align: center; text-align: center;
padding: 50px; padding: 50px;
} }
.next-loading { .next-loading {
margin-bottom: 5px; margin-bottom: 5px;
width: 100%; width: 100%;

@ -0,0 +1,101 @@
.ml350 {
margin-left: 40%;
}
.ml32 {
margin-left: 32%;
}
.square-img {
min-height: 210px;
}
.task-hide {
margin-bottom: 0em;
}
.backFAFAFA {
background: #FAFAFA;
}
.demo {
width: 500px;
background-color: #0dcecb;
text-align: center;
padding: 50px;
}
.next-loading {
margin-bottom: 5px;
width: 100%;
}
.next-rating-overlay .next-icon {
color: #FFA800 !important;
}
.custom-pagination {
display: inline-block;
margin-left: 10px;
}
.ml425 {
margin-left: 42.5%;
margin-top: 20px;
}
.shixun-card {
.edu-tab-con-box {
padding: 100px 0px;
}
.ant-modal-body .edu-tab-con-box {
padding: 0px !important;
}
img.edu-nodata-img {
margin: 40px auto 20px;
}
.square-list {
margin-top: 5px;
}
.tag-green {
position: absolute;
left: 10px;
bottom: 125px;
}
.tag-org {
position: absolute;
left: 0px;
top: 20px;
}
.tag-org-name {
width: 66px;
height: 28px;
background: #FF6802;
width: 66px;
height: 28px;
border-radius: 0px 20px 20px 0px;
}
.tag-org-name-test {
width: 45px;
height: 23px;
font-size: 14px;
color: #FFFFFF;
line-height: 19px;
margin-right: 6px;
}
.intermediatecenter {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
}

@ -26,7 +26,6 @@ import { notification } from "antd";
export const startProgramQuestion = (id, props) => { export const startProgramQuestion = (id, props) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const {searchParams} = getState().ojFormReducer; const {searchParams} = getState().ojFormReducer;
console.log(searchParams);
fetchStartProgram(id).then(res => { fetchStartProgram(id).then(res => {
const { status, data } = res; const { status, data } = res;
if (status === 200) { if (status === 200) {
@ -50,7 +49,7 @@ export const startProgramQuestion = (id, props) => {
// console.log(path); // console.log(path);
// props.history.push(`/myproblems/${identifier}`); // props.history.push(`/myproblems/${identifier}`);
props.history.push({ props.history.push({
pathname: `/myproblems/${identifier}?${searchParams}`, pathname: `/myproblems/${identifier}`,
}); });
} }
} }

@ -142,7 +142,7 @@ export const validateOjForm = (props, type, cb) => {
let validateResult = emptyValidate(key, value); let validateResult = emptyValidate(key, value);
const errMsg = validateResult[key].errMsg; const errMsg = validateResult[key].errMsg;
if (errMsg) { if (errMsg) {
hasSuccess = false; // hasSuccess = false;
} else { } else {
// 唯一性校验 // 唯一性校验
const bool = testCases.some((item, j) => { const bool = testCases.some((item, j) => {
@ -154,7 +154,7 @@ export const validateOjForm = (props, type, cb) => {
}); });
if (bool) { if (bool) {
hasSuccess = false; // hasSuccess = false;
validateResult = { validateResult = {
[key]: { [key]: {
validateStatus: 'error', validateStatus: 'error',
@ -168,13 +168,13 @@ export const validateOjForm = (props, type, cb) => {
tcValidResult.push(tempObj); tcValidResult.push(tempObj);
}); });
if (testCases.length === 0) { // if (testCases.length === 0) {
hasSuccess = false; // hasSuccess = false;
notification['error']({ // notification['error']({
message: '提示', // message: '提示',
description: '测试用例必须输入!' // description: '测试用例必须输入!'
}); // });
} // }
// if (!code) { // if (!code) {
// hasSuccess = false; // hasSuccess = false;

@ -12,14 +12,15 @@ import { fetchStaticList } from "../../services/staticService";
export const staticList = (id) => { export const staticList = (id) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const { params, total_count, other_info } = getState().staticReducer; const { params, total_count, other_info } = getState().staticReducer;
console.log('统计数据=====>>>>>', params);
if (total_count !== 0 && total_count === other_info.length) return; // if (total_count !== 0 && total_count === other_info.length) return;
fetchStaticList(id, params).then(res => { fetchStaticList(id, params).then(res => {
// console.log('统计数据=====>>>>>', res); // console.log('统计数据=====>>>>>', res);
const {data} = res; const {data} = res;
if (data.status === 0) { if (data.status === 0) {
dispatch({ dispatch({
type: types.GET_STATIC_INFO, type: types.GET_STATIC_INFO,
other_info:data.data.other_info,
payload: data.data payload: data.data
}); });
} }

@ -38,12 +38,14 @@ const initalState = {
const staticReducer = (state = initalState, action) => { const staticReducer = (state = initalState, action) => {
const { payload = {}, type } = action; const { payload = {}, type } = action;
const {subject_info, other_info = [], total = {}, total_count} = payload; const {subject_info, other_info = [], total = {}, total_count} = payload;
switch (type) { switch (type) {
case types.GET_STATIC_INFO: case types.GET_STATIC_INFO:
return { return {
...state, ...state,
subject_info, subject_info,
other_info: state.other_info.concat(other_info), other_info,
// other_info: state.other_info.concat(other_info),
total, total,
total_count, total_count,
params: Object.assign({}, state.params, { page: state.params.page + 1 }) params: Object.assign({}, state.params, { page: state.params.page + 1 })

Loading…
Cancel
Save