@ -280,9 +280,13 @@ class PollNew extends Component {
questionnair : true ,
left _banner _id : result . data . left _banner _id
} )
// console.log(this.state.polls_nametest)
// console.log(this.state.polls_descriptiontest)
// }
if ( result . data . poll . polls _name ) {
if ( result . data . poll . polls _name . length > 0 ) {
this . setState ( {
addonAfter : result . data . poll . polls _name . length ,
} )
}
}
} ) . catch ( ( error ) => {
console . log ( error )
} )
@ -326,8 +330,13 @@ class PollNew extends Component {
polls _descriptiontest : result . data . poll . polls _description ,
questionnair : true ,
} )
// }
if ( result . data . poll . polls _name ) {
if ( result . data . poll . polls _name . length > 0 ) {
this . setState ( {
addonAfter : result . data . poll . polls _name . length ,
} )
}
}
} ) . catch ( ( error ) => {
console . log ( error )
} )
@ -1765,12 +1774,13 @@ class PollNew extends Component {
max _choicess = max _choices ;
min _choicess = min _choices ;
}
axios . post ( urlly , {
question _title : object . question . question _title ,
question _type : number ,
is _necessary : object . question . is _necessary ,
max _choices : max _choicess ,
min _choices : min _choicess ,
max _choices : max _choicess === undefined ? null : max _choicess === null ? null : max _choicess === 0 ? null : max _choicess ,
min _choices : min _choicess === undefined ? null : min _choicess === null ? null : min _choicess === 0 ? null : min _choicess ,
question _answers : option ,
question _other _answer : null ,
insert _id : insert _id
@ -2123,6 +2133,12 @@ class PollNew extends Component {
//最小值
HandleGradationGroupChangee = ( value , index , max , length ) => {
console . log ( "最小值" ) ;
console . log ( value ) ;
console . log ( index ) ;
console . log ( max ) ;
console . log ( length ) ;
// debugger
var minbool = false ;
var maxbool = false ;
@ -2137,7 +2153,7 @@ class PollNew extends Component {
if ( minbool === true && maxbool === true ) {
for ( var i = 0 ; i < arr . length ; i ++ ) {
if ( index === i ) {
arr [ i ] . question . min _choices = parseInt ( value ) ;
arr [ i ] . question . min _choices = parseInt ( value ) ;
}
}
this . setState ( {
@ -2146,18 +2162,8 @@ class PollNew extends Component {
} else {
for ( var i = 0 ; i < arr . length ; i ++ ) {
if ( index === i ) {
try {
if ( parseInt ( value ) === 0 ) {
arr [ i ] . question . min _choices = 2 ;
arr [ i ] . question . max _choices = length ;
} else {
arr [ i ] . question . min _choices = parseInt ( value ) ;
arr [ i ] . question . max _choices = max ;
}
} catch ( e ) {
arr [ i ] . question . min _choices = 2 ;
arr [ i ] . question . max _choices = length ;
}
arr [ i ] . question . max _choices = length ;
break ;
}
}
@ -2169,19 +2175,32 @@ class PollNew extends Component {
}
//最大值
HandleGradationGroupChangeee = ( value , index , minchoices ) => {
HandleGradationGroupChangeee = ( value , index , minchoices ,length ) => {
// console.log("2112");
// console.log(value);
// console.log(minchoices);
console . log ( "最大值" ) ;
console . log ( value ) ;
console . log ( index ) ;
console . log ( minchoices ) ;
console . log ( length ) ;
let arr = this . state . adddom ;
for ( var i = 0 ; i < arr . length ; i ++ ) {
if ( index === i ) {
if ( parseInt ( value ) === 0 && parseInt ( minchoices ) === 0 ) {
arr [ i ] . question . min _choices = parseInt ( 0 ) ;
arr [ i ] . question . max _choices = parseInt ( 0 ) ;
} else if ( parseInt ( minchoices ) === 0 ) {
arr [ i ] . question . min _choices = parseInt ( 2 ) ;
arr [ i ] . question . max _choices = parseInt ( value ) ;
}
else if ( parseInt ( value ) === 0 && parseInt ( minchoices ) > 0 ) {
arr [ i ] . question . min _choices = parseInt ( minchoices ) ;
arr [ i ] . question . max _choices = parseInt ( value ) ;
} else {
}
else {
arr [ i ] . question . min _choices = minchoices === null ? 2 : minchoices === undefined ? 2 : minchoices === 0 ? 2 : parseInt ( minchoices ) ;
arr [ i ] . question . max _choices = parseInt ( value ) ;
arr [ i ] . question . max _choices = parseInt ( value ) ;
}
}
}
@ -2455,7 +2474,7 @@ class PollNew extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = ( mysave === true ) ? "" : "display:none;" ;
return (
< div >
< div className = "newMain" >
{ /*提示*/ }
{ Modalstype && Modalstype === true ? < Modals
modalsType = { this . state . Modalstype }
@ -2465,14 +2484,8 @@ class PollNew extends Component {
modalsBottomval = { this . state . ModalsBottomval }
loadtype = { this . state . Loadtype }
/ > : " " }
< style >
{
`
. newMains { margin : 0 auto ; padding - bottom : 235 px ! important ; min - width : 1200 px ; min - height : 800 px ! important ; }
`
}
< / s t y l e >
< div className = "educontent newMains" >
< div className = "educontent mb50" >
< p className = "clearfix mb20 mt10" >
< a className = " btn colorgrey fl hovercolorblue" onClick = { ( ) => this . gotohome ( ) } > { this . props . coursedata . name } < / a >
< span className = "color-grey-9 fl ml3 mr3" > & gt ; < / s p a n >
@ -2874,7 +2887,7 @@ class PollNew extends Component {
value = { itemo . question . min _choices === 0 || itemo . question . min _choices === "0" ? "--" : itemo . question . min _choices === null ? "--" : itemo . question . min _choices === undefined ? "--" : itemo . question . min _choices }
>
< Option value = { String ( "0" ) } > -- < / O p t i o n >
< Option value = { "0" } > -- < / O p t i o n >
{ itemo . question . answers === undefined ? "" : itemo . question . answers . map ( ( itemt , indext ) => {
return (
indext >= 1 ? < Option value = { String ( indext + 1 ) } > { indext + 1 } < / O p t i o n > : " "
@ -2885,10 +2898,10 @@ class PollNew extends Component {
className = "ml10 mr10 color-grey-6 lineh-40 fl" > ~ < / s p a n >
{ /*可选最大*/ }
< Select className = "fl w100"
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices )}
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices ,itemo . question . answers . length )}
value = { itemo . question . max _choices === 0 || itemo . question . max _choices === "0" ? "--" : itemo . question . min _choices === null ? "--" : itemo . question . min _choices === undefined ? "--" : itemo . question . max _choices }
>
< Option value = { String ( "0" ) } > -- < / O p t i o n >
< Option value = { "0" } > -- < / O p t i o n >
{ itemo . question . answers === undefined ? "" : itemo . question . answers . map ( ( itemt , indext ) => {
return (
indext >= 1 ? < Option value = { String ( indext + 1 ) } > { indext + 1 } < / O p t i o n > : " "
@ -3128,7 +3141,7 @@ class PollNew extends Component {
className = "ml10 mr10 color-grey-6 lineh-40 fl" > ~ < / s p a n >
{ /*可选最大*/ }
< Select className = "fl w100"
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices )}
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices ,itemo . question . answers . length )}
value = { itemo . question . max _choices === 0 || itemo . question . max _choices === "0" ? "--" : itemo . question . min _choices === null ? "--" : itemo . question . min _choices === undefined ? "--" : itemo . question . max _choices }
>
< Option value = { String ( "0" ) } > -- < / O p t i o n >
@ -3380,7 +3393,7 @@ class PollNew extends Component {
className = "ml10 mr10 color-grey-6 lineh-40 fl" > ~ < / s p a n >
{ /*可选最大*/ }
< Select className = "fl w100"
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices )}
onChange = { ( value ) => this . HandleGradationGroupChangeee ( value , indexo , itemo . question . min _choices ,itemo . question . answers . length )}
value = { itemo . question . max _choices === 0 || itemo . question . max _choices === "0" ? "--" : itemo . question . min _choices === null ? "--" : itemo . question . min _choices === undefined ? "--" : itemo . question . max _choices }
>
< Option value = { String ( "0" ) } > -- < / O p t i o n >