summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2008-04-07 13:56:19 +0200
committerGuillaume Seguin <guillaume@segu.in>2008-04-07 13:56:19 +0200
commit5fa4ef5325a084728b1a970d2cd22bdba49b9b6d (patch)
tree741252f8b996e1785db23eeef743ce678232f91a
parent4217ed28f9d27b494271e32fc4485c782a42f429 (diff)
downloadmarks-5fa4ef5325a084728b1a970d2cd22bdba49b9b6d.tar.gz
marks-5fa4ef5325a084728b1a970d2cd22bdba49b9b6d.tar.bz2
* Improve variable naming for better readability
-rw-r--r--main/views.py10
-rw-r--r--templates/main/marks.html4
2 files changed, 7 insertions, 7 deletions
diff --git a/main/views.py b/main/views.py
index 4c162c1..d5b77a0 100644
--- a/main/views.py
+++ b/main/views.py
@@ -126,28 +126,28 @@ def exam_view (request, exam):
}
return render_page (request, data, "main/exam.html")
-def marks_view (request, name):
+def marks_view (request, marks_set):
'''View the totals of a given marks set'''
user_data = get_user_data (request)
- if not name in user_data["marks"]:
+ if not marks_set in user_data["marks"]:
return home_view (request)
marks = {}
for exam in user_data["exams"]:
- marks[exam] = get_mark (user_data, exam, name)
+ marks[exam] = get_mark (user_data, exam, marks_set)
totals = {}
for set in user_data["ratings"]:
total_ratings = 0
total = 0
for exam in user_data["exams"]:
rating = get_rating (user_data, exam, set)
- total += rating * get_mark (user_data, exam, name)
+ total += rating * get_mark (user_data, exam, marks_set)
total_ratings += rating
if total_ratings:
totals[set] = round (float (total) / total_ratings, 2)
else:
totals[set] = 0
data = {
- "name": name,
+ "marks_set": marks_set,
"marks": marks,
"totals": totals,
}
diff --git a/templates/main/marks.html b/templates/main/marks.html
index 62cfe68..194cd42 100644
--- a/templates/main/marks.html
+++ b/templates/main/marks.html
@@ -1,10 +1,10 @@
{% extends "main/base.html" %}
{% load marks_tags %}
-{% block title %}{{ block.super }} ~ Jeu de notes {{ name }}{% endblock %}
+{% block title %}{{ block.super }} ~ Jeu de notes {{ marks_set }}{% endblock %}
{% block content %}
-{% rounded_block_start 'fullblock' %}Jeu de notes {{ name }}{% end_rounded_block_start %}
+{% rounded_block_start 'fullblock' %}Jeu de notes {{ marks_set }}{% end_rounded_block_start %}
<h4>Notes</h4>
<div class="blockcontent">
<ul>