@@ -408,7 +425,7 @@ class ChoquesEditor extends Component{ autoFocus={false} imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} - placeholder="请您输入题干" + placeholder="请您输入选项" options={options} value={item} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} @@ -418,7 +435,7 @@ class ChoquesEditor extends Component{ autoFocus={false} imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} - placeholder="请您输入题干" + placeholder="请您输入选项" options={options} value={JSON.parse(item)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 6b6c57a43..955a9d9b8 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -17,6 +17,8 @@ import NoneDatas from '../component/NoneDatas'; import LoadingSpin from '../../../common/LoadingSpin'; import Contentquestionbank from "./Contentquestionbank"; import Listjihe from "./Listjihe"; +import Certifiedprofessional from "../../modals/Certifiedprofessional"; +import QuestionModalPicture from '../component/QuestionModalPicture.js' const { TabPane } = Tabs; const Search = Input.Search; class Contentpart extends Component { @@ -25,25 +27,114 @@ class Contentpart extends Component { this.state = { page:1, chakanjiexibool:false, + mydisplay:false, + occupation:2, + url: "", + isysladmins:false, } } //初始化 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)=>{ + if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){ + this.HideAddcoursestypess(2); + return + } 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) { 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; - const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; + let isysladmins=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; let {defaultActiveKey} = this.props; 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)){ defaultActiveKeys="0" }else{ @@ -52,7 +143,26 @@ class Contentpart extends Component { this.props.callback(defaultActiveKeys); } } + HideAddcoursestypess=(i)=>{ + console.log("调用了"); + this.setState({ + mydisplay:true, + occupation:i, + }) + } + + mydisplayHidedel=()=>{ + this.setState({ + mydisplay:false, + }) + } + xinzenw=(e)=>{ + //只限制了教师 + if(this.props.current_user.professional_certification===false&&this.state.isysladmins===false){ + this.HideAddcoursestypess(2); + return + } var urls=""; if(this.props.discipline_id){ // if(urls==="?"){ @@ -95,13 +205,32 @@ class Contentpart extends Component { } render() { - let {page}=this.state; + let {page,mydisplay,url}=this.state; let {defaultActiveKey,item_type,booljupyterurls}=this.props; const defaultActiveKeys=defaultActiveKey+''; - const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false; - const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; + let isysladmins=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; + 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 = (
diff --git a/public/react/src/modules/question/component/Listjihe.js b/public/react/src/modules/question/component/Listjihe.js index d613227fe..34d8844e7 100644 --- a/public/react/src/modules/question/component/Listjihe.js +++ b/public/react/src/modules/question/component/Listjihe.js @@ -8,10 +8,12 @@ import { Table, Pagination, Radio, - Tooltip + Tooltip, + Icon } from "antd"; import './../questioncss/questioncom.css'; import QuillForEditor from "../../../common/quillForEditor"; +import Certifiedprofessional from "../../modals/Certifiedprofessional"; const tagArray = [ 'A.', 'B.', 'C.', 'D.', 'E.', 'F.', 'G.', 'H.', 'I.', @@ -31,15 +33,46 @@ class Listjihe extends Component { page: 1, name: "单选题", nd: "简单", + url: "", + mydisplay:false, + occupation:2, + isysladmins:false, } } //初始化 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) => { let data = {} @@ -53,8 +86,15 @@ class Listjihe extends Component { 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); + } //撤销 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() { - let {page, name, nd} = this.state; + let {page, name, nd,url,mydisplay} = this.state; let {defaultActiveKey, items, listjihe, chakanjiexiboolindex, keindex} = this.props; // 编程答案 @@ -132,7 +193,7 @@ class Listjihe extends Component { }catch (e) { } 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); }catch (e) { - itemsnamesy=items&&items.program_attr&&items.program_attr.description; + itemsnamesy=items&&items.program_attr&&items.program_attr.description+""; + } var analysisnames=""; @@ -149,7 +211,7 @@ class Listjihe extends Component { analysisnames= JSON.parse(items&&items.analysis); }catch (e) { - analysisnames=items&&items.analysis; + analysisnames=items&&items.analysis+""; } // console.log(items.name); // console.log(itemsnamesy); @@ -158,10 +220,61 @@ class Listjihe extends Component { const options = [ 'bold', // 加粗 ] + + try { + if(itemsnamesy.constructor === Object){ + // console.log("是对象"); + // console.log(itemsnamesy); + }else { + // console.log("不是对象"); + // console.log(itemsnamesy); + itemsnamesy=itemsnamesy+""; + } + }catch (e) { + + } + return (
@@ -428,7 +446,7 @@ class SingleEditor extends Component{ autoFocus={false} imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} - placeholder="请您输入题干" + placeholder="请您输入选项" options={options} value={item} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} @@ -438,7 +456,7 @@ class SingleEditor extends Component{ autoFocus={false} imgAttrs={{width: '146px', height: '136px'}} style={{ height: '166px'}} - placeholder="请您输入题干" + placeholder="请您输入选项" options={options} value={JSON.parse(item)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} diff --git a/public/react/src/modules/question/questioncss/font.css b/public/react/src/modules/question/questioncss/font.css new file mode 100644 index 000000000..1f2cd8386 --- /dev/null +++ b/public/react/src/modules/question/questioncss/font.css @@ -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; +} diff --git a/public/react/src/modules/question/questioncss/quill.core.css b/public/react/src/modules/question/questioncss/quill.core.css new file mode 100644 index 000000000..516e388b6 --- /dev/null +++ b/public/react/src/modules/question/questioncss/quill.core.css @@ -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"; +} diff --git a/public/react/src/modules/question/questioncss/quill.snow.css b/public/react/src/modules/question/questioncss/quill.snow.css new file mode 100644 index 000000000..962b40f99 --- /dev/null +++ b/public/react/src/modules/question/questioncss/quill.snow.css @@ -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"; +} diff --git a/public/react/src/modules/testpaper/Paperlibraryeditid.js b/public/react/src/modules/testpaper/Paperlibraryeditid.js index 8700a216f..e5104804f 100644 --- a/public/react/src/modules/testpaper/Paperlibraryeditid.js +++ b/public/react/src/modules/testpaper/Paperlibraryeditid.js @@ -31,7 +31,7 @@ class Paperlibraryeditid extends Component { super(props); this.Judquestio = React.createRef(); this.state = { - paperlibrartdata: [], + Contentdata: [], disciplinesdata: [], knowledgepoints: [], disciplmy: [], @@ -139,7 +139,7 @@ class Paperlibraryeditid extends Component { axios.get(urls).then((response) => { if (response) { this.setState({ - paperlibrartdata: response.data, + Contentdata: response.data, item_banksedit: response.data.exam, }) } @@ -188,7 +188,7 @@ class Paperlibraryeditid extends Component { .then((result) => { if (result.data.status === 0) { // this.props.showNotification(`试卷更新成功`); - this.props.history.push('/paperlibrary'); + this.props.history.push('/paperlibrary/see/'+this.props.match.params.id); } }).catch((error) => { //console.log(error); @@ -227,7 +227,7 @@ class Paperlibraryeditid extends Component { } render() { - let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state; + let {Contentdata,newmyshixunmodelbool,defaultActiveKey} = this.state; const params = this.props && this.props.match && this.props.match.params; let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`; @@ -248,7 +248,7 @@ class Paperlibraryeditid extends Component { { newmyshixunmodelbool===true?
智能组卷
人工组卷
试题数:{question_counts}
总分:{total_scores}
@@ -135,21 +188,22 @@ class Listjihe extends Component { } { - items.apply===false? -this.props.showmodels(items.id)}> - - 公开 -
- : - ( items.public==true? - "" - : -this.props.showmodelsInaudit(e)}> - - 公开审核中 +
+ + 已公开
- ) + : + items.apply===false? +this.props.showmodels(items.id)}> + + 公开 +
+ : +this.props.showmodelsInaudit(e)}> + + 公开审核中 +
}发起考试