video_transcode
harry 5 years ago
commit 9698cc1334

@ -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

File diff suppressed because it is too large Load Diff

@ -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

@ -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

@ -0,0 +1,22 @@
#coding=utf-8
desc "纠正学生实训耗时不准的问题"
namespace :shixuns do
task correct_the_shixun_cost_time: :environment do
puts "myshixun_id: #{ENV['myshixun_id']}"
if ENV['myshixun_id'].present?
myshixun = Myshixun.find(ENV['myshixun_id'])
myshixun.games.where(status: 2).each do |game|
puts "open_time: #{game.open_time.to_i}"
puts "end_time: #{game.end_time.to_i}"
puts "game_id: #{game.id}"
cost_time = game.end_time.to_i - game.open_time.to_i
puts "cost_time: #{cost_time}"
game.update_attributes!(cost_time: cost_time)
end
end
end
end

@ -2,9 +2,10 @@ desc "统计每个学校使用数据"
namespace :static_all do namespace :static_all do
task :repo => :environment do task :repo => :environment do
school_alls = School.includes(:courses, user_extensions: :user).all school_alls = School.includes(courses: [:homework_commons, :attachments, :course_videos], user_extensions: :user).all
proc_num = ENV['processes'].blank? ? 5 : ENV['processes'].to_i
school_alls.find_in_batches(batch_size: 50) do |schools| school_alls.find_in_batches(batch_size: 50) do |schools|
Parallel.each(schools, in_processes: 5) do |school| Parallel.each(schools, in_processes: proc_num) do |school|
puts("school_id: #{school.id}") puts("school_id: #{school.id}")
data = Schools::SchoolStatisticService.new(school) data = Schools::SchoolStatisticService.new(school)
sta_all = StaAll.find_or_initialize_by(school_id: school.id) sta_all = StaAll.find_or_initialize_by(school_id: school.id)

@ -221,7 +221,7 @@ 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(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}`)

@ -775,16 +775,16 @@ class App extends Component {
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} />)
} /> } />
@ -803,7 +803,7 @@ 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} />)
} /> } />

@ -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,17 +949,15 @@ class Coursesleftnav extends Component{
{/* ""*/} {/* ""*/}
{/*}*/} {/*}*/}
{ <style>
Navmodalnametype===true?<style> {
{
` `
body { body {
width: calc(100%) !important; width: calc(100%) !important;
} }
` `
} }
</style>:"" </style>
}
<Modal <Modal
keyboard={false} keyboard={false}
title={Navmodalname} title={Navmodalname}

@ -269,13 +269,19 @@ class Addcourses extends Component{
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="公开设置"

@ -1,7 +1,7 @@
/* /*
* @Description: 新建或编辑任务 * @Description: 新建或编辑任务
* @Author: tangjiang * @Author: tangjiang
* @Date: 2019-11-15 16:38:34 * @Date: 2019-11-15 16:38:34
* @Last Modified by: tangjiang * @Last Modified by: tangjiang
* @Last Modified time: 2019-11-19 23:23:41 * @Last Modified time: 2019-11-19 23:23:41
*/ */
@ -20,7 +20,7 @@ import actions from '../../../redux/actions';
// import {ModalConfirm} from '../../../common/components/ModalConfirm'; // import {ModalConfirm} from '../../../common/components/ModalConfirm';
const NewOrEditTask = (props) => { const NewOrEditTask = (props) => {
const { const {
publishLoading, publishLoading,
handlePublish, handlePublish,
// testCases = [], // testCases = [],
@ -41,7 +41,7 @@ const NewOrEditTask = (props) => {
courseQuestions courseQuestions
// updateTestAndValidate, // updateTestAndValidate,
} = props; } = props;
// 表单提交 // 表单提交
const handleSubmitForm = () => { const handleSubmitForm = () => {
// 改变loading状态 // 改变loading状态
@ -53,7 +53,7 @@ const NewOrEditTask = (props) => {
props.handleFormSubmit(props); // 提交表单 props.handleFormSubmit(props); // 提交表单
} }
}; };
useEffect(() => { useEffect(() => {
// 获取用户信息 // 获取用户信息
getUserInfoForNew(); getUserInfoForNew();
@ -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}`);
} }
// 发布 // 发布
@ -163,8 +163,8 @@ const NewOrEditTask = (props) => {
onClick={handleClickCancel} onClick={handleClickCancel}
style={{ background: '#666666', color: '#fff', border: 'none' }} style={{ background: '#666666', color: '#fff', border: 'none' }}
>取消</Button> >取消</Button>
<Button <Button
type="primary" type="primary"
loading={submitLoading} loading={submitLoading}
onClick={handleSubmitForm} onClick={handleSubmitForm}
>保存</Button> >保存</Button>
@ -174,14 +174,14 @@ const NewOrEditTask = (props) => {
// 发布/模拟挑战 // 发布/模拟挑战
const renderPubOrFight = () => { const renderPubOrFight = () => {
const pubButton = isPublish const pubButton = isPublish
? (<Button ? (<Button
style={{ background: 'rgba(102,102,102,1)', border: 'none' }} style={{ background: 'rgba(102,102,102,1)', border: 'none' }}
type="primary" type="primary"
loading={publishLoading} loading={publishLoading}
onClick={handleClickCancelPublish} onClick={handleClickCancelPublish}
>撤销发布</Button>) >撤销发布</Button>)
: (<Button : (<Button
type="primary" type="primary"
loading={publishLoading} loading={publishLoading}
onClick={handleClickPublish} onClick={handleClickPublish}
>立即发布</Button>); >立即发布</Button>);
@ -191,13 +191,13 @@ const NewOrEditTask = (props) => {
) : ( ) : (
<Button type="primary" onClick={imitationChallenge}>模拟挑战</Button> <Button type="primary" onClick={imitationChallenge}>模拟挑战</Button>
); );
if (isPublish) { if (isPublish) {
return ( return (
<React.Fragment> <React.Fragment>
{pubButton} {pubButton}
<Button <Button
type="primary" type="primary"
loading={submitLoading} loading={submitLoading}
onClick={handleSubmitForm} onClick={handleSubmitForm}
>保存</Button> >保存</Button>
@ -207,8 +207,8 @@ const NewOrEditTask = (props) => {
} else { } else {
return ( return (
<React.Fragment> <React.Fragment>
<Button <Button
type="primary" type="primary"
loading={submitLoading} loading={submitLoading}
onClick={handleSubmitForm} onClick={handleSubmitForm}
>保存</Button> >保存</Button>
@ -217,7 +217,7 @@ const NewOrEditTask = (props) => {
</React.Fragment> </React.Fragment>
); );
} }
} }
// 渲染退出 // 渲染退出
@ -296,7 +296,7 @@ const mapDispatchToProps = (dispatch) => ({
clearOJFormStore: () => dispatch(actions.clearOJFormStore()), clearOJFormStore: () => dispatch(actions.clearOJFormStore()),
// 按钮状态 // 按钮状态
changeSubmitLoadingStatus: (flag) => dispatch(actions.changeSubmitLoadingStatus(flag)), changeSubmitLoadingStatus: (flag) => dispatch(actions.changeSubmitLoadingStatus(flag)),
// 发布按钮状态 // 发布按钮状态
changePublishLoadingStatus: (flag) => dispatch(actions.changePublishLoadingStatus(flag)), changePublishLoadingStatus: (flag) => dispatch(actions.changePublishLoadingStatus(flag)),
// 测试用例及验证 // 测试用例及验证
updateTestAndValidate: (obj) => dispatch(actions.updateTestAndValidate(obj)), updateTestAndValidate: (obj) => dispatch(actions.updateTestAndValidate(obj)),

@ -1,7 +1,7 @@
/* /*
* @Description: 添加测试用例 * @Description: 添加测试用例
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-21 09:19:38 * @Date: 2019-11-21 09:19:38
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-27 10:37:41 * @LastEditTime : 2019-12-27 10:37:41
@ -19,14 +19,14 @@ const AddTestDemo = (props) => {
const { const {
// key, // key,
// onSubmitTest, // onSubmitTest,
onDeleteTest, onDeleteTest,
testCase, testCase,
testCaseValidate, testCaseValidate,
isOpen isOpen
} = props; } = props;
// const [isEditor, setIsEditor] = useState(false); // 是否是编辑 // const [isEditor, setIsEditor] = useState(false); // 是否是编辑
// 删除操作 // 删除操作
const handleDeletePanel = (e) => { const handleDeletePanel = (e) => {
// console.log('点击的删除按钮') // console.log('点击的删除按钮')
@ -63,7 +63,7 @@ const AddTestDemo = (props) => {
const value = e.target.value; const value = e.target.value;
testCaseOutputChange(value, index); testCaseOutputChange(value, index);
} }
// 右侧删除图标 // 右侧删除图标
const genExtra = () => ( const genExtra = () => (
<Icon <Icon
@ -127,7 +127,7 @@ const AddTestDemo = (props) => {
* 文本输入框可编辑的情况 * 文本输入框可编辑的情况
* 1. 新增时 * 1. 新增时
* 2. isAdd false isEditor 为true * 2. isAdd false isEditor 为true
* @param {*} testCase * @param {*} testCase
*/ */
// const isDisabled = (testCase) => { // const isDisabled = (testCase) => {
// return !testCase.isAdd && !isEditor; // return !testCase.isAdd && !isEditor;
@ -138,21 +138,19 @@ const AddTestDemo = (props) => {
// defaultActiveKey: [isOpen ? '1' : ''] // defaultActiveKey: [isOpen ? '1' : '']
// }; // };
// console.log(activePane); // console.log(activePane);
// 切换手风琴 // 切换手风琴
const handleChangeCollapse = () => { const handleChangeCollapse = () => {
const {index, updateOpenTestCaseIndex} = props; const {index, updateOpenTestCaseIndex} = props;
updateOpenTestCaseIndex(index); updateOpenTestCaseIndex(index);
} }
return ( return (
<Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}> <Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}>
<Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1"> <Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1">
<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

@ -119,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 = () => {
@ -129,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,9 +12,13 @@ class Bottomsubmit extends Component {
cannelfun = () => { cannelfun = () => {
// window.location.href= // window.location.href=
if(this.props.Cohetepaperbool===true){ try {
this.props.setCohetepaperbool(false); if(this.props.Cohetepaperbool===true){
}else { this.props.setCohetepaperbool(false);
}else {
this.props.history.replace(this.props.url);
}
}catch (e) {
this.props.history.replace(this.props.url); this.props.history.replace(this.props.url);
} }

@ -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({});
@ -212,10 +212,12 @@ const App = (props) => {
sorter: (a, b) => a.cost_time - b.cost_time sorter: (a, b) => a.cost_time - b.cost_time
} }
]; ];
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) => ({

@ -729,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="";
@ -743,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,
@ -758,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);
@ -845,7 +869,7 @@ class NewMyShixunModel extends Component {
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=(bool)=>{
var item_idsdata=[]; var item_idsdata=[];
var arr= this.state.Contentdata.items; var arr= this.state.Contentdata.items;
@ -853,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{
//未选用 //未选用
@ -866,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);
@ -878,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),
} }
this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages:true, if(bool===false){
}) this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages:true,
})
}else{
this.NOgetitem_baskets(data);
this.setState({
selectallquestionsonthispages:false,
})
}
} }
//全选的状态 //全选的状态
@ -1040,7 +1079,7 @@ class NewMyShixunModel 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)}

@ -236,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);
@ -418,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>
: :
@ -429,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>
} }
@ -461,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>
) )

@ -463,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) => {

@ -659,9 +659,37 @@ class Question extends Component {
}) })
} }
// 不选用 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";
@ -738,7 +766,7 @@ class Question extends Component {
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=(bool)=>{
var item_idsdata=[]; var item_idsdata=[];
var arr= this.state.Contentdata.items; var arr= this.state.Contentdata.items;
@ -746,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){
@ -759,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);
@ -770,10 +801,18 @@ class Question extends Component {
const data={ const data={
item_ids:item_idsdata item_ids:item_idsdata
} }
this.getitem_baskets(data); if(bool===false){
this.setState({ this.getitem_baskets(data);
selectallquestionsonthispages:true, this.setState({
}) selectallquestionsonthispages:true,
})
}else{
this.NOgetitem_baskets(data);
this.setState({
selectallquestionsonthispages:false,
})
}
} }
//全选的状态 //全选的状态
@ -901,6 +940,15 @@ class Question extends Component {
return ( return (
<div className="newMain clearfix" ref={this.saveContainer}> <div className="newMain clearfix" ref={this.saveContainer}>
<style>{
`
.newHeaders{
position: fixed;
top: 0px;
z-index: 999 !important;
}
`
}</style>
{ {
mydisplay===true? mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} /> <Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
@ -927,11 +975,7 @@ class Question extends Component {
<style> <style>
{ {
` `
.newHeaders{
position: fixed;
top: 0px;
z-index: 999 !important;
}
.ant-drawer { .ant-drawer {
z-index: 800 !important; z-index: 800 !important;
} }
@ -943,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: "81px" 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()}
@ -1016,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)}
@ -1047,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;
} }
@ -1095,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>
} }
@ -1106,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>
} }
@ -1117,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>
} }
@ -1128,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>
} }
@ -1139,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>
} }
@ -1150,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>
} }
@ -1161,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>
} }

@ -312,7 +312,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增单选题成功`); // this.props.showNotification(`新增单选题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -324,7 +324,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑单选题成功`); // this.props.showNotification(`编辑单选题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
@ -392,7 +392,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增多选题成功`); // this.props.showNotification(`新增多选题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
@ -406,7 +406,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑多选题成功`); // this.props.showNotification(`编辑多选题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
@ -461,7 +461,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`新增判断题成功`); // this.props.showNotification(`新增判断题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -474,7 +474,7 @@ class Questionitem_banks extends Component {
if (result.data.status == 0) { if (result.data.status == 0) {
// this.props.showNotification(`编辑判断题成功`); // this.props.showNotification(`编辑判断题成功`);
this.restricte=true; this.restricte=true;
this.props.history.replace('/question'); this.props.history.replace('/problemset');
} }
}).catch((error) => { }).catch((error) => {
@ -561,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>
@ -627,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={'/question'}></Bottomsubmit> onSubmits={() => this.preservation()} url={'/problemset'}></Bottomsubmit>
} }
</div> </div>
) )

@ -229,22 +229,9 @@ class ChoquesEditor extends Component{
var texts; var texts;
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if(this.isNull(_text)===true){
return
}
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
texts=JSON.stringify(value);
}catch (e) {
texts=""; texts="";
}
} else { } else {
if(_text.length>=500){ if(_text.length>=500){
var result = _text.substring(0,450); var result = _text.substring(0,450);
@ -298,66 +285,46 @@ class ChoquesEditor extends Component{
// 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(this.isNull(_text)===true){
this.setState({
question_titleysl:""
})
return
}
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)=>{
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if(this.isNull(_text)===true){
this.setState({
question_titlesysl:""
})
return
}
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 {
let texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
} }
} }

@ -201,7 +201,7 @@ 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() {
@ -348,11 +348,12 @@ class Contentpart extends Component {
.xaxisreverseorder .ant-input-group-addon{ .xaxisreverseorder .ant-input-group-addon{
width: 48px !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;
@ -362,7 +363,7 @@ class Contentpart extends Component {
.xaxisreverseorder .ant-popover-inner-content { .xaxisreverseorder .ant-popover-inner-content {
padding:0px !important; padding:0px !important;
} }
` `
} }
</style> </style>
@ -440,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>

@ -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>

@ -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>

@ -303,72 +303,50 @@ class JudquestionEditor extends Component{
// 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(this.isNull(_text)===true){
this.setState({
question_titleysl:""
})
return
}
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
this.setState({ this.setState({
question_titleysl:JSON.stringify(value) question_titleysl:""
})
// console.log("空");
} else {
// 提交到后台的内容需要处理一下;
try {
let texts = JSON.stringify(value);
this.setState({
question_titleysl:texts
}) })
}catch (e) { }catch (e) {
this.setState({ this.setState({
question_titleysl:"" question_titleysl:""
}) })
} }
// console.log("空");
} else {
// console.log("有");
// 提交到后台的内容需要处理一下;
let texts="";
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(this.isNull(_text)===true){
this.setState({
question_titlesysl:""
})
return
}
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() {

@ -25,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) {
@ -233,10 +255,10 @@ class Listjihe extends Component {
}catch (e) { }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" : " borderwds pd20 mb20 listjihecolors"}> className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "borderwds pd20 mb20 listjihecolors"}>
{/*顶部*/} {/*顶部*/}
{ {
mydisplay===true? mydisplay===true?
@ -301,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"
}} > }} >
@ -310,11 +333,11 @@ class Listjihe extends Component {
</div> </div>
{ {
items.item_type==="PROGRAM"? items.item_type==="PROGRAM"?
<a onClick={()=>this.seturls(`/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 === "" ?
@ -485,7 +508,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a onClick={()=>this.seturls(`/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>
@ -495,7 +518,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a onClick={()=>this.seturls(`/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>

@ -117,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"&&swsilan===true? 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()} >

@ -140,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()
@ -244,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;
@ -251,18 +258,9 @@ class SingleEditor extends Component{
var texts; var texts;
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if(this.isNull(_text)===true){
return
}
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
try {
texts= JSON.stringify(value)
}catch (e) {
texts=""; texts="";
}
} else { } else {
if(_text.length>=500){ if(_text.length>=500){
var result = _text.substring(0,450); var result = _text.substring(0,450);
@ -315,61 +313,47 @@ class SingleEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if(this.isNull(_text)===true){
this.setState({
question_titleysl:""
})
return
}
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 {
try {
let texts = JSON.stringify(value); let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts===undefined|| null?"":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(this.isNull(_text)===true){
this.setState({
question_titlesysl:""
})
return
}
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) => {

@ -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;
}

@ -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;

@ -73,7 +73,7 @@ class Contentpart extends Component {
} }
//跳转人工组卷 //跳转人工组卷
Mantegeneration=()=>{ Mantegeneration=()=>{
this.props.history.push('/question'); this.props.history.push('/problemset');
} }
@ -368,18 +368,24 @@ class Contentpart extends Component {
<div className="xaxisreverseorder" style={{ <div className="xaxisreverseorder" style={{
width:"50%" width:"50%"
}}> }}>
<a onClick={()=>this.xinzenw('/problemset')}>
<a onClick={()=>this.xinzenw('/Integeneration')}>
<div className="newbutoonss"> <div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p>
</div>
</a>
<a onClick={()=>this.xinzenw('/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>
:"" :""
} }

@ -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) => {

@ -361,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;

@ -1075,21 +1075,21 @@ submittojoinclass=(value)=>{
` `
} }
</style> </style>
{ {/*{*/}
Periofters===true? {/* 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">*/}
<div style={{ {/* <div style={{*/}
color:"#fff" {/* color:"#fff"*/}
}}> {/* }}>*/}
题库 {/* 题库*/}
</div> {/* </div>*/}
</div> {/* </div>*/}
</Popover> {/* </Popover>*/}
</li> {/* </li>*/}
:"" {/* :""*/}
} {/*}*/}
<li <li
@ -1267,7 +1267,9 @@ submittojoinclass=(value)=>{
{/* p 老师 l 学生 */} {/* p 老师 l 学生 */}
{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,45 +75,54 @@ class RepositoryAddFileupload_files extends Component {
}; };
onAttachmentRemove=(info)=>{ onAttachmentRemove=(info)=>{
let shixunId = this.props.match.params.shixunId; console.log(info);
let {message,filspath}=this.state; if(info.response){
if(message===""||message===undefined){ let shixunId = this.props.match.params.shixunId;
this.props.showNotification('删除文件请先填写提交信息'); let {message,filspath}=this.state;
return if(message===""||message===undefined){
} this.props.showNotification('删除文件请先填写提交信息');
return;
}
let matchpath =this.props.match.path; let matchpath =this.props.match.path;
let Repositoryflag =undefined; let Repositoryflag =undefined;
if( matchpath.indexOf("repository")>-1){ if( matchpath.indexOf("repository")>-1){
Repositoryflag =undefined; Repositoryflag =undefined;
} }
if(matchpath.indexOf("secret_repository")>-1){ if(matchpath.indexOf("secret_repository")>-1){
Repositoryflag =true; Repositoryflag =true;
} }
let newfilspath=filspath; let newfilspath=filspath;
if(newfilspath===""){ if(newfilspath===""){
newfilspath=info.name newfilspath=info.name
}else{ }else{
newfilspath=filspath+"/"+info.name newfilspath=filspath+"/"+info.name
} }
const url = `/shixuns//${shixunId}/delete_git_file.json`; const url = `/shixuns//${shixunId}/delete_git_file.json`;
axios.delete(url, { data: { axios.delete(url, { data: {
path:newfilspath, path:newfilspath,
message:message, message:message,
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,17 +1,17 @@
/* /*
* @Description: * @Description:
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-27 13:42:11 * @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-10 18:17:00 * @LastEditTime : 2020-02-10 18:17:00
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { import {
fetchStartProgram, fetchStartProgram,
fetchUserProgramDetail, fetchUserProgramDetail,
fetchDebuggerCode, fetchDebuggerCode,
fetchCodeSubmit, fetchCodeSubmit,
fetchUserCommitRecord, fetchUserCommitRecord,
fetchUserCommitRecordDetail, fetchUserCommitRecordDetail,
@ -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}`,
}); });
} }
} }
@ -90,7 +89,7 @@ export const getUserProgramDetail = (identifier, type) => {
type: types.SAVE_USE_TEST_CASE_VALUE, type: types.SAVE_USE_TEST_CASE_VALUE,
payload: data.test_case || {} payload: data.test_case || {}
}); });
// 代码是否更新 // 代码是否更新
let _modify_code = false; let _modify_code = false;
if (data.hack) { if (data.hack) {
_modify_code = data.hack.modify_code; _modify_code = data.hack.modify_code;
@ -145,7 +144,7 @@ export const saveUserCodeForInterval = (identifier, code) => {
/** /**
* @description 保存或更新之前先更新代码 * @description 保存或更新之前先更新代码
* @param {*} identifier * @param {*} identifier
* @param {*} inputValue 输入值: 自定义 | 系统返回的 * @param {*} inputValue 输入值: 自定义 | 系统返回的
* @param {*} type 测评类型 debug | submit * @param {*} type 测评类型 debug | submit
*/ */
@ -157,7 +156,7 @@ export const updateCode = (identifier, inputValue, type) => {
fetchUpdateCode(identifier, { fetchUpdateCode(identifier, {
code: Base64.encode(userCode) code: Base64.encode(userCode)
}).then(res => { }).then(res => {
// 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现 // 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现
// TODO 需要优化 // TODO 需要优化
if (res.data.status === 401) { if (res.data.status === 401) {
dispatch({ // 改变 loading 值 dispatch({ // 改变 loading 值
@ -187,7 +186,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus,
let count = 1; let count = 1;
/** /**
* @param {*} excuteTime 执行时间 * @param {*} excuteTime 执行时间
* @param {*} finalTime 总时间 * @param {*} finalTime 总时间
* @param {*} count 执行次数 * @param {*} count 执行次数
* @param {*} timer 定时器 * @param {*} timer 定时器
*/ */
@ -199,7 +198,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus,
if (+status === 0 || (excuteTime / 1000) > (finalTime + 1)) { if (+status === 0 || (excuteTime / 1000) > (finalTime + 1)) {
clearInterval(timer); // 清除定时器 clearInterval(timer); // 清除定时器
timer = null; timer = null;
let returnData = null; let returnData = null;
if (status === 1) { // 结果没有返回 if (status === 1) { // 结果没有返回
returnData = { returnData = {
error_line: -1, error_line: -1,
@ -221,7 +220,7 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus,
payload: { payload: {
type, type,
data: returnData data: returnData
} }
}); });
if (!type || type === 'debug') { if (!type || type === 'debug') {
dispatch({ // 改变 loading 值 dispatch({ // 改变 loading 值
@ -287,13 +286,13 @@ export const codeEvaluate = (dispatch, identifier, type, time_limit, hackStatus,
/** /**
* @description 调试代码 * @description 调试代码
* @param {*} identifier * @param {*} identifier
* @param {*} inputValue 输入值: 自定义 | 系统返回的 * @param {*} inputValue 输入值: 自定义 | 系统返回的
* @param {*} type 测评类型 debug | submit * @param {*} type 测评类型 debug | submit
*/ */
export const debuggerCode = (identifier,value, type) => { export const debuggerCode = (identifier,value, type) => {
return (dispatch, getState) => { return (dispatch, getState) => {
// 调用之前 先保存 code // 调用之前 先保存 code
// TODO // TODO
// console.log(identifier, value); // console.log(identifier, value);
const { hack } = getState().ojForUserReducer; const { hack } = getState().ojForUserReducer;
@ -398,7 +397,7 @@ export const changeUserCodeTab = (key) => {
/** /**
* @description 用户提交代码 先调用保存代码接口再调提交接口成功后调用调试接口 * @description 用户提交代码 先调用保存代码接口再调提交接口成功后调用调试接口
* @param {*} identifier * @param {*} identifier
*/ */
export const submitUserCode = (identifier, inputValue, type) => { export const submitUserCode = (identifier, inputValue, type) => {
return (dispatch, getState) => { return (dispatch, getState) => {
@ -430,7 +429,7 @@ export const submitUserCode = (identifier, inputValue, type) => {
fetchUpdateCode(identifier, { fetchUpdateCode(identifier, {
code: userCode code: userCode
}).then(res => { }).then(res => {
// 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现 // 是否更新了代码, 目的是当代码没有更新时不调用更新代码接口,目录没有实现
// TODO 需要优化 // TODO 需要优化
if (res.data.status === 401) { if (res.data.status === 401) {
dispatch({ dispatch({
@ -495,7 +494,7 @@ export const saveOpacityType = (type) => {
type: types.CLICK_OPERATE_TYPE, type: types.CLICK_OPERATE_TYPE,
payload: type payload: type
} }
} }
export const clearOjForUserReducer = () => { export const clearOjForUserReducer = () => {

@ -1,14 +1,14 @@
/* /*
* @Description: 开发者社区编辑模块 * @Description: 开发者社区编辑模块
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-20 16:35:46 * @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-11 16:29:32 * @LastEditTime : 2020-02-11 16:29:32
*/ */
import types from './actionTypes'; import types from './actionTypes';
import CONST from '../../constants'; import CONST from '../../constants';
import { import {
fetchPostOjForm, fetchPostOjForm,
fetchGetOjById, fetchGetOjById,
publishTask, publishTask,
@ -18,7 +18,7 @@ import {
} from '../../services/ojService'; } from '../../services/ojService';
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import { notification } from 'antd'; import { notification } from 'antd';
import { toStore } from 'educoder'; import { toStore } from 'educoder';
// import { startProgramQuestion } from '' // import { startProgramQuestion } from ''
const { jcLabel } = CONST; const { jcLabel } = CONST;
// 表单字段映射 // 表单字段映射
@ -124,7 +124,7 @@ export const validateOjForm = (props, type, cb) => {
hasSuccess = false; hasSuccess = false;
dispatch( dispatch(
{ {
type: maps[key].type, type: maps[key].type,
payload: payloadInfo(key, value, errMsg, validateResult[key]) payload: payloadInfo(key, value, errMsg, validateResult[key])
} }
) )
@ -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,14 +168,14 @@ 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;
// notification['error']({ // notification['error']({
@ -300,7 +300,7 @@ export const validateOjForm = (props, type, cb) => {
cb && cb(); cb && cb();
} else { } else {
const {identifier} = res.data; const {identifier} = res.data;
// message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功'); // message.success(paramsObj['submitType'] === 'update' ? '更新成功' : '保存成功');
notification.success({ notification.success({
message: '提示', message: '提示',
@ -311,7 +311,7 @@ export const validateOjForm = (props, type, cb) => {
type: types.SAVE_OJ_FORM_ID, type: types.SAVE_OJ_FORM_ID,
payload: identifier payload: identifier
}); });
// console.log(identifier , props.identifier); // console.log(identifier , props.identifier);
if (identifier || props.identifier) { if (identifier || props.identifier) {
dispatch(getOJFormById(identifier || props.identifier)); dispatch(getOJFormById(identifier || props.identifier));
@ -443,7 +443,7 @@ export const saveOjFormCode = (value) => {
payload: value payload: value
}; };
} }
// 验证任务名称 // 验证任务名称
export const validateOJName = (value) => { export const validateOJName = (value) => {
const validate = emptyValidate('name', value)['name']; const validate = emptyValidate('name', value)['name'];
const errMsg = validate.errMsg; const errMsg = validate.errMsg;
@ -735,9 +735,9 @@ export const saveKnowledge = (values) => {
} }
/** /**
* 新增时跳转到OJ时带的默认参数: * 新增时跳转到OJ时带的默认参数:
* @param {}} params * @param {}} params
* { * {
* difficult: '', // 难易度 * difficult: '', // 难易度
* sub_discipline_id: '' // 课程方向 * sub_discipline_id: '' // 课程方向
* tag_discipline_id [] 知识点 * tag_discipline_id [] 知识点
@ -767,7 +767,7 @@ export const tagDisciplines = (params) => {
} }
}); });
} }
} }
// 保存地址栏参数 // 保存地址栏参数
export const saveSearchParams = (params) => { export const saveSearchParams = (params) => {

@ -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 })

@ -1,7 +1,7 @@
/* /*
* @Description: 开发者社区接口 * @Description: 开发者社区接口
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-20 10:55:38 * @Date: 2019-11-20 10:55:38
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 15:23:19 * @LastEditTime : 2020-01-07 15:23:19
@ -34,7 +34,7 @@ export async function fetchPostOjForm (paramsObj) {
// if (identifier) { // if (identifier) {
// return axios.post(url, params); // return axios.post(url, params);
// } else { // } else {
// return // return
// } // }
return identifier ? axios.put(url, params) : axios.post(url, params); return identifier ? axios.put(url, params) : axios.post(url, params);
} }
@ -136,7 +136,7 @@ export async function fetchUploadImage (file) {
export async function fetchUploadImageUrl (id) { export async function fetchUploadImageUrl (id) {
const url = `/attachments/${id}`; const url = `/attachments/${id}`;
return axios.get(url); return axios.get(url);
} }
// 添加笔记 // 添加笔记
export async function fetchAddNotes (identifier, params) { export async function fetchAddNotes (identifier, params) {

Loading…
Cancel
Save