You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
27
27
pip install -r requirements.txt
28
28
```
29
29
30
-
Create the database:
30
+
Create the database and run the development server:
31
31
32
32
```bash
33
-
cddjango-schools
33
+
cddjango_school
34
34
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
39
35
python manage.py loaddata datas.json
40
-
```
41
-
42
-
Finally, run the development server:
43
-
44
-
```bash
45
36
python manage.py runserver
46
37
```
47
38
48
39
The project will be available at http://127.0.0.1:8000, Login using::
{"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?"}},
{"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}},
{"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}},
0 commit comments