Skip to content

Commit 60e5a6e

Browse files
committed
added nth question in quiz
1 parent 19e2950 commit 60e5a6e

File tree

5 files changed

+17
-13
lines changed

5 files changed

+17
-13
lines changed

django_school/classroom/templates/classroom/students/take_quiz_form.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<div class="progress mb-3">
77
<div class="progress-bar" role="progressbar" aria-valuenow="{{ progress }}" aria-valuemin="0" aria-valuemax="100" style="width: {{ progress }}%"></div>
88
</div>
9+
<h2><span class="badge badge-secondary">{{ answered_questions|add:"1" }}/{{total_questions}}</span></h2>
10+
911
<h2 class="mb-3">{{ quiz.name }}</h2>
1012
<p class="lead">{{ question.text }}</p>
1113
<form method="post" novalidate>

django_school/classroom/views/students.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,7 @@ def take_quiz(request, pk):
132132
'quiz': quiz,
133133
'question': question,
134134
'form': form,
135-
'progress': progress
135+
'progress': progress,
136+
'answered_questions': total_questions - total_unanswered_questions,
137+
'total_questions': total_questions
136138
})

django_school/templates/404.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
<!doctype html>
1+
{% load static %}<!doctype html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66
<title>Django School</title>
7-
<link href="https://fonts.googleapis.com/css?family=Clicker+Script" rel="stylesheet">
8-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
9-
<link rel="stylesheet" type="text/css" href="/static/vendor/fontello-2f186091/css/fontello.css">
10-
<link rel="stylesheet" type="text/css" href="/static/css/app.css">
11-
<link rel="stylesheet" type="text/css" href="/static/css/students.css">
7+
<!-- <link href="https://fonts.googleapis.com/css?family=Clicker+Script" rel="stylesheet"> -->
8+
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
9+
<link rel="stylesheet" type="text/css" href="{% static 'vendor/fontello-2f186091/css/fontello.css' %}">
10+
<link rel="stylesheet" type="text/css" href="{% static 'css/app.css' %}">
11+
<link rel="stylesheet" type="text/css" href="{% static 'css/students.css' %}">
1212
</head>
1313
<body>
1414
<div class="container" style="margin-top: 8rem">

django_school/templates/500.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
<meta charset="utf-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
66
<title>Django School</title>
7-
<link href="https://fonts.googleapis.com/css?family=Clicker+Script" rel="stylesheet">
8-
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.3/css/bootstrap.min.css" integrity="sha384-Zug+QiDoJOrZ5t4lssLdxGhVrurbmBWopoEl+M6BdEfwnCJZtKxi1KgxUyJq13dy" crossorigin="anonymous">
9-
<link rel="stylesheet" type="text/css" href="/static/vendor/fontello-2f186091/css/fontello.css">
10-
<link rel="stylesheet" type="text/css" href="/static/css/app.css">
11-
<link rel="stylesheet" type="text/css" href="/static/css/students.css">
7+
<!-- <link href="https://fonts.googleapis.com/css?family=Clicker+Script" rel="stylesheet"> -->
8+
<link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
9+
<link rel="stylesheet" type="text/css" href="{% static 'vendor/fontello-2f186091/css/fontello.css' %}">
10+
<link rel="stylesheet" type="text/css" href="{% static 'css/app.css' %}">
11+
<link rel="stylesheet" type="text/css" href="{% static 'css/students.css' %}">
1212
</head>
1313
<body>
1414
<div class="container" style="margin-top: 8rem">

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
Django==2.2.3
2-
django-crispy-forms==1.7.2
2+
django-crispy-forms==1.7.0

0 commit comments

Comments
 (0)