dev_jupyter
杨树林 5 years ago
parent 952ffd1043
commit 074111a1ce

@ -318,6 +318,11 @@ const Testpaperlibrary= Loadable({
loader: () => import('./modules/testpaper/Testpaperlibrary'),
loading: Loading
})
//试卷编辑
const Paperlibraryeditid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryeditid'),
loading: Loading
})
//试卷查看
const Paperlibraryseeid= Loadable({
loader: () => import('./modules/testpaper/Paperlibraryseeid'),
@ -760,7 +765,10 @@ class App extends Component {
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} />
<Route path="/paperlibrary/edit/:id"
render={
(props) => (<Paperlibraryeditid {...this.props} {...props} {...this.state} />)
}/>
<Route path="/paperlibrary/see/:id"
render={

@ -502,7 +502,7 @@ class Itembankstop extends Component {
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
<Select style={{width: '258px'}} initialValue={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
@ -525,7 +525,7 @@ class Itembankstop extends Component {
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div className="mytags" style={{
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
@ -625,7 +625,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择难度'}],
}
)(
<Radio.Group value={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Group initialValue={this.state.rbnd} onChange={this.handleFormLayoutChange}>
<Radio.Button value="1">简单</Radio.Button>
<Radio.Button value="2">适中</Radio.Button>
<Radio.Button value="3">困难</Radio.Button>

@ -575,7 +575,7 @@ class Comthetestpaperst extends Component {
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div className="mytags" style={{
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>

@ -0,0 +1,247 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Seeoagertit from "./component/Seeoagertit";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
//人工组卷预览
class Paperlibraryeditid extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
}
}
//初始化
componentDidMount() {
console.log("Paperlibraryseeid");
this.getdata();
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
})
if (response.data) {
if (response.data.disciplines) {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern=[];
//方向
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
const zsddata = fxdidata[j].tag_disciplines;
childern.push(
{
value: fxdidata[j].id,
label: fxdidata[j].name,
}
)
for (var k = 0; k < zsddata.length; k++) {
//知识点
this.state.knowledgepoints.push(zsddata[k]);
}
}
const datakec={
value: didata[i].id,
label: didata[i].name,
children: childern,
}
this.state.disciplmy.push(datakec);
}
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy:this.state.disciplmy,
})
}
}
}
});
}
getdata = () => {
let urls = `/examination_banks/${this.props.match.params.id}.json`;
axios.get(urls).then((response) => {
if (response) {
this.setState({
paperlibrartdata: response.data,
})
}
});
}
//跳转道描点的地方
scrollToAnchor = (anchorName) => {
try {
if (anchorName) {
// 找到锚点
let anchorElement = document.getElementById(anchorName);
// 如果对应id的锚点存在就跳转到锚点
if (anchorElement) {
anchorElement.scrollIntoView();
}
}
} catch (e) {
}
}
preservation = () => {
//保存试卷
}
setitem_type = (item_type) => {
}
setCohetepaperbool =(bool)=>{
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
// //console.log(params);
return (
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<style>
{
`
.newFooter{
display: none;
}
`
}
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb>
</div>
<Comthetestpaperst {...this.state} {...this.props}></Comthetestpaperst>
<div className="seesjtit intermediatecenter mt16">
{paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.name}
</div>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertit all_score={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_score}
>
</Seeoagertit>
<Paperlibraryseeid_item
{...this.state}
{...this.props}
getdata={()=>this.getdata()}
single_questions={paperlibrartdata&&paperlibrartdata.single_questions&&paperlibrartdata.single_questions.questions.length>0?paperlibrartdata.single_questions:null}
multiple_questions={paperlibrartdata&&paperlibrartdata.multiple_questions
&&paperlibrartdata.multiple_questions.questions.length>0?paperlibrartdata.multiple_questions:null
}
judgement_questions={paperlibrartdata&&paperlibrartdata.judgement_questions
&&paperlibrartdata.judgement_questions.questions.length>0?paperlibrartdata.judgement_questions:null
}
program_questions={paperlibrartdata&&paperlibrartdata.program_questions
&&paperlibrartdata.program_questions.questions.length>0?paperlibrartdata.program_questions:null
}
>
</Paperlibraryseeid_item>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)
}
}
export default SnackbarHOC()(TPMIndexHOC(Paperlibraryeditid));

@ -336,6 +336,13 @@ class Testpaperlibrary extends Component {
})
};
Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`);
}
showmodelysl = (id) => {
this.setState({
modalsType: true,
@ -400,6 +407,7 @@ class Testpaperlibrary extends Component {
<Contentpart
{...this.props}
{...this.state}
Testpapereditor={(e)=>this.Testpapereditor(e)}
setdifficulty={(e)=>this.setdifficulty(e)}
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}

@ -196,6 +196,7 @@ class Contentpart extends Component {
: this.props.Contentdata.exams.map((object, index) => {
return (
<Listjihe {...this.state} {...this.props} items={object} key={index}
Testpapereditor={(e)=>this.props.Testpapereditor(e)}
showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)}
>

@ -115,7 +115,7 @@ class Listjihe extends Component {
<span>删除</span>
</p>
<a >
<p className="viewparsings xiaoshou mr25 " >
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.Testpapereditor(items.id)}>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>

Loading…
Cancel
Save