TTsamurai
commited on
Commit
·
cf204ab
1
Parent(s):
40a44c0
update evaluation
Browse files
app.py
CHANGED
@@ -414,11 +414,7 @@ def create_demo():
|
|
414 |
with gr.Row():
|
415 |
providing_information_2 = likert_evaluation("The advisor provides the financial knowledge needed")
|
416 |
with gr.Row():
|
417 |
-
textbox = gr.HTML(
|
418 |
-
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
419 |
-
Make sure to assign different scores to each stock and answer all the statements.
|
420 |
-
</div>"""
|
421 |
-
)
|
422 |
submit_ranking = gr.Button(value="Submit Ranking")
|
423 |
return {
|
424 |
"first": ranking_first_comp,
|
@@ -672,7 +668,7 @@ def create_demo():
|
|
672 |
result_textbox = tabs["text_box"]
|
673 |
submit_ranking = tabs["submit_ranking"]
|
674 |
submit_ranking.click(
|
675 |
-
lambda user_id, first_comp, ranking_first_comp, second_comp, ranking_second_comp, third_comp, ranking_third_comp, fourth_comp, ranking_fourth_comp, fifth_comp, ranking_fifth_comp, perceived_personalization_1, perceived_personalization_2, emotional_trust_1, emotional_trust_2, emotional_trust_3, trust_in_competence_1, trust_in_competence_2, intention_to_use_1, intention_to_use_2, usefulness_1, usefulness_2, usefulness_3, overall_satisfaction, providing_information_1, providing_information_2
|
676 |
user_id,
|
677 |
first_comp,
|
678 |
ranking_first_comp,
|
@@ -699,6 +695,7 @@ def create_demo():
|
|
699 |
overall_satisfaction,
|
700 |
providing_information_1,
|
701 |
providing_information_2,
|
|
|
702 |
),
|
703 |
# Input components (names and rankings)
|
704 |
[
|
@@ -728,9 +725,10 @@ def create_demo():
|
|
728 |
overall_satisfaction,
|
729 |
providing_information_1,
|
730 |
providing_information_2,
|
|
|
731 |
],
|
732 |
# Output component(s) where you want the result to appear, e.g., result_textbox
|
733 |
-
[result_textbox],
|
734 |
)
|
735 |
|
736 |
def respond(
|
@@ -1033,9 +1031,7 @@ def create_demo():
|
|
1033 |
# log_action(user_id, tab_name, key, value)
|
1034 |
# Store the reason for this tab
|
1035 |
tab_data["multi_evaluator"] = evals
|
1036 |
-
evaluation_send_button = gr.Button(
|
1037 |
-
value="Thank you for submitting your evaluation. Please proceed to the next tab.", interactive=False
|
1038 |
-
)
|
1039 |
return (
|
1040 |
tab_data,
|
1041 |
evals["selection"],
|
@@ -1044,7 +1040,7 @@ def create_demo():
|
|
1044 |
evals["confidence"],
|
1045 |
evaluation_send_button,
|
1046 |
"""<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1047 |
-
<strong>
|
1048 |
</div>""",
|
1049 |
)
|
1050 |
|
@@ -1075,6 +1071,7 @@ def create_demo():
|
|
1075 |
overall_satisfaction,
|
1076 |
providing_information_1,
|
1077 |
providing_information_2,
|
|
|
1078 |
):
|
1079 |
# make sure that they are not the same
|
1080 |
ranking_list = [
|
@@ -1085,9 +1082,12 @@ def create_demo():
|
|
1085 |
ranking_fifth_comp,
|
1086 |
]
|
1087 |
if len(set(ranking_list)) != len(ranking_list):
|
1088 |
-
return
|
|
|
1089 |
<strong>Please make sure that you are not ranking the same stock multiple times.</strong>
|
1090 |
-
</div>"""
|
|
|
|
|
1091 |
if any(
|
1092 |
var is None
|
1093 |
for var in [
|
@@ -1106,9 +1106,12 @@ def create_demo():
|
|
1106 |
providing_information_2,
|
1107 |
]
|
1108 |
):
|
1109 |
-
return
|
|
|
1110 |
<strong>Please make sure that you answer all the statements.</strong>
|
1111 |
-
</div>"""
|
|
|
|
|
1112 |
else:
|
1113 |
save_feedback(
|
1114 |
user_id,
|
@@ -1144,7 +1147,7 @@ def create_demo():
|
|
1144 |
},
|
1145 |
feedback_file_final_survey,
|
1146 |
)
|
1147 |
-
|
1148 |
return """<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1149 |
<strong>Thank you for participating in the experiment. This concludes the session. You may now close the tab.</strong>
|
1150 |
</div>"""
|
|
|
414 |
with gr.Row():
|
415 |
providing_information_2 = likert_evaluation("The advisor provides the financial knowledge needed")
|
416 |
with gr.Row():
|
417 |
+
textbox = gr.HTML()
|
|
|
|
|
|
|
|
|
418 |
submit_ranking = gr.Button(value="Submit Ranking")
|
419 |
return {
|
420 |
"first": ranking_first_comp,
|
|
|
668 |
result_textbox = tabs["text_box"]
|
669 |
submit_ranking = tabs["submit_ranking"]
|
670 |
submit_ranking.click(
|
671 |
+
lambda user_id, first_comp, ranking_first_comp, second_comp, ranking_second_comp, third_comp, ranking_third_comp, fourth_comp, ranking_fourth_comp, fifth_comp, ranking_fifth_comp, perceived_personalization_1, perceived_personalization_2, emotional_trust_1, emotional_trust_2, emotional_trust_3, trust_in_competence_1, trust_in_competence_2, intention_to_use_1, intention_to_use_2, usefulness_1, usefulness_2, usefulness_3, overall_satisfaction, providing_information_1, providing_information_2, submit_ranking: respond_final_ranking(
|
672 |
user_id,
|
673 |
first_comp,
|
674 |
ranking_first_comp,
|
|
|
695 |
overall_satisfaction,
|
696 |
providing_information_1,
|
697 |
providing_information_2,
|
698 |
+
submit_ranking,
|
699 |
),
|
700 |
# Input components (names and rankings)
|
701 |
[
|
|
|
725 |
overall_satisfaction,
|
726 |
providing_information_1,
|
727 |
providing_information_2,
|
728 |
+
submit_ranking,
|
729 |
],
|
730 |
# Output component(s) where you want the result to appear, e.g., result_textbox
|
731 |
+
[result_textbox, submit_ranking],
|
732 |
)
|
733 |
|
734 |
def respond(
|
|
|
1031 |
# log_action(user_id, tab_name, key, value)
|
1032 |
# Store the reason for this tab
|
1033 |
tab_data["multi_evaluator"] = evals
|
1034 |
+
evaluation_send_button = gr.Button(value="Evaluation receirved", interactive=False)
|
|
|
|
|
1035 |
return (
|
1036 |
tab_data,
|
1037 |
evals["selection"],
|
|
|
1040 |
evals["confidence"],
|
1041 |
evaluation_send_button,
|
1042 |
"""<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1043 |
+
<strong>Thank you for submitting your evaluation. You may proceed to the next tab..</strong>
|
1044 |
</div>""",
|
1045 |
)
|
1046 |
|
|
|
1071 |
overall_satisfaction,
|
1072 |
providing_information_1,
|
1073 |
providing_information_2,
|
1074 |
+
submit_ranking,
|
1075 |
):
|
1076 |
# make sure that they are not the same
|
1077 |
ranking_list = [
|
|
|
1082 |
ranking_fifth_comp,
|
1083 |
]
|
1084 |
if len(set(ranking_list)) != len(ranking_list):
|
1085 |
+
return (
|
1086 |
+
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
1087 |
<strong>Please make sure that you are not ranking the same stock multiple times.</strong>
|
1088 |
+
</div>""",
|
1089 |
+
submit_ranking,
|
1090 |
+
)
|
1091 |
if any(
|
1092 |
var is None
|
1093 |
for var in [
|
|
|
1106 |
providing_information_2,
|
1107 |
]
|
1108 |
):
|
1109 |
+
return (
|
1110 |
+
"""<div style="background-color: #f8d7da; color: #721c24; padding: 15px; border: 1px solid #f5c6cb; border-radius: 5px; margin-bottom: 20px;">
|
1111 |
<strong>Please make sure that you answer all the statements.</strong>
|
1112 |
+
</div>""",
|
1113 |
+
submit_ranking,
|
1114 |
+
)
|
1115 |
else:
|
1116 |
save_feedback(
|
1117 |
user_id,
|
|
|
1147 |
},
|
1148 |
feedback_file_final_survey,
|
1149 |
)
|
1150 |
+
submit_ranking = gr.Button(value="Final evaluaiotn received", interactive=False)
|
1151 |
return """<div style="background-color: #d4edda; color: #155724; padding: 15px; border: 1px solid #c3e6cb; border-radius: 5px; margin-bottom: 20px;">
|
1152 |
<strong>Thank you for participating in the experiment. This concludes the session. You may now close the tab.</strong>
|
1153 |
</div>"""
|