def show_exam_result(request, course_id, lesson_id, submission_id):
    from django.db.models import Sum
    course = Course.objects.get(pk=course_id)
    submission = Submission.objects.get(pk=submission_id)
    selected_choices = submission.chocies.all()
    lesson = Lesson.objects.get(pk=lesson_id)
    questions = lesson.question_set.all()
    total_mark = round(lesson.question_set.all().aggregate(Sum('grade'))['grade__sum'])
    grade = 0
    for question in questions:
        if question.is_get_score(selected_choices):
            grade += question.grade
    ctx = {'grade': round(grade), 'total_mark': total_mark, 'questions': questions, 'lesson': lesson, 'selected_choices': selected_choices}
    return render(request, 'onlinecourse/exam_result_bootstrap.html', ctx)
def show_exam_result(request, course_id, lesson_id, submission_id):
    from django.db.models import Sum
    course = Course.objects.get(pk=course_id)
    submission = Submission.objects.get(pk=submission_id)
    selected_choices = submission.chocies.all()
    lesson = Lesson.objects.get(pk=lesson_id)
    questions = lesson.question_set.all()
    total_mark = round(lesson.question_set.all().aggregate(Sum('grade'))['grade__sum'])
    grade = 0
    for question in questions:
        if question.is_get_score(selected_choices):
            grade += question.grade
    ctx = {'grade': round(grade), 'total_mark': total_mark, 'questions': questions, 'lesson': lesson, 'selected_choices': selected_choices}
    return render(request, 'onlinecourse/exam_result_bootstrap.html', ctx)