调整 单独试题删除

dev_jupyter
杨树林 5 years ago
parent caca2d0b5e
commit e9f192b705

@ -21,6 +21,8 @@ import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from './component/PaperDeletModel';
import PaperDeletModels from './component/PaperDeletModels';
import Paperreview_itemModel from './component/Paperreview_itemModel';
import Paperreview_itemModels from './component/Paperreview_itemModels';
import Paperreview_items from './Paperreview_items';
const reorder = (list, startIndex, endIndex) => {
@ -41,6 +43,7 @@ class Paperreview_item extends Component {
total: 0,
modalsTypedel: false,
modalsTypey: false,
modalsTypeys: false,
modalsTypedels: false,
titilesm: "",
titilesms: "",
@ -48,7 +51,9 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无"
paperreviewsingleindex: "无",
set_scoreid:null,
item_bank_id:null
}
}
@ -189,6 +194,40 @@ class Paperreview_item extends Component {
})
}
setDownloadys=(value)=>{
const url = `/item_baskets/${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({
@ -198,9 +237,29 @@ class Paperreview_item extends Component {
} else {
this.setState({
modalsTypedel: bool,
modalsTypedels: true,
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);
});
}
}
@ -209,11 +268,10 @@ class Paperreview_item extends Component {
if (type === 1) {
this.setState({
modalsTypedels: bool,
titilesms: ""
})
} else {
}else {
//确定
const url = `/item_baskets/delete_item_type.json`;
const url = `/item_baskets/${this.state.item_bank_id}.json`;
axios.delete((url), {
data: {
item_type: this.state.titilesms
@ -221,15 +279,12 @@ class Paperreview_item extends Component {
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('删除成功');
this.props.showNotification('试题删除成功');
this.props.getdata({});
this.setState({
titilesms: ""
})
}
})
.catch(function (error) {
//console.log(error);
});
this.setState({
@ -239,6 +294,14 @@ class Paperreview_item extends Component {
}
showsetmodalsTypedels=(id,bool,type)=>{
debugger
this.setState({
item_bank_id:id,
})
this.setmodalsTypedels(bool,type);
}
hideparagraph = (name) => {
console.log("hideparagraph");
@ -260,6 +323,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
@ -269,6 +334,9 @@ class Paperreview_item extends Component {
multiplebool: true,
judgmentbool: false,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "JUDGMENT") {
@ -277,6 +345,8 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: true,
programbool: false,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
} else if (name === "PROGRAM") {
@ -285,6 +355,9 @@ class Paperreview_item extends Component {
multiplebool: false,
judgmentbool: false,
programbool: true,
paperreviewsingleindex:"无",
paperreviewsinglename:"",
})
}
@ -294,14 +367,26 @@ class Paperreview_item extends Component {
this.props.history.replace("/question");
}
showparagraphs = (e) => {
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,
@ -309,7 +394,8 @@ class Paperreview_item extends Component {
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex
paperreviewsingleindex,
modalsTypeys
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return (
@ -326,10 +412,17 @@ class Paperreview_item extends Component {
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={(bool, type) => this.setmodalsTypedels(bool, type)}></PaperDeletModels>
setmodalsTypedels={(id,bool, type) => this.setmodalsTypedels(id,bool, type)}></PaperDeletModels>
: ""
}
<div className="w100s mt20 mb20 backgroudwhites" style={{
@ -402,17 +495,23 @@ class Paperreview_item extends Component {
{...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 className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
showparagraphs={(e) => this.showparagraphs(e)}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
</div>
)}
</Draggable>
@ -487,14 +586,22 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<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>
@ -566,14 +673,22 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<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>
@ -650,14 +765,21 @@ class Paperreview_item extends Component {
{...provided.dragHandleProps}
>
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
<Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
objectsingle={object} key={index} indexx={index + 1}
indexxy={index}
hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
<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>

@ -0,0 +1,88 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from "./Paperreview_single";
//判断题
class Paperreview_items extends Component {
constructor(props) {
super(props);
this.state = {
}
}
//初始化
componentDidMount() {
}
getdata = (data) => {
}
preservation = () => {
}
setitem_type = (item_type) => {
}
render() {
let {paperreviewsingleindex,paperreviewsinglename,typenames,indexs,object,typenamesn}=this.props;
return (
<div>
{
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.id,true,1)}>删除</div>
<div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div>
</div>
: <div className="xaxisreverseorder mt25 ">
</div>
}
<Paperreview_single paperreviewsingleindex={paperreviewsingleindex}
name={typenames}
key={indexs}
showparagraphs={(e,name) => this.props.showparagraphs(e,name)}
objectsingle={object} key={indexs} indexx={indexs + 1}
indexxy={indexs}
hideparagraphs={() => this.props.hideparagraphs()}></Paperreview_single>
</div>
)
}
}
export default Paperreview_items

@ -62,21 +62,17 @@ class Paperreview_single extends Component {
}
setmodalsTypedels = () => {
}
Singlemagaziness = () => {
}
render() {
let {questions, totalscore, total, items} = this.state;
let {objectsingle, indexx, paperreviewsingleindex, indexxy} = this.props;
let {objectsingle, indexx, paperreviewsingleindex, indexxy,name} = this.props;
return (
<div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy)} style={{
onMouseEnter={() => this.props.showparagraphs(indexxy,name)} style={{
minHeight: "114px",
}}>

@ -0,0 +1,68 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal,InputNumber} from 'antd';
import axios from 'axios';
import './../questioncss/questioncom.css'
//立即申请试用
class Paperreview_itemModels extends Component {
constructor(props) {
super(props);
this.state={
value:0,
}
}
onChange=(value)=>{
console.log("Paperreview_itemModels");
console.log(value);
this.setState({
value:value,
})
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="设置分数"
centered={true}
visible={this.props.modalsTypeys===undefined?false:this.props.modalsTypeys}
width="442px"
>
<style>
{
`
.yslzxueshisanfd .ant-input-number{
height: 35px !important;
width: 124px !important;
}
`
}
</style>
<div className="educouddiv intermediatecenter">
<div className={"tabeltext-alignleft mt10 sortinxdirection yslzxueshisanfd"}>
<p className="titiles lh35">
{this.props.titilesm}</p>
<InputNumber min={0}
step={0.1}
onChange={this.onChange} />
<p className="titiles ml5 lh35">
/
</p>
</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>
</div>
</div>
</Modal>
)
}
}
export default Paperreview_itemModels;
Loading…
Cancel
Save