题库智能组卷换题型 换题

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

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

@ -66,26 +66,12 @@ class Paperreview extends Component {
//初始化
componentDidMount() {
console.log("Paperreview.js");
console.log(this.props.match.params.type);
console.log(this.props.match.params);
this.setState({
artificialtype:this.props.match.params.type
})
if(this.props.match.params.type==="artificial"){
//人工组卷
var data = {}
this.getdata(data);
}else{
//智能组卷
//
var data = {
exam_setting_id:this.props.match.params.id
}
var data = {};
this.getdata(data);
}
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -148,6 +134,18 @@ class Paperreview extends Component {
getdata = (data) => {
if(this.props.match.params.type==="artificial"){
//人工组卷
}else{
//智能组卷
//
data = {
exam_setting_id:this.props.match.params.id
}
}
const url = `/item_baskets.json`;
this.setState({
booljupyterurls: true,
@ -290,6 +288,23 @@ class Paperreview extends Component {
var data = {}
this.getdata(data);
}
//换题型
Replacementtype=(value)=>{
console.log("换题型");
console.log(value);
}
//换题
Changingtopics=(value)=>{
console.log("换题");
console.log(value);
}
render() {
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;
@ -354,7 +369,7 @@ class Paperreview extends Component {
{
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>
:

@ -460,6 +460,12 @@ class Paperreview_item extends Component {
singlebool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<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> : ""
}
@ -490,6 +496,9 @@ class Paperreview_item extends Component {
>
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -547,6 +556,12 @@ class Paperreview_item extends Component {
<div className="postitonrelatisss xaxisreverseorder ">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除
</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>
@ -582,6 +597,9 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -637,6 +655,12 @@ class Paperreview_item extends Component {
<div className="postitonrelatiss xaxisreverseorder">
<div className="scd xiaoshou" onClick={() => this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除
</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>
: ""}
@ -669,6 +693,9 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}
@ -728,6 +755,12 @@ class Paperreview_item extends Component {
programbool === true ?
<div className="postitonrelatiss xaxisreverseorder">
<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>
: ""
@ -761,6 +794,9 @@ class Paperreview_item extends Component {
<Paperreview_items
{...this.state}
{...this.props}
Changingtopics={(e)=>this.Changingtopics(e)}
key={index}
paperreviewsingleindex={this.state.paperreviewsingleindex}
paperreviewsinglename={this.state.paperreviewsinglename}

@ -67,6 +67,12 @@ class Paperreview_items extends Component {
paperreviewsingleindex===indexs&&paperreviewsinglename===typenames?
<div className="xaxisreverseorder mt25 mr2">
<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>
: <div className="xaxisreverseorder mt25 ">

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

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

@ -764,21 +764,29 @@ class Intelligentcomponents extends Component {
</Form>
<p className={"conditionsettings mt40"}>题型及数量</p>
<div className={"hengxians mt13"}></div>
<Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$dxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"多选题:"} mycount={this.props.multiple_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$ddxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"判断题:"} mycount={this.props.judgement_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$pdt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom;
}}></Ldanxuan>
{
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>
<div className={"hengxians mt13"}></div>
<Ldanxuan {...this.state} {...this.props} dxtx={"单选题:"} mycount={this.props.single_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$dxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"多选题:"} mycount={this.props.multiple_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$ddxt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"判断题:"} mycount={this.props.judgement_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$pdt = dom;
}}></Ldanxuan>
<Ldanxuan {...this.state} {...this.props} dxtx={"编程题:"} mycount={this.props.program_question_count} getdatas={()=>this.props.getdatas()} ref={dom => {
this.$bct = dom;
}}></Ldanxuan>
</div>
}
<div className="h20"></div>

@ -760,6 +760,17 @@
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{
padding: 20px;

@ -257,7 +257,7 @@ class Intecomponents extends Component {
.then((result) => {
if (result.data.status == 0) {
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) => {
console.log(error);

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

Loading…
Cancel
Save