<commit_before>from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods

from grades.models import *

def index(request):
    return render(request, 'grades/index.html')

def section_index(request):
    section_list = list(Section.objects.all())
    return render(request, 'grades/section/index.html', {'section_list': section_list})

def section(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    return render(request, 'grades/section/section.html', {'section': section})

@login_required
def roster(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    roster = list(Roster.objects.filter(section=section_id).order_by('student__last_name','student__first_name'))
    enrollment_statuses = list(EnrollmentStatus.objects.all())
    return render(request, 'grades/roster/roster.html', {'roster': roster,'section': section,'enrollment_statuses':enrollment_statuses})

def assignments(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    assignments = list(Assignment.objects.filter(section=section_id));
    return render(request, 'grades/assignments/assignments.html', {'assignments': assignments,'section': section})

@login_required
def roster_student(request,section_id,student_id):
    section = get_object_or_404(Section,pk=section_id)
    assignment_scores = list(AssignmentScore.objects.filter(student=student_id))
    student = get_object_or_404(Student,pk=student_id)<commit_msg>Sorting assignment scores by assignment name for student score display<commit_after>from django.http import HttpResponse
from django.shortcuts import render, get_object_or_404, get_list_or_404
from django.contrib.auth.decorators import login_required
from django.views.decorators.http import require_http_methods

from grades.models import *

def index(request):
    return render(request, 'grades/index.html')

def section_index(request):
    section_list = list(Section.objects.all())
    return render(request, 'grades/section/index.html', {'section_list': section_list})

def section(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    return render(request, 'grades/section/section.html', {'section': section})

@login_required
def roster(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    roster = list(Roster.objects.filter(section=section_id).order_by('student__last_name','student__first_name'))
    enrollment_statuses = list(EnrollmentStatus.objects.all())
    return render(request, 'grades/roster/roster.html', {'roster': roster,'section': section,'enrollment_statuses':enrollment_statuses})

def assignments(request,section_id):
    section = get_object_or_404(Section,pk=section_id)
    assignments = list(Assignment.objects.filter(section=section_id));
    return render(request, 'grades/assignments/assignments.html', {'assignments': assignments,'section': section})

@login_required
def roster_student(request,section_id,student_id):
    section = get_object_or_404(Section,pk=section_id)
    assignment_scores = list(AssignmentScore.objects.filter(student=student_id).order_by('assignment__name'))
    student = get_object_or_404(Student,pk=student_id)
{'fraction_non_alphanumeric': 0.11246290801186944, 'fraction_numerical': 0.012462908011869436, 'mean_word_length': 7.577608142493639, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1649807', 'n_tokens_mistral': 1034, 'n_tokens_neox': 1010, 'n_words': 168}