导入question

This commit is contained in:
caoqianming 2020-09-25 07:02:47 +08:00
parent 16fb63aa79
commit 82ed58a50b
1 changed files with 3 additions and 3 deletions

View File

@ -95,7 +95,7 @@ def drquestions(companyid,path,userid):
cateobj = Questioncat.objects.create(usecomp=Partment.objects.get(partid=companyid),name=cate) cateobj = Questioncat.objects.create(usecomp=Partment.objects.get(partid=companyid),name=cate)
print(cateobj) print(cateobj)
if type == '单选': if type == '单选':
if Question.objects.filter(type=1,title=title,right=right,deletemark=1).exists(): if Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').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']:
@ -115,7 +115,7 @@ def drquestions(companyid,path,userid):
obj.save() obj.save()
elif type == '多选': elif type == '多选':
right = list(right) right = list(right)
if Question.objects.filter(type=2,title=title,right=right,deletemark=1).exists(): if Question.objects.filter(type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').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]:
@ -140,7 +140,7 @@ def drquestions(companyid,path,userid):
right = 'A' right = 'A'
else: else:
right = 'B' right = 'B'
if Question.objects.filter(type=3,title=title,right=right,deletemark=1).exists(): if Question.objects.filter(type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
notinlist.append(i) notinlist.append(i)
else: else:
obj = Question() obj = Question()