-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclear_db.py
More file actions
64 lines (57 loc) · 1.85 KB
/
clear_db.py
File metadata and controls
64 lines (57 loc) · 1.85 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import sqlite3
def clear_db():
conn = sqlite3.connect('assessment_results.db')
c = conn.cursor()
# Drop the feedback table if it exists
c.execute('DROP TABLE IF EXISTS feedback')
# Recreate the feedback table with the correct schema
c.execute('''
CREATE TABLE IF NOT EXISTS feedback (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT,
familiarity TEXT,
role TEXT,
experience TEXT,
location TEXT,
use_frequently TEXT,
complexity TEXT,
ease_of_use TEXT,
need_support TEXT,
integration TEXT,
inconsistency TEXT,
learn_quickly TEXT,
cumbersome TEXT,
confidence TEXT,
learning_curve TEXT,
navigation TEXT,
relevance TEXT,
comprehensive TEXT,
useful_recommendations TEXT,
overall_satisfaction TEXT,
recommend TEXT,
best_feature TEXT,
biggest_difficulty TEXT,
missing_feature TEXT,
additional_comments TEXT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
)
''')
# Drop the results table if it exists
c.execute('DROP TABLE IF EXISTS results')
# Recreate the results table with the correct schema
c.execute('''
CREATE TABLE results (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT,
total_score INTEGER,
compliance_percentage REAL,
details TEXT,
consent TEXT,
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP
)
''')
conn.commit()
conn.close()
print("Database cleared and tables recreated.")
if __name__ == '__main__':
clear_db()