Merge remote-tracking branch 'origin/topic_bank' into topic_bank

dev_aliyun_beta
杨树明 6 years ago
commit 48445d6e70

@ -2702,10 +2702,10 @@ class PollNew extends Component {
{
this.props.match.params.news === "new" ?
<a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}
className=" fr font-16">返回</a>
className=" fr font-16"></a>
:
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16">返回</a>
className=" fr font-16"></a>
}
</div>

@ -854,19 +854,7 @@ class PollNewQuestbank extends Component {
//保存并继续,即提交本题的新建并继续创建一个相同的题(该新题处于编辑模式,题目和选项不要清空)
Deleteadddomtwo = (indexo, object, bool) => {
var thiss = this;
if (bool === true) {
this.setState({
q_countst: 1,
bindingid: undefined,
Newdisplay: false,
})
} else {
this.setState({
q_countst: 1,
Newdisplay: false,
})
}
if (object.question.question_type === 3) {
this.HandleInputTopics(this.contentMdRef.current.getValue().trim(), indexo);
@ -1019,11 +1007,11 @@ class PollNewQuestbank extends Component {
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1035,11 +1023,11 @@ class PollNewQuestbank extends Component {
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1250,11 +1238,11 @@ class PollNewQuestbank extends Component {
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1266,11 +1254,11 @@ class PollNewQuestbank extends Component {
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1406,6 +1394,19 @@ class PollNewQuestbank extends Component {
this.state.mymainsint = this.state.mymainsint + 1;
}
if (bool === true) {
this.setState({
q_countst: 1,
bindingid: undefined,
Newdisplay: false,
})
} else {
this.setState({
q_countst: 1,
Newdisplay: false,
})
}
this.setState({
// poll_questions: newarrpoll,
adddom: newarr,
@ -1424,11 +1425,7 @@ class PollNewQuestbank extends Component {
// indexo 第几个数组
//object 单个数组数据
Deleteadddomthree = (indexo, object, bool) => {
if (bool === true) {
this.setState({
bindingid: undefined,
})
}
this.setState({
Newdisplay: false,
});
@ -1571,11 +1568,11 @@ class PollNewQuestbank extends Component {
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1587,11 +1584,11 @@ class PollNewQuestbank extends Component {
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1775,11 +1772,11 @@ class PollNewQuestbank extends Component {
if(object.question.max_choices>0){
if(object.question.min_choices){
if(object.question.min_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1791,11 +1788,11 @@ class PollNewQuestbank extends Component {
if(object.question.min_choices>0){
if(object.question.max_choices){
if(object.question.max_choices===0){
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
}else {
this.props.showNotification(`最小和最大限制须同时为数值或者“--"`);
this.props.showNotification(`可选:最小和最大限制须同时为数值或者“--"`);
return;
}
@ -1917,7 +1914,11 @@ class PollNewQuestbank extends Component {
this.state.mymainsint = this.state.mymainsint + 1;
}
if (bool === true) {
this.setState({
bindingid: undefined,
})
}
//这里更新数据
if (this.state.q_countst == 1) {
this.setState({
@ -2100,7 +2101,7 @@ class PollNewQuestbank extends Component {
}
//上下移到服务器中
Upanddownmovementof = (bool, poll_question_id) => {
Upanddownmovementof = (bool, poll_question_id,index) => {
// console.log("调用了Upanddownmovementofr")
// console.log(poll_question_id)
var thiss = this;
@ -2109,14 +2110,30 @@ class PollNewQuestbank extends Component {
axios.put(url, {
opr: "up",
}).then((result) => {
try {
if (result.data.status === 0) {
this.props.showNotification(`上移成功`);
thiss.thisinitializationdatanew();
if(result){
if(result.data){
if (result.data.status === 0) {
this.props.showNotification(`上移成功`);
let arr = this.state.poll_questions;
let newarr = [...arr];
let temp = newarr[index - 1];
newarr[index - 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
thiss.thisinitializationdatanew();
}else{
this.props.showNotification(`上移失败`);
}
}
}else {
this.props.showNotification(`上移失败`);
}
// console.log(JSON.stringify(result))
} catch (e) {
// console.log("上移题目成功 错误")
this.props.showNotification(`上移失败`);
console.log(e)
}
@ -2126,15 +2143,31 @@ class PollNewQuestbank extends Component {
axios.put(url, {
opr: "down",
}).then((result) => {
try {
if (result.data.status === 0) {
// message.success("下移题目成功", 1)
this.props.showNotification(`下移成功`);
thiss.thisinitializationdatanew();
if(result){
if(result.data){
if (result.data.status === 0) {
// message.success("下移题目成功", 1)
this.props.showNotification(`下移成功`);
let arr = this.state.poll_questions;
let newarr = [...arr];
let temp = newarr[index + 1];
newarr[index + 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
thiss.thisinitializationdatanew();
}else {
this.props.showNotification(`下移失败`);
}
}else {
this.props.showNotification(`上移失败`);
}
}
// console.log(JSON.stringify(result))
} catch (e) {
// console.log("下移题目成功 错误")
this.props.showNotification(`上移失败`);
console.log(e)
}
})
@ -2271,17 +2304,11 @@ class PollNewQuestbank extends Component {
//点击向上排序按钮事件
handleClickBySortUp = (index, object) => {
// console.log("handleClickBySortUp 521")
let arr = this.state.poll_questions;
let newarr = [...arr];
// console.log(newarr)
if (index != 0) {
this.Upanddownmovementof(true, object.question.id);
let temp = newarr[index - 1];
newarr[index - 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
this.Upanddownmovementof(true, object.question.id,index);
}
}
@ -2292,13 +2319,8 @@ class PollNewQuestbank extends Component {
let newarr = [...arr];
//
if (index != newarr.length - 1) {
this.Upanddownmovementof(false, object.question.id);
let temp = newarr[index + 1];
newarr[index + 1] = newarr[index];
newarr[index] = temp;
this.setState({
poll_questions: newarr,
});
this.Upanddownmovementof(false, object.question.id,index);
} else {
// console.log("2222index==arr.length");
// console.log(this.state.poll_questions);
@ -2978,7 +3000,7 @@ class PollNewQuestbank extends Component {
{
item.question.question_type === 2?
<span style={{color: "#4B4B4B"}}
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "不限制" : item.question.min_choices === null && item.question.max_choices === null ? "不限制" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "不限制" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
className="font-16 mt10 ml10">{(item.question.min_choices === undefined && item.question.max_choices === undefined ? "" : item.question.min_choices === null && item.question.max_choices === null ? "" : item.question.min_choices === 0 && item.question.max_choices === 0 ? "": item.question.min_choices === "null" && item.question.max_choices === "null" ? "" : item.question.min_choices === item.question.max_choices && item.question.max_choices === item.question.min_choices ? "可选"+(item.question.max_choices)+"项" : "可选" +(item.question.min_choices===undefined||item.question.min_choices===null||item.question.min_choices===""||item.question.min_choices==="null"?2:item.question.min_choices) + "-" + (item.question.max_choices===undefined||item.question.max_choices===null||item.question.max_choices===""||item.question.max_choices==="null"?item.question.answers.length:item.question.max_choices) + "项")}</span>
: ""
}
@ -3121,7 +3143,7 @@ class PollNewQuestbank extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr3 w55 font-16 lineh-40"
className="color-grey-6 mr4 w55 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
@ -3138,7 +3160,7 @@ class PollNewQuestbank extends Component {
onClick={() => this.Deleteentrys(arrid, indext, true)}><Tooltip
title="删除"
placement={"bottom"}><i
className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
className="ml1 iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
}
<a className="lineh-40 ml10 yw18"
@ -3168,7 +3190,7 @@ class PollNewQuestbank extends Component {
{this.state.polls_status === undefined || this.state.polls_status === 1 ?
indext > 1 ?
<span>
<a className="lineh-40 mr"
<a className="lineh-40 mr10"
onClick={() => this.Deleteentrys(arrid, indext, false)}><Tooltip
title="删除" placement={"bottom"}><i
className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
@ -3236,7 +3258,7 @@ class PollNewQuestbank extends Component {
<div style={{minWidth: "1179px"}}>
<div>
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
className="color-grey-6 mr5 w55 font-16 lineh-40 fl" style={{textAlign: "center"}}>可选</span>
<div className="mr40 flex1 ">
{/*可选最小1*/}
<style>
@ -3425,7 +3447,7 @@ class PollNewQuestbank extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr3 w55 font-16 lineh-40"
className="color-grey-6 mr4 w55 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
@ -3440,7 +3462,7 @@ class PollNewQuestbank extends Component {
onClick={() => this.Deleteentrys(arrid, indext, true)}><Tooltip
title="删除"
placement={"bottom"}><i
className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
className="ml1 iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
}
{/* {*/}
@ -3545,7 +3567,7 @@ class PollNewQuestbank extends Component {
<div style={{minWidth: "1179px"}}>
<div>
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
className="color-grey-6 mr5 w55 font-16 lineh-40 fl" style={{textAlign: "center"}}>可选</span>
<div className="mr40 flex1 ">
{/*可选最小2*/}
<style>
@ -3747,7 +3769,7 @@ class PollNewQuestbank extends Component {
<div></div>) : itemt.answer_text === "" ? (
<p className="df mb20">
<span
className="color-grey-6 mr3 w55 font-16 lineh-40"
className="color-grey-6 mr4 w55 font-16 lineh-40"
style={{"text-align": "center"}}>其它</span>
<input
@ -3763,7 +3785,7 @@ class PollNewQuestbank extends Component {
onClick={() => this.Deleteentrys(arrid, indext, true)}><Tooltip
title="删除"
placement={"bottom"}><i
className="iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
className="ml1 iconfont icon-htmal5icon19 font-22 color-grey-c"></i></Tooltip></a>
}
@ -3864,7 +3886,7 @@ class PollNewQuestbank extends Component {
<div style={{minWidth: "1179px"}}>
<div>
<span
className="color-grey-6 mr20 font-16 lineh-40 fl">可选</span>
className="color-grey-6 w55 mr5 font-16 lineh-40 fl" style={{textAlign: "center"}}>可选</span>
<div className="mr40 flex1 ">
{/*可选最小3*/}
<style>

Loading…
Cancel
Save