Skip to content

Commit 105f322

Browse files
committed
added energy sources quiz
1 parent 4eaa73c commit 105f322

File tree

3 files changed

+78
-227
lines changed

3 files changed

+78
-227
lines changed

README.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Django School
22

33
[![Python Version](https://img.shields.io/badge/python-3.6-brightgreen.svg)](https://python.org)
4-
[![Django Version](https://img.shields.io/badge/django-2.2-brightgreen.svg)](https://djangoproject.com)
4+
[![Django Version](https://img.shields.io/badge/django-3.0-brightgreen.svg)](https://djangoproject.com)
55
[![CircleCI](https://circleci.com/gh/suhailvs/django-schools.svg?style=svg)](https://circleci.com/gh/suhailvs/django-schools)
66

77
This is an example project to illustrate an implementation of multiple user types. In this Django app, teachers can create quizzes and students can sign up and take quizzes related to their interests.
@@ -27,35 +27,26 @@ source ./env/bin/activate
2727
pip install -r requirements.txt
2828
```
2929

30-
Create the database:
30+
Create the database and run the development server:
3131

3232
```bash
33-
cd django-schools
33+
cd django_school
3434
python manage.py migrate
35-
```
36-
37-
Load datas, some questions, a **teacher**(user: `sumee`,pass: `sumee1910`) and a **student**(user: `suhail`,pass: `sumee1910`)
38-
```bash
3935
python manage.py loaddata datas.json
40-
```
41-
42-
Finally, run the development server:
43-
44-
```bash
4536
python manage.py runserver
4637
```
4738

4839
The project will be available at http://127.0.0.1:8000, Login using::
4940

5041
**Teacher**
5142

52-
username: `sumee`
53-
password: `sumee1910`
43+
username: `teacher`
44+
password: `teacher`
5445

5546
**Student**
5647

57-
username: `suhail`
58-
password: `sumee1910`
48+
username: `student`
49+
password: `student`
5950

6051

6152
## License
Lines changed: 69 additions & 209 deletions
Original file line numberDiff line numberDiff line change
@@ -1,209 +1,69 @@
1-
[{
2-
"model": "classroom.question",
3-
"pk": 1,
4-
"fields": {
5-
"quiz": 1,
6-
"text": "When was the Treaty of Versailles signed?"
7-
}
8-
}, {
9-
"model": "classroom.question",
10-
"pk": 2,
11-
"fields": {
12-
"quiz": 1,
13-
"text": "Britain, France, USA, Germany, Italy, and Russia."
14-
}
15-
}, {
16-
"model": "classroom.question",
17-
"pk": 3,
18-
"fields": {
19-
"quiz": 1,
20-
"text": "The war ended on November 11 1918."
21-
}
22-
}, {
23-
"model": "classroom.question",
24-
"pk": 4,
25-
"fields": {
26-
"quiz": 1,
27-
"text": "The name of the new government in Germany was called the Wiemar Republic."
28-
}
29-
}, {
30-
"model": "classroom.answer",
31-
"pk": 1,
32-
"fields": {
33-
"question": 1,
34-
"text": "June 29 of 1919",
35-
"is_correct": true
36-
}
37-
}, {
38-
"model": "classroom.answer",
39-
"pk": 2,
40-
"fields": {
41-
"question": 1,
42-
"text": "June 29 of 1920",
43-
"is_correct": false
44-
}
45-
}, {
46-
"model": "classroom.answer",
47-
"pk": 3,
48-
"fields": {
49-
"question": 1,
50-
"text": "March 29 of 1919",
51-
"is_correct": false
52-
}
53-
}, {
54-
"model": "classroom.answer",
55-
"pk": 4,
56-
"fields": {
57-
"question": 1,
58-
"text": "August 29 of 1920",
59-
"is_correct": false
60-
}
61-
}, {
62-
"model": "classroom.answer",
63-
"pk": 5,
64-
"fields": {
65-
"question": 2,
66-
"text": "How much money did Germany have to pay as a reparation?",
67-
"is_correct": false
68-
}
69-
}, {
70-
"model": "classroom.answer",
71-
"pk": 6,
72-
"fields": {
73-
"question": 2,
74-
"text": "Which countries were involved in World War 1?",
75-
"is_correct": true
76-
}
77-
}, {
78-
"model": "classroom.answer",
79-
"pk": 7,
80-
"fields": {
81-
"question": 2,
82-
"text": "What does BRAT stand for in the Treaty of Versailles?",
83-
"is_correct": false
84-
}
85-
}, {
86-
"model": "classroom.answer",
87-
"pk": 8,
88-
"fields": {
89-
"question": 2,
90-
"text": "What does MAIN stand for when it comes to the causes of the first world war?",
91-
"is_correct": false
92-
}
93-
}, {
94-
"model": "classroom.answer",
95-
"pk": 9,
96-
"fields": {
97-
"question": 3,
98-
"text": "When was the Treaty of Versailles signed?",
99-
"is_correct": true
100-
}
101-
}, {
102-
"model": "classroom.answer",
103-
"pk": 10,
104-
"fields": {
105-
"question": 3,
106-
"text": "Why did Germany declare war on Russia?",
107-
"is_correct": false
108-
}
109-
}, {
110-
"model": "classroom.answer",
111-
"pk": 11,
112-
"fields": {
113-
"question": 3,
114-
"text": "When did World War 1 begin?",
115-
"is_correct": false
116-
}
117-
}, {
118-
"model": "classroom.answer",
119-
"pk": 12,
120-
"fields": {
121-
"question": 3,
122-
"text": "When did World War 1 end?",
123-
"is_correct": false
124-
}
125-
}, {
126-
"model": "classroom.answer",
127-
"pk": 13,
128-
"fields": {
129-
"question": 4,
130-
"text": "What does MAIN stand for when it comes to the causes of the first world war?",
131-
"is_correct": false
132-
}
133-
}, {
134-
"model": "classroom.answer",
135-
"pk": 14,
136-
"fields": {
137-
"question": 4,
138-
"text": "What was the name of the new government in Germany after World War 1?",
139-
"is_correct": true
140-
}
141-
}, {
142-
"model": "classroom.answer",
143-
"pk": 15,
144-
"fields": {
145-
"question": 4,
146-
"text": "Were the Big Three happy about the outcome of the Treaty of Versailles?",
147-
"is_correct": false
148-
}
149-
}, {
150-
"model": "classroom.answer",
151-
"pk": 16,
152-
"fields": {
153-
"question": 4,
154-
"text": "How much money did Germany have to pay as a reparation?",
155-
"is_correct": false
156-
}
157-
},{
158-
"model": "classroom.user",
159-
"pk": 1,
160-
"fields": {
161-
"password": "pbkdf2_sha256$100000$fBZ6FNGxOrNT$O53zRTxQFRUSqX+THFIxWZn0evHJE0l32ST2BA0aKy4=",
162-
"last_login": "2018-06-21T05:34:02.608Z",
163-
"is_superuser": false,
164-
"username": "suhail",
165-
"first_name": "",
166-
"last_name": "",
167-
"email": "",
168-
"is_staff": false,
169-
"is_active": true,
170-
"date_joined": "2018-06-21T04:47:59.795Z",
171-
"is_student": true,
172-
"is_teacher": false,
173-
"groups": [],
174-
"user_permissions": []
175-
}
176-
}, {
177-
"model": "classroom.user",
178-
"pk": 2,
179-
"fields": {
180-
"password": "pbkdf2_sha256$100000$qSn4XCPpb6Ry$XjIgpmcuUzajsPso6UWzDUSNDMbC6bwTQYUuUghk8PY=",
181-
"last_login": "2018-06-21T05:35:05.133Z",
182-
"is_superuser": false,
183-
"username": "sumee",
184-
"first_name": "",
185-
"last_name": "",
186-
"email": "",
187-
"is_staff": false,
188-
"is_active": true,
189-
"date_joined": "2018-06-21T04:48:26.868Z",
190-
"is_student": false,
191-
"is_teacher": true,
192-
"groups": [],
193-
"user_permissions": []
194-
}
195-
}, {
196-
"model": "classroom.quiz",
197-
"pk": 1,
198-
"fields": {
199-
"owner": 2,
200-
"name": "World War 1",
201-
"subject": 5
202-
}
203-
}, {
204-
"model": "classroom.student",
205-
"pk": 1,
206-
"fields": {
207-
"interests": [2, 3, 5]
208-
}
209-
}]
1+
[
2+
{"model": "classroom.question", "pk": 1, "fields": {"quiz": 1, "text": "When was the Treaty of Versailles signed?"}},
3+
{"model": "classroom.question", "pk": 2, "fields": {"quiz": 1, "text": "Britain, France, USA, Germany, Italy, and Russia."}},
4+
{"model": "classroom.question", "pk": 3, "fields": {"quiz": 1, "text": "The war ended on November 11 1918."}},
5+
{"model": "classroom.question", "pk": 4, "fields": {"quiz": 1, "text": "The name of the new government in Germany was called the Wiemar Republic."}},
6+
7+
{"model": "classroom.question", "pk": 5, "fields": {"quiz": 2, "text": "An advantage of using solar power is"}},
8+
{"model": "classroom.question", "pk": 6, "fields": {"quiz": 2, "text": "An advantage of using hydroelectric power is"}},
9+
{"model": "classroom.question", "pk": 7, "fields": {"quiz": 2, "text": "Most utility companies in the U.S. dont use hydroelectric power because"}},
10+
{"model": "classroom.question", "pk": 8, "fields": {"quiz": 2, "text": "Which energy source would be best for a city that has limited space and want to be effecient?"}},
11+
{"model": "classroom.question", "pk": 9, "fields": {"quiz": 2, "text": "What is a major disadvantage of nuclear power?"}},
12+
{"model": "classroom.question", "pk": 10, "fields": {"quiz": 2, "text": "If a community were choosing between solar and wind; what advantage would make wind the best choice?"}},
13+
{"model": "classroom.question", "pk": 11, "fields": {"quiz": 2, "text": "An advantage of burning coal for energy is"}},
14+
{"model": "classroom.question", "pk": 12, "fields": {"quiz": 2, "text": "An advantage of using natural gas as a form of energy is"}},
15+
{"model": "classroom.question", "pk": 13, "fields": {"quiz": 2, "text": "What do geothermal and solar energy have in common?"}},
16+
17+
{"model": "classroom.answer", "pk": 1, "fields": {"question": 1, "text": "June 29 of 1919", "is_correct": true}},
18+
{"model": "classroom.answer", "pk": 2, "fields": {"question": 1, "text": "June 29 of 1920", "is_correct": false}},
19+
{"model": "classroom.answer", "pk": 3, "fields": {"question": 1, "text": "March 29 of 1919", "is_correct": false}},
20+
{"model": "classroom.answer", "pk": 4, "fields": {"question": 1, "text": "August 29 of 1920", "is_correct": false}},
21+
{"model": "classroom.answer", "pk": 5, "fields": {"question": 2, "text": "How much money did Germany have to pay as a reparation?", "is_correct": false}},
22+
{"model": "classroom.answer", "pk": 6, "fields": {"question": 2, "text": "Which countries were involved in World War 1?", "is_correct": true}},
23+
{"model": "classroom.answer", "pk": 7, "fields": {"question": 2, "text": "What does BRAT stand for in the Treaty of Versailles?", "is_correct": false}},
24+
{"model": "classroom.answer", "pk": 8, "fields": {"question": 2, "text": "What does MAIN stand for when it comes to the causes of the first world war?", "is_correct": false}},
25+
{"model": "classroom.answer", "pk": 9, "fields": {"question": 3, "text": "When was the Treaty of Versailles signed?", "is_correct": true}},
26+
{"model": "classroom.answer", "pk": 10, "fields": {"question": 3, "text": "Why did Germany declare war on Russia?", "is_correct": false}},
27+
{"model": "classroom.answer", "pk": 11, "fields": {"question": 3, "text": "When did World War 1 begin?", "is_correct": false}},
28+
{"model": "classroom.answer", "pk": 12, "fields": {"question": 3, "text": "When did World War 1 end?", "is_correct": false}},
29+
{"model": "classroom.answer", "pk": 13, "fields": {"question": 4, "text": "What does MAIN stand for when it comes to the causes of the first world war?", "is_correct": false}},
30+
{"model": "classroom.answer", "pk": 14, "fields": {"question": 4, "text": "What was the name of the new government in Germany after World War 1?", "is_correct": true}},
31+
{"model": "classroom.answer", "pk": 15, "fields": {"question": 4, "text": "Were the Big Three happy about the outcome of the Treaty of Versailles?", "is_correct": false}},
32+
{"model": "classroom.answer", "pk": 16, "fields": {"question": 4, "text": "How much money did Germany have to pay as a reparation?", "is_correct": false}},
33+
34+
{"model": "classroom.answer", "pk": 17, "fields": {"question": 5, "text": "no greenhouse gases", "is_correct": true}},
35+
{"model": "classroom.answer", "pk": 18, "fields": {"question": 5, "text": "lots of pollution", "is_correct": false}},
36+
{"model": "classroom.answer", "pk": 19, "fields": {"question": 5, "text": "it is available even on cloudy days", "is_correct": false}},
37+
{"model": "classroom.answer", "pk": 20, "fields": {"question": 6, "text": "reservoirs can be used for irrigation of crops", "is_correct": true}},
38+
{"model": "classroom.answer", "pk": 21, "fields": {"question": 6, "text": "sometimes surrounding area get flooded", "is_correct": false}},
39+
{"model": "classroom.answer", "pk": 22, "fields": {"question": 6, "text": "the normal flow of the water is diverted", "is_correct": false}},
40+
{"model": "classroom.answer", "pk": 23, "fields": {"question": 7, "text": "the plants are expensive to build and use expensive machinery", "is_correct": true}},
41+
{"model": "classroom.answer", "pk": 24, "fields": {"question": 7, "text": "reservoirs can be used to irrigate crops and they dont want to help farmers", "is_correct": false}},
42+
{"model": "classroom.answer", "pk": 25, "fields": {"question": 7, "text": "the cause a lot of greenhouse gass", "is_correct": false}},
43+
{"model": "classroom.answer", "pk": 26, "fields": {"question": 8, "text": "solar-costly to build and 6%-30% efficient", "is_correct": false}},
44+
{"model": "classroom.answer", "pk": 27, "fields": {"question": 8, "text": "Wind-turbines need lots of free space 40%-60% efficient", "is_correct": false}},
45+
{"model": "classroom.answer", "pk": 28, "fields": {"question": 8, "text": "Natural gas-can be used in small areas 50%-60% efficient", "is_correct": true}},
46+
{"model": "classroom.answer", "pk": 29, "fields": {"question": 9, "text": "it produces small amounts of power", "is_correct": false}},
47+
{"model": "classroom.answer", "pk": 30, "fields": {"question": 9, "text": "the by-product(waste) is nuclear radiation", "is_correct": true}},
48+
{"model": "classroom.answer", "pk": 31, "fields": {"question": 9, "text": "power plants are inexpensive to build", "is_correct": false}},
49+
{"model": "classroom.answer", "pk": 32, "fields": {"question": 10, "text": "locations for turbines are limited because the wind can be blocked", "is_correct": false}},
50+
{"model": "classroom.answer", "pk": 33, "fields": {"question": 10, "text": "solar needs a back up system for cloudy days", "is_correct": false}},
51+
{"model": "classroom.answer", "pk": 34, "fields": {"question": 10, "text": "wind energy is less expensive and it is limitless", "is_correct": true}},
52+
{"model": "classroom.answer", "pk": 35, "fields": {"question": 11, "text": "it is an inexpensive source of energy", "is_correct": true}},
53+
{"model": "classroom.answer", "pk": 36, "fields": {"question": 11, "text": "it does not pollute the air", "is_correct": false}},
54+
{"model": "classroom.answer", "pk": 37, "fields": {"question": 11, "text": "it is a renewable energy source", "is_correct": false}},
55+
{"model": "classroom.answer", "pk": 38, "fields": {"question": 12, "text": "it is more expensive compared to other fossil fuels", "is_correct": false}},
56+
{"model": "classroom.answer", "pk": 39, "fields": {"question": 12, "text": "It produces low emissions(pollution) compared to other fossil fuels", "is_correct": true}},
57+
{"model": "classroom.answer", "pk": 40, "fields": {"question": 12, "text": "there is a more limited supply compared to other fossil fuels", "is_correct": false}},
58+
{"model": "classroom.answer", "pk": 41, "fields": {"question": 13, "text": "they both use sunlight to generate energy", "is_correct": false}},
59+
{"model": "classroom.answer", "pk": 42, "fields": {"question": 13, "text": "both are non-renewable energy sources", "is_correct": false}},
60+
{"model": "classroom.answer", "pk": 43, "fields": {"question": 13, "text": "neither produce greenhouse gass", "is_correct": true}},
61+
62+
{"model": "classroom.quiz", "pk": 1, "fields": {"owner": 1, "name": "World War 1", "subject": 5}},
63+
{"model": "classroom.quiz", "pk": 2, "fields": {"owner": 1, "name": "EnergySources", "subject": 4}},
64+
65+
{"model": "classroom.user", "pk": 1, "fields": {"password": "pbkdf2_sha256$180000$og6o8PzLsRNC$/Ay4/y7/plwM2t3MGrzUoGvTKCqRlrSYmCwrkL9VrVY=", "last_login": "2020-03-19T02:20:24.490Z", "is_superuser": false, "username": "teacher", "first_name": "Teacher", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2020-03-19T02:20:24.014Z", "is_student": false, "is_teacher": true, "groups": [], "user_permissions": []}},
66+
{"model": "classroom.user", "pk": 2, "fields": {"password": "pbkdf2_sha256$180000$DBSRJ8mc0QUn$aCBAYWUqewnK+nJ1FqSBQpnvY33P/FpK2CAYyQuX1p0=", "last_login": "2020-03-19T02:19:48.856Z", "is_superuser": false, "username": "student", "first_name": "Student", "last_name": "", "email": "", "is_staff": false, "is_active": true, "date_joined": "2020-03-19T02:19:48.411Z", "is_student": true, "is_teacher": false, "groups": [], "user_permissions": []}},
67+
68+
{"model": "classroom.student", "pk": 2, "fields": {"score": 0, "interests": [2, 3, 4, 5]}}
69+
]

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Django==2.2.3
2-
django-crispy-forms==1.7.0
1+
Django==3.0.4
2+
django-crispy-forms==1.9.0

0 commit comments

Comments
 (0)