题库编辑试卷

dev_jupyter
杨树林 5 years ago
parent a8d09fba65
commit 3c989da899

@ -508,7 +508,6 @@ class Questionitem_banks extends Component {
{/*题目头部操作*/}
<Itembankstop
{...this.state}
{...this.props}
getcontentMdRef={(ref) => this.getcontentMdRef(ref)}

@ -45,7 +45,6 @@ const options = [
class Itembankstop extends Component {
constructor(props) {
super(props);
this.contentMdRef = React.createRef()
this.state = {
page: 1,
Knowpoints: [],
@ -73,6 +72,47 @@ class Itembankstop extends Component {
}
componentDidUpdate(prevProps) {
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
const _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}
}catch (e) {
}
}
//编辑的时候
if (prevProps.item_banksedit !== this.props.item_banksedit) {
if (this.props.item_banksedit.item_type) {
@ -89,18 +129,17 @@ class Itembankstop extends Component {
}catch (e) {
}
this.getdatasmys();
}
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
@ -117,23 +156,26 @@ class Itembankstop extends Component {
}
}
}
const _result =[];
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
}
handdisciplinesChange =(name,title)=>{
this.setState({
rbkc:[name.id,title.id]
@ -487,7 +529,7 @@ class Itembankstop extends Component {
}
)(
<div className="sortinxdirection">
<InputGroup compact>
<InputGroup >
<Cascader style={{width: '258px'}} value={this.state.rbkc} options={options} onChange={this.handleFormzhishidian}
placeholder="请选择..."/>
</InputGroup>
@ -501,8 +543,8 @@ class Itembankstop extends Component {
{getFieldDecorator("rbzsd"
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} initialValue={undefined} onChange={this.handleFormkechen}
<InputGroup >
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (
@ -552,7 +594,7 @@ class Itembankstop extends Component {
rules: [{required: true, message: '请选择题型'}],
}
)(
<InputGroup compact>
<InputGroup >
<Select style={{width: '258px'}} value={this.state.rbtx} onChange={this.handleFormtixing}
placeholder="请选择...">
<Option value="SINGLE">单选题</Option>

@ -3,7 +3,6 @@ import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModel extends Component {
constructor(props) {
@ -14,7 +13,7 @@ class Paperreview_itemModel extends Component {
}
onChange=(value)=>{
console.log("Paperreview_itemModel");
console.log("设置批量得分");
console.log(value);
this.setState({
value:value,

@ -74,6 +74,52 @@ class Comthetestpaperst extends Component {
componentDidUpdate(prevProps) {
//编辑的时候
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
const fxdidata = didata[i].sub_disciplines;
for (var j = 0; j < fxdidata.length; j++) {
//课程
if (this.props.item_banksedit.sub_discipline.id === fxdidata[j].id) {
const zsddata = fxdidata[j].tag_disciplines;
for (var k = 0; k < zsddata.length; k++) {
//知识点
knowledgepointsdata.push(zsddata[k]);
}
}
}
}
}
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
if (prevProps.item_banksedit !== this.props.item_banksedit) {
// if (this.props.item_banksedit.item_type) {
// this.handleFormtixing(this.props.item_banksedit.item_type);
@ -89,18 +135,41 @@ class Comthetestpaperst extends Component {
}catch (e) {
}
try {
if(this.props.item_banksedit.name){
this.props.form.setFieldsValue({
// course:value,
classroom:this.props.item_banksedit.name,
})
}
}catch (e) {
}
try {
if(this.props.item_banksedit.duration){
this.props.form.setFieldsValue({
// course:value,
kssc:this.props.item_banksedit.duration,
})
}
}catch (e) {
}
this.getdatasmys();
}
if (prevProps.disciplmy !== this.props.disciplmy) {
this.setState({
options: this.props.disciplmy
})
}
// 把知识点放进塞选中 ,如果是编辑 已经选中就不放进去
if(prevProps.disciplinesdata!== this.props.disciplinesdata){
}
getdatasmys=()=>{
if(this.props.disciplinesdata){
try {
if(this.props.item_banksedit.discipline &&this.props.item_banksedit.sub_discipline){
const didata = this.props.disciplinesdata;
const knowledgepointsdata = [];
var didata = this.props.disciplinesdata;
var knowledgepointsdata = [];
for (var i = 0; i < didata.length; i++) {
//方向
if (this.props.item_banksedit.discipline.id === didata[i].id) {
@ -117,18 +186,22 @@ class Comthetestpaperst extends Component {
}
}
}
const _result =[];
var _result =[];
knowledgepointsdata.filter(item => {
if (this.props.item_banksedit.tag_disciplines.findIndex(t => t.id === item.id) === -1) {
_result.push(item);
}
});
this.setState({
knowledgepoints:knowledgepointsdata,
knowledgepoints2: _result,
})
}else{
}
}catch (e) {
}
}
}
@ -374,7 +447,7 @@ class Comthetestpaperst extends Component {
////console.log('Clicked! But prevent default.');
}
deletesobject = (item, index) => {
debugger
var tmp = this.state.Knowpoints;
for (var i = 0; i < tmp.length; i++) {
if (i ===index) {
@ -552,7 +625,7 @@ class Comthetestpaperst extends Component {
)(
<div className="sortinxdirection">
<InputGroup compact>
<Select style={{width: '258px'}} initialValue={undefined} onChange={this.handleFormkechen}
<Select style={{width: '258px'}} value={undefined} onChange={this.handleFormkechen}
placeholder="请选择...">
{knowledgepoints2 && knowledgepoints2.map((object, index) => {
return (

@ -17,10 +17,12 @@ 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 Seeoagertits from "./component/Seeoagertits";
import Paperlibraryseeid_item from './component/Paperlibraryseeid_item';
import Comthetestpaperst from '../question/comthetestpaper/Comthetestpaperst';
import Paperlibraryseeid_itemss from './component/Paperlibraryseeid_itemss';
import JudquestionEditor from "../question/component/JudquestionEditor";
//人工组卷预览
class Paperlibraryeditid extends Component {
constructor(props) {
@ -28,21 +30,22 @@ class Paperlibraryeditid extends Component {
this.contentMdRef = React.createRef();
this.Judquestio = React.createRef();
this.state = {
paperlibrartdata:[],
paperlibrartdata: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
item_banksedit:[]
item_banksedit: []
}
}
getJudquestio = (Ref) => {
this.Judquestio = Ref;
}
//初始化
componentDidMount() {
console.log("Paperlibraryseeid");
this.getdata();
let urls = `/disciplines.json`;
axios.get(urls, {
@ -60,7 +63,7 @@ class Paperlibraryeditid extends Component {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern=[];
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
@ -82,7 +85,7 @@ class Paperlibraryeditid extends Component {
}
}
const datakec={
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
@ -92,7 +95,7 @@ class Paperlibraryeditid extends Component {
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy:this.state.disciplmy,
disciplmy: this.state.disciplmy,
})
@ -112,7 +115,7 @@ class Paperlibraryeditid extends Component {
if (response) {
this.setState({
paperlibrartdata: response.data,
item_banksedit:response.data.exam,
item_banksedit: response.data.exam,
})
}
});
@ -140,8 +143,6 @@ class Paperlibraryeditid extends Component {
//保存试卷
}
@ -150,12 +151,13 @@ class Paperlibraryeditid extends Component {
}
setCohetepaperbool =(bool)=>{
setCohetepaperbool = (bool) => {
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
const params = this.props && this.props.match && this.props.match.params;
@ -189,59 +191,44 @@ class Paperlibraryeditid extends Component {
></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}
<Seeoagertits
all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
difficulty={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.difficulty}
>
</Seeoagertit>
</Seeoagertits>
<Paperlibraryseeid_item
<Paperlibraryseeid_itemss
{...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
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
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
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
}
>
</Paperlibraryseeid_item>
></Paperlibraryseeid_itemss>
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)

@ -218,76 +218,6 @@ class Paperreview_item extends Component {
}
setmodalsTypedel = (bool, type, names) => {
if (type === 1) {
this.setState({
modalsTypedel: bool,
titilesms: names
})
} else {
this.setState({
modalsTypedel: bool,
titilesms: names
})
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);
});
}
}
setmodalsTypedels = (bool, type) => {
if (type === 1) {
this.setState({
modalsTypedels: bool,
})
}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({
modalsTypedels: bool,
})
}
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");

@ -67,8 +67,8 @@ class Paperlibraryseeid_items extends Component {
render() {
let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
console.log("objectsingle");
console.log(objectsingle);
// console.log("objectsingle");
// console.log(objectsingle);
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
@ -121,7 +121,7 @@ class Paperlibraryseeid_items extends Component {
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "} key={index}>
<Radio checked={object.is_answer}>
{object.choice_text}
</Radio>
@ -143,7 +143,7 @@ class Paperlibraryseeid_items extends Component {
{
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"} key={index}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>

@ -0,0 +1,790 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import '../../question/questioncss/questioncom.css';
import '../../tpm/newshixuns/css/Newshixuns.css';
import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from '../../question/component/PaperDeletModel';
import PaperDeletModels from '../../question/component/PaperDeletModels';
import Paperreview_itemModel from '../../question/component/Paperreview_itemModel';
import Paperreview_itemModels from '../../question/component/Paperreview_itemModels';
import Paperreview_items from '../../question/Paperreview_items';
const reorder = (list, startIndex, endIndex) => {
const result = Array.from(list);
const [removed] = result.splice(startIndex, 1);
result.splice(endIndex, 0, removed);
return result;
};
//这不是唯一的 试题库还有 Paperreview_item.js
class Paperlibraryseeid_itemss extends Component {
constructor(props) {
super(props);
this.state = {
questions: 0,
totalscore: 0,
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
onDragEnd = (result) => {
const ids = this.props.single_questions.questions[result.source.index].id;
const positions = this.props.single_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEnds = (result) => {
const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url =`/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
onDragEndsss = (result) => {
const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url = `/examination_items/${ids}/adjust_position.json`;
var data = {
position: positions
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`拖动成功`);
this.props.getdata({});
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazine = (name, bool) => {
if (bool === true) {
this.setState({
modalsTypey: true,
titilesm: name
})
} else {
this.setState({
modalsTypey: false,
titilesm: ""
})
}
}
setDownloady = (fenshu) => {
const url = "/examination_items/batch_set_score.json";
var data = {
exam_id:this.props.match.params.id,
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);
})
}
setDownloadys=(value)=>{
const url = `/examination_items/${this.state.set_scoreid}/set_score.json`;
var data = {
score: value,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
this.props.showNotification(`调分成功`);
this.props.getdata({});
this.Singlemagazines(false);
}
}).catch((error) => {
console.log(error);
})
}
Singlemagazines=(bool,id,name)=>{
if(bool===true){
this.setState({
set_scoreid:id,
modalsTypeys:bool,
titilesm: name
})
}else{
this.setState({
modalsTypeys:bool,
set_scoreid:null,
titilesm: null
})
}
}
setmodalsTypedel = (bool, type, names) => {
if (type === 1) {
this.setState({
modalsTypedel: bool,
titilesms: names
})
} else {
this.setState({
modalsTypedel: bool,
titilesms: names
})
const url = `/examination_items/delete_item_type.json`;
axios.delete((url), {
data: {
exam_id:this.props.match.params.id,
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);
});
}
}
setmodalsTypedels = (bool, type) => {
if (type === 1) {
this.setState({
modalsTypedels: bool,
})
}else {
//确定
const url = `/examination_items/${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({
modalsTypedels: bool,
})
}
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");
}
hideparagraphs = () => {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
showparagraph = (name) => {
console.log("showparagraph");
if (name === "SINGLE") {
this.setState({
singlebool: true,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
showparagraphs = (e,name) => {
console.log("showparagraphs");
console.log(e);
this.setState({
paperreviewsingleindex: e,
paperreviewsinglename:name,
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
})
}
Setscore=(id)=>{
}
render() {
let {
questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
<div className=" w100s ">
{
modalsTypedel === true ?
<PaperDeletModel {...this.state} {...this.props}
setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
: ""
}
{
modalsTypey === true ?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs) => this.setDownloady(fs)}
Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
}
{
modalsTypeys === true ?
<Paperreview_itemModels {...this.state} {...this.props} setDownloadys={(value) => this.setDownloadys(value)}
Singlemagazines={(bool,id,name) => this.Singlemagazines(bool,id,name)}></Paperreview_itemModels>
: ""
}
{
modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props}
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
{/*单选题*/}
{
single_questions && single_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s mt20 mb20 postitonrelati">
<div
className={singlebool === true ? "w100s sortinxdirection borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}>
<p className={singlebool === true ? "ml18 yldxtit" : "yldxtit"}>单选题</p> <p
className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
</div>
{
singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div>
</div> : ""
}
<DragDropContext onDragEnd={this.onDragEnd}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
single_questions && single_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"SINGLE"}
typenamesn={"单选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
multiple_questions && multiple_questions ?
<div className="backgroudwhites" style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={multiplebool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("MULTIPLE")}
onMouseLeave={() => this.hideparagraph("MULTIPLE")}>
<p
className={multiplebool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
<p
className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
</div>
{
multiplebool === true ?
<div className="postitonrelatisss xaxisreverseorder ">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEnds}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
multiple_questions && multiple_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"MULTIPLE"}
typenamesn={"多选题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
{
judgement_questions && judgement_questions ?
<div className={judgmentbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={judgmentbool === true ? "w100s sortinxdirection borderwdswuhques mt10 intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls "}
onMouseEnter={() => this.showparagraph("JUDGMENT")}
onMouseLeave={() => this.hideparagraph("JUDGMENT")}>
<p
className={judgmentbool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
: single_questions !== null && multiple_questions === null ? "二"
: "三"}判断题</p> <p
className="ml15 yldxtits">{judgement_questions && judgement_questions.questions_count}{judgement_questions && judgement_questions.questions_score}</p>
</div>
{
judgmentbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div>
</div>
: ""}
<DragDropContext onDragEnd={this.onDragEndss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
judgement_questions && judgement_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"JUDGMENT"}
typenamesn={"判断题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
: ""
}
{
program_questions && program_questions ?
<div className={programbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
<div className="h20 lh20"></div>
<div className="w100s mb20 postitonrelati">
<div
className={programbool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls " : "w100s sortinxdirection intermediatecenterysls"}
onMouseEnter={() => this.showparagraph("PROGRAM")}
onMouseLeave={() => this.hideparagraph("PROGRAM")}>
<p className={programbool === true ? "ml18 yldxtit" : "yldxtit"}>
{single_questions === null && multiple_questions === null && program_questions === null ? "一"
: single_questions === null && multiple_questions === null && program_questions !== null ? "二"
: single_questions !== null && multiple_questions === null && program_questions === null ? "二"
: single_questions === null && multiple_questions !== null && program_questions === null ? "二"
: single_questions !== null && multiple_questions !== null && program_questions === null ? "三"
: single_questions === null && multiple_questions !== null && program_questions !== null ? "三"
: single_questions !== null && multiple_questions == null && program_questions !== null ? "三" :
"四"}
编程题</p> <p
className="ml15 yldxtits">{program_questions && program_questions.questions_count}{program_questions && program_questions.questions_score}</p>
</div>
{
programbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div>
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("编程题", true)}>批量设置得分</div>
</div>
: ""
}
<DragDropContext onDragEnd={this.onDragEndsss}>
<Droppable droppableId={"0"}>
{(provided, snapshot) => (
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={""}
onScroll={this.contentViewScrolledit}
>
{
program_questions && program_questions.questions.map((object, index) => {
return (
<Draggable
key={object.id}
draggableId={object.id}
index={index}
className={""}
>
{(provided, snapshot) => (
<div
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
{...provided.dragHandleProps}
>
<Paperreview_items
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
indexs={index}
typenames={"PROGRAM"}
typenamesn={"编程题"}
showsetmodalsTypedels={(id,bool,type)=>this.showsetmodalsTypedels(id,bool,type)}
Singlemagazines={(bool,id,name)=>this.Singlemagazines(bool,id,name)}
showparagraphs={(e,name) => this.showparagraphs(e,name)}
object={object}
hideparagraphs={() => this.hideparagraphs()}
>
</Paperreview_items>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div>
)
}
}
export default Paperlibraryseeid_itemss

@ -0,0 +1,70 @@
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,
Radio,
Checkbox
} from "antd";
import './../testioncss/testioncss.css';
class Seeoagertit extends Component {
constructor(props) {
super(props);
this.state = {
page:1,
}
}
//初始化
componentDidMount(){
}
onChange=(e)=> {
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
}
render() {
return (
<div className="w100s mt20 mb20 backgroudwhites" style={{
position: "relative",
}}>
<div className="w100s sortinxdirection">
<div className="w70s sortinxdirection">
<p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstishu lh34">总分<span className="questionstotal">{this.props.all_questions_count}</span></p>
<p className="ml58 questionstishu lh34">难度<span className="questionstotal">
{this.props.difficulty===undefined?"":
this.props.difficulty===1?"简单":this.props.difficulty===2?"适中":this.props.difficulty===3?"困难":""
}
</span></p>
</div>
<div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.jixuxuantioncli()}>
继续选题
</div>
</div>
</div>
<div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
</div>
</div>
)
}
}
export default Seeoagertit ;
Loading…
Cancel
Save