Skip to content

Commit a16e962

Browse files
committed
First commit
0 parents  commit a16e962

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+1148
-0
lines changed

db.sqlite3

140 KB
Binary file not shown.

manage.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
"""Django's command-line utility for administrative tasks."""
3+
import os
4+
import sys
5+
6+
7+
def main():
8+
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tejalearns.settings')
9+
try:
10+
from django.core.management import execute_from_command_line
11+
except ImportError as exc:
12+
raise ImportError(
13+
"Couldn't import Django. Are you sure it's installed and "
14+
"available on your PYTHONPATH environment variable? Did you "
15+
"forget to activate a virtual environment?"
16+
) from exc
17+
execute_from_command_line(sys.argv)
18+
19+
20+
if __name__ == '__main__':
21+
main()

quiz/__init__.py

Whitespace-only changes.
144 Bytes
Binary file not shown.

quiz/__pycache__/admin.cpython-37.pyc

260 Bytes
Binary file not shown.

quiz/__pycache__/apps.cpython-37.pyc

356 Bytes
Binary file not shown.

quiz/__pycache__/forms.cpython-37.pyc

575 Bytes
Binary file not shown.
1016 Bytes
Binary file not shown.

quiz/__pycache__/urls.cpython-37.pyc

763 Bytes
Binary file not shown.

quiz/__pycache__/views.cpython-37.pyc

5.88 KB
Binary file not shown.

quiz/admin.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.contrib import admin
2+
3+
# Register your models here.
4+
from .models import Questions
5+
6+
7+
admin.site.register(Questions)

quiz/apps.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from django.apps import AppConfig
2+
3+
4+
class QuizConfig(AppConfig):
5+
name = 'quiz'

quiz/forms.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from django import forms
2+
3+
from .models import User,Score
4+
5+
6+
class PostForm(forms.ModelForm):
7+
8+
class Meta:
9+
model = User
10+
fields = ('username',)

quiz/migrations/0001_initial.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Generated by Django 2.2.4 on 2019-08-22 13:03
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
initial = True
9+
10+
dependencies = [
11+
]
12+
13+
operations = [
14+
migrations.CreateModel(
15+
name='Questions',
16+
fields=[
17+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
18+
('question', models.CharField(max_length=250)),
19+
('optiona', models.CharField(max_length=100)),
20+
('optionb', models.CharField(max_length=100)),
21+
('optionc', models.CharField(max_length=100)),
22+
('optiond', models.CharField(max_length=100)),
23+
('answer', models.CharField(max_length=100)),
24+
],
25+
),
26+
]

quiz/migrations/0002_score_user.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Generated by Django 2.2.4 on 2019-08-28 21:04
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('quiz', '0001_initial'),
10+
]
11+
12+
operations = [
13+
migrations.CreateModel(
14+
name='Score',
15+
fields=[
16+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
17+
('name', models.CharField(max_length=250)),
18+
('score', models.CharField(max_length=250)),
19+
],
20+
),
21+
migrations.CreateModel(
22+
name='User',
23+
fields=[
24+
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
25+
('username', models.CharField(max_length=250)),
26+
],
27+
),
28+
]
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.4 on 2019-08-29 14:02
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('quiz', '0002_score_user'),
10+
]
11+
12+
operations = [
13+
migrations.RenameField(
14+
model_name='score',
15+
old_name='name',
16+
new_name='user',
17+
),
18+
]

quiz/migrations/__init__.py

Whitespace-only changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
155 Bytes
Binary file not shown.

quiz/models.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from django.db import models
2+
3+
# Create your models here.
4+
5+
class Questions(models.Model):
6+
question = models.CharField(max_length = 250)
7+
optiona = models.CharField(max_length = 100)
8+
optionb = models.CharField(max_length = 100)
9+
optionc = models.CharField(max_length = 100)
10+
optiond = models.CharField(max_length = 100)
11+
answer = models.CharField(max_length = 100)
12+
13+
def __str__(self):
14+
return self.question
15+
16+
17+
18+
19+
class User(models.Model):
20+
username=models.CharField(max_length=250)
21+
22+
23+
24+
class Score(models.Model):
25+
user=models.CharField(max_length=250)
26+
score=models.IntegerField()
27+
28+
29+
30+
31+

quiz/static/quiz/img1.jpeg

399 KB
Loading

quiz/static/quiz/img10.jpeg

327 KB
Loading

quiz/static/quiz/img2.jpeg

323 KB
Loading

quiz/static/quiz/img3.jpeg

159 KB
Loading

quiz/static/quiz/img4.jpeg

164 KB
Loading

quiz/static/quiz/img5.jpeg

161 KB
Loading

quiz/static/quiz/img6.jpeg

256 KB
Loading

quiz/static/quiz/img7.jpeg

248 KB
Loading

quiz/static/quiz/img8.jpeg

269 KB
Loading

quiz/static/quiz/img9.jpeg

253 KB
Loading

quiz/templates/quiz/first.html

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
<html>
3+
<head>
4+
<title>Django Girls blog</title>
5+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
6+
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
7+
<link href='//fonts.googleapis.com/css?family=Lobster&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
8+
</head>
9+
<body>
10+
<div class="page-header">
11+
12+
<h1><a href="/">niranjans quiz app</a></h1>
13+
</div>
14+
<div class="content container">
15+
<div class="row">
16+
<div class="col-md-8">
17+
<h2></h2>
18+
<form action="{% url 'blog-home' %}" method="POST" class="post-form">{% csrf_token %}
19+
{{ form.as_p }}
20+
<button type="submit" class="save btn btn-default">Save</button>
21+
</form>
22+
</div>
23+
</div>
24+
</div>
25+
</body>
26+
</html>

quiz/templates/quiz/quiz-1.html

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{% load static %}
2+
<html>
3+
<head>
4+
<script type="text/javascript">
5+
window.history.forward();
6+
function noBack() {
7+
window.history.forward();
8+
}
9+
</script>
10+
</head>
11+
<body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
12+
<p><center>
13+
<img src="{% static 'quiz/img1.jpeg' %}" width="380" height="380" alt="pic of Friends"/></center>
14+
</p>
15+
<h2> hai {{ g }}</h2>
16+
<h2>{{ ques.0 }}</h2>
17+
<h2>{{ data }}</h2>
18+
19+
<script type="">
20+
$(document).ready(function(){
21+
$('.multiple').click(function() {
22+
$('.multiple').not(this).prop('checked', false);
23+
});
24+
});
25+
</script>
26+
27+
<ul>
28+
<form action="{% url 'quiz-e1' %}" method="POST">
29+
{% csrf_token %}
30+
<input type="radio" name ="q1a1" value="{{ ques.0.optiona }} " class="multiple" checked=”checked”>{{ ques.0.optiona }}
31+
<br>
32+
<input type="radio" name="q1a1" value="{{ ques.0.optionb }} " class="multiple">{{ ques.0.optionb }}
33+
<br>
34+
<input type="radio" name="q1a1" value="{{ ques.0.optionc }} " class="multiple">{{ ques.0.optionc }}
35+
<br>
36+
<input type="radio" name="q1a1" value="{{ ques.0.optiond }} " class="multiple">{{ ques.0.optiond }}
37+
<br>
38+
<input type="submit" name="q1a5" value="go to the next question" >
39+
</form>
40+
41+
</ul>
42+
43+
44+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
45+
</body>
46+
</html>

quiz/templates/quiz/quiz-10.html

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% load static %}
2+
<html>
3+
<body>
4+
<p><center>
5+
<img src="{% static 'quiz/img10.jpeg' %}" width="380" height="380" alt="pic of Friends"/></center>
6+
</p>
7+
<h2>Q.10 What is Joey's full name?</h2>
8+
<form action="quiz-e10.html" method="POST">
9+
<h3><input type="submit" value="op1">Joesph Charles Tribiani</h3>
10+
</form>
11+
<form action="quiz-e10.html" method="POST">
12+
<h3><input type="submit" value="op2">Joseph Tribiani Jr.</h3>
13+
</form>
14+
<form action="quiz-e10.html" method="POST">
15+
<h3><input type="submit" value="op3">Joseph Tribiani</h3>
16+
</form>
17+
<form action="" method="POST">
18+
{% csrf_token %}
19+
<input type="submit" value="op4">Joesph Francis Tribiani
20+
</h3>
21+
</form>
22+
</body>
23+
</html>

quiz/templates/quiz/quiz-2.html

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{% load static %}
2+
<html>
3+
<head>
4+
<script type="text/javascript">
5+
window.history.forward();
6+
function noBack() {
7+
window.history.forward();
8+
}
9+
</script>
10+
</head>
11+
<body onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
12+
13+
14+
<p><center>
15+
<img src="{% static 'quiz/img2.jpeg' %}" width="380" height="380" alt="pic of Friends"/></center>
16+
</p>
17+
<h2>{{ ques.1 }}</h2>
18+
<ul>
19+
<form action="{% url 'quiz-e2' %}" method="POST">
20+
{% csrf_token %}
21+
<input type="radio" name ="q1a1" value="{{ ques.1.optiona }} " class="multiple" checked=”checked”>{{ ques.1.optiona }}
22+
<br>
23+
<input type="radio" name="q1a1" value="{{ ques.1.optionb }} " class="multiple">{{ ques.1.optionb }}
24+
<br>
25+
<input type="radio" name="q1a1" value="{{ ques.1.optionc }} " class="multiple">{{ ques.1.optionc }}
26+
<br>
27+
<input type="radio" name="q1a1" value="{{ ques.1.optiond }} " class="multiple">{{ ques.1.optiond }}
28+
<br>
29+
<input type="submit" name="q1a1" value="go to the next question">
30+
</form>
31+
32+
</ul>
33+
<script type="text/javascript">
34+
function checkOnlyOne(b){
35+
36+
var x = document.getElementsByClassName('multiple');
37+
var i;
38+
39+
for (i = 0; i < x.length; i++) {
40+
if(x[i].value != b) x[i].checked = false;
41+
}
42+
}
43+
</script>
44+
45+
46+
47+
</body>
48+
</html>

quiz/templates/quiz/quiz-3.html

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{% load static %}
2+
<html>
3+
<head>
4+
<script type="text/javascript">
5+
window.history.forward();
6+
function noBack() {
7+
window.history.forward();
8+
}
9+
</script>
10+
11+
12+
</head>
13+
<bod onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="">
14+
15+
<p><center>
16+
<img src="{% static 'quiz/img3.jpeg' %}" width="380" height="380" alt="pic of Friends"/></center>
17+
</p>
18+
<h2>{{ ques.2 }}</h2>
19+
<ul>
20+
<form action="{% url 'quiz-e3' %}" method="POST">
21+
{% csrf_token %}
22+
<input type="radio" name ="q1a1" value="{{ ques.2.optiona }} " class="multiple" checked=”checked”>{{ ques.2.optiona }}
23+
<br>
24+
<input type="radio" name="q1a1" value="{{ ques.2.optionb }} " class="multiple" >{{ ques.2.optionb }}
25+
<br>
26+
<input type="radio" name="q1a1" value="{{ ques.2.optionc }} " class="multiple" >{{ ques.2.optionc }}
27+
<br>
28+
<input type="radio" name="q1a1" value="{{ ques.2.optiond }} " class="multiple">{{ ques.2.optiond }}
29+
<br>
30+
<input type="submit" name="q1a1" value="go to the next question">
31+
</form>
32+
33+
</ul>
34+
<script type="text/javascript">
35+
function checkOnlyOne(b){
36+
37+
var x = document.getElementsByClassName('multiple');
38+
var i;
39+
40+
for (i = 0; i < x.length; i++) {
41+
if(x[i].value != b) x[i].checked = false;
42+
}
43+
}
44+
</script>
45+
46+
47+
48+
49+
</body>
50+
</html>

0 commit comments

Comments
 (0)