调整题库样式

dev_jupyter
杨树林 5 years ago
parent 802876d0c7
commit 18cbd9917b

@ -714,32 +714,34 @@ class Itembankstop extends Component {
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/> <img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection huanhan" style={{
minHeight: "33px",
lineHeight: "28px",
}}> </div>
)}
</Form.Item>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => { <div className="sortinxdirection huanhan w100s mt15" style={{
return ( minHeight: "33px",
<div key={index} className={index===0?"mytags mb20":"mytags"} style={{ lineHeight: "28px",
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")}/> }}>
</div> {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
) return (
})} <div key={index} className={index===0?"mytags mb20":"mytags"} style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
</div>
)} </div>
</Form.Item>
<Form.Item <Form.Item
label="题型" label="题型"

@ -161,28 +161,29 @@ class JudquestionEditor extends Component{
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"", question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"", question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
question_titleysl:this.props.item_banksedit.name|| '',
question_titlesysl:this.props.item_banksedit.analysis||'',
}) })
// if(this.props.item_banksedit){ if(this.props.item_banksedit){
// if(this.props.item_banksedit.choices){ if(this.props.item_banksedit.choices){
// for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){ for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){
// if( this.props.item_banksedit.choices[ik].choice_text==="正确"){ if( this.props.item_banksedit.choices[ik].choice_text==="正确"){
// if( this.props.item_banksedit.choices[ik].is_answer===true){ if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({ this.setState({
// zqda:"0" zqda:"0"
// }) })
// } }
//
// }else{ }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){ if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({ this.setState({
// zqda:"1" zqda:"1"
// }) })
// } }
// } }
// } }
// } }
// } }
}catch (e) { }catch (e) {
} }
@ -199,28 +200,30 @@ class JudquestionEditor extends Component{
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"", question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"", question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
mychoicess:this.props.item_banksedit.choices, mychoicess:this.props.item_banksedit.choices,
question_titleysl:this.props.item_banksedit.name|| '',
question_titlesysl:this.props.item_banksedit.analysis||'',
}) })
// if(this.props.item_banksedit){ if(this.props.item_banksedit){
// if(this.props.item_banksedit.choices){ if(this.props.item_banksedit.choices){
// for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){ for(var ik=0;ik<this.props.item_banksedit.choices.length;ik++ ){
// if( this.props.item_banksedit.choices[ik].choice_text==="正确"){ if( this.props.item_banksedit.choices[ik].choice_text==="正确"){
// if( this.props.item_banksedit.choices[ik].is_answer===true){ if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({ this.setState({
// zqda:"0" zqda:"0"
// }) })
// } }
//
// }else{ }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){ if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({ this.setState({
// zqda:"1" zqda:"1"
// }) })
// } }
// } }
// } }
// } }
// } }
} }
} }

@ -69,15 +69,14 @@ class Listjihe extends Component {
// 编程答案 // 编程答案
var rightkey = null var rightkey = null
var MULTIPLEkey = null;
if (items) { if (items) {
if (items.item_type) { if (items.item_type) {
if (items.item_type === "PROGRAM") { if (items.item_type === "PROGRAM") {
} else { } else {
if (items.item_type === "JUDGMENT") { if (items.item_type === "JUDGMENT") {
//多选题
if (items.choices) { if (items.choices) {
if (items.choices.length > 0) { if (items.choices.length > 0) {
var arr = items.choices; var arr = items.choices;
@ -90,19 +89,38 @@ class Listjihe extends Component {
} }
} }
} else { } else {
if (items.choices) { // 单选题和判断题
if (items.choices.length > 0) { if(items.item_type === "MULTIPLE"){
var arr = items.choices; if (items.choices) {
for (var i = 0; i < arr.length; i++) { if (items.choices.length > 0) {
if (arr[i].is_answer === true) { var arr = items.choices;
rightkey = i; for (var i = 0; i < arr.length; i++) {
break; if (arr[i].is_answer === true) {
if(MULTIPLEkey===null){
MULTIPLEkey = tagArrays[i];
}else{
MULTIPLEkey =MULTIPLEkey+ tagArrays[i];
}
}
} }
} }
} }
}
}else{
if (items.choices) {
if (items.choices.length > 0) {
var arr = items.choices;
for (var i = 0; i < arr.length; i++) {
if (arr[i].is_answer === true) {
rightkey = i;
break;
}
}
}
}
}
} }
} }
} }
@ -182,7 +200,7 @@ class Listjihe extends Component {
items === undefined || items === null ? "" : items.choices.map((object, index) => { items === undefined || items === null ? "" : items.choices.map((object, index) => {
return ( return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}> <p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}> <Radio disabled={false} disabled={true} >
{object.choice_text} {object.choice_text}
</Radio> </Radio>
</p> </p>
@ -367,11 +385,18 @@ class Listjihe extends Component {
<div className=" sortinxdirection mt15 yldxtit"> <div className=" sortinxdirection mt15 yldxtit">
{ {
items.item_type === "SINGLE" || items.item_type === "MULTIPLE" ? items.item_type === "SINGLE" ?
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
> >
</p>
: items.item_type === "MULTIPLE"?
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁")}}
>
</p> </p>
: :
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"

@ -694,32 +694,33 @@ class Comthetestpaperst extends Component {
<img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/> <img className=" ml22 zjzsdian xiaoshou" src={getImageUrl("/images/educoder/zjzsd.png")} onClick={()=>this.NewknTypedeldel(true)}/>
<div className="sortinxdirection" style={{
height: "33px",
lineHeight: "28px",
}}> </div>
)}
</Form.Item>
</div>
<div className="sortinxdirection huanhan w100s mt15" style={{
height: "33px",
lineHeight: "28px",
}}>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => { {this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return ( return (
<div key={index} className="mytags" style={{ <div key={index} className="mytags" style={{
position: "relative", position: "relative",
}}> }}>
<p className="w100s stestcen lh32">{object.name}</p> <p className="w100s stestcen lh32">{object.name}</p>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/> <img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
</div> </div>
) )
})} })}
</div>
</div>
)}
</Form.Item>
</div> </div>
<style> <style>
{ {

@ -528,7 +528,7 @@
height:32px; height:32px;
border-radius:2px; border-radius:2px;
border:1px solid #DDDDDD; border:1px solid #DDDDDD;
margin-left: 20px; margin-right: 20px;
} }
.lh32{ .lh32{
line-height: 32px; line-height: 32px;
@ -966,3 +966,7 @@
border: 1px solid #f30707; border: 1px solid #f30707;
border-radius: 5px; border-radius: 5px;
} }
.mt15{
margin-top: 15px;
}

@ -548,7 +548,7 @@
height:32px; height:32px;
border-radius:2px; border-radius:2px;
border:1px solid #DDDDDD; border:1px solid #DDDDDD;
margin-left: 20px; margin-right: 20px;
} }
.lh32{ .lh32{
line-height: 32px; line-height: 32px;

Loading…
Cancel
Save