题库智能组卷换题型 换题

dev_jupyter
杨树林 5 years ago
parent cdd5460653
commit 73f62a989d

@ -769,7 +769,7 @@ class App extends Component {
render={ render={
(props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />) (props) => (<NewOrEditTask {...this.props} {...props} {...this.state} />)
} /> } />
<Route path="/IntegenerationSee/:type/:id" <Route path="/Integeneration/:type/:id"
render={ render={
(props) => (<Paperreview {...this.props} {...props} {...this.state} />) (props) => (<Paperreview {...this.props} {...props} {...this.state} />)
}/> }/>

@ -66,26 +66,12 @@ class Paperreview extends Component {
//初始化 //初始化
componentDidMount() { componentDidMount() {
console.log("Paperreview.js"); console.log("Paperreview.js");
console.log(this.props.match.params.type); console.log(this.props.match.params);
this.setState({ this.setState({
artificialtype:this.props.match.params.type artificialtype:this.props.match.params.type
}) })
if(this.props.match.params.type==="artificial"){ var data = {};
//人工组卷
var data = {}
this.getdata(data);
}else{
//智能组卷
//
var data = {
exam_setting_id:this.props.match.params.id
}
this.getdata(data); this.getdata(data);
}
let urls = `/disciplines.json`; let urls = `/disciplines.json`;
axios.get(urls, { axios.get(urls, {
params: { params: {
@ -148,6 +134,18 @@ class Paperreview extends Component {
getdata = (data) => { getdata = (data) => {
if(this.props.match.params.type==="artificial"){
//人工组卷
}else{
//智能组卷
//
data = {
exam_setting_id:this.props.match.params.id
}
}
const url = `/item_baskets.json`; const url = `/item_baskets.json`;
this.setState({ this.setState({
booljupyterurls: true, booljupyterurls: true,
@ -290,6 +288,23 @@ class Paperreview extends Component {
var data = {} var data = {}
this.getdata(data); this.getdata(data);
} }
//换题型
Replacementtype=(value)=>{
console.log("换题型");
console.log(value);
}
//换题
Changingtopics=(value)=>{
console.log("换题");
console.log(value);
}
render() { render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state; let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
@ -354,7 +369,7 @@ class Paperreview extends Component {
{ {
Cohetepaperbool===false? Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}> <Paperreview_item {...this.state} {...this.props} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}>
</Paperreview_item> </Paperreview_item>
: :

@ -460,6 +460,12 @@ class Paperreview_item extends Component {
singlebool === true ? singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder"> <div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div> <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "SINGLE")}>删除</div>
{
this.props.match.params.type==="Intelligence"?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("单选题")}>换题型</div>
:
""
}
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div> <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("单选题", true)}>批量设置得分</div>
</div> : "" </div> : ""
} }
@ -490,6 +496,9 @@ class Paperreview_item extends Component {
> >
<Paperreview_items <Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index} key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex} paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename} paperreviewsinglename={this.state.paperreviewsinglename}
@ -547,6 +556,12 @@ class Paperreview_item extends Component {
<div className="postitonrelatisss xaxisreverseorder "> <div className="postitonrelatisss xaxisreverseorder ">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除 <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</div> </div>
{
this.props.match.params.type==="Intelligence"?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("多选题")}>换题型</div>
:
""
}
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div> <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("多选题", true)}>批量设置得分</div>
</div> </div>
@ -582,6 +597,9 @@ class Paperreview_item extends Component {
<Paperreview_items <Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index} key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex} paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename} paperreviewsinglename={this.state.paperreviewsinglename}
@ -637,6 +655,12 @@ class Paperreview_item extends Component {
<div className="postitonrelatiss xaxisreverseorder"> <div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除 <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</div> </div>
{
this.props.match.params.type==="Intelligence"?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("判断题")}>换题型</div>
:
""
}
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div> <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("判断题", true)}>批量设置得分</div>
</div> </div>
: ""} : ""}
@ -669,6 +693,9 @@ class Paperreview_item extends Component {
<Paperreview_items <Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index} key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex} paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename} paperreviewsinglename={this.state.paperreviewsinglename}
@ -728,6 +755,12 @@ class Paperreview_item extends Component {
programbool === true ? programbool === true ?
<div className="postitonrelatiss xaxisreverseorder"> <div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div> <div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "PROGRAM")}>删除</div>
{
this.props.match.params.type==="Intelligence"?
<div className="szdfds xiaoshou" onClick={() => this.props.Replacementtype("编程题")}>换题型</div>
:
""
}
<div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("编程题", true)}>批量设置得分</div> <div className="szdfd xiaoshou" onClick={() => this.Singlemagazine("编程题", true)}>批量设置得分</div>
</div> </div>
: "" : ""
@ -761,6 +794,9 @@ class Paperreview_item extends Component {
<Paperreview_items <Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index} key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex} paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename} paperreviewsinglename={this.state.paperreviewsinglename}

@ -67,6 +67,12 @@ class Paperreview_items extends Component {
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames? paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2"> <div className="xaxisreverseorder mt25 mr2">
<div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.item_id,true,1)}>删除</div> <div className="scd xiaoshou" onClick={()=>this.props.showsetmodalsTypedels(object.item_id,true,1)}>删除</div>
{
this.props.match.params.type==="Intelligence"?
<div className="szdfds xiaoshou" onClick={() =>this.props.Changingtopics(object.item_id)}>换题</div>
:
""
}
<div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div> <div className="szdfd xiaoshou" onClick={()=>this.props.Singlemagazines(true,object.id,typenamesn)}>设置得分</div>
</div> </div>
: <div className="xaxisreverseorder mt25 "> : <div className="xaxisreverseorder mt25 ">

@ -76,10 +76,20 @@ class Paperreview_single extends Component {
try { try {
itemssname= JSON.parse(objectsingle.name); itemssname= JSON.parse(objectsingle.name);
}catch (e) { }catch (e) {
itemssname=objectsingle.name;
} }
if(itemssname===undefined){ if(itemssname===undefined){
itemssname=objectsingle.name itemssname=objectsingle.name
} }
var itemsnamesy="";
try {
itemsnamesy= JSON.parse(objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description);
}catch (e) {
itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description;
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
@ -188,7 +198,7 @@ class Paperreview_single extends Component {
> >
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(objectsingle.program_attr.description)} value={itemsnamesy}
/> />
</p> </p>
: :
@ -199,8 +209,15 @@ class Paperreview_single extends Component {
<p className="w100s listjihetixingstits verticallayout "> <p className="w100s listjihetixingstits verticallayout ">
{ {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
var string=""
try {
string=JSON.parse(object.choice_text);
}catch (e) {
string=object.choice_text;
}
return ( return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}> <p key={index} className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]} {tagArray[index]}
<p className="programquills" style={{wordBreak: "break-word"}}> <p className="programquills" style={{wordBreak: "break-word"}}>
{object ? {object ?
@ -210,7 +227,7 @@ class Paperreview_single extends Component {
object.choice_text.length>0? object.choice_text.length>0?
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(object.choice_text)} value={string}
/> />
:"" :""
: :

@ -135,6 +135,23 @@ class Listjihe extends Component {
itemssname=items.name itemssname=items.name
} }
var itemsnamesy="";
try {
itemsnamesy= JSON.parse(items&&items.program_attr&&items.program_attr.description);
}catch (e) {
itemsnamesy=items&&items.program_attr&&items.program_attr.description;
}
var analysisnames="";
try {
analysisnames= JSON.parse(items&&items.analysis);
}catch (e) {
analysisnames=items&&items.analysis;
}
return ( return (
<div key={keindex} <div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}> className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
@ -217,7 +234,7 @@ class Listjihe extends Component {
> >
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(items.program_attr.description)} value={itemsnamesy}
/> />
</p> </p>
@ -232,6 +249,12 @@ class Listjihe extends Component {
<p className="w100s listjihetixingstitsp verticallayout "> <p className="w100s listjihetixingstitsp verticallayout ">
{ {
items === undefined || items === null ? "" : items.choices.map((object, index) => { items === undefined || items === null ? "" : items.choices.map((object, index) => {
var string=""
try {
string=JSON.parse(object.choice_text);
}catch (e) {
string=object.choice_text;
}
return ( return (
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}> <p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh26">{tagArray[index]}</p> <p className="lh26">{tagArray[index]}</p>
@ -244,7 +267,7 @@ class Listjihe extends Component {
object.choice_text.length>0? object.choice_text.length>0?
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(object.choice_text)} value={string}
/> />
:"" :""
@ -425,7 +448,7 @@ class Listjihe extends Component {
<QuillForEditor <QuillForEditor
imgAttrs={{width: '60px', height: '30px'}} imgAttrs={{width: '60px', height: '30px'}}
readOnly={true} readOnly={true}
value={JSON.parse(items.analysis)} value={analysisnames}
/> />
: :
"" ""

@ -764,6 +764,12 @@ class Intelligentcomponents extends Component {
</Form> </Form>
{
this.props.single_question_count===0&&this.props.multiple_question_count===0&&this.props.judgement_question_count===0&&
this.props.program_question_count===0?
""
:
<div>
<p className={"conditionsettings mt40"}>题型及数量</p> <p className={"conditionsettings mt40"}>题型及数量</p>
<div className={"hengxians mt13"}></div> <div className={"hengxians mt13"}></div>
<Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => { <Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
@ -778,7 +784,9 @@ class Intelligentcomponents extends Component {
<Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => { <Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom; this.$bct = dom;
}}></Ldanxuan> }}></Ldanxuan>
</div>
}
<div className="h20"></div> <div className="h20"></div>

@ -760,6 +760,17 @@
font-size:12px; font-size:12px;
} }
.szdfds{
width:100px;
height:40px;
background:#FC7E30;
border-radius:4px 4px 0px 0px;
text-align: center;
color: #ffffff;
line-height: 40px;
margin-right: 27px;
font-size:12px;
}
.pd20{ .pd20{
padding: 20px; padding: 20px;

@ -257,7 +257,7 @@ class Intecomponents extends Component {
.then((result) => { .then((result) => {
if (result.data.status == 0) { if (result.data.status == 0) {
console.log("组卷成功"); console.log("组卷成功");
this.props.history.push(`/IntegenerationSee/Intelligence/${result.data.exam_setting_id}`); this.props.history.push(`/Integeneration/Intelligence/${result.data.exam_setting_id}`);
} }
}).catch((error) => { }).catch((error) => {
console.log(error); console.log(error);

@ -78,6 +78,14 @@ class Paperlibraryseeid_items extends Component {
if(itemssname===undefined){ if(itemssname===undefined){
itemssname=objectsingle.name itemssname=objectsingle.name
} }
var itemsnamesy="";
try {
itemsnamesy= JSON.parse(objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description);
}catch (e) {
itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description;
}
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
@ -185,7 +193,7 @@ class Paperlibraryseeid_items extends Component {
> >
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(objectsingle.program_attr.description)} value={itemsnamesy}
/> />
</p> </p>
: :
@ -196,6 +204,12 @@ class Paperlibraryseeid_items extends Component {
<p className="w100s listjihetixingstits verticallayout "> <p className="w100s listjihetixingstits verticallayout ">
{ {
objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => {
var string=""
try {
string=JSON.parse(object.choice_text);
}catch (e) {
string=object.choice_text;
}
return ( return (
<p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}> <p className={index === 0 ? "sortinxdirection" : "sortinxdirection mt15"}>
{tagArray[index]} {tagArray[index]}
@ -207,7 +221,7 @@ class Paperlibraryseeid_items extends Component {
object.choice_text.length>0? object.choice_text.length>0?
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={JSON.parse(object.choice_text)} value={string}
/> />
:"" :""
: :

Loading…
Cancel
Save