Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
caicai8 6 years ago
commit 51fa698c46

@ -870,11 +870,11 @@ class CoursesNew extends Component {
})( })(
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} onInput={this.handleSearchschool}
className={"fl construction mr10 yslzxueshis2"} className={"fl construction mr10 yslzxueshis2"}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
dataSource={optionschool}
> >
{optionschool}
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>

@ -1026,10 +1026,11 @@ class Goldsubject extends Component {
<AutoComplete style={{ width: 280 }} <AutoComplete style={{ width: 280 }}
onSearch={this.handleSearchschool} onSearch={this.handleSearchschool}
// onChange={this.handleChangeschools} // onChange={this.handleChangeschools}
onInput={this.handleSearchschool}
className={"fl construction mr10 yslzxueshis2 "} className={"fl construction mr10 yslzxueshis2 "}
placeholder="请输入并选择课本堂的所属单位" placeholder="请输入并选择课本堂的所属单位"
dataSource={optionschool}
> >
{optionschool}
</AutoComplete> </AutoComplete>
)} )}
<span className={"newcoursestitle fl"}> <span className={"newcoursestitle fl"}>

@ -1803,6 +1803,7 @@ class PollNew extends Component {
var urlly = `/polls/${poll_id}/poll_questions.json` var urlly = `/polls/${poll_id}/poll_questions.json`
var max_choicess = null; var max_choicess = null;
var min_choicess = null; var min_choicess = null;
try {
if (max_choices === 0 && min_choices === 0) { if (max_choices === 0 && min_choices === 0) {
max_choicess = null; max_choicess = null;
min_choicess = null; min_choicess = null;
@ -1810,11 +1811,26 @@ class PollNew extends Component {
max_choicess = max_choices; max_choicess = max_choices;
min_choicess = min_choices; min_choicess = min_choices;
} }
console.log("createquestionsandanswers"); }catch (e) {
console.log(max_choicess); max_choicess = null;
console.log(min_choicess); min_choicess = null;
console.log(length); }
axios.post(urlly, { // console.log("createquestionsandanswers");
// console.log(max_choicess);
// console.log(min_choicess);
// console.log(length);
var datay={};
datay={
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
question_answers: option,
question_other_answer: null,
insert_id: insert_id
}
try {
if(number===2){
datay={
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
is_necessary: object.question.is_necessary, is_necessary: object.question.is_necessary,
@ -1823,7 +1839,13 @@ class PollNew extends Component {
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
insert_id: insert_id insert_id: insert_id
}).then((result) => { }
}
}catch (e) {
}
axios.post(urlly, datay).then((result) => {
// try { // try {
if (result !== undefined) { if (result !== undefined) {
if (result.data.status === 0) { if (result.data.status === 0) {
@ -1856,6 +1878,7 @@ class PollNew extends Component {
var thiss = this; var thiss = this;
var max_choicess = null; var max_choicess = null;
var min_choicess = null; var min_choicess = null;
try {
if (max_choices === 0 && min_choices === 0) { if (max_choices === 0 && min_choices === 0) {
max_choicess = null; max_choicess = null;
min_choicess = null; min_choicess = null;
@ -1863,11 +1886,27 @@ class PollNew extends Component {
max_choicess = max_choices; max_choicess = max_choices;
min_choicess = min_choices; min_choicess = min_choices;
} }
console.log("createquestionsandanswers"); }catch (e) {
console.log(max_choicess); max_choicess = null;
console.log(min_choicess); min_choicess = null;
console.log(length); }
axios.put(url, {
// console.log("createquestionsandanswers");
// console.log(max_choicess);
// console.log(min_choicess);
// console.log(length);
var datay={};
datay={
// debug: true,
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
question_answers: option,
question_other_answer: null,
};
try {
if(number===2){
datay={
// debug: true, // debug: true,
question_title: object.question.question_title, question_title: object.question.question_title,
question_type: number, question_type: number,
@ -1876,7 +1915,13 @@ class PollNew extends Component {
min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess, min_choices: min_choicess===undefined?2:min_choicess===null?2:min_choicess===0?2:min_choicess,
question_answers: option, question_answers: option,
question_other_answer: null, question_other_answer: null,
}).then((result) => { };
}
}catch (e) {
}
axios.put(url,datay).then((result) => {
try { try {
if (result.data.status === 0) { if (result.data.status === 0) {
this.props.showNotification(`编辑题目成功`); this.props.showNotification(`编辑题目成功`);

@ -35,6 +35,7 @@ class DetailTop extends Component{
getdatalist=()=>{ getdatalist=()=>{
let courseslist=[]; let courseslist=[];
let keys=1; let keys=1;
let listtype=false;
if(this.props.courses!=undefined&&this.props.courses.length!=0){ if(this.props.courses!=undefined&&this.props.courses.length!=0){
if(this.props.detailInfoList.has_start===true){ if(this.props.detailInfoList.has_start===true){
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
@ -48,13 +49,30 @@ class DetailTop extends Component{
}else{ }else{
this.props.courses.map((item,key)=>{ this.props.courses.map((item,key)=>{
if(this.props.pathtopskey===key+1){ if(listtype===false){
keys=key+1 keys=key+1
if(item.course_status.status===0) {
listtype=true
return ( return (
courseslist.push(item) courseslist.push(item)
) )
} }
}
})
this.props.courses.map((item,key)=>{
if(listtype===false){
keys=key+1
if(item.course_status.status===2) {
listtype=true
return (
courseslist.push(item)
)
}
}
}) })
} }
} }
this.setState({ this.setState({

Loading…
Cancel
Save