from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404


# Create your views here.
from quiz.models import *


@login_required
def home(request):
    return render(request, 'stuff_admin/home.html')


@login_required
def progress(request):
    query_set = Module.objects.all()
    return render(request, 'stuff_admin/progress.html', {'query_set': query_set})


@login_required
def pass_quiz(request, id):
    query_set = get_object_or_404(Concept, id=id)
    return render(request, 'stuff_admin/pass_quiz.html', {'query_set': query_set})


@login_required
def module(request, id):
    query_set = get_object_or_404(Module, id=id)
    return render(request, 'stuff_admin/chapter_details.html', {'query_set': query_set})


@login_required
def concept(request, id):
    query_set = get_object_or_404(Concept, id=id)
    return render(request, 'stuff_admin/concept.html', {'query_set': query_set})
