| | |
| | | } |
| | | // 填空题改造 |
| | | if (questionObj.questionType == "completion") { |
| | | let c = []; |
| | | let index = 0; |
| | | for (let i = 0; i < questionObj.stem.length; i++) { |
| | | const item = questionObj.stem[i]; |
| | | if (item == "input") { |
| | | questionObj.stem[i] = { |
| | | num: index, |
| | | data: "input", |
| | | }; |
| | | if (item != 'input') { |
| | | item.split("").map(citem => { |
| | | const obj = { |
| | | type: 'txt', |
| | | text: citem |
| | | } |
| | | c.push(obj) |
| | | }) |
| | | } else { |
| | | const obj = { |
| | | type: "input", |
| | | num: index |
| | | } |
| | | if (!oldObj) questionObj.userAnswer[index] = ""; |
| | | index++; |
| | | c.push(obj) |
| | | } |
| | | // if (item == "input") { |
| | | // questionObj.stem[i] = { |
| | | // num: index, |
| | | // data: "input", |
| | | // }; |
| | | // if (!oldObj) questionObj.userAnswer[index] = ""; |
| | | // index++; |
| | | // } |
| | | } |
| | | questionObj.customArr = c; |
| | | } |
| | | // 题干富文本处理 |
| | | if (questionObj.stemStyle == "RichText") { |
| | |
| | | item.topicId = data.id |
| | | } |
| | | }) |
| | | console.log('班级', res) |
| | | let isJoinClass = wx.getStorageSync('joinClass') |
| | | if (res.datas.length) { |
| | | this.setData({ |
| | | classList: res.datas |
| | |
| | | }) |
| | | } else { |
| | | // 拒绝 |
| | | if (!isJoinClass) { |
| | | |
| | | this.setData({ |
| | | visible: true |
| | | }) |
| | | } |
| | | |
| | | } |
| | | } else { |
| | | // 未加入班级 |
| | | if (!isJoinClass) { |
| | | this.setData({ |
| | | visible: true |
| | | }) |
| | | } |
| | | } else { |
| | | // 未加入班级 |
| | | } |
| | | } else { |
| | | if (!isJoinClass) { |
| | | this.setData({ |
| | | visible: true |
| | | }) |
| | | } |
| | | } else { |
| | | this.setData({ |
| | | visible: true, |
| | | }) |
| | | } |
| | | |
| | | }) |