|
|
@ -50,7 +50,9 @@ class JudquestionEditor extends Component{
|
|
|
|
question_type: this.props.question_type || 0,
|
|
|
|
question_type: this.props.question_type || 0,
|
|
|
|
question_score: this.props.question_score || this.props.init_question_score,
|
|
|
|
question_score: this.props.question_score || this.props.init_question_score,
|
|
|
|
question_titles:this.props.question_titles||'',
|
|
|
|
question_titles:this.props.question_titles||'',
|
|
|
|
zqda:null
|
|
|
|
zqda:null,
|
|
|
|
|
|
|
|
item_banksedit:[],
|
|
|
|
|
|
|
|
mychoicess:[],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
addOption = () => {
|
|
|
|
addOption = () => {
|
|
|
@ -150,6 +152,74 @@ class JudquestionEditor extends Component{
|
|
|
|
this.props.getanswerMdRef(this);
|
|
|
|
this.props.getanswerMdRef(this);
|
|
|
|
}catch (e) {
|
|
|
|
}catch (e) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
item_banksedit:this.props.item_banksedit,
|
|
|
|
|
|
|
|
question_title:this.props.item_banksedit.name,
|
|
|
|
|
|
|
|
question_titles:this.props.item_banksedit.analysis,
|
|
|
|
|
|
|
|
mychoicess:this.props.item_banksedit.choices,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
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) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
|
|
|
|
|
|
|
console.log("componentDidUpdate");
|
|
|
|
|
|
|
|
console.log(prevProps);
|
|
|
|
|
|
|
|
console.log(this.props.item_banksedit);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(prevProps.item_banksedit !== this.props.item_banksedit){
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
item_banksedit:this.props.item_banksedit,
|
|
|
|
|
|
|
|
question_title:this.props.item_banksedit.name,
|
|
|
|
|
|
|
|
question_titles:this.props.item_banksedit.analysis,
|
|
|
|
|
|
|
|
mychoicess:this.props.item_banksedit.choices,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onOptionClick = (index) => {
|
|
|
|
onOptionClick = (index) => {
|
|
|
@ -201,7 +271,9 @@ class JudquestionEditor extends Component{
|
|
|
|
////console.log(value);
|
|
|
|
////console.log(value);
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
zqda:e.target.value,
|
|
|
|
zqda:e.target.value,
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles} = this.state;
|
|
|
@ -225,7 +297,7 @@ class JudquestionEditor extends Component{
|
|
|
|
// ////console.log("xuanzheshijuan");
|
|
|
|
// ////console.log("xuanzheshijuan");
|
|
|
|
// ////console.log(answerTagArray);
|
|
|
|
// ////console.log(answerTagArray);
|
|
|
|
// ////console.log(!exerciseIsPublish);
|
|
|
|
// ////console.log(!exerciseIsPublish);
|
|
|
|
|
|
|
|
const params= this.props&&this.props.match&&this.props.match.params;
|
|
|
|
return(
|
|
|
|
return(
|
|
|
|
<div className="padding20-30 bor-bottom-greyE signleEditor danxuano" id={qNumber}>
|
|
|
|
<div className="padding20-30 bor-bottom-greyE signleEditor danxuano" id={qNumber}>
|
|
|
|
<style>{`
|
|
|
|
<style>{`
|
|
|
@ -267,7 +339,7 @@ class JudquestionEditor extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="mb10 sortinxdirection">
|
|
|
|
<div className="mb10 sortinxdirection">
|
|
|
|
<Radio.Group buttonStyle="solid" onChange={this.handleFormLayoutChange}>
|
|
|
|
<Radio.Group buttonStyle="solid" value={this.state.zqda} onChange={this.handleFormLayoutChange}>
|
|
|
|
<Radio.Button value="0">正确</Radio.Button>
|
|
|
|
<Radio.Button value="0">正确</Radio.Button>
|
|
|
|
<Radio.Button value="1">错误</Radio.Button>
|
|
|
|
<Radio.Button value="1">错误</Radio.Button>
|
|
|
|
|
|
|
|
|
|
|
|