调整样式

yslnewtiku
杨树林 5 years ago
parent 1096dea50a
commit d62a7794a6

@ -180,16 +180,16 @@ class Questionitem_banks extends Component {
// 1: [3] // 1: [3]
// 2: (4) ["1", "2", "3", "4"] // 2: (4) ["1", "2", "3", "4"]
for(var k=0;k<anserdata[2].length;k++){ for(var k=0;k<anserdata[2].length;k++){
console.log("k");
console.log(k);
const choicesdata={ const choicesdata={
choice_text:anserdata[2][k], choice_text:anserdata[2][k],
is_answer:anserdata[1]-1===k?1:0, is_answer:anserdata[1][0]===(k+1)?1:0,
} }
choices.push(choicesdata); choices.push(choicesdata);
} }
var data={ var data={
repertoire_id:1, repertoire_id:1,
sub_repertoire_id:1, sub_repertoire_id:1,
@ -202,7 +202,6 @@ class Questionitem_banks extends Component {
}; };
debugger
if(boolnew===true){ if(boolnew===true){
axios.post(url, data) axios.post(url, data)
@ -242,15 +241,24 @@ class Questionitem_banks extends Component {
const choices=[]; const choices=[];
// 1: [3] // 1: [3]
// 2: (4) ["1", "2", "3", "4"] // 2: (4) ["1", "2", "3", "4"]
console.log("MULTIPLE");
console.log(anserdata);
for(var k=0;k<anserdata[2].length;k++){ for(var k=0;k<anserdata[2].length;k++){
console.log("k");
console.log(k); var bool =false
for(var y=0;y<anserdata[1].length;y++){
if(anserdata[1][y]===(k+1)){
bool=true
}
}
const choicesdata={ const choicesdata={
choice_text:anserdata[2][k], choice_text:anserdata[2][k],
is_answer:anserdata[1]-1===k?1:0, is_answer:bool===true?1:0,
} }
choices.push(choicesdata); choices.push(choicesdata);
} }
var data={ var data={
repertoire_id:1, repertoire_id:1,
sub_repertoire_id:1, sub_repertoire_id:1,
@ -422,7 +430,6 @@ class Questionitem_banks extends Component {
<SingleEditor <SingleEditor
{...this.state} {...this.state}
{...this.props} {...this.props}
question_choices={this.state.myquestion_choicesco}
getanswerMdRef={(ref)=>this.getanswerMdRef(ref)} getanswerMdRef={(ref)=>this.getanswerMdRef(ref)}
> >

@ -49,14 +49,13 @@ class ChoquesEditor extends Component{
if(this.props.item_banksedit.choices){ if(this.props.item_banksedit.choices){
this.props.item_banksedit.choices.forEach((item, index) => { this.props.item_banksedit.choices.forEach((item, index) => {
console.log("SingleEditor");
console.log(item);
choicescomy.push({ choicescomy.push({
choice_text:item.choice_text, choice_text:item.choice_text,
standard_boolean:item.is_answer, standard_boolean:item.is_answer,
}) })
}) })
_standard_answers = []
_question_choices = [] _question_choices = []
choicescomy.forEach((item, index) => { choicescomy.forEach((item, index) => {
_standard_answers.push(item.standard_boolean) _standard_answers.push(item.standard_boolean)
@ -105,9 +104,10 @@ class ChoquesEditor extends Component{
}) })
) )
}else{ }else{
this.props.confirm({ // this.props.confirm({
content: `确认要删除这个选项吗?`, // content: `确认要删除这个选项吗?`,
onOk: () => { // onOk: () => {
this.toMDMode(null) this.toMDMode(null)
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
@ -115,8 +115,9 @@ class ChoquesEditor extends Component{
standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]}) standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]})
}) })
) )
}
}) // }
// })
} }
} }
onSave = () => { onSave = () => {

@ -330,7 +330,7 @@ class Itembankstop extends Component {
<style> <style>
{ {
` `
.ant-radio-button-wrapper{ .rbndclass .ant-radio-button-wrapper{
width:106px !important; width:106px !important;
height:33px !important; height:33px !important;
background:#EEEEEE; background:#EEEEEE;
@ -342,7 +342,7 @@ class Itembankstop extends Component {
margin-top: 6px !important; margin-top: 6px !important;
} }
.ant-radio-button-wrapper-checked { .rbndclass .ant-radio-button-wrapper-checked {
width: 106px !important; width: 106px !important;
height: 33px !important; height: 33px !important;
background: #4CACFF !important; background: #4CACFF !important;
@ -354,22 +354,22 @@ class Itembankstop extends Component {
margin-top: 6px!important; margin-top: 6px!important;
} }
.ant-radio-button-wrapper:not(:first-child)::before{ .rbndclass .ant-radio-button-wrapper:not(:first-child)::before{
border:0px !important; border:0px !important;
width:0px !important; width:0px !important;
} }
.ant-radio-button-wrapper{ .rbndclass .ant-radio-button-wrapper{
border:0px !important; border:0px !important;
} }
.ant-radio-group{ .rbndclass .ant-radio-group{
border:0px !important; border:0px !important;
} }
.ant-radio-group label{ .rbndclass .ant-radio-group label{
border:0px !important; border:0px !important;
} }
.ant-radio-group span{ .rbndclass .ant-radio-group span{
border:0px !important; border:0px !important;
} }
@ -380,6 +380,7 @@ class Itembankstop extends Component {
` `
} }
</style> </style>
<div className="rbndclass">
<Form.Item label="难度"> <Form.Item label="难度">
{getFieldDecorator('rbnd', {getFieldDecorator('rbnd',
{ {
@ -394,7 +395,7 @@ class Itembankstop extends Component {
</Radio.Group>, </Radio.Group>,
)} )}
</Form.Item> </Form.Item>
</div>
{/*<Form.Item>*/} {/*<Form.Item>*/}
{/* <Button type="primary" htmlType="submit" className="login-form-button">*/} {/* <Button type="primary" htmlType="submit" className="login-form-button">*/}
{/* 提交*/} {/* 提交*/}

@ -59,6 +59,7 @@ class SingleEditor extends Component{
}) })
}) })
_standard_answers = []
_question_choices = [] _question_choices = []
choicescomy.forEach((item, index) => { choicescomy.forEach((item, index) => {
_standard_answers.push(item.standard_boolean) _standard_answers.push(item.standard_boolean)
@ -108,9 +109,6 @@ class SingleEditor extends Component{
}) })
) )
}else{ }else{
this.props.confirm({
content: `确认要删除这个选项吗?`,
onOk: () => {
this.toMDMode(null) this.toMDMode(null)
this.setState( this.setState(
(prevState) => ({ (prevState) => ({
@ -118,8 +116,6 @@ class SingleEditor extends Component{
standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]}) standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]})
}) })
) )
}
})
} }
} }
onSave = () => { onSave = () => {

Loading…
Cancel
Save