Antworten zeigen/verstecken
This commit is contained in:
@@ -130,16 +130,17 @@ def delete_quiz(request, pk):
|
||||
def detail_quiz(request, pk):
|
||||
#quiz = get_object_or_404(QivipQuiz, pk=pk, user_id=request.user)
|
||||
quiz = get_object_or_404(QivipQuiz, pk=pk)
|
||||
show_answers = request.GET.get('show_answers', 'false').lower() == 'true'
|
||||
questions = QivipQuestion.objects.filter(quiz_id=quiz)
|
||||
|
||||
# Parse JSON data for each question
|
||||
for question in questions:
|
||||
if question.data:
|
||||
question.data = json.loads(question.data)
|
||||
|
||||
|
||||
context = {
|
||||
'quiz': quiz,
|
||||
'questions': questions
|
||||
'questions': questions,
|
||||
'detail':show_answers,
|
||||
}
|
||||
return render(request, 'library/detail_quiz.html', context)
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user