解决冲突

ecloud_sso
daiao 5 years ago
commit e1e7cc725b

@ -6,10 +6,12 @@ module ControllerRescueHandler
Util.logger_error e
render json: {status: -1, message: e.message}
end
rescue_from ActiveRecord::StatementInvalid do |e|
Util.logger_error e
render json: {status: -1, message: "接口数据异常"}
end
rescue_from NoMethodError do |e|
Util.logger_error e
render json: {status: -1, message: "接口方法异常"}
@ -18,6 +20,7 @@ module ControllerRescueHandler
rescue_from ActionController::UnknownFormat do |e|
render json: {status: -1, message: "接口调用非JSON格式"}
end
# rescue_from ActionView::MissingTemplate, with: :object_not_found
# rescue_from ActiveRecord::RecordNotFound, with: :object_not_found
rescue_from Educoder::TipException, with: :tip_show
@ -32,6 +35,7 @@ module ControllerRescueHandler
rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(','))
end
# rescue_from RuntimeError do |ex|
# Util.logger_error "#######ex:#{ex}"
# render_error(ex.message)

@ -44,9 +44,9 @@ if (isDev) {
// 超管
debugType="admin";
// 老师
//debugType="teacher";
// debugType="teacher";
// 学生
//debugType="student";
// debugType="student";

@ -22,8 +22,8 @@ import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font');
// const Color = Quill.import('attributes/style/color');
Size.whitelist = ['12px', '14px', '16px', '18px', '20px', false];
Font.whitelist = ['SimSun', 'SimHei','Microsoft-YaHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
window.Quill = Quill;
window.katex = katex;
@ -55,10 +55,11 @@ function QuillForEditor ({
// toolbar 默认值
const defaultConfig = [
'bold', 'italic', 'underline',
{size: ['12px', '14px', '16px', '18px', '20px']},
{size: ['14px', '16px', '18px', '20px']},
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']},
{header: [1,2,3,4,5,false]},
'blockquote', 'code-block',
'link', 'image', 'video',

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 15:46:24
* @LastEditTime : 2020-02-11 16:34:18
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -22,7 +22,6 @@ function KnowLedge (props) {
showAdd, // 显示新增图标
addKnowledge // 调用新增知识点接口
} = props;
useEffect(() => {
const _options = [];
const _selects = [];

@ -35,7 +35,10 @@ const NewOrEditTask = (props) => {
getUserInfoForNew,
handleCancelPublish,
validateOjForm,
getQuestion
getQuestion,
saveSearchParams,
setOjInitialValue,
courseQuestions
// updateTestAndValidate,
} = props;
@ -54,14 +57,35 @@ const NewOrEditTask = (props) => {
useEffect(() => {
// 获取用户信息
getUserInfoForNew();
// 获取课程列表
getQuestion({
source: 'question'
});
// console.log('获取路由参数: ====', props.match.params);
const id = props.match.params.id;
// 保存OJForm的id号指明是编辑还是新增
props.saveOJFormId(id);
// 获取地址栏查询参数
const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) {
const $params = $searchs.split('&') || [];
let obj = Object.create(null);
$params.forEach(item => {
const keys = item.split('=');
obj[keys[0]] = keys[1];
});
// 保存初始值
if (obj['newoj']) {
const tags = obj['tag_discipline_id'];
const tag_arrs = (tags && tags.split(',').map(tag => +tag)) || [];
setOjInitialValue({
difficult: obj['difficult'],
sub_discipline_id: obj['sub_discipline_id'],
tag_discipline_id: tag_arrs
});
}
saveSearchParams({searchParams: $searchs, curPage: obj['pages']});
}
// 获取课程列表
getQuestion({
source: 'question'
});
if (id) { // id号即 identifier
// TODO id 存在时, 编辑, 获取 store 中的记录数
props.getOJFormById(id);
@ -96,7 +120,8 @@ const NewOrEditTask = (props) => {
props.clearOJFormStore();
// 清空描述信息
toStore('oj_description', '');
props.history.push('/problems');
// props.history.push('/problems');
props.history.push(`/question?${props.searchParams}`);
}
// 发布
@ -236,7 +261,7 @@ const NewOrEditTask = (props) => {
}
const mapStateToProps = (state) => {
const { ojForm, identifier, testCases, isPublish } = state.ojFormReducer;
const { ojForm, identifier, testCases, isPublish, searchParams, courseQuestions } = state.ojFormReducer;
const { publishLoading, submitLoading } = state.commonReducer;
const { userInfo } = state.userReducer;
return {
@ -246,7 +271,9 @@ const mapStateToProps = (state) => {
isPublish, // 是否已发布
publishLoading,
submitLoading,
userInfo
userInfo,
searchParams,
courseQuestions
}
};
@ -278,7 +305,9 @@ const mapDispatchToProps = (dispatch) => ({
// 新建时获取信息
getUserInfoForNew: () => dispatch(actions.getUserInfoForNew()),
validateOjForm: (props, type, cb) => dispatch(actions.validateOjForm(props, type, cb)),
getQuestion: (params) => dispatch(actions.getQuestion(params))
getQuestion: (params) => dispatch(actions.getQuestion(params)),
saveSearchParams: (params) => dispatch(actions.saveSearchParams(params)),
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
});
export default withRouter(connect(

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang
* @LastEditTime : 2020-02-05 13:26:58
* @LastEditTime : 2020-02-11 16:44:57
*/
import './index.scss';
// import 'katex/dist/katex.css';
@ -61,7 +61,7 @@ class EditTab extends React.Component {
top: 500,
bottom: 20,
offsetTop: 0,
showAdd: false
showAdd: props.tag_discipline_id || false
// knowledges: [],
// coursers: [] // 选中的课程
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-06 15:27:34
* @LastEditTime : 2020-02-10 18:24:01
*/
import './index.scss';
import React, { useEffect, useState } from 'react';
@ -31,7 +31,9 @@ function StudentStudy (props) {
// user_program_identifier,
restoreInitialCode,
changeUserCodeTab,
changeShowOrHideControl
changeShowOrHideControl,
searchParams,
saveSearchParams
} = props;
const {
@ -47,7 +49,16 @@ function StudentStudy (props) {
saveUserProgramIdentifier(id);
// startProgramQuestion(id);
getUserProgramDetail(id);
const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) {
const $params = $searchs.split('&') || [];
let obj = Object.create(null);
$params.forEach(item => {
const keys = item.split('=');
obj[keys[0]] = keys[1];
});
saveSearchParams({searchParams: $searchs, curPage: obj['pages']});
}
if (tab) {
changeUserCodeTab(tab);
}
@ -97,7 +108,7 @@ function StudentStudy (props) {
changeShowOrHideControl(false);
props.saveEditorCodeForDetail('');
props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit`);
props.history.push(`/problems/${identifier}/edit?{searchParams}`);
}
// 处理退出
const handleClickQuit = () => {
@ -106,7 +117,8 @@ function StudentStudy (props) {
// 将控制台关闭
changeShowOrHideControl(false);
props.saveEditorCodeForDetail('');
props.history.push('/problems');
// props.history.push('/problems');
props.history.push(`/question?${searchParams}`);
}
return (
@ -163,11 +175,13 @@ function StudentStudy (props) {
const mapStateToProps = (state) => {
const { userInfo } = state.userReducer;
const { hack_identifier, user_program_identifier, hack } = state.ojForUserReducer;
const { searchParams } = state.ojFormReducer;
return {
hack,
userInfo,
user_program_identifier,
hack_identifier
hack_identifier,
searchParams
};
};
@ -182,7 +196,8 @@ const mapDispatchToProps = (dispatch) => ({
restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)),
clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()),
changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab))
changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab)),
saveSearchParams: (params) => dispatch(actions.saveSearchParams(params))
});
export default withRouter(connect(

@ -406,14 +406,14 @@ class Paperreview extends Component {
Cohetepaperbool===false?
artificialtype==="artificial"?
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item>
<Breadcrumb.Item >试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"} href="/question">人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"/Integeneration"}>智能组卷</Breadcrumb.Item>
<Breadcrumb.Item >试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"/Integeneration"} href="/paperlibrary">智能组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb>
:
@ -449,7 +449,7 @@ class Paperreview extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={ artificialtype==="artificial"?'/question':'/paperlibrary'}></Bottomsubmit>
</div>
)

@ -90,7 +90,10 @@ class Paperreview_single extends Component {
}catch (e) {
itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description;
}
var fenshul=(objectsingle.score+"分");
const options = [
'bold', // 加粗
]
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
@ -122,7 +125,7 @@ class Paperreview_single extends Component {
{/*顶部*/}
<div className="w100s sortinxdirection ">
<div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p>
<p className="cretitlecolrlis lh28" style={{fontWeight:"bold"}}>{indexx}</p>
</div>
<style>
{
@ -133,12 +136,18 @@ class Paperreview_single extends Component {
line-height: 28px;
}
.markdown-body p {
color: #333333;
font-size: 14px !important;
line-height: 28px;
font-weight: bold;
}
.bodyysls .ql-editor p span{
font-weight: bold;
}
`
}
</style>
@ -146,25 +155,26 @@ class Paperreview_single extends Component {
objectsingle.item_type==="PROGRAM"?
<div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"
minWidth:"32px",fontWeight:"bold"
}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}>
<div id={"titessone"} className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",fontWeight:"bold"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(fenshul+objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
</div>
:
<div className="w100s sortinxdirection">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"
<div className="w100s sortinxdirection titesstwos">
<div id={"titesstwo"} className="tites titesstwostest lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px",fontWeight:"bold"
}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{wordBreak: "break-word"}}
<div className={objectsingle.score<10?" lh28 listjihetixingstit text-indents40 bodyysls cretitlecolrlist programquill":objectsingle.score<100?" lh28 listjihetixingstit text-indents44 bodyysls cretitlecolrlist programquill":" lh28 listjihetixingstit text-indents50 bodyysls cretitlecolrlist programquill" }style={{wordBreak: "break-word",fontWeight:"bold"}}
>
{
itemssname===null|| itemssname===undefined?
@ -207,7 +217,7 @@ class Paperreview_single extends Component {
<p className={"sortinxdirection mt15"}>
{
objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}}
<p className="programquill " style={{wordBreak: "break-word"}}
>
{
itemsnamesy===null || itemsnamesy===undefined?

@ -118,6 +118,7 @@ class Question extends Component {
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
this.setState({
sub_discipline_id:sub_discipline_id,
discipline_id:discipline_id,
tag_discipline_id:null,
keyword:"",
page:1,
@ -937,6 +938,7 @@ class Question extends Component {
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
pages={this.state.page}
Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -35,13 +35,25 @@ class Questionitem_banks extends Component {
myquestion_choicesco: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy:[]
disciplmy:[],
pages:1,
}
}
//初始化
componentDidMount() {
const query = this.props.location.search;
const parsed = queryString.parse(query);
console.log(parsed);
try {
this.setState({
pages:parsed.pages
})
}catch (e) {
}
// let {defaultActiveKey}= this.state;
// var data={
// public:defaultActiveKey
@ -454,6 +466,7 @@ class Questionitem_banks extends Component {
}
if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建
// debugger
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
@ -465,7 +478,12 @@ class Questionitem_banks extends Component {
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
});
window.open("/problems/new");
let arrays=myrbkc.join(',');
// console.log("开始打印了");
// 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}`);
}
@ -491,7 +509,10 @@ class Questionitem_banks extends Component {
<style>
{
`
body{
width: 100%!important;
}
.newFooter{
display: none;
}

@ -230,18 +230,15 @@ class ChoquesEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
texts=JSON.stringify(value);
}catch (e) {
texts="";
}
} else {
if(_text.length>=301){
var result = _text.substring(0,300);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value);
texts=value;
}
}
let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts;
//console.log(question_choices);
@ -265,24 +262,24 @@ class ChoquesEditor extends Component{
}
onContentChange=(value,quill)=>{
// debugger
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titleysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
}
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
let texts="";
texts = JSON.stringify(value);
this.setState({
question_titleysl:texts
})
@ -293,20 +290,20 @@ class ChoquesEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titlesysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
let texts="";
texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
@ -336,7 +333,10 @@ class ChoquesEditor extends Component{
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}>
<style>{`
@ -357,6 +357,12 @@ class ChoquesEditor extends Component{
#e_tips_mdEditor_question_undefined4{
display: none;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style>
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
@ -369,7 +375,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={question_title}
onContentChange={this.onContentChange}
@ -403,7 +409,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
@ -413,7 +419,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
@ -452,7 +458,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
/>

@ -38,7 +38,7 @@ class Contentpart extends Component {
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
debugger
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;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
@ -53,50 +53,51 @@ class Contentpart extends Component {
}
}
xinzenw=(e)=>{
var urls="?";
var urls="";
if(this.props.discipline_id){
if(urls==="?"){
urls=urls+`discipline_id=${this.props.discipline_id}`
}else {
// if(urls==="?"){
// urls=urls+`discipline_id=${this.props.discipline_id}`
// }else {
urls=urls+`&discipline_id=${this.props.discipline_id}`
}
// }
}
if(this.props.sub_discipline_id){
if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}`
}else {
// if(urls==="?"){
// urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}`
// }else {
urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}`
}
// }
}
if(this.props.tag_discipline_id){
if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}`
}else {
// if(urls==="?"){
// urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}`
// }else {
urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}`
}
// }
}
if(this.props.difficulty){
if(urls==="?"){
urls=urls+`difficulty=${this.props.difficulty}&`
}else {
// if(urls==="?"){
// urls=urls+`difficulty=${this.props.difficulty}&`
// }else {
urls=urls+`&difficulty=${this.props.difficulty}`
}
// }
}
if(this.props.item_type){
if(urls==="?"){
urls=urls+`item_type=${this.props.item_type}`
}else {
// if(urls==="?"){
// urls=urls+`item_type=${this.props.item_type}`
// }else {
urls=urls+`&item_type=${this.props.item_type}`
}
// }
}
this.props.history.push("/question/newitem?pages="+this.props.pages+urls);
this.props.history.push("/question/newitem"+urls);
}
render() {
let {page}=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;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
@ -166,14 +167,14 @@ class Contentpart extends Component {
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
@ -316,6 +317,7 @@ class Contentpart extends Component {
keindex={index}
items={object}
key={index}
pages={this.props.pages}
getitem_basketss={(id)=>this.props.getitem_basketss(id)}
getitem_baskets={(e)=>this.props.getitem_baskets(e)}
showmodels={(e)=>this.props.showmodels(e)}

@ -80,10 +80,36 @@ class Headplugselections extends Component {
}catch (e) {
}
}
shixunserdchAlls=(itme,id)=>{
if(id!=undefined){
this.setState({
shixunsearchAllvalue:id,
})
try {
this.props.setdiscipline_id(id);
}catch (e) {
}
}
// console.log(itme);
// console.log(itme[0]);
if(itme!=undefined){
try {
this.props.setsub_discipline_id(id,itme[0].id);
}catch (e) {
}
}
}
//获取方向
shixunsearchAll = (id) => {
//大写A
//console.log("获取方向");
//console.log(id);
if(id!=undefined){
@ -128,7 +154,8 @@ class Headplugselections extends Component {
getshixunchildValue = (id,ids) => {
// //console.log("getshixunchildValue");
// //console.log(id);
// console.log(id);
// console.log(ids);
// debugger
if(id!=undefined ||ids!=undefined){
this.setState({
@ -141,6 +168,7 @@ class Headplugselections extends Component {
}
}
}
render() {
let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
@ -232,8 +260,8 @@ class Headplugselections extends Component {
disciplinesdata&&disciplinesdata.map((item,key)=>{
return(
item.sub_disciplines.length>0?
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}>
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunsearchAll(item.id)}>
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={"bottomRight"}>
<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}
</li>
</Dropdown>

@ -681,6 +681,9 @@ class Itembankstop extends Component {
<style>
{
`
body{
width: 100%!important;
}
.ant-form-item{
margin-bottom: 0px !important;

@ -187,6 +187,13 @@ class JudquestionEditor extends Component{
}catch (e) {
}
const params = this.props && this.props.match && this.props.match.params;
if(JSON.stringify(params) === "{}"){
//新增
this.setState({
zqda:"0"
})
}
}
componentDidUpdate(prevProps) {
@ -282,24 +289,32 @@ class JudquestionEditor extends Component{
}
onContentChange=(value,quill)=>{
// console.log("这是题干赋值");
// console.log(value);
// console.log(quill);
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
// console.log(_text);
// console.log(_text.length);
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titleysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
}
// console.log("空");
} else {
// console.log("有");
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
let texts="";
texts = JSON.stringify(value);
this.setState({
question_titleysl:texts
})
@ -310,20 +325,21 @@ class JudquestionEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titlesysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value =JSON.stringify(value);
texts=value;
}
let texts="";
texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
@ -352,6 +368,10 @@ class JudquestionEditor extends Component{
// ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{`
@ -372,6 +392,12 @@ class JudquestionEditor extends Component{
#e_tips_mdEditor_question_undefined4{
display: none;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style>
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
@ -384,7 +410,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={question_title}
onContentChange={this.onContentChange}
@ -434,7 +460,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
/>

@ -151,10 +151,13 @@ class Listjihe extends Component {
}catch (e) {
analysisnames=items&&items.analysis;
}
console.log(items.name);
console.log(itemsnamesy);
console.log(analysisnames);
// console.log(items.name);
// console.log(itemsnamesy);
//
// console.log(analysisnames);
const options = [
'bold', // 加粗
]
return (
<div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
@ -165,18 +168,29 @@ class Listjihe extends Component {
padding-left: 0px !important;
padding-top: 0px !important;
}
.markdown-body .ql-editor p span{
font-weight: bold;
}
.markdown-body .ql-editor p {
font-weight: bold;
}
.programquill .ql-editor{
padding-left: 0px !important;
padding-top: 0px !important;
}
.ql-editor{
display: inline-block;
text-align: justify;
}
`
}
</style>
<div className="w100s sortinxdirection">
<div className="listjihetixingstitsy">
<div className="listjihetixingstitsy" style={{
fontWeight:"bold"
}} >
{
this.props.listjihe
}.
@ -184,10 +198,11 @@ class Listjihe extends Component {
{
items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}>
<div className="ml10 w100s " style={{wordBreak: "break-word"}} 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>
:
<div className="ml10 w100s markdown-body" style={{wordBreak: "break-word"}}>
<div className="ml10 w100s markdown-body" style={{wordBreak: "break-word",fontWeight:"bold"}}>
{ items===undefined||items===null||items===""?"":
items.name === undefined || items.name === null || items.name === "" ?
""
@ -319,8 +334,8 @@ class Listjihe extends Component {
{
items.choosed === true ?
<p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">撤销</span></p>
{/*<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>*/}
<span className=" lh30">撤销</span></p>
:
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
@ -354,7 +369,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit`}>
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit?editoj=1&pages=`+this.props.pages}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
@ -364,7 +379,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a href={`/question/edit/${items.id}`}>
<a target="_blank" href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
@ -400,8 +415,16 @@ class Listjihe extends Component {
<span>公开</span>
</p>
:
(
items.public==true?
""
:
<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>
)
:
""
}
@ -451,13 +474,18 @@ class Listjihe extends Component {
</div>
<div className=" sortinxdirection mt15 yldxtit">
<p id={"analysisnamesid"} className=" testfondex yldxtit programquill"
<p className=" testfondex yldxtit "
style={{wordBreak: "break-word"}}
>
解析
</p>
<p id={"analysisnamesid"} className="wt930px testfondex yldxtit programquill"
style={{wordBreak: "break-word"}}
>
{items ?
items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
""
"暂无解析"
:
items.analysis.length>0?
analysisnames===null || analysisnames===undefined?"":
@ -467,7 +495,7 @@ class Listjihe extends Component {
value={analysisnames}
/>
:
""
"暂无解析"
:
""
}

@ -9,7 +9,10 @@ class PaperDeletModel extends Component {
constructor(props) {
super(props);
this.state={
newkntypeinput:""
newkntypeinput:"",
errores:false,
errorestit:'',
addonAfteronelens3:0,
}
}
isNull=( str )=>{
@ -28,12 +31,13 @@ class PaperDeletModel extends Component {
// })
// //console.log(e.target.value);
// //console.log(e.target.value.length);
if(this.isNull(e.target.value)===true){
this.props.showNotification('不能输入空格');
return
}
this.setState({
newkntypeinput: e.target.value
newkntypeinput: e.target.value,
addonAfteronelens3:e.target.value.length,
errorestit:'',
errores:false,
boolred:false,
})
this.props.setboolred(false);
//
@ -48,7 +52,8 @@ class PaperDeletModel extends Component {
// })
// }
// }
}
};
mysinputOnBlur=(e)=>{
//console.log("失去焦点了");
}
@ -57,8 +62,28 @@ class PaperDeletModel extends Component {
//console.log("获取焦点");
}
NewknTypedeltyoedels=()=>{
debugger
if(this.state.newkntypeinput.length===0){
this.setState({
errorestit:'请输入知识点',
errores:true,
boolred:true,
})
return
}
if(this.isNull(this.state.newkntypeinput)===true){
this.setState({
errorestit:'不能输入空格',
errores:true,
boolred:true,
})
return
}
this.props.NewknTypedeltyoedel(this.state.newkntypeinput)
}
render() {
let{errores,errorestit,addonAfteronelens3}=this.state;
return(
<Modal
keyboard={false}
@ -71,12 +96,32 @@ class PaperDeletModel extends Component {
width="442px"
>
<div className="educouddiv">
<div className={this.props.boolred===true?"tabeltext-alignleft mt10 inpustred":"tabeltext-alignleft mt10"}>
<Input onInput={this.handleChange} maxLength={15} onBlur={this.mysinputOnBlur } onFocus={this.inputOnFocus }/>
<style>
{
`
.eduinpus .ant-input{
width: 310px !important;
border-right: 0px solid #FFFFff !important;
}
body{
width: 100%!important;
}
`
}
</style>
<div className={this.props.boolred===true?"tabeltext-alignleft mt10 inpustred inpustredysl eduinpus":errores===true?"tabeltext-alignleft mt10 inpustred inpustredysl eduinpus":"tabeltext-alignleft mt10 eduinpus"}>
<Input className={"eduinpus"} onInput={this.handleChange} maxLength={15} onBlur={this.mysinputOnBlur } addonAfter={String(addonAfteronelens3)+"/15"} onFocus={this.inputOnFocus }/>
</div>
<div className="clearfix mt30 edu-txt-center">
{
errores===true?
<p className={"xingcolor"}>{errorestit}</p>
:""
}
<div className={errores===true?"clearfix mt10 edu-txt-center":"clearfix mt30 edu-txt-center"}>
<a className="task-btn mr30 w80" onClick={()=>this.props.NewknTypedeldel(false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.NewknTypedeltyoedel(this.state.newkntypeinput)}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={ ()=>this.NewknTypedeltyoedels()}>确定</a>
</div>
</div>
</Modal>

@ -20,6 +20,25 @@ class Paperreview_itemModel extends Component {
})
}
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
this.props.setDownloady(this.state.value)
}
render() {
return(
@ -56,7 +75,7 @@ width: 124px !important;
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloady(this.state.value)}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div>
</div>
</Modal>

@ -21,6 +21,28 @@ class Paperreview_itemModels extends Component {
})
}
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
console.log("必须为数值s");
this.props.setDownloadys(this.state.value);
}
render() {
return(
@ -57,7 +79,7 @@ width: 124px !important;
</div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazines(false,null)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloadys(this.state.value)}>确定</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div>
</div>
</Modal>

@ -21,7 +21,6 @@ const tagArray = [
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
//题库的试卷 单选题 组件
class SingleEditor extends Component{
constructor(props){
@ -253,18 +252,15 @@ class SingleEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
texts= JSON.stringify(value)
}catch (e) {
texts="";
}
} else {
if(_text.length>=301){
var result = _text.substring(0,300);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value)
value = JSON.stringify(value);
texts=value;
}
}
let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts;
this.setState({ question_choices });
@ -291,50 +287,40 @@ class SingleEditor extends Component{
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titleysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
} else {
// 提交到后台的内容需要处理一下;
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
} else {
let texts = JSON.stringify(value);
this.setState({
question_titleysl:texts
})
try {
//console.log("onContentChange");
//console.log(quill.getText().length);
}catch (e) {
}
}
}
onContentChanges=(value,quill)=>{
const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) {
// 处理编辑器内容为空
try {
this.setState({
question_titlesysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
} else {
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
} else {
let texts = JSON.stringify(value);
this.setState({
question_titlesysl:texts
})
@ -368,6 +354,10 @@ class SingleEditor extends Component{
// //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -389,6 +379,12 @@ class SingleEditor extends Component{
#e_tips_mdEditor_question_undefined4{
display: none;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style>
<p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */}
@ -401,7 +397,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={question_title}
onContentChange={this.onContentChange}
/>
@ -433,7 +429,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
@ -443,7 +439,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}}
placeholder="请您输入题干"
options={['code-block', 'image', 'formula']}
options={options}
value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/>
@ -484,7 +480,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }}
placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']}
options={options}
value={question_titles}
onContentChange={this.onContentChanges}
/>

@ -621,6 +621,9 @@ class Comthetestpaperst extends Component {
<style>
{
`
body{
width: 100%!important;
}
.ant-form-item{
margin-bottom: 0px !important;

@ -533,6 +533,9 @@ class Intelligentcomponents extends Component {
<style>
{
`
body{
width: 100%!important;
}
.ant-form-item{
margin-bottom: 0px !important;

@ -705,6 +705,9 @@
font-size: 14px;
}
.testfondexsysl{
width:5% !important;
}
.yldxtits{
color: #888888;
font-size: 14px;
@ -712,7 +715,9 @@
.mt25{
margin-top: 25px;
}
.wt930px{
width: 930px !important;
}
.postitonrelati{
position: relative;
}
@ -991,8 +996,28 @@
}
.inpustred .ant-input{
border: 1px solid #f30707;
border-radius: 5px;
border: 1px solid #f30707 !important;
border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input:hover{
border: 1px solid #f30707 !important;
border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input:active{
border: 1px solid #f30707 !important;
border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon:hover{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon:active{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
}
.mt15{
@ -1072,3 +1097,18 @@
.lh34{
line-height: 34px !important;
}
.titesstwos{
position: relative;
}
.titesstwostest{
position: absolute;
}
.text-indents40{
text-indent:40px
}
.text-indents44{
text-indent:44px
}
.text-indents50{
text-indent: 50px
}

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -37,6 +37,7 @@ class Paperlibraryeditid extends Component {
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool:false,
defaultActiveKey:"0",
}
@ -110,6 +111,26 @@ class Paperlibraryeditid extends Component {
}
});
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
}
@ -206,10 +227,10 @@ class Paperlibraryeditid extends Component {
}
render() {
let {paperlibrartdata,newmyshixunmodelbool} = this.state;
let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log("newmyshixunmodelbool");
// //console.log(newmyshixunmodelbool);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -246,8 +267,8 @@ class Paperlibraryeditid extends Component {
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb>
</div>
@ -304,7 +325,7 @@ class Paperlibraryeditid extends Component {
newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
}
</div>
)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -26,6 +26,7 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
defaultActiveKey:"0",
}
@ -37,7 +38,24 @@ class Paperlibraryseeid extends Component {
componentDidMount() {
////console.log("Paperlibraryseeid");
this.getdata();
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
}
@ -92,9 +110,10 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
let {paperlibrartdata,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -113,8 +132,8 @@ class Paperlibraryseeid extends Component {
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
</div>
@ -171,7 +190,7 @@ class Paperlibraryseeid extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div>
)

@ -18,6 +18,7 @@ import SiderBar from "../tpm/SiderBar";
import Headplugselections from "../question/component/Headplugselections";
import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
import QuestionModalys from "./component/QuestionModalys";
class Testpaperlibrary extends Component {
constructor(props) {
super(props);
@ -40,6 +41,8 @@ class Testpaperlibrary extends Component {
modalsTypes:false,
modalsType:false,
timuid:0,
modalsTypeInaudit:false,
defaultActiveKeybool:false,
}
}
getContainer = () => {
@ -75,6 +78,9 @@ class Testpaperlibrary extends Component {
})
}
});
}
paginationonChange=(pages)=>{
@ -117,12 +123,21 @@ class Testpaperlibrary extends Component {
}
this.getdata(data);
}
callback = (key) => {
callback = (key,bool) => {
try {
var currenturl = window.location.href;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl+'?defaultActiveKey='+key);
}catch (e) {
}
this.setState({
defaultActiveKey: key,
difficulty:null,
keyword:null,
page:1,
defaultActiveKeybool:bool,
})
var data={
page:1,
@ -138,11 +153,16 @@ class Testpaperlibrary extends Component {
}
//获取数据
getdata=(data)=>{
getdata=(data,bool)=>{
const url = `/examination_banks.json`;
if(bool){
}else {
this.setState({
booljupyterurls:true,
})
}
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({
@ -288,7 +308,7 @@ class Testpaperlibrary extends Component {
page: this.state.page,
per_page:10,
};
this.getdata(data);
this.getdata(data,true);
}
}).catch((error) => {
////console.log(error);
@ -314,7 +334,7 @@ class Testpaperlibrary extends Component {
page: this.state.page,
per_page:10,
};
this.getdata(data);
this.getdata(data,true);
}
})
.catch(function (error) {
@ -325,19 +345,31 @@ class Testpaperlibrary extends Component {
showmodels = (id) => {
this.setState({
modalsType: true,
titilesm: "在平台审核后,所有成员均可使用试",
titiless: "是否设置为公开",
titilesm: "在平台审核后,所有成员均可使用试",
titiless: "是否设置为公开",
titbool: true,
timuid: id
})
};
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`);
this.props.history.push(`/paperlibrary/edit/${id}?defaultActiveKey=${this.state.defaultActiveKey}`);
}
showmodelsInaudit = (e) => {
this.setState({
modalsTypeInaudit: true,
titilesm: "公开申请已提交,请等待管理员的审核",
titiless: "我们将在1-2个工作日内完成审核",
})
};
modalsTypeInauditbool=()=>{
this.setState({
modalsTypeInaudit:false,
})
}
showmodelysl = (id) => {
this.setState({
@ -403,7 +435,7 @@ class Testpaperlibrary extends Component {
render() {
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
let{Headertop,items_count,page,per_page,modalsTypes,modalsType,modalsTypeInaudit}=this.state;
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;
@ -424,6 +456,12 @@ class Testpaperlibrary extends Component {
setDownload={() => this.setDownload()}></QuestionModal>
:""
}
{
modalsTypeInaudit===true?
<QuestionModalys {...this.props}{...this.state} modalsType={modalsTypeInaudit} modalCancel={() => this.modalsTypeInauditbool()}
setDownload={() => this.modalsTypeInauditbool()}></QuestionModalys>
:""
}
{/*试卷库*/}
<SiderBar
{...this.props}
@ -449,9 +487,11 @@ class Testpaperlibrary extends Component {
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}
setdatafuns={(key)=>this.setdatafuns(key)}
callback={(key)=>this.callback(key)}
callback={(key,bool)=>this.callback(key,bool)}
setdatafunsval={(key)=>this.setdatafunsval(key)}
setdifficulty={(bool)=>this.setdifficulty(bool)}
showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}
>
</Contentpart>

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import {
notification,
@ -24,12 +24,32 @@ class Contentpart extends Component {
super(props);
this.state = {
page:1,
defaultActiveKeyss:"0",
}
}
//初始化
componentDidMount(){
const query = this.props.location.search;
const parsed = queryString.parse(query);
console.log("Contentpart");
console.log(parsed);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKeyss:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKeyss:"0",
})
}else{
this.setState({
defaultActiveKeyss:"1",
})
}
}
}
//跳转人工组卷
@ -44,20 +64,33 @@ class Contentpart extends Component {
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;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
let defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
}
this.props.callback(defaultActiveKeys);
try {
if(this.props.defaultActiveKeybool===false){
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
}
}
}catch (e) {
}
render() {
let {page}=this.state;
let {defaultActiveKey}=this.props;
this.props.callback(defaultActiveKeys,false);
}
}
render() {
let {page,defaultActiveKeyss}=this.state;
let {defaultActiveKey,defaultActiveKeybool}=this.props;
let 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;
@ -79,6 +112,15 @@ class Contentpart extends Component {
</div>
);
if(defaultActiveKeybool===false){
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
}
}
return (
<div className=" clearfix mt25">
@ -108,14 +150,14 @@ class Contentpart extends Component {
{
isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}>
<Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1">
</TabPane>
<TabPane tab="我的" key="0">
</TabPane>
</Tabs>
:
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}>
<Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1">
</TabPane>
</Tabs>
@ -222,6 +264,7 @@ class Contentpart extends Component {
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
Isitapopup={this.props.Isitapopup}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
>
</Listjihe>

@ -58,7 +58,7 @@ class Listjihe extends Component {
gotoseesj=(id)=>{
this.props.history.push(`/paperlibrary/see/${id}`);
this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
}
@ -73,6 +73,8 @@ class Listjihe extends Component {
const update_times=items&&items.update_time&&items.update_time;
const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name;
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s">
@ -133,12 +135,21 @@ class Listjihe extends Component {
}
{
items.public === false ?
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?
""
:
<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>
:""}

@ -87,6 +87,9 @@ class Paperlibraryseeid_items extends Component {
}catch (e) {
itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description;
}
const options = [
'bold', // 加粗
]
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
@ -118,7 +121,7 @@ class Paperlibraryseeid_items extends Component {
{/*顶部*/}
<div className="w100s sortinxdirection ">
<div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p>
<p className="cretitlecolrlis lh28" style={{fontWeight:"bold"}}>{indexx}</p>
</div>
<style>
{
@ -133,8 +136,16 @@ class Paperlibraryseeid_items extends Component {
color: #333333;
font-size: 14px !important;
line-height: 28px;
font-weight: bold;
}
.bodyysls .ql-editor p span{
font-weight: bold;
}
.markdown-body .ql-editor p {
font-weight: bold;
}
`
}
</style>
@ -142,12 +153,12 @@ class Paperlibraryseeid_items extends Component {
objectsingle.item_type==="PROGRAM"?
<div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"
minWidth:"32px",fontWeight:"bold"
}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",fontWeight:"bold"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div>
@ -155,11 +166,11 @@ class Paperlibraryseeid_items extends Component {
:
<div className="w100s sortinxdirection">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"}}
minWidth:"32px",fontWeight:"bold"}}
>
({objectsingle.score})
</div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{wordBreak: "break-word"}}
<div className="ml10 lh28 listjihetixingstit bodyysls cretitlecolrlist programquill" style={{wordBreak: "break-word",fontWeight:"bold"}}
>
{
itemssname===null || itemssname===undefined?

@ -0,0 +1,42 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './../../question/questioncss/questioncom.css'
//立即申请试用
class QuestionModalys extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>知道啦</a>
</div>
</div>
</Modal>
)
}
}
export default QuestionModalys;

@ -37,6 +37,7 @@ const types = {
GET_COURSE_QUESTION: 'GET_COURSE_QUESTION', // 获取编辑题
CHANGE_KNOWLEDGES: 'CHANGE_KNOWLEDGES', // 保存所选择的知识点
SET_OJ_INITIAL_VALUE: 'SET_OJ_INITIAL_VALUE', // 设置初始值
SET_SEARCH_PARAMS: 'SET_SEARCH_PARAMS', // 只在地址栏参数
// study
SAVE_USER_PROGRAM_ID: 'SAVE_USER_PROGRAM_ID',// 保存用户编程题id值
USER_PROGRAM_DETAIL: 'USER_PROGRAM_DETAIL', // 用户编程题详情

@ -38,7 +38,8 @@ import {
getQuestion,
saveKnowledge,
setOjInitialValue,
tagDisciplines
tagDisciplines,
saveSearchParams
} from './ojForm';
import {
@ -145,6 +146,7 @@ export default {
saveKnowledge,
setOjInitialValue,
tagDisciplines,
saveSearchParams,
//
addTestCase,
deleteTestCase,

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-09 14:14:47
* @LastEditTime : 2020-02-10 18:17:00
*/
import types from "./actionTypes";
import { Base64 } from 'js-base64';
@ -24,7 +24,9 @@ import { notification } from "antd";
// 进入编程页面时,首先调用开启编程题接口
export const startProgramQuestion = (id, props) => {
return (dispatch) => {
return (dispatch, getState) => {
const {searchParams} = getState().ojFormReducer;
console.log(searchParams);
fetchStartProgram(id).then(res => {
const { status, data } = res;
if (status === 200) {
@ -48,7 +50,7 @@ export const startProgramQuestion = (id, props) => {
// console.log(path);
// props.history.push(`/myproblems/${identifier}`);
props.history.push({
pathname: `/myproblems/${identifier}`,
pathname: `/myproblems/${identifier}?${searchParams}`,
});
}
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 16:45:34
* @LastEditTime : 2020-02-11 16:29:32
*/
import types from './actionTypes';
import CONST from '../../constants';
@ -206,7 +206,7 @@ export const validateOjForm = (props, type, cb) => {
if (hasSuccess) {
// console.log('表单保存的数据为: ', getState());
const {ojFormReducer} = getState();
const {code, score, ojForm, testCases = [], tag_discipline_id = []} = ojFormReducer;
const {code, score, ojForm, testCases = [], tag_discipline_id = [], curPage = 1} = ojFormReducer;
const {category, description, difficult, language, name, openOrNot, timeLimit, sub_discipline_id} = ojForm;
let paramsObj = {};
const hack = { // 编程题干
@ -312,14 +312,19 @@ export const validateOjForm = (props, type, cb) => {
payload: identifier
});
console.log(identifier , props.identifier);
// console.log(identifier , props.identifier);
if (identifier || props.identifier) {
dispatch(getOJFormById(identifier || props.identifier));
}
// 保存成功后,调用编辑接口并改变路
if (paramsObj['submitType'] === 'add' && identifier) {
props.history.push(`/problems/${identifier}/edit`);
//更改查询参数
dispatch({
type: types.SET_SEARCH_PARAMS,
searchParams: `editoj=1&pages=${curPage}`,
curPage: curPage
});
props.history.push(`/problems/${identifier}/edit?editoj=1&pages=${curPage}`);
};
}
// 保存或更新后调用start接口
@ -691,7 +696,7 @@ export const getQuestion = (params) => {
disciplines.forEach(c => {
if (sub_discipline_id && c.sub_disciplines) {
c.sub_disciplines.forEach(sub => {
if (+sub.id === sub_discipline_id) {
if (+sub.id === +sub_discipline_id) {
temp_knowledges = sub.tag_disciplines || [];
}
});
@ -763,3 +768,11 @@ export const tagDisciplines = (params) => {
});
}
}
// 保存地址栏参数
export const saveSearchParams = (params) => {
return {
type: types.SET_SEARCH_PARAMS,
payload: params
}
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 16:40:32
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 17:38:50
* @LastEditTime : 2020-02-10 17:59:55
*/
import { Base64 } from 'js-base64';
import types from '../actions/actionTypes';
@ -75,6 +75,8 @@ const init = {
isPublish: 0, // 是否是发布状态: 0 未发布 1 已发布
courseQuestions: [], // 课程题库
knowledges: [], // 知识点下拉值
searchParams: '', // 地址栏参数
curPage: 1, // 当前页数
}
const tcValidateObj = {
@ -350,11 +352,18 @@ const ojFormReducer = (state = initialState, action) => {
}
case types.SET_OJ_INITIAL_VALUE:
const _p = action.payload;
console.log(_p.tag_discipline_id);
return {
...state,
ojForm: Object.assign({}, state.ojForm, {difficult: _p.difficult, sub_discipline_id: _p.sub_discipline_id}),
tag_discipline_id: _p.tag_discipline_id || []
}
case types.SET_SEARCH_PARAMS:
return {
...state,
searchParams: action.payload.searchParams,
curPage: action.payload.curPage
}
default:
return state;
}

Loading…
Cancel
Save