调整题库样式

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)}/>
<div className="sortinxdirection huanhan" style={{
minHeight: "33px",
lineHeight: "28px",
}}>
</div>
)}
</Form.Item>
{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>
<div className="sortinxdirection huanhan w100s mt15" style={{
minHeight: "33px",
lineHeight: "28px",
<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>
)}
</Form.Item>
</div>
<Form.Item
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_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
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.choices){
// 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].is_answer===true){
// this.setState({
// zqda:"0"
// })
// }
//
// }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({
// zqda:"1"
// })
// }
// }
// }
// }
// }
if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){
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].is_answer===true){
this.setState({
zqda:"0"
})
}
}else{
if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({
zqda:"1"
})
}
}
}
}
}
}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_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
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.choices){
// 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].is_answer===true){
// this.setState({
// zqda:"0"
// })
// }
//
// }else{
// if( this.props.item_banksedit.choices[ik].is_answer===true){
// this.setState({
// zqda:"1"
// })
// }
// }
// }
// }
// }
if(this.props.item_banksedit){
if(this.props.item_banksedit.choices){
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].is_answer===true){
this.setState({
zqda:"0"
})
}
}else{
if( this.props.item_banksedit.choices[ik].is_answer===true){
this.setState({
zqda:"1"
})
}
}
}
}
}
}
}

@ -69,15 +69,14 @@ class Listjihe extends Component {
// 编程答案
var rightkey = null
var MULTIPLEkey = null;
if (items) {
if (items.item_type) {
if (items.item_type === "PROGRAM") {
} else {
if (items.item_type === "JUDGMENT") {
//多选题
if (items.choices) {
if (items.choices.length > 0) {
var arr = items.choices;
@ -90,19 +89,38 @@ class Listjihe extends Component {
}
}
} 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;
// 单选题和判断题
if(items.item_type === "MULTIPLE"){
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) {
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) => {
return (
<p className={index === 1 ? "sortinxdirection ml10" : "sortinxdirection "}>
<Radio disabled={false}>
<Radio disabled={false} disabled={true} >
{object.choice_text}
</Radio>
</p>
@ -367,11 +385,18 @@ class Listjihe extends Component {
<div className=" sortinxdirection mt15 yldxtit">
{
items.item_type === "SINGLE" || items.item_type === "MULTIPLE" ?
items.item_type === "SINGLE" ?
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}}
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 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)}/>
<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) => {
return (
<div key={index} className="mytags" style={{
position: "relative",
}}>
<p className="w100s stestcen lh32">{object.name}</p>
{this.state.Knowpoints === undefined ? "" : this.state.Knowpoints.map((object, index) => {
return (
<div key={index} className="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")}/>
<img className=" ml7 zjzsdian xiaoshou icondowncolorssy" onClick={() => this.deletesobject(object, index)} src={getImageUrl("/images/educoder/bzucha.png")}/>
</div>
)
})}
</div>
)
})}
</div>
</div>
)}
</Form.Item>
</div>
<style>
{

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

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

Loading…
Cancel
Save