Login requirement added to sites and tested
This commit is contained in:
parent
46f5979aef
commit
18ec49903b
@ -482,6 +482,9 @@ def create_all_csvs():
|
||||
# export CSV
|
||||
@app.route("/export_all_tables")
|
||||
def export_all_tables():
|
||||
if not session.get("logged_in"):
|
||||
return redirect("/login")
|
||||
|
||||
create_all_csvs()
|
||||
|
||||
with ZipFile('zip_exports/all_tables.zip', 'w') as zipf: #no compression, need to add zipfile.ZIP_DEFLATED for compression
|
||||
@ -492,7 +495,9 @@ def export_all_tables():
|
||||
# export CSV
|
||||
@app.route("/export_all_videos")
|
||||
def export_all_videos():
|
||||
|
||||
if not session.get("logged_in"):
|
||||
return redirect("/login")
|
||||
|
||||
with ZipFile('zip_exports/all_videos.zip', 'w') as zipf: #no compression, need to add zipfile.ZIP_DEFLATED for compression
|
||||
zipdir('uploads/', zipf)
|
||||
|
||||
@ -532,6 +537,8 @@ def export_csv(table_name):
|
||||
# the contents of all tables
|
||||
@app.route("/table_contents")
|
||||
def table_contents():
|
||||
if not session.get("logged_in"):
|
||||
return redirect("/login")
|
||||
meta = db.metadata
|
||||
#meta.reflect(db.engine) # Uncomment this to also get the hidden tables, but this crashes rn
|
||||
tables = meta.tables.keys()
|
||||
@ -562,6 +569,8 @@ def table_contents():
|
||||
|
||||
@app.route('/show_tables')
|
||||
def show_tables():
|
||||
if not session.get("logged_in"):
|
||||
return redirect("/login")
|
||||
meta = db.metadata
|
||||
meta.reflect(db.engine)
|
||||
tables = meta.tables
|
||||
@ -629,6 +638,8 @@ def delete_json_tables():
|
||||
# Route to delete all entries
|
||||
@app.route('/delete_all_entries', methods=['GET'])
|
||||
def delete_all_entries():
|
||||
if not session.get("logged_in"):
|
||||
return redirect("/login")
|
||||
# here I could also use a "drop_all()", that works jsut like create all from the creation part
|
||||
# this together with the reflect could drop actually all tables
|
||||
try:
|
||||
|
3
slaeforms/exports/demographic_data.csv
Normal file
3
slaeforms/exports/demographic_data.csv
Normal file
@ -0,0 +1,3 @@
|
||||
id,user_id,date_created,stimulus_name,alter,geschlecht,hoerstatus,bevorzugte_kommunikation,gebärdenzeitraum,gebärdensprachkompetenz
|
||||
33b2f49f-ccc8-48c5-b7f6-fa4bb9aa1bf3,60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,2024-06-27 17:43:45.381824,empty_stimulus,1,Männlich,Hörend,Gesprochene Sprache,1.0,1
|
||||
70afa75b-d522-4f26-b8f5-1a22ef425ad5,253b881d-cc08-4835-bf03-4d0ffdd8eddd,2024-06-27 17:44:43.877367,empty_stimulus,1,Weiblich,Schwerhörig,Text,1.0,1
|
|
5
slaeforms/exports/double_video_responses.csv
Normal file
5
slaeforms/exports/double_video_responses.csv
Normal file
@ -0,0 +1,5 @@
|
||||
id,user_id,date_created,stimulus_name,likertscale
|
||||
8240918c-aaf9-4dc8-b868-f4cec9920dfc,60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,2024-06-27 17:43:33.469473,"('video_1', 'video_2')",2
|
||||
36ef34e3-0e47-4980-86f9-e3456b4bf12c,60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,2024-06-27 17:43:35.573252,"('video_2', 'video_1')",2
|
||||
253a2bdd-3c33-47b6-a715-a2b167b11de3,253b881d-cc08-4835-bf03-4d0ffdd8eddd,2024-06-27 17:44:32.383837,"('video_1', 'video_2')",2
|
||||
ce8f86ee-fe37-45db-9a7e-a8cba56cd1da,253b881d-cc08-4835-bf03-4d0ffdd8eddd,2024-06-27 17:44:35.019425,"('video_2', 'video_1')",2
|
|
5
slaeforms/exports/single_video_responses.csv
Normal file
5
slaeforms/exports/single_video_responses.csv
Normal file
@ -0,0 +1,5 @@
|
||||
id,user_id,date_created,stimulus_name,likertscale,text_feedback,video_upload
|
||||
9affead9-d952-47dd-be8f-f1f746f9426d,60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,2024-06-27 17:43:51.471157,video_2,3,test,
|
||||
e4c5df2c-0244-4ec6-bd2c-02eff4a4c5f1,60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,2024-06-27 17:43:55.326471,video_1,3,,
|
||||
12313ba8-1f3e-4ea4-a39e-42021a46d0a7,253b881d-cc08-4835-bf03-4d0ffdd8eddd,2024-06-27 17:44:47.661124,video_1,3,,
|
||||
c5cc69d6-d51e-4836-aabd-54d3b0682511,253b881d-cc08-4835-bf03-4d0ffdd8eddd,2024-06-27 17:44:50.468067,video_2,3,,
|
|
@ -1,2 +1,4 @@
|
||||
user_id,device_id,question_order,date_created
|
||||
662dc5a5-ff08-4270-ad33-444e8dd01514,50bc84f6-6c55-4277-9651-5c3c98e973f5,"{'Block 0': [('video_1', 'video_1'), ('video_2', 'video_2'), ('video_3', 'video_3')], 'Block 1': ['empty_stimulus'], 'Block 2': ['video_1', 'video_3', 'video_2']}",2024-06-25 12:01:22.516505
|
||||
user_id,device_id,question_order,date_created,form_completed
|
||||
60c9c65b-b6b7-4510-8fb1-e9f220a7c46e,f9a2bd4b-e1ef-43a2-a358-a74feea0076d,"{'Block 0': [('video_1', 'video_2'), ('video_2', 'video_1')], 'Block 1': ['empty_stimulus'], 'Block 2': ['video_2', 'video_1']}",2024-06-27 17:43:23.511495,False
|
||||
253b881d-cc08-4835-bf03-4d0ffdd8eddd,f9a2bd4b-e1ef-43a2-a358-a74feea0076d,"{'Block 0': [('video_1', 'video_2'), ('video_2', 'video_1')], 'Block 1': ['empty_stimulus'], 'Block 2': ['video_1', 'video_2']}",2024-06-27 17:44:22.713605,True
|
||||
89ad42ff-3310-4548-b179-7df9c138e794,f9a2bd4b-e1ef-43a2-a358-a74feea0076d,"{'Block 0': [('video_1', 'video_2'), ('video_2', 'video_1')], 'Block 1': ['empty_stimulus'], 'Block 2': ['video_2', 'video_1']}",2024-06-27 17:56:57.288776,False
|
||||
|
|
@ -6,7 +6,7 @@
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<title>all links
|
||||
</title>
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<link rel=" shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
|
||||
<title>DGS Avatar Study</title>
|
||||
</head>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<title>Login Page</title>
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -81,7 +81,7 @@ step={{question["step"]}}
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}" />
|
||||
<!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<title>Testform</title>
|
||||
<link rel=" shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link rel=" shortcut icon" href="{{ url_for('static/icons', filename='favicon.ico') }}">
|
||||
<script>const ICON_PATHS = {
|
||||
cameraofficon: "{{ url_for('static', filename='icons/camera-off-icon.png') }}",
|
||||
cameraicon: "{{ url_for('static', filename='icons/camera-icon.png') }}",
|
||||
|
@ -5,7 +5,7 @@
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<title>Test Page 0 - Nothing</title>
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
|
||||
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -3,6 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
|
||||
<link rel=" shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
|
||||
<title>DGS Avatar Study</title>
|
||||
</head>
|
||||
|
||||
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user