#165 change question_order
This commit is contained in:
@@ -94,6 +94,17 @@ def quiz_names_json(request):
|
||||
return JsonResponse(names, safe=False)
|
||||
|
||||
|
||||
|
||||
def reorder_questions(request):
|
||||
if request.method == "POST":
|
||||
data = json.loads(request.body)
|
||||
for item in data['order']:
|
||||
QivipQuestion.objects.filter(id=item['id']).update(order=item['position'])
|
||||
return JsonResponse({'status': 'ok'})
|
||||
return JsonResponse({'status': 'error'}, status=400)
|
||||
|
||||
|
||||
|
||||
def apply_quiz_filters(queryset, form):
|
||||
|
||||
if not form.is_valid():
|
||||
|
||||
Reference in New Issue
Block a user