diff options
author | Prabhu Ramachandran | 2011-11-25 02:24:34 +0530 |
---|---|---|
committer | Prabhu Ramachandran | 2011-11-25 02:24:34 +0530 |
commit | b4023e17d6f97e51ffde740c17d19630b5a9c2d1 (patch) | |
tree | 78b015a1d6e9ffa1d4fbf673b6ef21491833b564 | |
parent | 3375839bfc531329adc45994659be382295038b6 (diff) | |
download | online_test-b4023e17d6f97e51ffde740c17d19630b5a9c2d1.tar.gz online_test-b4023e17d6f97e51ffde740c17d19630b5a9c2d1.tar.bz2 online_test-b4023e17d6f97e51ffde740c17d19630b5a9c2d1.zip |
ENH: First cut of CSS for pages.
This is largely taken from other sites and looks reasonable for now.
Also added links to the admin page from the
monitor/user_data/grade_user.
-rw-r--r-- | exam/views.py | 4 | ||||
-rw-r--r-- | settings.py | 1 | ||||
-rw-r--r-- | static/exam/css/base.css | 26 | ||||
-rw-r--r-- | templates/base.html | 11 | ||||
-rw-r--r-- | templates/exam/grade_user.html | 1 | ||||
-rw-r--r-- | templates/exam/monitor.html | 2 | ||||
-rw-r--r-- | templates/exam/user_data.html | 5 |
7 files changed, 44 insertions, 6 deletions
diff --git a/exam/views.py b/exam/views.py index cd91ef8..ed73adf 100644 --- a/exam/views.py +++ b/exam/views.py @@ -124,7 +124,9 @@ def start(request): try: profile = user.get_profile() except Profile.DoesNotExist: - profile = None + msg = 'You do not have a profile and cannot take the quiz!' + raise Http404(msg) + new_paper = QuestionPaper(user=user, user_ip=ip, key=key, quiz=quiz, profile=profile) new_paper.start_time = datetime.datetime.now() diff --git a/settings.py b/settings.py index a844324..6cce1cb 100644 --- a/settings.py +++ b/settings.py @@ -96,6 +96,7 @@ STATICFILES_DIRS = ( # Put strings here, like "/home/html/static" or "C:/www/django/static". # Always use forward slashes, even on Windows. # Don't forget to use absolute paths, not relative paths. + join(CURDIR, 'static'), ) # List of finder classes that know how to find static files in diff --git a/static/exam/css/base.css b/static/exam/css/base.css new file mode 100644 index 0000000..d51be30 --- /dev/null +++ b/static/exam/css/base.css @@ -0,0 +1,26 @@ +body { font-family: 'Georgia', serif; font-size: 17px; color: #000; background: #eee;} +h1, h2, h3, h4 { font-family: 'Garamond', 'Georgia', serif; font-weight: normal; } +h1 { margin: 0 0 30px 0; font-size: 36px;} +h1 span { display: none; } +h2 { font-size: 24px; margin: 15px 0 5px 0; } +h3 { font-size: 19px; margin: 15px 0 5px 0; } +h4 { font-size: 15px; margin: 15px 0 5px 0; } + +.box { width: 700px; margin: 10px auto ; } +.page { margin: 2em auto; width: 35em; border: 5px solid #ccc; + padding: 0.8em; background: white; } +.entries { list-style: none; margin: 0; padding: 0; } +.entries li { margin: 0.8em 1.2em; } +.entries li h2 { margin-left: -1em; } +.add-entry { font-size: 0.9em; border-bottom: 1px solid #ccc; } +.add-entry dl { font-weight: bold; } +.metanav { text-align: right; font-size: 0.8em; padding: 0.3em; + margin-bottom: 1em; background: #fafafa; } +.flash { background: #CEE5F5; padding: 0.5em; + border: 1px solid #AACBE2; } +.error { background: #F0D6D6; padding: 0.5em; } +textarea, code, +pre { font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', + monospace!important; font-size: 14px; background: #eee; } +pre { padding: 0px 30px; margin: 15px -30px; line-height: 1.3; } + diff --git a/templates/base.html b/templates/base.html index 22e9ba2..c2bbabb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -8,15 +8,18 @@ {% endblock %} </title> {% block meta %} -{% endblock%} +{% endblock %} +<link rel="stylesheet" href="{{ URL_ROOT }}/static/exam/css/base.css" type="text/css" /> +{% block css %} +{% endblock %} {% block script %} {% endblock %} </head> <body {% block onload %}{% endblock %}> - + <div class=box> {% block content %} {% endblock %} - + </div> </body> -</html>
\ No newline at end of file +</html> diff --git a/templates/exam/grade_user.html b/templates/exam/grade_user.html index f671237..2994ee2 100644 --- a/templates/exam/grade_user.html +++ b/templates/exam/grade_user.html @@ -59,4 +59,5 @@ Marks: <input id="q{{ question.id }}" type="text" {% endif %} {# if data.papers #} +<a href="{{URL_ROOT}}/admin/">Admin</a> {% endblock content %} diff --git a/templates/exam/monitor.html b/templates/exam/monitor.html index 8f34a7f..a15b2a2 100644 --- a/templates/exam/monitor.html +++ b/templates/exam/monitor.html @@ -62,4 +62,6 @@ {% endif %} {% endif %} +<a href="{{URL_ROOT}}/admin/">Admin</a> + {% endblock content %} diff --git a/templates/exam/user_data.html b/templates/exam/user_data.html index 1e2c392..7db0af2 100644 --- a/templates/exam/user_data.html +++ b/templates/exam/user_data.html @@ -21,8 +21,9 @@ Last login: {{ data.user.last_login }} </p> {% if data.papers %} -<a href="{{URL_ROOT}}/exam/grade_user/{{ data.user.username }}/"> +<p><a href="{{URL_ROOT}}/exam/grade_user/{{ data.user.username }}/"> Grade/correct paper</a> +</p> {% for paper in data.papers %} @@ -60,5 +61,7 @@ User IP address: {{ paper.user_ip }} <hr /> <a href="{{URL_ROOT}}/exam/grade_user/{{ data.user.username }}/"> Grade/correct paper</a> +<br/> +<a href="{{URL_ROOT}}/admin/">Admin</a> {% endblock content %} |