|
@@ -88,7 +88,7 @@ import Checkoutbox from "./CheckoutBox/index"; // 多选题
|
|
|
import Writing from "./Writing/index"; // 写作题
|
|
|
import Wordcard from "./common/Wordcard.vue";
|
|
|
import { getContentFile } from "@/api/ajax";
|
|
|
-import { getToken } from '@/utils/auth'
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
export default {
|
|
|
name: "Question",
|
|
|
components: {
|
|
@@ -150,9 +150,9 @@ export default {
|
|
|
top: 0,
|
|
|
isWordCard: false,
|
|
|
hz: "",
|
|
|
- bookDownTimer:null,// 下载文件计时器
|
|
|
- bookuploadUrl:'',
|
|
|
- isHasDone: false,// 是否答到最后一题
|
|
|
+ bookDownTimer: null, // 下载文件计时器
|
|
|
+ bookuploadUrl: "",
|
|
|
+ isHasDone: false, // 是否答到最后一题
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -202,7 +202,7 @@ export default {
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
// this.handleAnswerTimeStart()
|
|
|
- this.uploadBookWrite()
|
|
|
+ this.uploadBookWrite();
|
|
|
},
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
@@ -393,7 +393,7 @@ export default {
|
|
|
_this.top = 0;
|
|
|
_this.contextData = JSON.parse(JSON.stringify(_this.context));
|
|
|
_this.previewSrcList = [];
|
|
|
- _this.handlePreImg();
|
|
|
+ //_this.handlePreImg();
|
|
|
_this.queIndex = 0;
|
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
|
if (_this.contextData && _this.contextData.ui_type) {
|
|
@@ -471,7 +471,7 @@ export default {
|
|
|
// 计算答题正确错误和未答个数
|
|
|
handleAnswerRightNumber() {
|
|
|
const _this = this;
|
|
|
- this.isHasDone = true
|
|
|
+ this.isHasDone = true;
|
|
|
this.answerRightNumber = 0;
|
|
|
this.answerErrorNumber = 0;
|
|
|
this.answerNotDoneNumber = 0;
|
|
@@ -481,7 +481,7 @@ export default {
|
|
|
if (_this.uiType == "SORT_01") {
|
|
|
if (
|
|
|
JSON.stringify(item.upsetOption) !=
|
|
|
- JSON.stringify(item.Bookanswer[0].text.split(''))
|
|
|
+ JSON.stringify(item.Bookanswer[0].text.split(""))
|
|
|
) {
|
|
|
doneNumber++;
|
|
|
}
|
|
@@ -519,26 +519,29 @@ export default {
|
|
|
doneNumber++;
|
|
|
}
|
|
|
}
|
|
|
- }else if(_this.uiType == "BLANK_20"){
|
|
|
- if (item.Bookanswer) {
|
|
|
- let flag = false;
|
|
|
- for(let i=0;i<item.Bookanswer.length;i++){
|
|
|
- for(let j=0;j<item.Bookanswer[i].left.length;j++){
|
|
|
- if(item.Bookanswer[i].left[j].trim()){
|
|
|
- flag = true;
|
|
|
- }
|
|
|
- }
|
|
|
- for(let j=0;j<item.Bookanswer[i].right.length;j++){
|
|
|
- if(item.Bookanswer[i].right[j].trim()){
|
|
|
- flag = true;
|
|
|
- }
|
|
|
- }
|
|
|
+ } else if (_this.uiType == "BLANK_20") {
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ let flag = false;
|
|
|
+ for (let i = 0; i < item.Bookanswer.length; i++) {
|
|
|
+ for (let j = 0; j < item.Bookanswer[i].left.length; j++) {
|
|
|
+ if (item.Bookanswer[i].left[j].trim()) {
|
|
|
+ flag = true;
|
|
|
}
|
|
|
- if (flag) {
|
|
|
- doneNumber++;
|
|
|
+ }
|
|
|
+ for (let j = 0; j < item.Bookanswer[i].right.length; j++) {
|
|
|
+ if (item.Bookanswer[i].right[j].trim()) {
|
|
|
+ flag = true;
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ doneNumber++;
|
|
|
}
|
|
|
- } else if (item.Bookanswer && (item.Bookanswer[0]||item.Bookanswer[0]==0)) {
|
|
|
+ }
|
|
|
+ } else if (
|
|
|
+ item.Bookanswer &&
|
|
|
+ (item.Bookanswer[0] || item.Bookanswer[0] == 0)
|
|
|
+ ) {
|
|
|
doneNumber++;
|
|
|
}
|
|
|
// 统计答对答错个数
|
|
@@ -587,49 +590,49 @@ export default {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
|
}
|
|
|
- }else if(_this.uiType == "SINGLE_14" ||_this.uiType == "SINGLE_13"){
|
|
|
- if (item.Bookanswer) {
|
|
|
- let correct = []
|
|
|
- item.option.forEach(items=>{
|
|
|
- if(items.isAnswer&&items.con){
|
|
|
- correct.push(items.con)
|
|
|
- }else if(items.isAnswer&&items.img_url){
|
|
|
- correct.push(items.img_url)
|
|
|
- }
|
|
|
- })
|
|
|
- let flag = true
|
|
|
- // 先比对答案个数
|
|
|
- if(correct.length>0){
|
|
|
- if(item.Bookanswer.length==correct.length){
|
|
|
- for(let i = 0; i<item.Bookanswer.length; i++){
|
|
|
- if(correct.indexOf(item.Bookanswer[i])==-1){
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }else{
|
|
|
- return true
|
|
|
- }
|
|
|
- if (flag) {
|
|
|
- this.answerRightNumber++;
|
|
|
- } else {
|
|
|
- this.answerErrorNumber++;
|
|
|
+ } else if (_this.uiType == "SINGLE_14" || _this.uiType == "SINGLE_13") {
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ let correct = [];
|
|
|
+ item.option.forEach((items) => {
|
|
|
+ if (items.isAnswer && items.con) {
|
|
|
+ correct.push(items.con);
|
|
|
+ } else if (items.isAnswer && items.img_url) {
|
|
|
+ correct.push(items.img_url);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ let flag = true;
|
|
|
+ // 先比对答案个数
|
|
|
+ if (correct.length > 0) {
|
|
|
+ if (item.Bookanswer.length == correct.length) {
|
|
|
+ for (let i = 0; i < item.Bookanswer.length; i++) {
|
|
|
+ if (correct.indexOf(item.Bookanswer[i]) == -1) {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
}
|
|
|
- // if (
|
|
|
- // correct &&
|
|
|
- // item.Bookanswer[0] &&
|
|
|
- // item.Bookanswer[0] == correct
|
|
|
- // ) {
|
|
|
- // this.answerRightNumber++;
|
|
|
- // } else if (
|
|
|
- // correct &&
|
|
|
- // item.Bookanswer[0] &&
|
|
|
- // item.Bookanswer[0] != correct
|
|
|
- // ) {
|
|
|
- // this.answerErrorNumber++;
|
|
|
- // }
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ this.answerRightNumber++;
|
|
|
+ } else {
|
|
|
+ this.answerErrorNumber++;
|
|
|
+ }
|
|
|
+ // if (
|
|
|
+ // correct &&
|
|
|
+ // item.Bookanswer[0] &&
|
|
|
+ // item.Bookanswer[0] == correct
|
|
|
+ // ) {
|
|
|
+ // this.answerRightNumber++;
|
|
|
+ // } else if (
|
|
|
+ // correct &&
|
|
|
+ // item.Bookanswer[0] &&
|
|
|
+ // item.Bookanswer[0] != correct
|
|
|
+ // ) {
|
|
|
+ // this.answerErrorNumber++;
|
|
|
+ // }
|
|
|
}
|
|
|
} else if (_this.uiType == "SINGLE_04") {
|
|
|
if (item.Bookanswer) {
|
|
@@ -724,17 +727,17 @@ export default {
|
|
|
} else if (_this.uiType == "SORT_01") {
|
|
|
if (item.Bookanswer && item.Bookanswer[0]) {
|
|
|
if (
|
|
|
- JSON.stringify(item.option[0].con.split('')) ==
|
|
|
- JSON.stringify(item.Bookanswer[0].text.split('')) &&
|
|
|
+ JSON.stringify(item.option[0].con.split("")) ==
|
|
|
+ JSON.stringify(item.Bookanswer[0].text.split("")) &&
|
|
|
JSON.stringify(item.upsetOption) !=
|
|
|
- JSON.stringify(item.Bookanswer[0].text.split(''))
|
|
|
+ JSON.stringify(item.Bookanswer[0].text.split(""))
|
|
|
) {
|
|
|
this.answerRightNumber++;
|
|
|
} else if (
|
|
|
- JSON.stringify(item.option[0].con.split('')) !=
|
|
|
- JSON.stringify(item.Bookanswer[0].text.split('')) &&
|
|
|
+ JSON.stringify(item.option[0].con.split("")) !=
|
|
|
+ JSON.stringify(item.Bookanswer[0].text.split("")) &&
|
|
|
JSON.stringify(item.upsetOption) !=
|
|
|
- JSON.stringify(item.Bookanswer[0].text.split(''))
|
|
|
+ JSON.stringify(item.Bookanswer[0].text.split(""))
|
|
|
) {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
@@ -755,7 +758,7 @@ export default {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
|
}
|
|
|
- }else if (_this.uiType == "BLANK_15") {
|
|
|
+ } else if (_this.uiType == "BLANK_15") {
|
|
|
if (item.Bookanswer) {
|
|
|
if (
|
|
|
item.correct[0] &&
|
|
@@ -808,11 +811,15 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
let bookanswerTotal = {
|
|
|
- lianxian: JSON.parse(JSON.stringify(item.Bookanswer)),
|
|
|
- wavdata: item.BookWavAnswerWav?item.BookWavAnswerWav:null
|
|
|
- }
|
|
|
- item.Bookanswer = [bookanswerTotal]
|
|
|
- } else if ( _this.uiType == "BLANK_13"||_this.uiType == "BLANK_16"||_this.uiType == "BLANK_19") {
|
|
|
+ lianxian: JSON.parse(JSON.stringify(item.Bookanswer)),
|
|
|
+ wavdata: item.BookWavAnswerWav ? item.BookWavAnswerWav : null,
|
|
|
+ };
|
|
|
+ item.Bookanswer = [bookanswerTotal];
|
|
|
+ } else if (
|
|
|
+ _this.uiType == "BLANK_13" ||
|
|
|
+ _this.uiType == "BLANK_16" ||
|
|
|
+ _this.uiType == "BLANK_19"
|
|
|
+ ) {
|
|
|
if (item.Bookanswer) {
|
|
|
let flag = true;
|
|
|
let empty = true;
|
|
@@ -1001,7 +1008,7 @@ export default {
|
|
|
_this.uiType == "BLANK_06" ||
|
|
|
_this.uiType == "BLANK_09" ||
|
|
|
_this.uiType == "BLANK_12" ||
|
|
|
- _this.uiType == "BLANK_17"
|
|
|
+ _this.uiType == "BLANK_17"
|
|
|
) {
|
|
|
if (item.Bookanswer) {
|
|
|
if (
|
|
@@ -1018,7 +1025,12 @@ export default {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
|
}
|
|
|
- } else if (_this.uiType == "MATCH_01"||_this.uiType == "MATCH_02"||_this.uiType == "MATCH_03"||_this.uiType == "MATCH_04") {
|
|
|
+ } else if (
|
|
|
+ _this.uiType == "MATCH_01" ||
|
|
|
+ _this.uiType == "MATCH_02" ||
|
|
|
+ _this.uiType == "MATCH_03" ||
|
|
|
+ _this.uiType == "MATCH_04"
|
|
|
+ ) {
|
|
|
if (item.Bookanswer) {
|
|
|
let flag = true;
|
|
|
let isDone = true;
|
|
@@ -1051,10 +1063,10 @@ export default {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
|
let bookanswerTotal = {
|
|
|
- lianxian: JSON.parse(JSON.stringify(item.Bookanswer)),
|
|
|
- wavdata: item.BookWavAnswerWav?item.BookWavAnswerWav:null
|
|
|
- }
|
|
|
- item.Bookanswer = [bookanswerTotal]
|
|
|
+ lianxian: JSON.parse(JSON.stringify(item.Bookanswer)),
|
|
|
+ wavdata: item.BookWavAnswerWav ? item.BookWavAnswerWav : null,
|
|
|
+ };
|
|
|
+ item.Bookanswer = [bookanswerTotal];
|
|
|
}
|
|
|
} else if (_this.uiType == "JUDGE_02") {
|
|
|
if (item.Bookanswer) {
|
|
@@ -1090,211 +1102,234 @@ export default {
|
|
|
this.answerErrorNumber++;
|
|
|
}
|
|
|
}
|
|
|
- }else if(_this.uiType == "SINGLE_20"){
|
|
|
- let flag = true
|
|
|
- if(item.Bookanswer){
|
|
|
- let correct = []
|
|
|
- item.stem.forEach((items,index)=>{
|
|
|
- if(!item.correct[index]||(item.correct[index]&&item.correct[index].con=='')){
|
|
|
- correct.push('')
|
|
|
- }else{
|
|
|
- correct.push(item.correct[index])
|
|
|
- }
|
|
|
- })
|
|
|
- correct.forEach((items,indexs)=>{
|
|
|
- if(items){
|
|
|
- // 有标准答案
|
|
|
- if(item.Bookanswer[indexs]&&item.Bookanswer[indexs]==items){
|
|
|
-
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- if (flag) {
|
|
|
- this.answerRightNumber++;
|
|
|
+ } else if (_this.uiType == "SINGLE_20") {
|
|
|
+ let flag = true;
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ let correct = [];
|
|
|
+ item.stem.forEach((items, index) => {
|
|
|
+ if (
|
|
|
+ !item.correct[index] ||
|
|
|
+ (item.correct[index] && item.correct[index].con == "")
|
|
|
+ ) {
|
|
|
+ correct.push("");
|
|
|
+ } else {
|
|
|
+ correct.push(item.correct[index]);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ correct.forEach((items, indexs) => {
|
|
|
+ if (items) {
|
|
|
+ // 有标准答案
|
|
|
+ if (
|
|
|
+ item.Bookanswer[indexs] &&
|
|
|
+ item.Bookanswer[indexs] == items
|
|
|
+ ) {
|
|
|
} else {
|
|
|
- this.answerErrorNumber++;
|
|
|
+ flag = false;
|
|
|
}
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (flag) {
|
|
|
+ this.answerRightNumber++;
|
|
|
+ } else {
|
|
|
+ this.answerErrorNumber++;
|
|
|
}
|
|
|
- }else if(_this.uiType == "BLANK_18"){
|
|
|
- let flag = true
|
|
|
- let number = 0;
|
|
|
- if(item.Bookanswer){
|
|
|
- for(let i=0;i<item.stem.length;i++){
|
|
|
- if(item.stem[i].con.indexOf('__')>-1){
|
|
|
- if(!item.Bookanswer[number]){
|
|
|
- flag = false
|
|
|
- }
|
|
|
- // 有填空 比对
|
|
|
- if(item.stem[i].correct[0]&&item.Bookanswer[number]&&item.stem[i].correct[0]==item.Bookanswer[number].trim()){
|
|
|
- number++
|
|
|
- }else if(item.stem[i].correct[0]&&item.Bookanswer[number]&&item.stem[i].correct[0]!=item.Bookanswer[number].trim()){
|
|
|
- flag = false
|
|
|
- }else{
|
|
|
- number++
|
|
|
- }
|
|
|
- }
|
|
|
+ }
|
|
|
+ } else if (_this.uiType == "BLANK_18") {
|
|
|
+ let flag = true;
|
|
|
+ let number = 0;
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ for (let i = 0; i < item.stem.length; i++) {
|
|
|
+ if (item.stem[i].con.indexOf("__") > -1) {
|
|
|
+ if (!item.Bookanswer[number]) {
|
|
|
+ flag = false;
|
|
|
}
|
|
|
- if (flag) {
|
|
|
- this.answerRightNumber++;
|
|
|
+ // 有填空 比对
|
|
|
+ if (
|
|
|
+ item.stem[i].correct[0] &&
|
|
|
+ item.Bookanswer[number] &&
|
|
|
+ item.stem[i].correct[0] == item.Bookanswer[number].trim()
|
|
|
+ ) {
|
|
|
+ number++;
|
|
|
+ } else if (
|
|
|
+ item.stem[i].correct[0] &&
|
|
|
+ item.Bookanswer[number] &&
|
|
|
+ item.stem[i].correct[0] != item.Bookanswer[number].trim()
|
|
|
+ ) {
|
|
|
+ flag = false;
|
|
|
} else {
|
|
|
- this.answerErrorNumber++;
|
|
|
+ number++;
|
|
|
}
|
|
|
- }
|
|
|
- }else if(_this.uiType == "RECORD_15"){
|
|
|
- let flag = true
|
|
|
- if(item.Bookanswer){
|
|
|
- if(item.recordOrInput=='record'){
|
|
|
-
|
|
|
- }else{
|
|
|
- if(item.correct[0]&&item.Bookanswer[0].input.trim()==item.correct[0]){
|
|
|
-
|
|
|
- }else if(!item.correct[0]){
|
|
|
-
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
+ }
|
|
|
}
|
|
|
if (flag) {
|
|
|
- this.answerRightNumber++;
|
|
|
+ this.answerRightNumber++;
|
|
|
} else {
|
|
|
- this.answerErrorNumber++;
|
|
|
+ this.answerErrorNumber++;
|
|
|
}
|
|
|
- }else if(_this.uiType == "BLANK_20"){
|
|
|
- let flag = true
|
|
|
- if(item.Bookanswer){
|
|
|
- let arr = []
|
|
|
- for(let i = 0;i<item.option.length;i++){
|
|
|
- let obj = {
|
|
|
- left:[],
|
|
|
- right:[]
|
|
|
- }
|
|
|
- for(let j=0;j<item.option[i].correct.length;j++){
|
|
|
- if(j==0){
|
|
|
- obj.left = item.option[i].correct[j]?item.option[i].correct[j].replace(/\*\//g, "").split('|'):[]
|
|
|
- }else if(j==1){
|
|
|
- obj.right = item.option[i].correct[j]?item.option[i].correct[j].replace(/\*\//g, "").split('|'):[]
|
|
|
- }
|
|
|
- }
|
|
|
- arr.push(obj)
|
|
|
+ }
|
|
|
+ } else if (_this.uiType == "RECORD_15") {
|
|
|
+ let flag = true;
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ if (item.recordOrInput == "record") {
|
|
|
+ } else {
|
|
|
+ if (
|
|
|
+ item.correct[0] &&
|
|
|
+ item.Bookanswer[0].input.trim() == item.correct[0]
|
|
|
+ ) {
|
|
|
+ } else if (!item.correct[0]) {
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ this.answerRightNumber++;
|
|
|
+ } else {
|
|
|
+ this.answerErrorNumber++;
|
|
|
+ }
|
|
|
+ } else if (_this.uiType == "BLANK_20") {
|
|
|
+ let flag = true;
|
|
|
+ if (item.Bookanswer) {
|
|
|
+ let arr = [];
|
|
|
+ for (let i = 0; i < item.option.length; i++) {
|
|
|
+ let obj = {
|
|
|
+ left: [],
|
|
|
+ right: [],
|
|
|
+ };
|
|
|
+ for (let j = 0; j < item.option[i].correct.length; j++) {
|
|
|
+ if (j == 0) {
|
|
|
+ obj.left = item.option[i].correct[j]
|
|
|
+ ? item.option[i].correct[j].replace(/\*\//g, "").split("|")
|
|
|
+ : [];
|
|
|
+ } else if (j == 1) {
|
|
|
+ obj.right = item.option[i].correct[j]
|
|
|
+ ? item.option[i].correct[j].replace(/\*\//g, "").split("|")
|
|
|
+ : [];
|
|
|
}
|
|
|
- for(let i=0;i<item.Bookanswer.length;i++){
|
|
|
- for(let key in item.Bookanswer[i]){
|
|
|
- for(let j=0;j<item.Bookanswer[i][key].length;j++){
|
|
|
- if(arr[i][key][j]&&arr[i][key][j].indexOf('*/')>-1){
|
|
|
- // 答案乱序
|
|
|
- let noStar = arr[i][key][j].replace(/\*\//g, "")
|
|
|
- if(noStar.length==item.Bookanswer[i][key][j].length){
|
|
|
- let singleWords = arr[i][key][j].split('*/')
|
|
|
- let singleFlag = true
|
|
|
- for(let n=0;n<singleWords.length;n++){
|
|
|
- if(item.Bookanswer[i][key][j].indexOf(singleWords[n])>-1){
|
|
|
-
|
|
|
- }else{
|
|
|
- singleFlag = false
|
|
|
- return false
|
|
|
- }
|
|
|
- }
|
|
|
- if(singleFlag){
|
|
|
-
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }else if(arr[i][key][j]&&arr[i][key][j].indexOf('*/')==-1){
|
|
|
- // 不乱序
|
|
|
- if(arr[i][key][j]==item.Bookanswer[i][key][j].trim()){
|
|
|
- }else{
|
|
|
- flag = false
|
|
|
- }
|
|
|
- }else if(!arr[i][key][j]){
|
|
|
- }
|
|
|
+ }
|
|
|
+ arr.push(obj);
|
|
|
+ }
|
|
|
+ for (let i = 0; i < item.Bookanswer.length; i++) {
|
|
|
+ for (let key in item.Bookanswer[i]) {
|
|
|
+ for (let j = 0; j < item.Bookanswer[i][key].length; j++) {
|
|
|
+ if (arr[i][key][j] && arr[i][key][j].indexOf("*/") > -1) {
|
|
|
+ // 答案乱序
|
|
|
+ let noStar = arr[i][key][j].replace(/\*\//g, "");
|
|
|
+ if (noStar.length == item.Bookanswer[i][key][j].length) {
|
|
|
+ let singleWords = arr[i][key][j].split("*/");
|
|
|
+ let singleFlag = true;
|
|
|
+ for (let n = 0; n < singleWords.length; n++) {
|
|
|
+ if (
|
|
|
+ item.Bookanswer[i][key][j].indexOf(singleWords[n]) >
|
|
|
+ -1
|
|
|
+ ) {
|
|
|
+ } else {
|
|
|
+ singleFlag = false;
|
|
|
+ return false;
|
|
|
}
|
|
|
+ }
|
|
|
+ if (singleFlag) {
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ } else if (
|
|
|
+ arr[i][key][j] &&
|
|
|
+ arr[i][key][j].indexOf("*/") == -1
|
|
|
+ ) {
|
|
|
+ // 不乱序
|
|
|
+ if (arr[i][key][j] == item.Bookanswer[i][key][j].trim()) {
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
}
|
|
|
+ } else if (!arr[i][key][j]) {
|
|
|
+ }
|
|
|
}
|
|
|
+ }
|
|
|
}
|
|
|
- if (flag) {
|
|
|
- this.answerRightNumber++;
|
|
|
- } else {
|
|
|
- this.answerErrorNumber++;
|
|
|
- }
|
|
|
+ }
|
|
|
+ if (flag) {
|
|
|
+ this.answerRightNumber++;
|
|
|
+ } else {
|
|
|
+ this.answerErrorNumber++;
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
this.answerNotDoneNumber = this.queList.length - doneNumber;
|
|
|
},
|
|
|
// 上传文件
|
|
|
- uploadBookWrite(){
|
|
|
- let userInfor = getToken();
|
|
|
- let UserCode = '',
|
|
|
- UserType = '',
|
|
|
- SessionID = ''
|
|
|
- if (userInfor) {
|
|
|
- let user = JSON.parse(getToken());
|
|
|
- UserCode = user.user_code;
|
|
|
- UserType = user.user_type;
|
|
|
- SessionID = user.session_id;
|
|
|
- }
|
|
|
- this.bookuploadUrl =
|
|
|
- process.env.VUE_APP_BASE_API +
|
|
|
- "/GCLSFileServer/WebFileUpload?UserCode=" +
|
|
|
- UserCode +
|
|
|
- "&UserType=" +
|
|
|
- UserType +
|
|
|
- "&SessionID=" +
|
|
|
- SessionID +
|
|
|
- "&SecurityLevel=Mid"
|
|
|
+ uploadBookWrite() {
|
|
|
+ let userInfor = getToken();
|
|
|
+ let UserCode = "",
|
|
|
+ UserType = "",
|
|
|
+ SessionID = "";
|
|
|
+ if (userInfor) {
|
|
|
+ let user = JSON.parse(getToken());
|
|
|
+ UserCode = user.user_code;
|
|
|
+ UserType = user.user_type;
|
|
|
+ SessionID = user.session_id;
|
|
|
+ }
|
|
|
+ this.bookuploadUrl =
|
|
|
+ process.env.VUE_APP_BASE_API +
|
|
|
+ "/GCLSFileServer/WebFileUpload?UserCode=" +
|
|
|
+ UserCode +
|
|
|
+ "&UserType=" +
|
|
|
+ UserType +
|
|
|
+ "&SessionID=" +
|
|
|
+ SessionID +
|
|
|
+ "&SecurityLevel=Mid";
|
|
|
},
|
|
|
// 下载文件zip
|
|
|
- downloadBookWrite(idList){
|
|
|
- let MethodName = "file_store_manager-StartCreateFileCompressPack"
|
|
|
- let data = {
|
|
|
- file_id_list:JSON.parse(idList)
|
|
|
- }
|
|
|
- getContentFile(MethodName, data)
|
|
|
- .then((res) => {
|
|
|
- let id = res.file_compress_task_id
|
|
|
- let _this = this
|
|
|
- this.bookDownTimer = setInterval(()=>{_this.checkTaskProgress(id)}, 2000);
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- });
|
|
|
+ downloadBookWrite(idList) {
|
|
|
+ let MethodName = "file_store_manager-StartCreateFileCompressPack";
|
|
|
+ let data = {
|
|
|
+ file_id_list: JSON.parse(idList),
|
|
|
+ };
|
|
|
+ getContentFile(MethodName, data)
|
|
|
+ .then((res) => {
|
|
|
+ let id = res.file_compress_task_id;
|
|
|
+ let _this = this;
|
|
|
+ this.bookDownTimer = setInterval(() => {
|
|
|
+ _this.checkTaskProgress(id);
|
|
|
+ }, 2000);
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
},
|
|
|
//成功后调用打包进度
|
|
|
- checkTaskProgress(taskId){
|
|
|
- let userInfor = getToken();
|
|
|
- let UserCode = '',
|
|
|
- UserType = '',
|
|
|
- SessionID = ''
|
|
|
- if (userInfor) {
|
|
|
- let user = JSON.parse(getToken());
|
|
|
- UserCode = user.user_code;
|
|
|
- UserType = user.user_type;
|
|
|
- SessionID = user.session_id;
|
|
|
- }
|
|
|
- let MethodName = "file_store_manager-GetFileCompressTaskProgress"
|
|
|
- let data = {
|
|
|
- file_compress_task_id:taskId
|
|
|
- }
|
|
|
- getContentFile(MethodName, data)
|
|
|
- .then((res) => {
|
|
|
- if(res.is_finish=='true'){
|
|
|
- clearInterval(this.bookDownTimer)
|
|
|
- window.open(process.env.VUE_APP_BASE_API +
|
|
|
- `/GCLSFileServer/WebFileDownload?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}&FileID=${res.compress_pack_file_id}`)
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- });
|
|
|
+ checkTaskProgress(taskId) {
|
|
|
+ let userInfor = getToken();
|
|
|
+ let UserCode = "",
|
|
|
+ UserType = "",
|
|
|
+ SessionID = "";
|
|
|
+ if (userInfor) {
|
|
|
+ let user = JSON.parse(getToken());
|
|
|
+ UserCode = user.user_code;
|
|
|
+ UserType = user.user_type;
|
|
|
+ SessionID = user.session_id;
|
|
|
+ }
|
|
|
+ let MethodName = "file_store_manager-GetFileCompressTaskProgress";
|
|
|
+ let data = {
|
|
|
+ file_compress_task_id: taskId,
|
|
|
+ };
|
|
|
+ getContentFile(MethodName, data)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.is_finish == "true") {
|
|
|
+ clearInterval(this.bookDownTimer);
|
|
|
+ window.open(
|
|
|
+ process.env.VUE_APP_BASE_API +
|
|
|
+ `/GCLSFileServer/WebFileDownload?UserCode=${UserCode}&UserType=${UserType}&SessionID=${SessionID}&FileID=${res.compress_pack_file_id}`
|
|
|
+ );
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {});
|
|
|
},
|
|
|
// 返回是否答完最后一题
|
|
|
- handleBookIsDone(){
|
|
|
- return this.isHasDone
|
|
|
+ handleBookIsDone() {
|
|
|
+ return this.isHasDone;
|
|
|
},
|
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
};
|
|
@@ -1307,7 +1342,7 @@ export default {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- z-index:999;
|
|
|
+ z-index: 999;
|
|
|
}
|
|
|
.guide {
|
|
|
font-size: 20px;
|