题目导入是重复题目增加分类过滤条件
This commit is contained in:
parent
3e7033cb25
commit
165156aff1
|
@ -108,8 +108,8 @@ def drquestions(companyid,path,userid):
|
||||||
else:
|
else:
|
||||||
cateobj = Questioncat.objects.create(usecomp=Partment.objects.get(partid=companyid),name=cate)
|
cateobj = Questioncat.objects.create(usecomp=Partment.objects.get(partid=companyid),name=cate)
|
||||||
if type == '单选':
|
if type == '单选':
|
||||||
if Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
|
if Question.objects.filter(questioncat=cateobj, type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
|
||||||
Question.objects.filter(type=1,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
|
pass
|
||||||
else:
|
else:
|
||||||
if right in ['A','B','C','D','E','F']:
|
if right in ['A','B','C','D','E','F']:
|
||||||
obj = Question()
|
obj = Question()
|
||||||
|
@ -128,8 +128,8 @@ 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,usecomps = ','+companyid+',').exists():
|
if Question.objects.filter(questioncat=cateobj, type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
|
||||||
Question.objects.filter(type=2,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
|
pass
|
||||||
else:
|
else:
|
||||||
if [False for c in right if c not in qlist]:
|
if [False for c in right if c not in qlist]:
|
||||||
pass
|
pass
|
||||||
|
@ -153,8 +153,8 @@ 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,usecomps = ','+companyid+',').exists():
|
if Question.objects.filter(questioncat=cateobj, type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').exists():
|
||||||
Question.objects.filter(type=3,title=title,right=right,deletemark=1,usecomps = ','+companyid+',').update(nousecomps='', questioncat=cateobj)
|
pass
|
||||||
else:
|
else:
|
||||||
obj = Question()
|
obj = Question()
|
||||||
obj.type = 3
|
obj.type = 3
|
||||||
|
|
Loading…
Reference in New Issue