-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdb_create.py
41 lines (41 loc) · 2.41 KB
/
db_create.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from quiz import *
from models import *
def insert():
admincreate = user.query.filter_by(username="admin").first()
if admincreate:
pass
else:
new_user = user(username="admin",email="[email protected]",password=generate_password_hash("admin",method='sha256'),role=True,token="asjbfjasbiadbvudbraskbvdksbcf1w2e3r2ru23180u0")
db.session.add(new_user)
db.session.commit()
new_problem = Problems(statement="Test1",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_first=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test2",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,type_of_ques=False)
db.session.add(new_problem)
new_problem = Problems(statement="Test4",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,type_of_ques=False)
db.session.add(new_problem)
new_problem = Problems(statement="Test3",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,answer_third=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test5",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,answer_third=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test6",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,answer_third=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test7",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,answer_third=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test9",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_second=True,answer_third=True,type_of_ques=True)
db.session.add(new_problem)
new_problem = Problems(statement="Test10",option_first="1",option_second="2",option_third="3",option_fourth="4",answer_first=True,type_of_ques=True)
db.session.add(new_problem)
new_quiz = Quiz(name="Quiz-1")
db.session.add(new_quiz)
new_quiz = Quiz(name="Quiz-2")
db.session.add(new_quiz)
new_quiz = Quiz(name="Quiz-3")
db.session.add(new_quiz)
new_quiz = Quiz(name="Quiz-4")
db.session.add(new_quiz)
new_category =Category(name="Sports")
db.session.add(new_category)
new_category =Category(name="GK")
db.session.add(new_category)
db.session.commit()