Merge branch 'dev_item_bank' into dev_jupyter

dev_static
daiao 5 years ago
commit e1655dfa29

@ -82,7 +82,7 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net" // proxy = "https://testeduplus2.educoder.net"
//proxy="http://47.96.87.25:48080" //proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net" proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net" // proxy="https://test-newweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net" proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001" //proxy="http://192.168.2.63:3001"

@ -510,7 +510,7 @@ class DetailCards extends Component{
{this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true? {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?
item.shixuns_list && item.shixuns_list.map((line,index)=>{ item.shixuns_list && item.shixuns_list.map((line,index)=>{
return( return(
<div className="clearfix paragraph lineh-30" onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}> <div className="clearfix paragraph lineh-30" onMouseEnter>
<li className="fl li-width63"> <li className="fl li-width63">
@ -681,4 +681,4 @@ export default DetailCards;
// </Droppable> // </Droppable>
// </DragDropContext> // </DragDropContext>
// </div> // </div>
// } // }

@ -17,7 +17,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css'; import '../tpm/newshixuns/css/Newshixuns.css';
import Paperreview_single from './Paperreview_single'; import Paperreview_single from './Paperreview_single';
import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd';
import PaperDeletModel from './component/PaperDeletModel'; import PaperDeletModel from './component/PaperDeletModel';
import PaperDeletModels from './component/PaperDeletModels'; import PaperDeletModels from './component/PaperDeletModels';
import Paperreview_itemModel from './component/Paperreview_itemModel'; import Paperreview_itemModel from './component/Paperreview_itemModel';
@ -36,14 +36,19 @@ class Paperreview_item extends Component {
super(props); super(props);
this.state = { this.state = {
questions:0, questions: 0,
totalscore:0, totalscore: 0,
total:0, total: 0,
modalsTypedel:false, modalsTypedel: false,
modalsTypey:false, modalsTypey: false,
modalsTypedels:false, modalsTypedels: false,
titilesm:"", titilesm: "",
titilesms:"", titilesms: "",
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: false,
paperreviewsingleindex: "无"
} }
} }
@ -52,8 +57,6 @@ class Paperreview_item extends Component {
componentDidMount() { componentDidMount() {
} }
@ -64,8 +67,6 @@ class Paperreview_item extends Component {
preservation = () => { preservation = () => {
} }
@ -73,14 +74,14 @@ class Paperreview_item extends Component {
} }
onDragEnd=(result)=>{ onDragEnd = (result) => {
const ids=this.props.single_questions.questions[result.source.index].id; const ids = this.props.single_questions.questions[result.source.index].id;
const positions=this.props.single_questions.questions[result.destination.index].position; const positions = this.props.single_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
var data={ var data = {
position:positions position: positions
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -93,13 +94,13 @@ class Paperreview_item extends Component {
}) })
} }
onDragEnds=(result)=>{ onDragEnds = (result) => {
const ids=this.props.multiple_questions.questions[result.source.index].id; const ids = this.props.multiple_questions.questions[result.source.index].id;
const positions=this.props.multiple_questions.questions[result.destination.index].position; const positions = this.props.multiple_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
var data={ var data = {
position:positions position: positions
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -115,12 +116,12 @@ class Paperreview_item extends Component {
} }
onDragEndss=(result)=>{ onDragEndss = (result) => {
const ids=this.props.judgement_questions.questions[result.source.index].id; const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions=this.props.judgement_questions.questions[result.destination.index].position; const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
var data={ var data = {
position:positions position: positions
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -134,13 +135,13 @@ class Paperreview_item extends Component {
} }
onDragEndsss=(result)=>{ onDragEndsss = (result) => {
const ids=this.props.judgement_questions.questions[result.source.index].id; const ids = this.props.judgement_questions.questions[result.source.index].id;
const positions=this.props.judgement_questions.questions[result.destination.index].position; const positions = this.props.judgement_questions.questions[result.destination.index].position;
const url=`/item_baskets/${ids}/adjust_position.json` const url = `/item_baskets/${ids}/adjust_position.json`
var data={ var data = {
position:positions position: positions
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
@ -153,76 +154,78 @@ class Paperreview_item extends Component {
}) })
} }
Singlemagazine=(name,bool)=>{ Singlemagazine = (name, bool) => {
if(bool===true){ if (bool === true) {
this.setState({ this.setState({
modalsTypey:true, modalsTypey: true,
titilesm:name titilesm: name
}) })
}else { } else {
this.setState({ this.setState({
modalsTypey:false, modalsTypey: false,
titilesm:"" titilesm: ""
}) })
} }
} }
setDownloady=(fenshu)=>{ setDownloady = (fenshu) => {
const url ="/item_baskets/batch_set_score.json"; const url = "/item_baskets/batch_set_score.json";
var data ={ var data = {
score:fenshu, score: fenshu,
item_type:this.state.titilesm==="单选题"?"SINGLE":this.state.titilesm==="多选题"?"MULTIPLE":this.state.titilesm==="判断题"?"JUDGMENT":this.state.titilesm==="编程题"?"PROGRAM":'', item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '',
} }
axios.post(url, data) axios.post(url, data)
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
this.props.showNotification(`调分成功`); this.props.showNotification(`调分成功`);
this.props.getdata({}); this.props.getdata({});
this.Singlemagazine("",false); this.Singlemagazine("", false);
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
setmodalsTypedel=(bool,type,names)=>{ setmodalsTypedel = (bool, type, names) => {
if(type===1){ if (type === 1) {
this.setState({ this.setState({
modalsTypedel:bool, modalsTypedel: bool,
titilesms:names titilesms: names
}) })
}else{ } else {
this.setState({ this.setState({
modalsTypedel:bool, modalsTypedel: bool,
modalsTypedels:true, modalsTypedels: true,
titilesms:names titilesms: names
}) })
} }
} }
setmodalsTypedels=(bool,type)=>{ setmodalsTypedels = (bool, type) => {
if(type===1){ if (type === 1) {
this.setState({ this.setState({
modalsTypedels:bool, modalsTypedels: bool,
titilesms:"" titilesms: ""
}) })
}else { } else {
//确定 //确定
const url=`/item_baskets/delete_item_type.json`; const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), { data: { axios.delete((url), {
item_type:this.state.titilesms data: {
}}) item_type: this.state.titilesms
}
})
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.props.showNotification('删除成功'); this.props.showNotification('删除成功');
this.props.getdata({}); this.props.getdata({});
this.setState({ this.setState({
titilesms:"" titilesms: ""
}) })
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -230,298 +233,452 @@ class Paperreview_item extends Component {
}); });
this.setState({ this.setState({
modalsTypedels:bool, modalsTypedels: bool,
})
}
}
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,
})
} else if (name === "MULTIPLE") {
this.setState({
singlebool: false,
multiplebool: true,
judgmentbool: false,
programbool: false,
})
} else if (name === "JUDGMENT") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: true,
programbool: false,
})
} else if (name === "PROGRAM") {
this.setState({
singlebool: false,
multiplebool: false,
judgmentbool: false,
programbool: true,
}) })
} }
}
jixuxuantioncli = () => {
this.props.history.replace("/question");
} }
showparagraphs = (e) => {
console.log("showparagraphs");
console.log(e);
this.setState({
paperreviewsingleindex: e,
})
}
render() { render() {
let {questions,totalscore,total,modalsTypedel,modalsTypey,modalsTypedels} = this.state; let {
let {single_questions,multiple_questions,judgement_questions,program_questions,all_score}=this.props; questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels,
singlebool,
multiplebool,
judgmentbool,
programbool,
paperreviewsingleindex
} = this.state;
let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props;
return ( return (
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19"> <div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
{ {
modalsTypedel===true? modalsTypedel === true ?
<PaperDeletModel {...this.state} {...this.props} setmodalsTypedel={(bool,type,name)=>this.setmodalsTypedel(bool,type,name)}></PaperDeletModel> <PaperDeletModel {...this.state} {...this.props}
:"" setmodalsTypedel={(bool, type, name) => this.setmodalsTypedel(bool, type, name)}></PaperDeletModel>
: ""
} }
{ {
modalsTypey===true? modalsTypey === true ?
<Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs)=>this.setDownloady(fs)} Singlemagazine={(name,bool)=>this.Singlemagazine(name,bool)}></Paperreview_itemModel> <Paperreview_itemModel {...this.state} {...this.props} setDownloady={(fs) => this.setDownloady(fs)}
:"" Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}></Paperreview_itemModel>
: ""
} }
{ {
modalsTypedels===true? modalsTypedels === true ?
<PaperDeletModels {...this.state} {...this.props} setmodalsTypedels={(bool,type)=>this.setmodalsTypedels(bool,type)}></PaperDeletModels> <PaperDeletModels {...this.state} {...this.props}
:"" setmodalsTypedels={(bool, type) => this.setmodalsTypedels(bool, type)}></PaperDeletModels>
: ""
} }
<div className="w100s mt20 mb20 backgroudwhites" style={{ <div className="w100s mt20 mb20 backgroudwhites" style={{
position:"relative", position: "relative",
}}> }}>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<p className="questionstishu">题数{this.props.all_score}</p> <div className="w70s sortinxdirection">
<p className="ml58 questionstotal">总分{this.props.all_questions_count}</p> <p className="questionstishu lh34">题数{this.props.all_score}</p>
<p className="ml58 questionstotal lh34">总分{this.props.all_questions_count}</p>
</div>
<div className="w30s xaxisreverseorder">
<div className="jixuxuanti xiaoshou" onClick={() => this.jixuxuantioncli()}>
继续选题
</div>
</div>
</div> </div>
<div className="questiontypeheng w100s mt19 mb19"></div> <div className="questiontypeheng w100s mt19 mb19"></div>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div> <div className="pagertdstcolor w50s sortinxdirection">拖动试题可调整排序</div>
<div className="pagertdstcolor w50s xaxisreverseorder">{single_questions&&single_questions.questions_count}个试题</div> <div
className="pagertdstcolor w50s xaxisreverseorder">{single_questions && single_questions.questions_count}个试题
</div> </div>
{/*单选题*/} </div>
{
single_questions&&single_questions? {/*单选题*/}
<div className="backgroudwhites" style={{ {
position: "relative", single_questions && single_questions ?
}}> <div className="backgroudwhites" style={{
position: "relative",
<div className="w100s mt20 mb20 postitonrelati"> }}>
<div className="w100s sortinxdirection">
<p className="yldxtit">单选题</p> <p className="ml15 yldxtits">{single_questions&&single_questions.questions_count}{single_questions&&single_questions.questions_score}</p> <div className="w100s mt20 mb20 postitonrelati">
</div> <div
<div className="postitonrelatis xaxisreverseorder"> className={singlebool === true ? "w100s sortinxdirection borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
<div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"SINGLE")}>删除</div> onMouseEnter={() => this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}>
<div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("单选题",true)} >设置得分</div> <p className={singlebool === true ? "ml18 yldxtit" : "yldxtit"}>单选题</p> <p
</div> className="ml15 yldxtits">{single_questions && single_questions.questions_count}{single_questions && single_questions.questions_score}</p>
<DragDropContext onDragEnd={this.onDragEnd} > </div>
<Droppable droppableId={"0"}> {
{(provided, snapshot) => ( singlebool === true ?
<div <div className="postitonrelatiss xaxisreverseorder">
ref={provided.innerRef} <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
{...provided.droppableProps} <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div>
className={""} </div> : ""
onScroll={this.contentViewScrolledit} }
> <DragDropContext onDragEnd={this.onDragEnd}>
{ <Droppable droppableId={"0"}>
single_questions&&single_questions.questions.map((object, index) => { {(provided, snapshot) => (
return ( <div
<Draggable ref={provided.innerRef}
key={object.id} {...provided.droppableProps}
draggableId={object.id} className={""}
index={index} onScroll={this.contentViewScrolledit}
className={""} >
> {
{(provided, snapshot) => ( single_questions && single_questions.questions.map((object, index) => {
<div return (
key={index} <Draggable
ref={provided.innerRef} key={object.id}
{...provided.draggableProps} draggableId={object.id}
{...provided.dragHandleProps} index={index}
> className={""}
<Paperreview_single objectsingle={object}></Paperreview_single> >
</div> {(provided, snapshot) => (
)} <div
</Draggable> key={index}
) ref={provided.innerRef}
}) {...provided.draggableProps}
{...provided.dragHandleProps}
} >
</div>
)}
</Droppable> <div className="xaxisreverseorder mt25 mr2">
</DragDropContext> <div className="scd xiaoshou">删除</div>
<div className="szdfd xiaoshou">设置得分</div>
</div>
</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>
{ )}
multiple_questions&&multiple_questions? </Draggable>
<div className="backgroudwhites" style={{ )
position: "relative", })
}}>
<div className="h20 lh20"></div> }
<div className="w100s mb20 postitonrelati"> </div>
<div className="w100s sortinxdirection"> )}
<p className="yldxtit">{single_questions===null?"一":"二"}多选题</p> <p className="ml15 yldxtits">{multiple_questions&&multiple_questions.questions_count}{multiple_questions&&multiple_questions.questions_score}</p> </Droppable>
</div> </DragDropContext>
<div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"MULTIPLE")}>删除</div>
<div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("多选题",true)}>设置得分</div> </div>
</div> </div>
<DragDropContext onDragEnd={this.onDragEnds} > : ""
<Droppable droppableId={"0"}> }
{(provided, snapshot) => (
<div
ref={provided.innerRef} {
{...provided.droppableProps} multiple_questions && multiple_questions ?
className={""} <div className="backgroudwhites" style={{
onScroll={this.contentViewScrolledit} position: "relative",
> }}>
{ <div className="h20 lh20"></div>
multiple_questions&&multiple_questions.questions.map((object, index) => { <div className="w100s mb20 postitonrelati">
return ( <div
<Draggable className={multiplebool === true ? "w100s sortinxdirection mt10 borderwdswuhques intermediatecenterysls" : "w100s sortinxdirection intermediatecenterysls"}
key={object.id} onMouseEnter={() => this.showparagraph("MULTIPLE")}
draggableId={object.id} onMouseLeave={() => this.hideparagraph("MULTIPLE")}>
index={index} <p
className={""} className={multiplebool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null ? "一" : "二"}多选题</p>
> <p
{(provided, snapshot) => ( className="ml15 yldxtits">{multiple_questions && multiple_questions.questions_count}{multiple_questions && multiple_questions.questions_score}</p>
<div </div>
key={index} {
ref={provided.innerRef} multiplebool === true ?
{...provided.draggableProps} <div className="postitonrelatisss xaxisreverseorder ">
{...provided.dragHandleProps} <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
> </div>
<Paperreview_single objectsingle={object}></Paperreview_single> <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div>
</div> </div>
)}
</Draggable> : ""
) }
})
} <DragDropContext onDragEnd={this.onDragEnds}>
</div> <Droppable droppableId={"0"}>
)} {(provided, snapshot) => (
</Droppable> <div
</DragDropContext> ref={provided.innerRef}
{...provided.droppableProps}
className={""}
</div> onScroll={this.contentViewScrolledit}
</div> >
: {
"" multiple_questions && multiple_questions.questions.map((object, index) => {
} return (
<Draggable
{ key={object.id}
judgement_questions&&judgement_questions? draggableId={object.id}
<div className="backgroudwhites" style={{ index={index}
position: "relative", className={""}
}}> >
{(provided, snapshot) => (
<div className="w100s mt20 mb20 postitonrelati"> <div
<div className="w100s sortinxdirection"> key={index}
<p className="yldxtit">{single_questions===null&&multiple_questions===null?"一":single_questions===null&&multiple_questions!==null?"二" ref={provided.innerRef}
:single_questions!==null&&multiple_questions===null?"二" {...provided.draggableProps}
:"三"}判断题</p> <p className="ml15 yldxtits">{judgement_questions&&judgement_questions.questions_count}{judgement_questions&&judgement_questions.questions_score}</p> {...provided.dragHandleProps}
</div> >
<div className="postitonrelatis xaxisreverseorder">
<div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"JUDGMENT")}>删除</div> <div className="xaxisreverseorder mt25 mr2">
<div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("判断题",true)}>设置得分</div> <div className="scd xiaoshou">删除</div>
</div> <div className="szdfd xiaoshou">设置得分</div>
</div>
<DragDropContext onDragEnd={this.onDragEndss} > <Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
<Droppable droppableId={"0"}> objectsingle={object} key={index} indexx={index + 1}
{(provided, snapshot) => ( indexxy={index}
<div hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
ref={provided.innerRef} </div>
{...provided.droppableProps} )}
className={""} </Draggable>
onScroll={this.contentViewScrolledit} )
> })
{
judgement_questions&&judgement_questions.questions.map((object, index) => { }
return ( </div>
<Draggable )}
key={object.id} </Droppable>
draggableId={object.id} </DragDropContext>
index={index}
className={""}
> </div>
{(provided, snapshot) => ( </div>
<div :
key={index} ""
ref={provided.innerRef} }
{...provided.draggableProps}
{...provided.dragHandleProps} {
> judgement_questions && judgement_questions ?
<Paperreview_single objectsingle={object}></Paperreview_single> <div className={judgmentbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
</div> position: "relative",
)} }}>
</Draggable> <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")}
</div> onMouseLeave={() => this.hideparagraph("JUDGMENT")}>
)} <p
</Droppable> className={judgmentbool === true ? "ml18 yldxtit" : "yldxtit"}>{single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二"
</DragDropContext> : single_questions !== null && multiple_questions === null ? "二"
</div> : "三"}判断题</p> <p
</div> 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")}>删除
program_questions&&program_questions? </div>
<div className="backgroudwhites" style={{ <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div>
position: "relative", </div>
}}> : ""}
<div className="w100s mt20 mb20 postitonrelati"> <DragDropContext onDragEnd={this.onDragEndss}>
<div className="w100s sortinxdirection"> <Droppable droppableId={"0"}>
<p className="yldxtit"> {(provided, snapshot) => (
{single_questions===null&&multiple_questions===null&&program_questions===null?"一" <div
:single_questions===null&&multiple_questions===null&&program_questions!==null?"二" ref={provided.innerRef}
:single_questions!==null&&multiple_questions===null&&program_questions===null?"二" {...provided.droppableProps}
:single_questions===null&&multiple_questions!==null&&program_questions===null?"二" className={""}
:single_questions!==null&&multiple_questions!==null&&program_questions===null?"三" onScroll={this.contentViewScrolledit}
:single_questions===null&&multiple_questions!==null&&program_questions!==null?"三" >
:single_questions!==null&&multiple_questions==null&&program_questions!==null?"三": {
"四"} judgement_questions && judgement_questions.questions.map((object, index) => {
编程题</p> <p className="ml15 yldxtits">{program_questions&&program_questions.questions_count}{program_questions&&program_questions.questions_score}</p> return (
</div> <Draggable
<div className="postitonrelatis xaxisreverseorder"> key={object.id}
<div className="scd xiaoshou" onClick={()=>this.setmodalsTypedel(true,1,"PROGRAM")}>删除</div> draggableId={object.id}
<div className="szdfd xiaoshou" onClick={()=>this.Singlemagazine("编程题",true)}>设置得分</div> index={index}
</div> className={""}
<DragDropContext onDragEnd={this.onDragEndsss} > >
<Droppable droppableId={"0"}> {(provided, snapshot) => (
{(provided, snapshot) => ( <div
<div key={index}
ref={provided.innerRef} ref={provided.innerRef}
{...provided.droppableProps} {...provided.draggableProps}
className={""} {...provided.dragHandleProps}
onScroll={this.contentViewScrolledit} >
>
{ <div className="xaxisreverseorder mt25 mr2">
program_questions&&program_questions.questions.map((object, index) => { <div className="scd xiaoshou">删除</div>
return ( <div className="szdfd xiaoshou">设置得分</div>
<Draggable </div>
key={object.id} <Paperreview_single paperreviewsingleindex={this.state.paperreviewsingleindex}
draggableId={object.id} objectsingle={object} key={index} indexx={index + 1}
index={index} indexxy={index}
className={""} hideparagraphs={() => this.hideparagraphs()}></Paperreview_single>
> </div>
{(provided, snapshot) => ( )}
<div </Draggable>
key={index} )
ref={provided.innerRef} })
{...provided.draggableProps}
{...provided.dragHandleProps} }
> </div>
<Paperreview_single objectsingle={object}></Paperreview_single> )}
</div> </Droppable>
)} </DragDropContext>
</Draggable> </div>
) </div>
}) : ""
}
}
</div>
)} {
</Droppable> program_questions && program_questions ?
</DragDropContext> <div className={programbool === true ? "backgroudwhites " : "backgroudwhites"} style={{
position: "relative",
}}>
</div>
</div> <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")}>
</div> <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}
>
<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>
</div>
)}
</Draggable>
)
})
}
</div>
)}
</Droppable>
</DragDropContext>
</div>
</div>
:
""
}
</div>
</div> </div>
) )

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder'; import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -17,21 +17,22 @@ import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData'; import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css'; import '../tpm/newshixuns/css/Newshixuns.css';
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
//单选题 //单选题
class Paperreview_single extends Component { class Paperreview_single extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
questions:0, questions: 0,
totalscore:0, totalscore: 0,
total:0, total: 0,
} }
} }
@ -40,8 +41,6 @@ class Paperreview_single extends Component {
componentDidMount() { componentDidMount() {
} }
@ -52,37 +51,43 @@ class Paperreview_single extends Component {
preservation = () => { preservation = () => {
}
setitem_type = (item_type) => {
} }
showparagraph = (indexx) => {
setitem_type = (item_type) => { }
setmodalsTypedels = () => {
}
Singlemagaziness = () => {
} }
render() { render() {
let {questions,totalscore,total,items} = this.state; let {questions, totalscore, total, items} = this.state;
let {objectsingle} =this.props; let {objectsingle, indexx, paperreviewsingleindex, indexxy} = this.props;
// //console.log(params);
const objectsingleid=objectsingle.id;
const objectsinglescore=`${objectsingle.score}分)`;
return ( return (
<div className="w100s borderwdswuh mt25 mb20 pd20 " style={{ <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "}
onMouseEnter={() => this.props.showparagraphs(indexxy)} style={{
minHeight: "114px", minHeight: "114px",
}}> }}>
{/*顶部*/}
{/*顶部*/} <div className="w100s sortinxdirection ">
<div className="w100s sortinxdirection "> <div className=" sortinxdirection ">
{/*<div className=" sortinxdirection ">*/} <p className="cretitlecolrlis lh28">{indexx}</p>
{/* <p className="cretitlecolrlis lh28">{objectsingleid}</p>、<p className="cretitlecolrlisobj lh28">{objectsinglescore}分)</p>*/} </div>
{/*</div>*/} <style>
<style> {
{ `
`
.markdown-body{ .markdown-body{
color: #333333; color: #333333;
font-size: 14px !important; font-size: 14px !important;
@ -96,56 +101,57 @@ class Paperreview_single extends Component {
} }
` `
} }
</style> </style>
<div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingleid+objectsinglescore+objectsingle.name).replace(/▁/g, "▁▁▁")}}> <div className=" lh28 listjihetixingstit markdown-body cretitlecolrlist" style={{wordBreak: "break-word"}}
</div> dangerouslySetInnerHTML={{__html: markdownToHTML(`${objectsingle.score}分) ` + objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div> </div>
{/*内容*/} </div>
<div className="w100s sortinxdirection"> {/*内容*/}
<div className="w100s sortinxdirection">
{
objectsingle.item_type==="JUDGMENT"? {
<p className="w100s listjihetixingstits sortinxdirection "> objectsingle.item_type === "JUDGMENT" ?
{ <p className="w100s listjihetixingstits sortinxdirection ">
objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { {
return ( objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
<p className={index===1? "sortinxdirection ml10":"sortinxdirection " } > return (
<Radio checked={object.is_answer}> <p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
{object.choice_text} <Radio checked={object.is_answer}>
</Radio> {object.choice_text}
</p> </Radio>
) </p>
}) )
} })
</p> }
:
objectsingle.item_type==="PROGRAM"?
<p className="w100s listjihetixingstitssy sortinxdirection ">
<p className={"sortinxdirection mt15"} >
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.program_attr.description).replace(/▁/g, "▁▁▁")}}></p>
</p>
</p> </p>
: :
<p className="w100s listjihetixingstits verticallayout "> objectsingle.item_type === "PROGRAM" ?
{ <p className="w100s listjihetixingstitssy sortinxdirection ">
objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { <p className={"sortinxdirection mt15"}>
return ( <p style={{wordBreak: "break-word"}}
<p className={index===0?"sortinxdirection":"sortinxdirection mt15"} > dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.program_attr.description).replace(/▁/g, "▁▁▁")}}></p>
{tagArray[index]} </p>
<p style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p> </p>
</p> :
) <p className="w100s listjihetixingstits verticallayout ">
}) {
} objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
</p> return (
} <p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]}
<p style={{wordBreak: "break-word"}}
</div> dangerouslySetInnerHTML={{__html: markdownToHTML(object.choice_text).replace(/▁/g, "▁▁▁")}}></p>
</p>
)
})
}
</p>
}
</div>
</div> </div>

@ -688,26 +688,44 @@
right: 2px; right: 2px;
top: 11px; top: 11px;
} }
.postitonrelatiss{
position: absolute;
right: 2px;
top: -41px;
}
.postitonrelatisss{
position: absolute;
right: 2px;
top: -39px;
}
.postitonrelatisssy{
position: absolute;
right: 1px;
top: 52px;
}
.mt50{
margin-top: 50px;
}
.szdfd{ .szdfd{
width:88px; width:100px;
height:34px; height:40px;
background:rgba(51,189,140,1); background:rgba(51,189,140,1);
border-radius:4px 4px 0px 0px; border-radius:4px 4px 0px 0px;
text-align: center; text-align: center;
color: #ffffff; color: #ffffff;
line-height: 32px; line-height: 40px;
margin-right: 27px; margin-right: 27px;
font-size:12px;
} }
.scd{ .scd{
width:88px; width:100px;
height:34px; height:40px;
background:#4CACFF; background:#4CACFF;
border-radius:4px 4px 0px 0px; border-radius:4px 4px 0px 0px;
text-align: center; text-align: center;
color: #ffffff; color: #ffffff;
line-height: 32px; line-height: 40px;
font-size:12px;
} }
@ -757,3 +775,35 @@
.mt7{ .mt7{
margin-top: 7px; margin-top: 7px;
} }
.ml18{
margin-left: 18px;
}
.btques{
width:1021px;
background:rgba(249,249,249,1);
border:1px solid rgba(221,221,221,1);
}
.borderwdswuhques {
width: 1020px !important;
background: #F9F9F9;
border: 1px solid #DDDDDD;
min-height: 42px;
}
.jixuxuanti{
width:106px;
height:34px;
background:rgba(51,189,140,1);
border-radius:4px;
color:#ffffff ;
line-height: 34px;
text-align: center;
}
.lh34{
line-height: 34px;
}
.mr2{
margin-right: 2px;
}

Loading…
Cancel
Save