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

video_transcode
杨树林 5 years ago
commit 63f4eb33b3

@ -793,37 +793,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="/question/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="/question/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="/question/: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 +835,15 @@ class App extends Component {
(props) => (<Developer {...this.props} {...props} {...this.state} />) (props) => (<Developer {...this.props} {...props} {...this.state} />)
}/> }/>
{/*<Route path="/question"*/} <Route path="/question"
{/* 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,7 +1,7 @@
/* /*
* @Description: 学员学习 * @Description: 学员学习
* @Author: tangjiang * @Author: tangjiang
* @Github: * @Github:
* @Date: 2019-11-23 10:53:19 * @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-10 18:24:01 * @LastEditTime : 2020-02-10 18:24:01
@ -37,7 +37,7 @@ function StudentStudy (props) {
} = props; } = props;
const { const {
match: { params }, match: { params },
getUserProgramDetail, getUserProgramDetail,
saveUserProgramIdentifier saveUserProgramIdentifier
} = props; } = props;
@ -48,7 +48,18 @@ function StudentStudy (props) {
// 保存当前的id // 保存当前的id
saveUserProgramIdentifier(id); saveUserProgramIdentifier(id);
// startProgramQuestion(id); // startProgramQuestion(id);
getUserProgramDetail(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);
const $searchs = window.location.search && window.location.search.substring(1); const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) { if ($searchs) {
const $params = $searchs.split('&') || []; const $params = $searchs.split('&') || [];
@ -110,7 +121,7 @@ function StudentStudy (props) {
props.clearOjForUserReducer(); props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit?{searchParams}`); props.history.push(`/problems/${identifier}/edit?{searchParams}`);
} }
// 处理退出 // 处理退出
const handleClickQuit = () => { const handleClickQuit = () => {
// 退出时,清空内容 // 退出时,清空内容
props.clearOjForUserReducer(); props.clearOjForUserReducer();
@ -136,9 +147,9 @@ function StudentStudy (props) {
</div> </div>
<div className={'study_quit'}> <div className={'study_quit'}>
{/* to={`/problems/${_hack_id}/edit`} */} {/* to={`/problems/${_hack_id}/edit`} */}
<span <span
style={{ display: userInfo.hack_manager ? 'inline-block' : 'none' }} style={{ display: userInfo.hack_manager ? 'inline-block' : 'none' }}
onClick={() => handleClickEditor(hack.identifier)} onClick={() => handleClickEditor(hack.identifier)}
className={`quit-btn`} className={`quit-btn`}
> >
<Icon type="form" className="quit-icon"/> 编辑 <Icon type="form" className="quit-icon"/> 编辑
@ -161,7 +172,7 @@ function StudentStudy (props) {
<LeftPane /> <LeftPane />
</div> </div>
<SplitPane split="vertical" defaultSize="100%" allowResize={false}> <SplitPane split="vertical" defaultSize="100%" allowResize={false}>
<RightPane <RightPane
updateNotice={handleUpdateNotice} updateNotice={handleUpdateNotice}
/> />
<div /> <div />
@ -182,7 +193,7 @@ const mapStateToProps = (state) => {
user_program_identifier, user_program_identifier,
hack_identifier, hack_identifier,
searchParams searchParams
}; };
}; };
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,
})
}
} }
//公共和我的 //公共和我的
@ -719,57 +768,78 @@ 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){
url=`/item_baskets/${id}.json`; if(Undoclickable===true) {
axios.delete(url) Undoclickable = false;
.then((result) => { url = `/item_baskets/${id}.json`;
if (result.data.status == 0) { axios.delete(url)
// this.props.showNotification(`撤销成功`); .then((result) => {
var data = { if (result.data.status == 0) {
discipline_id:this.state.discipline_id, // this.props.showNotification(`撤销成功`);
sub_discipline_id:this.state.sub_discipline_id, var data = {
tag_discipline_id:this.state.tag_discipline_id, discipline_id: this.state.discipline_id,
public: this.state.defaultActiveKey, sub_discipline_id: this.state.sub_discipline_id,
difficulty: this.state.difficulty, tag_discipline_id: this.state.tag_discipline_id,
item_type: this.state.item_type, public: this.state.defaultActiveKey,
keyword: this.state.keywords, difficulty: this.state.difficulty,
page: this.state.page, item_type: this.state.item_type,
per_page:10, keyword: this.state.keywords,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), page: this.state.page,
}; per_page: 10,
this.getdatasy(data); exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
this.getbasket_listdata(); };
} this.getdatasy(data);
}).catch((error) => { this.getbasket_listdata();
////console.log(error); }
}) setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}
}else{ }else{
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`; if(Undoclickable===true) {
axios.delete(url,{ data: { Undoclickable = false;
item_id:id===undefined?"":parseInt(id), url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
}}) axios.delete(url, {
.then((result) => { data: {
if (result.data.status == 0) { item_id: id === undefined ? "" : parseInt(id),
// this.props.showNotification(`撤销成功`); }
var data = { })
discipline_id:this.state.discipline_id, .then((result) => {
sub_discipline_id:this.state.sub_discipline_id, if (result.data.status == 0) {
tag_discipline_id:this.state.tag_discipline_id, // this.props.showNotification(`撤销成功`);
public: this.state.defaultActiveKey, var data = {
difficulty: this.state.difficulty, discipline_id: this.state.discipline_id,
item_type: this.state.item_type, sub_discipline_id: this.state.sub_discipline_id,
keyword: this.state.keywords, tag_discipline_id: this.state.tag_discipline_id,
page: this.state.page, public: this.state.defaultActiveKey,
per_page:10, difficulty: this.state.difficulty,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id), item_type: this.state.item_type,
}; keyword: this.state.keywords,
this.getdatasy(data); page: this.state.page,
this.getbasket_listdata(); per_page: 10,
} exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}).catch((error) => { };
////console.log(error); this.getdatasy(data);
}) this.getbasket_listdata();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}
} }
@ -884,7 +954,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 +963,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,6 +1034,7 @@ 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}

@ -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);
@ -331,20 +332,30 @@ class Paperreview extends Component {
} }
//换题 //换题
Changingtopics=(id)=>{ Changingtopics=(id)=>{
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`; if(Changes===true){
let data={ Changes=false;
item_id:id, const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data={
item_id:id,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
//console.log(result);
var data = {}
this.getdata(data);
}
setTimeout(()=>{
Changes=true;
},1000);
}).catch((error) => {
//console.log(error);
setTimeout(()=>{
Changes=true;
},1000);
})
} }
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
//console.log(result);
var data = {}
this.getdata(data);
}
}).catch((error) => {
//console.log(error);
})
} }
setIntelligentformation=(bool)=>{ setIntelligentformation=(bool)=>{
@ -384,7 +395,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>
: :
"" ""
@ -427,11 +438,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)}

@ -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`
var data = { if(this.props.match.params.type==="Intelligence") {
position: positions var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
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,8 +112,18 @@ 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`
var data = {
position: positions if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -125,8 +143,18 @@ 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`
var data = {
position: positions
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -145,8 +173,18 @@ 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`
var data = {
position: positions
if(this.props.match.params.type==="Intelligence") {
var data = {
position: positions,
exam_setting_id:this.props.match.params.id,
}
}else {
var data = {
position: positions
}
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -176,22 +214,43 @@ class Paperreview_item extends Component {
} }
setDownloady = (fenshu) => { setDownloady = (fenshu) => {
const url = "/item_baskets/batch_set_score.json"; if(this.props.match.params.type==="Intelligence") {
var data = { //智能选题
score: fenshu, const url = "/item_baskets/batch_set_score.json";
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '', 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";
var data = {
score: fenshu,
item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
} }
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazine("", false);
}
}).catch((error) => {
//console.log(error);
})
} }
setDownloadys=(value)=>{ setDownloadys=(value)=>{
@ -239,24 +298,49 @@ class Paperreview_item extends Component {
modalsTypedel: bool, modalsTypedel: bool,
titilesms: names titilesms: names
}) })
const url = `/item_baskets/delete_item_type.json`; if(this.props.match.params.type==="Intelligence") {
axios.delete((url), { //智能组卷
data: { const url = `/item_baskets/delete_item_type.json`;
item_type: names axios.delete((url), {
} data: {
}) item_type: names,
.then((response) => { exam_setting_id:this.props.match.params.id,
if (response.data.status == 0) { }
// this.props.showNotification('大题删除成功'); })
this.props.getdata({}); .then((response) => {
this.setState({ if (response.data.status == 0) {
titilesms: "" // this.props.showNotification('大题删除成功');
}) this.props.getdata({});
} this.setState({
}) titilesms: ""
.catch(function (error) { })
////console.log(error); }
}); })
.catch(function (error) {
////console.log(error);
});
}else{
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: names
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('大题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
////console.log(error);
});
}
@ -271,17 +355,35 @@ class Paperreview_item extends Component {
}) })
}else { }else {
//确定 //确定
const url = `/item_baskets/${this.state.item_bank_id}.json`; if(this.props.match.params.type==="Intelligence"){
axios.delete((url)) //智能组卷
.then((response) => { const url = `/item_baskets/${this.state.item_bank_id}.json`;
if (response.data.status == 0) { axios.delete(url, { data: {
// this.props.showNotification('试题删除成功'); exam_setting_id: this.props.match.params.id,
this.props.getdata({}); }})
} .then((response) => {
}) if (response.data.status == 0) {
.catch(function (error) { // this.props.showNotification('试题删除成功');
this.props.getdata({});
}
})
.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,
}) })
@ -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,6 +655,7 @@ class Question extends Component {
single_questions_count: 0, single_questions_count: 0,
subjective_questions_count: 0, subjective_questions_count: 0,
}) })
// Undoclickable=true;
}) })
} }
@ -683,30 +693,49 @@ class Question extends Component {
} }
// 撤销 // 撤销
getitem_basketss=(id)=>{ getitem_basketss=(id)=>{
//选用题型可以上传单个 或者多个题型 this.setState({
let url=`/item_baskets/${id}.json`;
axios.delete(url)
.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();
}
}).catch((error) => {
////console.log(error);
}) })
if(Undoclickable===true){
Undoclickable=false;
//选用题型可以上传单个 或者多个题型
let url=`/item_baskets/${id}.json`;
axios.delete(url)
.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();
}
setTimeout(()=>{
Undoclickable=true;
},1000);
}).catch((error) => {
////console.log(error);
setTimeout(()=>{
Undoclickable=true;
},1000);
})
}else{
return
}
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=()=>{ selectallquestionsonthispage=()=>{
@ -778,11 +807,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 +873,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,13 +881,47 @@ 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}>
{
mydisplay===true?
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.mydisplayHidedel} />
:""
}
{
mydisplay===true?
<style>
{
`
body{
overflow:hidden!important;
}
`
}
</style>
:""
}
{ {
visible===true? visible===true?
<style> <style>
@ -862,7 +952,7 @@ class Question extends Component {
visible===true? visible===true?
<div <div
style={{ style={{
marginTop: "60px" marginTop: "81px"
}}></div> }}></div>
:""} :""}
{ {
@ -895,19 +985,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 +995,6 @@ class Question extends Component {
Headertop={Headertop} Headertop={Headertop}
/> />
:
""
}
{/*顶部*/} {/*顶部*/}

@ -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 {
@ -172,6 +172,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`;
@ -473,17 +487,22 @@ 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);
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}`);
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}`);
} }
@ -505,6 +524,10 @@ class Questionitem_banks extends Component {
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
> >
<Prompt
when={true}
message={() => '你确定离开此页面吗?'}
/>
<style> <style>
{ {
@ -588,7 +611,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={'/question'}></Bottomsubmit>
} }
</div> </div>
) )
@ -598,14 +621,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;
@ -236,8 +237,23 @@ class ChoquesEditor extends Component{
texts=""; texts="";
} }
} else { } else {
value = JSON.stringify(value); if(_text.length>=500){
texts=value; var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
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;
}
}
} }
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;
@ -333,10 +349,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 +375,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 +425,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 +435,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==="?"){
@ -95,13 +205,32 @@ class Contentpart extends Component {
} }
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={{
@ -136,12 +265,38 @@ 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,7 +347,7 @@ class Contentpart extends Component {
` `
.xaxisreverseorder .ant-input-group-addon{ .xaxisreverseorder .ant-input-group-addon{
width: 60px !important; width: 48px !important;
} }
@ -214,7 +369,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 +402,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 +411,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
@ -320,9 +475,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>

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

@ -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';
@ -368,10 +369,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 +395,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',
@ -31,15 +33,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 +86,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 +103,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 +193,7 @@ class Listjihe extends Component {
}catch (e) { }catch (e) {
} }
if(itemssname===undefined){ if(itemssname===undefined){
itemssname=items.name itemssname=items.name+""
} }
@ -141,7 +202,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 +211,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 +220,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) {
}
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{
@ -197,7 +310,7 @@ 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`)} >
<div className="ml10 w100s " style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div> <div className="ml10 w100s " style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a> </a>
: :
@ -212,6 +325,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemssname} value={itemssname}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
} }
@ -249,6 +363,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemsnamesy} value={itemsnamesy}
showUploadImage={this.handleShowUploadImage}
/> />
} }
</p> </p>
@ -282,6 +397,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={string} value={string}
showUploadImage={this.handleShowUploadImage}
/> />
:"" :""
@ -369,7 +485,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?editoj=1&pages=`+this.props.pages)}>
<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 +495,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(`/question/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 +517,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 +544,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>
@ -435,7 +557,7 @@ class Listjihe extends Component {
items.item_type === "PROGRAM" ? items.item_type === "PROGRAM" ?
"" ""
: :
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.chakanjiexibool(keindex)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.chakanjiexibool(keindex)}>
<i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
查看解析</p> 查看解析</p>
} }
@ -493,6 +615,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==="/question"&&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;
@ -258,8 +259,23 @@ class SingleEditor extends Component{
texts=""; texts="";
} }
} else { } else {
value = JSON.stringify(value); if(_text.length>=500){
texts=value; var result = _text.substring(0,450);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
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;
}
}
} }
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;
@ -354,9 +370,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 +398,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 +446,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 +456,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;
}

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

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

@ -162,13 +162,11 @@ class Testpaperlibrary extends Component {
booljupyterurls:true, booljupyterurls:true,
}) })
} }
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,6 +55,20 @@ 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
})
} }
//跳转人工组卷 //跳转人工组卷
@ -60,11 +79,32 @@ class Contentpart extends Component {
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,22 +360,22 @@ 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 href={'/Integeneration'}> <a onClick={()=>this.xinzenw('/Integeneration')}>
<div className="newbutoonss"> <div className="newbutoonss">
<p className="newbutoontess" >智能组卷</p> <p className="newbutoontess" >智能组卷</p>
</div> </div>
</a> </a>
<a href={'/question'} > <a onClick={()=>this.xinzenw('/question')}>
<div className="newbutoons mr39"> <div className="newbutoons mr39">
<p className="newbutoontess" >人工组卷</p> <p className="newbutoontess" >人工组卷</p>
</div> </div>
@ -260,9 +426,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.apply===false?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
(
items.public==true? items.public==true?
"" <p className="viewparsings mr25 ">
: <i className="iconfont icon-dianjiliang font-13 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}> <span>已公开</span>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</p> </p>
) :
items.apply===false?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</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>

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

@ -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,12 +940,35 @@ 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>
); );
return (
// 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 (
<div className="newHeaders" id="nHeader" > <div className="newHeaders" id="nHeader" >
<style>{ <style>{
@ -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,17 +1075,22 @@ submittojoinclass=(value)=>{
` `
} }
</style> </style>
{/*<li className={`pr questionbanks`} >*/} {
{/* <Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >*/} Periofters===true?
{/* <div className=" sortinxdirection mr10">*/} <li className={`pr questionbanks`} >
{/* <div style={{*/} <Popover className="queyppors" id={"yslpopovers"} placement="bottom" content={contents} trigger="click" >
{/* color:"#fff"*/} <div className=" sortinxdirection mr10">
{/* }}>*/} <div style={{
{/* 题库*/} color:"#fff"
{/* </div>*/} }}>
{/* </div>*/} 题库
{/* </Popover>*/} </div>
{/*</li>*/} </div>
</Popover>
</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'}}

@ -154,4 +154,4 @@ export async function fetchQuestion (params) {
export async function fetchTagDisciplines (params) { export async function fetchTagDisciplines (params) {
const url = `/tag_disciplines.json`; const url = `/tag_disciplines.json`;
return axios.post(url, params); return axios.post(url, params);
} }

Loading…
Cancel
Save