Commit ed4e7984 authored by rachbit's avatar rachbit

added assignment templates, edited assignment views

parent cd772cb6
{% extends 'base.html' %}
{% load static %}
{% block title %}Widget's Assignments{% endblock %}
{% block content %}
<i><h1>Welcome to Widget's Assignments!</h1></i>
{% for assignments in assignments %}
<p><strong>
<a href="{{ assignments.get_absolute_url }}">
<li>
{{ assignments.name }}
</li>
</a>
</strong></p>
{% endfor %}
<br><br>
<a href="#">
<button type="button"><p>New Assignment</p></button>
</a>
<br><br><br>
{# the links to other html files #}
<div class = links>
<a href="../dashboard/">Dashboard</a><br>
<a href="../announcements/">Announcements</a><br>
<a href="../forum/">Forum</a><br>
<a href="../calendar/">Calendar</a><br>
</div>
{% endblock %}
...@@ -3,22 +3,6 @@ from django.http import HttpResponse ...@@ -3,22 +3,6 @@ from django.http import HttpResponse
from .models import Assignment, Course from .models import Assignment, Course
def index(request): def index(request):
assignments = Assignment.objects.all()
return_string = '<body>' args = {'assignments':assignments}
for assignment in Assignment.objects.all(): return render(request, 'assignments/assignments.html', args)
assignment_details = 'Assignment Name: {}<br>Description: {}<br>Perfect Score: {}<br> Passing Score: {}<br>Course/Section: {} {}-{}<br>'.format(
assignment.name,
assignment.description,
assignment.perfect_score,
assignment.passing_score(),
assignment.course.code,
assignment.course.title,
assignment.course.section
)
return_string += assignment_details + '<br>'
html_string = '<html>{}</html>'.format(return_string)
return HttpResponse('Widget\'s Assignments Page<br><br>' + html_string)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment