added endpage and tracking for completed forms
This commit is contained in:
parent
75202fe7a5
commit
2f6a42d39a
@ -53,6 +53,7 @@ class User(db.Model):
|
|||||||
device_id = db.Column("device_id",db.UUID(as_uuid=True), nullable=False)
|
device_id = db.Column("device_id",db.UUID(as_uuid=True), nullable=False)
|
||||||
question_order = db.Column("question_order",db.String(60))
|
question_order = db.Column("question_order",db.String(60))
|
||||||
date_created = db.Column("date_created",db.DateTime, default=datetime.today()) # todo test if this default works
|
date_created = db.Column("date_created",db.DateTime, default=datetime.today()) # todo test if this default works
|
||||||
|
form_completed = db.Column("form_completed",db.Boolean, default=False)
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return "<User %r>" % self.user_id
|
return "<User %r>" % self.user_id
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ except SQLAlchemyError as e:
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
#actual page logic with start, form and send
|
#actual page logic with start, form and send
|
||||||
|
|
||||||
@app.route("/popuptest", methods=["GET"])
|
#@app.route("/popuptest", methods=["GET"])
|
||||||
def popuptest():
|
def popuptest():
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
@ -147,6 +148,7 @@ def startpage():
|
|||||||
new_device_id = uuid.uuid4()
|
new_device_id = uuid.uuid4()
|
||||||
session["slaeform_device_id"] = new_device_id
|
session["slaeform_device_id"] = new_device_id
|
||||||
session["agreed_to_tos"] = False
|
session["agreed_to_tos"] = False
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
@ -213,11 +215,12 @@ def startpage():
|
|||||||
user_id = new_user_id
|
user_id = new_user_id
|
||||||
question_order = str(session["block_order"])
|
question_order = str(session["block_order"])
|
||||||
date = datetime.today()
|
date = datetime.today()
|
||||||
new_user = User(user_id=user_id, device_id=device_id,question_order=question_order,date_created = date) #,question_order=question_order
|
new_user = User(user_id=user_id, device_id=device_id,question_order=question_order,date_created = date,form_completed=False) #,question_order=question_order
|
||||||
|
|
||||||
db.session.add(new_user)
|
db.session.add(new_user)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
|
||||||
print("block order: {order}".format(order=session["block_order"]))
|
print("block order: {order}".format(order=session["block_order"]))
|
||||||
try:
|
try:
|
||||||
db.session.add(new_user)
|
db.session.add(new_user)
|
||||||
@ -231,6 +234,11 @@ def startpage():
|
|||||||
"teststartpage.html"
|
"teststartpage.html"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@app.route("/endpage")
|
||||||
|
def endpage():
|
||||||
|
print("Form is done, sent to endpage")
|
||||||
|
return render_template("endpage.html")
|
||||||
|
|
||||||
|
|
||||||
@app.route("/form")
|
@app.route("/form")
|
||||||
def form():
|
def form():
|
||||||
@ -248,10 +256,14 @@ def form():
|
|||||||
#print("current Blockname: {blockname}, current block index: {blockindex}, current stim index: {stimulusindex}".format(blockname=session["current_block_name"],
|
#print("current Blockname: {blockname}, current block index: {blockindex}, current stim index: {stimulusindex}".format(blockname=session["current_block_name"],
|
||||||
# blockindex=session["current_block_index"],
|
# blockindex=session["current_block_index"],
|
||||||
# stimulusindex=session["current_stimulus_index"] ) )
|
# stimulusindex=session["current_stimulus_index"] ) )
|
||||||
|
infovideo = None
|
||||||
|
if "infovideo" in current_block:
|
||||||
|
infovideo = current_block["infovideo"]
|
||||||
|
|
||||||
# erster Fall: SinglePage
|
# erster Fall: SinglePage
|
||||||
if current_block["type"] == "SinglePage":
|
if current_block["type"] == "SinglePage":
|
||||||
return render_template(current_block["template"])
|
return render_template(current_block["template"])
|
||||||
|
|
||||||
|
|
||||||
#zweiter Fall, empty TaskTemplate
|
#zweiter Fall, empty TaskTemplate
|
||||||
if current_block["type"] == "TaskTemplate" and current_block["stimuli"]["type"] == "empty":
|
if current_block["type"] == "TaskTemplate" and current_block["stimuli"]["type"] == "empty":
|
||||||
@ -264,7 +276,8 @@ def form():
|
|||||||
stimuli=current_block_stimuli,
|
stimuli=current_block_stimuli,
|
||||||
stimulus_type=stimulus_type,
|
stimulus_type=stimulus_type,
|
||||||
current_stimulus=current_stimulus,
|
current_stimulus=current_stimulus,
|
||||||
questions=current_block["questions"]
|
questions=current_block["questions"],
|
||||||
|
infovideo=infovideo
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -293,7 +306,8 @@ def form():
|
|||||||
stimulus_type=stimulus_type,
|
stimulus_type=stimulus_type,
|
||||||
current_stimulus=current_stimulus,
|
current_stimulus=current_stimulus,
|
||||||
stimulus_configuration=stimulus_configuration,
|
stimulus_configuration=stimulus_configuration,
|
||||||
questions=current_block["questions"]
|
questions=current_block["questions"],
|
||||||
|
infovideo=infovideo
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -369,23 +383,39 @@ def sendpage():
|
|||||||
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
os.makedirs(UPLOAD_FOLDER, exist_ok=True)
|
||||||
video.save(path)
|
video.save(path)
|
||||||
|
|
||||||
|
if (session["current_block_index"] == session["number_of_blocks"]-1) and (session["current_stimulus_index"] >= session["number_of_stimuli"]-1):
|
||||||
|
#update the database entry, the form is completed
|
||||||
|
user = db.session.query(User).filter_by(user_id=session["slaeform_user_id"]).one()
|
||||||
|
user.form_completed = True
|
||||||
|
print("updated db entry for form_completed")
|
||||||
|
# This user is done, so we can remove it from the session
|
||||||
|
session.pop("slaeform_user_id")
|
||||||
|
try:
|
||||||
|
db.session.commit()
|
||||||
|
except Exception as e:
|
||||||
|
print("Error occurred: {e}".format(e=str(e)))
|
||||||
|
return "There was a problem while updating the user"
|
||||||
|
return redirect("/endpage")
|
||||||
|
|
||||||
# Now move to the next stimulus or block
|
# Now move to the next stimulus or block
|
||||||
update_session()
|
update_session()
|
||||||
print("now redirect and reload the page")
|
print("now redirect and reload the page")
|
||||||
return redirect("/form")
|
return redirect("/form")
|
||||||
|
|
||||||
def update_session():
|
def update_session():
|
||||||
|
print("update session")
|
||||||
if "stimuli" in config[session["current_block_name"]]:
|
if "stimuli" in config[session["current_block_name"]]:
|
||||||
# if there are stimuli in this block
|
# if there are stimuli in this block
|
||||||
if session["current_stimulus_index"] < session["number_of_stimuli"]-1:
|
if session["current_stimulus_index"] < session["number_of_stimuli"]-1:
|
||||||
|
print("there are still stimuli left")
|
||||||
# if there are still stimuli left, keep going through them
|
# if there are still stimuli left, keep going through them
|
||||||
session["current_stimulus_index"] += 1
|
session["current_stimulus_index"] += 1
|
||||||
# set the name of the current stimulus
|
# set the name of the current stimulus
|
||||||
session["current_stimulus_name"] = session["block_order"][session["current_block_name"]][session["current_stimulus_index"]]
|
session["current_stimulus_name"] = session["block_order"][session["current_block_name"]][session["current_stimulus_index"]]
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
print("here are no stimuli left")
|
||||||
|
session["number_of_stimuli"] = 0
|
||||||
# if there are no stimuli left..
|
# if there are no stimuli left..
|
||||||
if(session["current_block_index"] < session["number_of_blocks"]-1):
|
if(session["current_block_index"] < session["number_of_blocks"]-1):
|
||||||
# go to next block if possible
|
# go to next block if possible
|
||||||
@ -406,15 +436,27 @@ def update_session():
|
|||||||
if "stimuli" in config[session["current_block_name"]]:
|
if "stimuli" in config[session["current_block_name"]]:
|
||||||
# set the name of the current stimulus
|
# set the name of the current stimulus
|
||||||
session["current_stimulus_name"] = session["block_order"][session["current_block_name"]][session["current_stimulus_index"]]
|
session["current_stimulus_name"] = session["block_order"][session["current_block_name"]][session["current_stimulus_index"]]
|
||||||
|
|
||||||
if (session["current_block_index"] == session["number_of_blocks"]-1) and (session["current_stimulus_index"] >= session["number_of_stimuli"]-1):
|
print("---Session updated-----------------------------------------------")
|
||||||
session.pop("slaeform_user_id")
|
|
||||||
print("---Session updated---")
|
|
||||||
print("current_block_index / number_of_blocks: {current_block_index} / {number_of_blocks}".format(current_block_index=session["current_block_index"],number_of_blocks=session["number_of_blocks"]))
|
print("current_block_index / number_of_blocks: {current_block_index} / {number_of_blocks}".format(current_block_index=session["current_block_index"],number_of_blocks=session["number_of_blocks"]))
|
||||||
print("current_block_name: ", session["current_block_name"])
|
print("current_block_name: ", session["current_block_name"])
|
||||||
print("current_stimulus_index: ", session["current_stimulus_index"])
|
print("current_stimulus_index: ", session["current_stimulus_index"])
|
||||||
print("Current number_of_stimuli: ", session["number_of_stimuli"])
|
print("Current number_of_stimuli: ", session["number_of_stimuli"])
|
||||||
|
|
||||||
|
#@app.route("/update")
|
||||||
|
def update():
|
||||||
|
|
||||||
|
print("Current Session: ",session)
|
||||||
|
try:
|
||||||
|
user = db.session.query(User).filter_by(user_id=session["slaeform_user_id"]).one()
|
||||||
|
user.form_completed = True
|
||||||
|
db.session.commit()
|
||||||
|
except Exception as e:
|
||||||
|
print("Error occurred: {e}".format(e=str(e)))
|
||||||
|
return "There was a problem while updating the user"
|
||||||
|
|
||||||
|
return "db entry updated!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Database stuff------------------------------------------------------------------------------
|
# Database stuff------------------------------------------------------------------------------
|
||||||
@ -494,19 +536,6 @@ def table_contents():
|
|||||||
tables = meta.tables.keys()
|
tables = meta.tables.keys()
|
||||||
table_contents = {}
|
table_contents = {}
|
||||||
|
|
||||||
#Testing querys for exporting etc
|
|
||||||
print("tables: ",tables)
|
|
||||||
print("testquerys:")
|
|
||||||
qtable = meta.tables["default_demographic_test"]
|
|
||||||
query1 = select(qtable).where(qtable.c.alter == 78)
|
|
||||||
print("Query 1: ", query1)
|
|
||||||
print("Query 1 result: ")
|
|
||||||
result = db.session.execute(query1)
|
|
||||||
print("Columns: ", result.columns)
|
|
||||||
for row in result:
|
|
||||||
print(row)
|
|
||||||
#Test End
|
|
||||||
|
|
||||||
for table_name in tables:
|
for table_name in tables:
|
||||||
table = meta.tables[table_name]
|
table = meta.tables[table_name]
|
||||||
columns = table.columns.keys()
|
columns = table.columns.keys()
|
||||||
@ -537,19 +566,6 @@ def show_tables():
|
|||||||
tables = meta.tables
|
tables = meta.tables
|
||||||
return render_template('show_tables.html', tables=tables)
|
return render_template('show_tables.html', tables=tables)
|
||||||
|
|
||||||
# Control Panel ---------------------------------------------------------
|
|
||||||
|
|
||||||
@app.route("/upload_configs")
|
|
||||||
def upload_configs():
|
|
||||||
links = []
|
|
||||||
for rule in app.url_map.iter_rules():
|
|
||||||
# Filter out rules we can't navigate to in a browser
|
|
||||||
# and rules that require parameters
|
|
||||||
if "GET" in rule.methods and has_no_empty_params(rule):
|
|
||||||
url = url_for(rule.endpoint, **(rule.defaults or {}))
|
|
||||||
links.append((url, rule.endpoint))
|
|
||||||
return render_template("all_links.html", links=links)
|
|
||||||
|
|
||||||
|
|
||||||
# Root page -----------------------------
|
# Root page -----------------------------
|
||||||
|
|
||||||
@ -572,7 +588,7 @@ def all_links():
|
|||||||
# delete all tables as last link --------------------------
|
# delete all tables as last link --------------------------
|
||||||
|
|
||||||
# Route to delete all entries
|
# Route to delete all entries
|
||||||
@app.route('/delete_json_tables', methods=['GET'])
|
#@app.route('/delete_json_tables', methods=['GET'])
|
||||||
def delete_json_tables():
|
def delete_json_tables():
|
||||||
try:
|
try:
|
||||||
meta = db.metadata
|
meta = db.metadata
|
||||||
|
@ -1,64 +1,71 @@
|
|||||||
{
|
{
|
||||||
"Block 0":{
|
"Block 0": {
|
||||||
"type": "TaskTemplate",
|
"type": "TaskTemplate",
|
||||||
"tempalte": "standard_template.html",
|
"tempalte": "standard_template.html",
|
||||||
"stimuli":{
|
"stimuli": {
|
||||||
"type":"double_video",
|
"type": "double_video",
|
||||||
"list_1":{
|
"list_1": {
|
||||||
"video_1":"https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522",
|
"video_1": "https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522",
|
||||||
"video_2":"https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-"
|
"video_2": "https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-"
|
||||||
},
|
},
|
||||||
"list_2":{
|
"list_2": {
|
||||||
"video_2":"https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-",
|
"video_2": "https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-",
|
||||||
"video_1":"https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522"
|
"video_1": "https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522"
|
||||||
},
|
},
|
||||||
"configuration":{
|
"configuration": {
|
||||||
"embed":"yt"
|
"embed": "yt"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"questions":{
|
"questions": {
|
||||||
"question1":{
|
"question1": {
|
||||||
"type": "likert",
|
"type": "likert",
|
||||||
"name": "likertscale",
|
"name": "likertscale",
|
||||||
"text": "How would you rate this video?",
|
"text": "How would you rate this video?",
|
||||||
"required": "true",
|
"required": "true",
|
||||||
"points":{
|
"points": {
|
||||||
"p1":{
|
"p1": {
|
||||||
"value":"1",
|
"value": "1",
|
||||||
"text":"I dont like it at all"
|
"text": "I dont like it at all"
|
||||||
},
|
},
|
||||||
"p2":{
|
"p2": {
|
||||||
"value":"2",
|
"value": "2",
|
||||||
"text":"I am indifferent"
|
"text": "I am indifferent"
|
||||||
},
|
},
|
||||||
"p3":{
|
"p3": {
|
||||||
"value":"3",
|
"value": "3",
|
||||||
"text":"I like it a lot"
|
"text": "I like it a lot"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"database_table" :{
|
"infovideo": {
|
||||||
|
"videourl": "https://www.youtube-nocookie.com/embed/F_w50c5Us3Y?si=-H07MmQ4lYOC2Bwh",
|
||||||
|
"infotext": "Hier wird in Zukunft ein Erklärtext stehen, in dem die Fragestellungen erklärt werden. Dazu werden alle Fragen der Seite einzeln durchgegangen und einfach erklärt. Zum Beispiel wird hier erklärt, dass man um Feedback zu geben, ein Video aufnehmen kann. Dazu drückt man auf den Knopf mit dem Videokamera Symbol. Danach muss man oben links am Browser bestätigen, dass der Browser auf die Kamera zugreifen darf.",
|
||||||
|
"configuration": {
|
||||||
|
"embed": "yt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"database_table": {
|
||||||
"table_name": "double_video_responses",
|
"table_name": "double_video_responses",
|
||||||
"fields": {
|
"fields": {
|
||||||
"likertscale":{
|
"likertscale": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Block 1":{
|
"Block 1": {
|
||||||
"type": "TaskTemplate",
|
"type": "TaskTemplate",
|
||||||
"tempalte": "standard_template.html",
|
"tempalte": "standard_template.html",
|
||||||
"stimuli":{
|
"stimuli": {
|
||||||
"type":"empty",
|
"type": "empty",
|
||||||
"list":{
|
"list": {
|
||||||
"empty_stimulus":""
|
"empty_stimulus": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"questions":{
|
"questions": {
|
||||||
"question1_alter":{
|
"question1_alter": {
|
||||||
"type": "numberinput",
|
"type": "numberinput",
|
||||||
"name": "alter",
|
"name": "alter",
|
||||||
"text": "Alter:",
|
"text": "Alter:",
|
||||||
@ -66,74 +73,74 @@
|
|||||||
"min": "1",
|
"min": "1",
|
||||||
"max": "120"
|
"max": "120"
|
||||||
},
|
},
|
||||||
"question2_geschlecht":{
|
"question2_geschlecht": {
|
||||||
"type": "dropdowninput",
|
"type": "dropdowninput",
|
||||||
"name": "geschlecht",
|
"name": "geschlecht",
|
||||||
"text": "Geschlecht:",
|
"text": "Geschlecht:",
|
||||||
"required": "true",
|
"required": "true",
|
||||||
"defaulttext": "",
|
"defaulttext": "",
|
||||||
"points":{
|
"points": {
|
||||||
"männlich":{
|
"männlich": {
|
||||||
"value":"Männlich",
|
"value": "Männlich",
|
||||||
"text":"Männlich"
|
"text": "Männlich"
|
||||||
},
|
},
|
||||||
"weiblich":{
|
"weiblich": {
|
||||||
"value":"Weiblich",
|
"value": "Weiblich",
|
||||||
"text":"Weiblich"
|
"text": "Weiblich"
|
||||||
},
|
},
|
||||||
"divers":{
|
"divers": {
|
||||||
"value":"Divers",
|
"value": "Divers",
|
||||||
"text":"Divers"
|
"text": "Divers"
|
||||||
},
|
},
|
||||||
"keine_angabe":{
|
"keine_angabe": {
|
||||||
"value":"keine_angabe",
|
"value": "keine_angabe",
|
||||||
"text":"Keine Angabe"
|
"text": "Keine Angabe"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"question3_hoerstatus":{
|
"question3_hoerstatus": {
|
||||||
"type": "dropdowninput",
|
"type": "dropdowninput",
|
||||||
"name": "hoerstatus",
|
"name": "hoerstatus",
|
||||||
"text": "Hörstatus:",
|
"text": "Hörstatus:",
|
||||||
"required": "true",
|
"required": "true",
|
||||||
"defaulttext": "",
|
"defaulttext": "",
|
||||||
"points":{
|
"points": {
|
||||||
"hörend":{
|
"hörend": {
|
||||||
"value":"Hörend",
|
"value": "Hörend",
|
||||||
"text":"Hörend"
|
"text": "Hörend"
|
||||||
},
|
},
|
||||||
"schwerhörig":{
|
"schwerhörig": {
|
||||||
"value":"Schwerhörig",
|
"value": "Schwerhörig",
|
||||||
"text":"Schwerhörig"
|
"text": "Schwerhörig"
|
||||||
},
|
},
|
||||||
"gehörlos":{
|
"gehörlos": {
|
||||||
"value":"Gehörlos",
|
"value": "Gehörlos",
|
||||||
"text":"Gehörlos"
|
"text": "Gehörlos"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"question4_bevorzugte_kommunikation":{
|
"question4_bevorzugte_kommunikation": {
|
||||||
"type": "dropdowninput",
|
"type": "dropdowninput",
|
||||||
"name": "bevorzugte_kommunikation",
|
"name": "bevorzugte_kommunikation",
|
||||||
"text": "Bevorzugte Kommunikationsform:",
|
"text": "Bevorzugte Kommunikationsform:",
|
||||||
"required": "true",
|
"required": "true",
|
||||||
"defaulttext": "",
|
"defaulttext": "",
|
||||||
"points":{
|
"points": {
|
||||||
"gesprochen":{
|
"gesprochen": {
|
||||||
"value":"Gesprochene Sprache",
|
"value": "Gesprochene Sprache",
|
||||||
"text":"Gesprochene Sprache"
|
"text": "Gesprochene Sprache"
|
||||||
},
|
},
|
||||||
"text":{
|
"text": {
|
||||||
"value":"Text",
|
"value": "Text",
|
||||||
"text":"Text"
|
"text": "Text"
|
||||||
},
|
},
|
||||||
"gebärdensprache":{
|
"gebärdensprache": {
|
||||||
"value":"Gebärdensprache",
|
"value": "Gebärdensprache",
|
||||||
"text":"Gebärdensprache"
|
"text": "Gebärdensprache"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"question5_gebeardenzeitraum":{
|
"question5_gebeardenzeitraum": {
|
||||||
"type": "numberinput",
|
"type": "numberinput",
|
||||||
"name": "gebärdenzeitraum",
|
"name": "gebärdenzeitraum",
|
||||||
"text": "Wie viele Jahre verwenden sie schon Gebärdensprache:",
|
"text": "Wie viele Jahre verwenden sie schon Gebärdensprache:",
|
||||||
@ -142,7 +149,7 @@
|
|||||||
"max": "100",
|
"max": "100",
|
||||||
"step": "0.5"
|
"step": "0.5"
|
||||||
},
|
},
|
||||||
"question6_sprachkompetenz":{
|
"question6_sprachkompetenz": {
|
||||||
"type": "numberinput",
|
"type": "numberinput",
|
||||||
"name": "gebärdensprachkompetenz",
|
"name": "gebärdensprachkompetenz",
|
||||||
"text": "Wie schätzen sie ihre Gebärdensprachkompetenz ein (1-10):",
|
"text": "Wie schätzen sie ihre Gebärdensprachkompetenz ein (1-10):",
|
||||||
@ -151,118 +158,128 @@
|
|||||||
"max": "10"
|
"max": "10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"database_table" :{
|
"infovideo": {
|
||||||
|
"videourl": "https://www.youtube-nocookie.com/embed/F_w50c5Us3Y?si=-H07MmQ4lYOC2Bwh",
|
||||||
|
"infotext": "Hier wird in Zukunft ein Erklärtext stehen, in dem die Fragestellungen erklärt werden. \n Dazu werden alle Fragen der Seite einzeln durchgegangen und einfach erklärt. Zum Beispiel wird hier erklärt, dass man um Feedback zu geben, ein Video aufnehmen kann. Dazu drückt man auf den Knopf mit dem Videokamera Symbol. Danach muss man oben links am Browser bestätigen, dass der Browser auf die Kamera zugreifen darf.",
|
||||||
|
"configuration": {
|
||||||
|
"embed": "yt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"database_table": {
|
||||||
"table_name": "demographic_data",
|
"table_name": "demographic_data",
|
||||||
"fields": {
|
"fields": {
|
||||||
"alter":{
|
"alter": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"geschlecht":{
|
"geschlecht": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"size": "14",
|
"size": "14",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"hoerstatus":{
|
"hoerstatus": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"size": "14",
|
"size": "14",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"bevorzugte_kommunikation":{
|
"bevorzugte_kommunikation": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"size": "22",
|
"size": "22",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"gebärdenzeitraum":{
|
"gebärdenzeitraum": {
|
||||||
"type": "float",
|
"type": "float",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"gebärdensprachkompetenz":{
|
"gebärdensprachkompetenz": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Block 2":{
|
"Block 2": {
|
||||||
"type": "TaskTemplate",
|
"type": "TaskTemplate",
|
||||||
"tempalte": "standard_template.html",
|
"tempalte": "standard_template.html",
|
||||||
"stimuli":{
|
"stimuli": {
|
||||||
"type":"single_video",
|
"type": "single_video",
|
||||||
"order": "random",
|
"order": "random",
|
||||||
"list":{
|
"list": {
|
||||||
"video_1":"https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522",
|
"video_1": "https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522",
|
||||||
"video_2":"https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-"
|
"video_2": "https://www.youtube-nocookie.com/embed/g9KA72jN5SM?si=O7dfqTXdFCCAScJ-"
|
||||||
},
|
},
|
||||||
"configuration":{
|
"configuration": {
|
||||||
"embed":"yt"
|
"embed": "yt"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"questions":{
|
"questions": {
|
||||||
"question1":{
|
"question1": {
|
||||||
"type": "likert",
|
"type": "likert",
|
||||||
"name": "likertscale",
|
"name": "likertscale",
|
||||||
"text": "How would you rate this video?",
|
"text": "How would you rate this video?",
|
||||||
"required": "true",
|
"required": "true",
|
||||||
"points":{
|
"points": {
|
||||||
"p1":{
|
"p1": {
|
||||||
"value":"1",
|
"value": "1",
|
||||||
"text":"I dont like it at all"
|
"text": "I dont like it at all"
|
||||||
},
|
},
|
||||||
"p2":{
|
"p2": {
|
||||||
"value":"2",
|
"value": "2",
|
||||||
"text":"I dont like it"
|
"text": "I dont like it"
|
||||||
},
|
},
|
||||||
"p3":{
|
"p3": {
|
||||||
"value":"3",
|
"value": "3",
|
||||||
"text":"I am indifferent"
|
"text": "I am indifferent"
|
||||||
},
|
},
|
||||||
"p4":{
|
"p4": {
|
||||||
"value":"4",
|
"value": "4",
|
||||||
"text":"I like it"
|
"text": "I like it"
|
||||||
},
|
},
|
||||||
"p5":{
|
"p5": {
|
||||||
"value":"5",
|
"value": "5",
|
||||||
"text":"I like it a lot"
|
"text": "I like it a lot"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"question2":{
|
"question2": {
|
||||||
"type": "textinput",
|
"type": "textinput",
|
||||||
"name": "text_feedback",
|
"name": "text_feedback",
|
||||||
"text": "Here you can give us Feedback",
|
"text": "Here you can give us Feedback",
|
||||||
"required": "false",
|
"required": "false",
|
||||||
"size": "250"
|
"size": "250"
|
||||||
},
|
},
|
||||||
"question3":{
|
"question3": {
|
||||||
"type": "videoinput",
|
"type": "videoinput",
|
||||||
"text": "Here you can give us Feedback as video",
|
"text": "Here you can give us Feedback as video",
|
||||||
"name": "video_feedback",
|
"name": "video_feedback",
|
||||||
"required": "false"
|
"required": "false"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"database_table" :{
|
"infovideo": {
|
||||||
|
"videourl": "https://www.youtube-nocookie.com/embed/F_w50c5Us3Y?si=-H07MmQ4lYOC2Bwh",
|
||||||
|
"infotext": "Hier wird in Zukunft ein Erklärtext stehen, in dem die Fragestellungen erklärt werden.\\n Dazu werden alle Fragen der Seite einzeln durchgegangen und einfach erklärt.\\n Zum Beispiel wird hier erklärt, dass man um Feedback zu geben, ein Video aufnehmen kann. Dazu drückt man auf den Knopf mit dem Videokamera Symbol. Danach muss man oben links am Browser bestätigen, dass der Browser auf die Kamera zugreifen darf.",
|
||||||
|
"configuration": {
|
||||||
|
"embed": "yt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"database_table": {
|
||||||
"table_name": "single_video_responses",
|
"table_name": "single_video_responses",
|
||||||
"fields": {
|
"fields": {
|
||||||
"likertscale":{
|
"likertscale": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"nullable": "false"
|
"nullable": "false"
|
||||||
},
|
},
|
||||||
"text_feedback":{
|
"text_feedback": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"size": "250",
|
"size": "250",
|
||||||
"nullable": "true"
|
"nullable": "true"
|
||||||
},
|
},
|
||||||
"video_upload":{
|
"video_upload": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"size": "100",
|
"size": "100",
|
||||||
"nullable": "true"
|
"nullable": "true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"Block_3":{
|
|
||||||
"type": "SinglePage",
|
|
||||||
"template": "endpage.html"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
13
slaeforms/static/infoDialogScript.js
Normal file
13
slaeforms/static/infoDialogScript.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const dialog = document.querySelector("dialog");
|
||||||
|
const showButton = document.querySelector("dialog + button");
|
||||||
|
const closeButton = document.querySelector("dialog button");
|
||||||
|
|
||||||
|
// "Show the dialog" button opens the dialog modally
|
||||||
|
showButton.addEventListener("click", () => {
|
||||||
|
dialog.showModal();
|
||||||
|
});
|
||||||
|
|
||||||
|
// "Close" button closes the dialog
|
||||||
|
closeButton.addEventListener("click", () => {
|
||||||
|
dialog.close();
|
||||||
|
});
|
@ -40,8 +40,8 @@ dialog .iframe-container{
|
|||||||
height: 90px;
|
height: 90px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 20px;
|
top: 30px;
|
||||||
left: 80vw;
|
left: min(calc(66vw + 30px + 34vw / 2),calc(1720px + calc(100vw - 1690px) / 2)); /*first is the normal case, second if 66vw is more than 1690 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.infoButtonIcon {
|
.infoButtonIcon {
|
||||||
@ -56,8 +56,8 @@ dialog .iframe-container{
|
|||||||
.container {
|
.container {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
/* height: 100vh;*/
|
/* height: 100vh;*/
|
||||||
width: 60vw; /* You can adjust this width as needed */
|
width: 66vw; /* You can adjust this width as needed */
|
||||||
max-width: 1200px; /* Maximum width to keep it from getting too wide on large screens */
|
max-width: 1690px; /* Maximum width to keep it from getting too wide on large screens */
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
background-color: #7b8cdb; /* Just for visual differentiation */
|
background-color: #7b8cdb; /* Just for visual differentiation */
|
||||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<button class="dialogBtn" autofocus><img class="infoButtonIcon" id="buttonClose" src="{{ url_for('static', filename='icons/x-icon.png')}}"
|
<button class="dialogBtn" autofocus><img class="infoButtonIcon" id="buttonClose" src="{{ url_for('static', filename='icons/x-icon.png')}}"
|
||||||
alt="Delete Icon"></button>
|
alt="Delete Icon"></button>
|
||||||
<div class="iframe-container">
|
<div class="iframe-container">
|
||||||
<iframe class="center" src="https://www.youtube-nocookie.com/embed/IqGVT1q1PtM?si=kel7ZWEQl3h-h522" title="YouTube video player" frameborder="0"
|
<iframe class="center" src="https://www.youtube-nocookie.com/embed/F_w50c5Us3Y?si=-H07MmQ4lYOC2Bwh" title="YouTube video player" frameborder="0"
|
||||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
allowfullscreen></iframe>
|
allowfullscreen></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
@ -92,6 +92,27 @@ step={{question["step"]}}
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|
||||||
|
{% if (infovideo) %}
|
||||||
|
<dialog>
|
||||||
|
|
||||||
|
<button class="dialogBtn" autofocus><img class="infoButtonIcon" id="buttonClose" src="{{ url_for('static', filename='icons/x-icon.png')}}"
|
||||||
|
alt="Delete Icon"></button>
|
||||||
|
<div class="iframe-container">
|
||||||
|
<iframe class="center" src="{{ infovideo['videourl'] }}" title="YouTube video player" frameborder="0"
|
||||||
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
|
allowfullscreen></iframe>
|
||||||
|
</div>
|
||||||
|
<div class="dialogTextContainer">
|
||||||
|
<p>{{ infovideo["infotext"] }}</p>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
<button class="dialogBtn"><img class="infoButtonIcon" id="buttonInfoIcon" src="{{ url_for('static', filename='icons/info-icon.png')}}"
|
||||||
|
alt="Info Icon"></button>
|
||||||
|
<script src="{{ url_for('static', filename='infoDialogScript.js')}}"></script>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
{% if (stimulus_type == "single_video") %}
|
{% if (stimulus_type == "single_video") %}
|
||||||
{{ single_video(**stimulus_configuration) }}
|
{{ single_video(**stimulus_configuration) }}
|
||||||
{% elif (stimulus_type == "double_video") %}
|
{% elif (stimulus_type == "double_video") %}
|
||||||
@ -120,7 +141,6 @@ step={{question["step"]}}
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% elif (questions[question]["type"] == "textinput") %}
|
{% elif (questions[question]["type"] == "textinput") %}
|
||||||
<div class="textarea-container">
|
<div class="textarea-container">
|
||||||
<label class="textarea-label">
|
<label class="textarea-label">
|
||||||
|
Loading…
Reference in New Issue
Block a user