Spaces:
Sleeping
Sleeping
elibrowne
commited on
Commit
·
e7103e4
1
Parent(s):
80eb545
Collapsible?
Browse files
app.py
CHANGED
|
@@ -117,8 +117,44 @@ with gr.Blocks() as user_eval:
|
|
| 117 |
step += 1
|
| 118 |
print(eval_1 + eval_2 + eval_3)
|
| 119 |
if step == len(passage_texts):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
return {
|
| 121 |
-
selection: gr.
|
| 122 |
scores_p: gr.Column(visible = False),
|
| 123 |
scores_g: gr.Column(visible = True)
|
| 124 |
}
|
|
|
|
| 117 |
step += 1
|
| 118 |
print(eval_1 + eval_2 + eval_3)
|
| 119 |
if step == len(passage_texts):
|
| 120 |
+
collapsible_string = """
|
| 121 |
+
<style>
|
| 122 |
+
/* Style the button that is used to open and close the collapsible content */
|
| 123 |
+
.collapsible {
|
| 124 |
+
background-color: #eee;
|
| 125 |
+
color: #444;
|
| 126 |
+
cursor: pointer;
|
| 127 |
+
padding: 18px;
|
| 128 |
+
width: 100%;
|
| 129 |
+
border: none;
|
| 130 |
+
text-align: left;
|
| 131 |
+
outline: none;
|
| 132 |
+
font-size: 15px;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */
|
| 136 |
+
.active, .collapsible:hover {
|
| 137 |
+
background-color: #ccc;
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Style the collapsible content. Note: hidden by default */
|
| 141 |
+
.content {
|
| 142 |
+
padding: 0 18px;
|
| 143 |
+
display: none;
|
| 144 |
+
overflow: hidden;
|
| 145 |
+
background-color: #f1f1f1;
|
| 146 |
+
}
|
| 147 |
+
</style>
|
| 148 |
+
"""
|
| 149 |
+
for i, passage in enumerate(passage_texts):
|
| 150 |
+
collapsible_string += """
|
| 151 |
+
<button type="button" class="collapsible">Passage """ + str(i + 1) + """</button>
|
| 152 |
+
<div class="content">
|
| 153 |
+
<p> """ + passage + """ </p>
|
| 154 |
+
</div>
|
| 155 |
+
"""
|
| 156 |
return {
|
| 157 |
+
selection: gr.HTML(collapsible_string),
|
| 158 |
scores_p: gr.Column(visible = False),
|
| 159 |
scores_g: gr.Column(visible = True)
|
| 160 |
}
|