import question

This commit is contained in:
caoqianming 2020-06-09 11:47:56 +08:00
parent db1bacaaa1
commit ec9fcba978
2 changed files with 5 additions and 5 deletions

View File

@ -190,9 +190,9 @@ export default {
}, },
methods: { methods: {
checkPermission, checkPermission,
getList(query = this.listQuery) { getList() {
this.listLoading = true; this.listLoading = true;
getExamTestlist(query).then(response => { getExamTestlist(this.listQuery).then(response => {
this.tableData = response.data; this.tableData = response.data;
this.listLoading = false; this.listLoading = false;
}); });

View File

@ -168,7 +168,7 @@ class QuestionViewSet(ModelViewSet):
else: else:
cateobj = Questioncat.objects.get(id=questioncatdict[questioncat]) cateobj = Questioncat.objects.get(id=questioncatdict[questioncat])
if type == '单选': if type == '单选':
if Question.objects.filter(type='单选',name=name,right=right,is_delete=0).exists(): if Question.objects.filter(type='单选',name=name, is_delete=0).exists():
notinlist.append(i) notinlist.append(i)
else: else:
if right in ['A','B','C','D','E','F']: if right in ['A','B','C','D','E','F']:
@ -186,7 +186,7 @@ class QuestionViewSet(ModelViewSet):
obj.save() obj.save()
elif type == '多选': elif type == '多选':
right = list(right) right = list(right)
if Question.objects.filter(type='多选',name=name,right=right,is_delete=0).exists(): if Question.objects.filter(type='多选', name=name, is_delete=0).exists():
notinlist.append(i) notinlist.append(i)
else: else:
if [False for c in right if c not in qlist]: if [False for c in right if c not in qlist]:
@ -209,7 +209,7 @@ class QuestionViewSet(ModelViewSet):
right = 'A' right = 'A'
else: else:
right = 'B' right = 'B'
if Question.objects.filter(type='判断',name=name,right=right,is_delete=0).exists(): if Question.objects.filter(type='判断',name=name, is_delete=0).exists():
notinlist.append(i) notinlist.append(i)
else: else:
obj = Question() obj = Question()