<commit_before>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from primatequiz.models import *
from questions.models import question



# Create your views here.
def renderBase(request):
    return render_to_response("basic_bootstrap.html", context_instance=RequestContext(request))

def quiz(request):
    questions = question.objects.order_by('?')
    if len(questions) < 5:
        questions = questions
    else:
        questions = questions[0:4]
    result = species.objects.order_by('?')[0]
    return render_to_response("splashpage.html",
                                    {"questions":questions,"result":result},
                                    context_instance=RequestContext(request))

def results(request, slug=None):
    if not slug:
        rez = species.objects.order_by('?')[0]
    else:
        rez = get_object_or_404(species, slug = slug)

    if rez:
        return render_to_response("results.html",
                                    {"species":rez},
                                    context_instance=RequestContext(request))

<commit_msg>increased number of Qs<commit_after>from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.http import HttpResponseRedirect, HttpResponse
from primatequiz.models import *
from questions.models import question



# Create your views here.
def renderBase(request):
    return render_to_response("basic_bootstrap.html", context_instance=RequestContext(request))

def quiz(request):
    questions = question.objects.order_by('?')
    if len(questions) < 5:
        questions = questions
    else:
        questions = questions[0:6]
    result = species.objects.order_by('?')[0]
    return render_to_response("splashpage.html",
                                    {"questions":questions,"result":result},
                                    context_instance=RequestContext(request))

def results(request, slug=None):
    if not slug:
        rez = species.objects.order_by('?')[0]
    else:
        rez = get_object_or_404(species, slug = slug)

    if rez:
        return render_to_response("results.html",
                                    {"species":rez},
                                    context_instance=RequestContext(request))


{'fraction_non_alphanumeric': 0.09436325678496868, 'fraction_numerical': 0.00918580375782881, 'mean_word_length': 2.7320872274143304, 'pattern_counts': {'":': 6, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3669213', 'n_tokens_mistral': 669, 'n_tokens_neox': 616, 'n_words': 137}