fix: 矩阵答卷联调

This commit is contained in:
wanganmao
2022-12-10 18:15:36 +08:00
parent 336aa18c62
commit c7a835fd9b

View File

@@ -236,29 +236,32 @@ export default defineComponent({
}
}
var arr = this.row.slice(0, this.rowIndex + 1);
if(this.config.is_disable_lines_same) {
var res = arr.reduce((ctx, cur) => {
if(!cur.value) {
ctx.len = 0;
var arr = this.row.slice(0, this.rowIndex + 1);
var res = arr.reduce((ctx, cur) => {
if(!cur.value) {
ctx.len = 0;
return ctx;
}
if(ctx.lastVal == cur.value) {
ctx.len++;
}
else{
ctx.len = 0;
}
if(ctx.len >= this.config.disable_lines_same) {
ctx.ok = false;
}
ctx.lastVal = cur.value
return ctx;
}
if(ctx.lastVal == cur.value) {
ctx.len++;
}
else{
ctx.len = 0;
}
if(ctx.len >= 2) {
ctx.ok = false;
}
ctx.lastVal = cur.value
return ctx;
}, { lastVal: "", len: 0, ok: true });
}, { lastVal: "", len: 0, ok: true });
if(!res.ok) {
message.error(`您在每一题的态度与观点均对我们有非常重要的意义,请您务必仔细阅读题目后回答,连续一致的答案可能会导致整个问卷的作废,请您重新作答。`);
return;
if(!res.ok) {
message.error(`您在每一题的态度与观点均对我们有非常重要的意义,请您务必仔细阅读题目后回答,连续一致的答案可能会导致整个问卷的作废,请您重新作答。`);
return;
}
}
}