summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testapp/exam/forms.py7
-rw-r--r--testapp/templates/exam/intro.html29
2 files changed, 30 insertions, 6 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index a5ca26f..d99a04d 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -85,8 +85,11 @@ class UserLoginForm(forms.Form):
def clean(self):
super(UserLoginForm, self).clean()
- u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"]
- user = authenticate(username = u_name, password = pwd)
+ try:
+ u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"]
+ user = authenticate(username = u_name, password = pwd)
+ except Exception:
+ raise forms.ValidationError("Username and/or Password is not entered")
if not user:
raise forms.ValidationError("Invalid username/password")
diff --git a/testapp/templates/exam/intro.html b/testapp/templates/exam/intro.html
index 1d3e5de..2306fb7 100644
--- a/testapp/templates/exam/intro.html
+++ b/testapp/templates/exam/intro.html
@@ -3,7 +3,16 @@
{% block title %}Instructions and Rules {% endblock %}
{% block content %}
-<h2>Important rules and instructions</h2>
+<html lang="en">
+ <body>
+ <div class="container">
+ <div class="content">
+<div class="page-header">
+<h1><Strong><center>Online Test</center></strong></h1>
+</div>
+ <div class=row>
+ <div class=span14>
+<h3><center>Important instructions & rules</center></h3><br>
<p> Welcome <strong>{{user.first_name.title}} {{user.last_name.title}}</strong>,
to the programming quiz! </p>
@@ -43,11 +52,23 @@ carefully.
</ul>
-<p> We hope you enjoy taking this exam.</p>
+<p> We hope you enjoy taking this exam !!!</p>
<form action="{{URL_ROOT}}/exam/start/" method="post" align="center">
{% csrf_token %}
-<input type="submit" name="start" value="Start Exam!">
+<center><button class="btn" type="submit" name="start">Start Exam!</button></center>
+<!--input type="submit" name="start" value="Start Exam!"-->
</form>
+</div>
+ </div>
+ </div>
+<footer>
+ <p>&copy; FOSSEE group, IIT Bombay</p>
+ </footer>
-{% endblock content %} \ No newline at end of file
+ </div> <!-- /container -->
+
+ </body>
+</html>
+
+{% endblock content %}