Spaces:
Runtime error
Runtime error
Commit
Β·
40cdf6a
1
Parent(s):
e4f8576
update
Browse files- templates/completed.html +11 -11
- templates/experiment.html +34 -25
- templates/index.html +55 -62
templates/completed.html
CHANGED
|
@@ -15,25 +15,25 @@
|
|
| 15 |
}
|
| 16 |
.container {
|
| 17 |
text-align: center;
|
| 18 |
-
background-color: #ffffff;
|
| 19 |
padding: 60px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
width: 60%;
|
| 23 |
}
|
| 24 |
h1 {
|
| 25 |
-
color: #000000;
|
| 26 |
-
font-size: 48px;
|
| 27 |
margin-bottom: 30px;
|
| 28 |
}
|
| 29 |
p {
|
| 30 |
-
color: #000000;
|
| 31 |
-
font-size: 24px;
|
| 32 |
margin-bottom: 30px;
|
| 33 |
}
|
| 34 |
.thank-you {
|
| 35 |
color: #4CAF50;
|
| 36 |
-
font-size: 24px;
|
| 37 |
margin-top: 20px;
|
| 38 |
}
|
| 39 |
.button-container {
|
|
@@ -46,7 +46,7 @@
|
|
| 46 |
border: none;
|
| 47 |
border-radius: 5px;
|
| 48 |
cursor: pointer;
|
| 49 |
-
font-size: 24px;
|
| 50 |
transition: background-color 0.3s ease;
|
| 51 |
}
|
| 52 |
button:hover {
|
|
@@ -58,9 +58,9 @@
|
|
| 58 |
<div class="container">
|
| 59 |
<h1>Thank you! πππ</h1>
|
| 60 |
<p>Experiment completed! Your responses have been recorded.</p>
|
| 61 |
-
|
| 62 |
-
<p>
|
| 63 |
-
|
| 64 |
<div class="button-container">
|
| 65 |
<a href="/" style="text-decoration: none;">
|
| 66 |
<button>Back to Start Page</button>
|
|
@@ -68,4 +68,4 @@
|
|
| 68 |
</div>
|
| 69 |
</div>
|
| 70 |
</body>
|
| 71 |
-
</html>
|
|
|
|
| 15 |
}
|
| 16 |
.container {
|
| 17 |
text-align: center;
|
| 18 |
+
background-color: #ffffff;
|
| 19 |
padding: 60px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
width: 60%;
|
| 23 |
}
|
| 24 |
h1 {
|
| 25 |
+
color: #000000;
|
| 26 |
+
font-size: 48px;
|
| 27 |
margin-bottom: 30px;
|
| 28 |
}
|
| 29 |
p {
|
| 30 |
+
color: #000000;
|
| 31 |
+
font-size: 24px;
|
| 32 |
margin-bottom: 30px;
|
| 33 |
}
|
| 34 |
.thank-you {
|
| 35 |
color: #4CAF50;
|
| 36 |
+
font-size: 24px;
|
| 37 |
margin-top: 20px;
|
| 38 |
}
|
| 39 |
.button-container {
|
|
|
|
| 46 |
border: none;
|
| 47 |
border-radius: 5px;
|
| 48 |
cursor: pointer;
|
| 49 |
+
font-size: 24px;
|
| 50 |
transition: background-color 0.3s ease;
|
| 51 |
}
|
| 52 |
button:hover {
|
|
|
|
| 58 |
<div class="container">
|
| 59 |
<h1>Thank you! πππ</h1>
|
| 60 |
<p>Experiment completed! Your responses have been recorded.</p>
|
| 61 |
+
{% for method, preference in preferences.items() %}
|
| 62 |
+
<p>{{ method }} preference rate: {{ preference }}%</p>
|
| 63 |
+
{% endfor %}
|
| 64 |
<div class="button-container">
|
| 65 |
<a href="/" style="text-decoration: none;">
|
| 66 |
<button>Back to Start Page</button>
|
|
|
|
| 68 |
</div>
|
| 69 |
</div>
|
| 70 |
</body>
|
| 71 |
+
</html>
|
templates/experiment.html
CHANGED
|
@@ -15,29 +15,34 @@
|
|
| 15 |
height: 100vh;
|
| 16 |
}
|
| 17 |
.container {
|
| 18 |
-
background-color: #ffffff;
|
| 19 |
padding: 20px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
-
width:
|
| 23 |
-
height:
|
| 24 |
margin: 0;
|
| 25 |
text-align: center;
|
| 26 |
display: flex;
|
| 27 |
flex-direction: column;
|
| 28 |
}
|
| 29 |
h1, h2 {
|
| 30 |
-
color: #000000;
|
| 31 |
-
font-size: 24px;
|
| 32 |
}
|
| 33 |
p {
|
| 34 |
-
color: #000000;
|
| 35 |
-
font-size: 18px;
|
| 36 |
}
|
| 37 |
.visualization-container {
|
|
|
|
|
|
|
| 38 |
flex: 1;
|
| 39 |
margin: 20px 0;
|
| 40 |
}
|
|
|
|
|
|
|
|
|
|
| 41 |
.buttons {
|
| 42 |
display: flex;
|
| 43 |
justify-content: space-between;
|
|
@@ -49,7 +54,7 @@
|
|
| 49 |
border: none;
|
| 50 |
border-radius: 5px;
|
| 51 |
cursor: pointer;
|
| 52 |
-
font-size: 18px;
|
| 53 |
margin-top: 20px;
|
| 54 |
width: 48%;
|
| 55 |
transition: background-color 0.3s ease;
|
|
@@ -57,28 +62,24 @@
|
|
| 57 |
button:hover {
|
| 58 |
background-color: #45a049;
|
| 59 |
}
|
| 60 |
-
button.reject {
|
| 61 |
-
background-color: #f44336;
|
| 62 |
-
}
|
| 63 |
-
button.reject:hover {
|
| 64 |
-
background-color: #e53935;
|
| 65 |
-
}
|
| 66 |
iframe {
|
| 67 |
width: 100%;
|
| 68 |
-
height: calc(100vh -
|
| 69 |
border: none;
|
| 70 |
}
|
| 71 |
</style>
|
| 72 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
| 73 |
<script>
|
| 74 |
window.onload = function() {
|
| 75 |
-
var
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
| 82 |
};
|
| 83 |
</script>
|
| 84 |
</head>
|
|
@@ -87,16 +88,24 @@
|
|
| 87 |
<h1>{{ sample_id + 1 }} / 10</h1>
|
| 88 |
<p><strong>Task description:</strong> {{ statement }}</p>
|
| 89 |
<div class="visualization-container">
|
| 90 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
</div>
|
|
|
|
| 92 |
<div class="buttons">
|
| 93 |
<form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
|
| 94 |
<input type="hidden" name="username" value="{{ username }}">
|
| 95 |
-
<button type="submit" name="feedback" value="
|
| 96 |
</form>
|
| 97 |
<form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
|
| 98 |
<input type="hidden" name="username" value="{{ username }}">
|
| 99 |
-
<button type="submit" name="feedback" value="
|
| 100 |
</form>
|
| 101 |
</div>
|
| 102 |
</div>
|
|
|
|
| 15 |
height: 100vh;
|
| 16 |
}
|
| 17 |
.container {
|
| 18 |
+
background-color: #ffffff;
|
| 19 |
padding: 20px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
+
width: 95%;
|
| 23 |
+
height: 95%;
|
| 24 |
margin: 0;
|
| 25 |
text-align: center;
|
| 26 |
display: flex;
|
| 27 |
flex-direction: column;
|
| 28 |
}
|
| 29 |
h1, h2 {
|
| 30 |
+
color: #000000;
|
| 31 |
+
font-size: 24px;
|
| 32 |
}
|
| 33 |
p {
|
| 34 |
+
color: #000000;
|
| 35 |
+
font-size: 18px;
|
| 36 |
}
|
| 37 |
.visualization-container {
|
| 38 |
+
display: flex;
|
| 39 |
+
justify-content: space-between;
|
| 40 |
flex: 1;
|
| 41 |
margin: 20px 0;
|
| 42 |
}
|
| 43 |
+
.visualization {
|
| 44 |
+
width: 48%;
|
| 45 |
+
}
|
| 46 |
.buttons {
|
| 47 |
display: flex;
|
| 48 |
justify-content: space-between;
|
|
|
|
| 54 |
border: none;
|
| 55 |
border-radius: 5px;
|
| 56 |
cursor: pointer;
|
| 57 |
+
font-size: 18px;
|
| 58 |
margin-top: 20px;
|
| 59 |
width: 48%;
|
| 60 |
transition: background-color 0.3s ease;
|
|
|
|
| 62 |
button:hover {
|
| 63 |
background-color: #45a049;
|
| 64 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
iframe {
|
| 66 |
width: 100%;
|
| 67 |
+
height: calc(100vh - 250px);
|
| 68 |
border: none;
|
| 69 |
}
|
| 70 |
</style>
|
| 71 |
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap" rel="stylesheet">
|
| 72 |
<script>
|
| 73 |
window.onload = function() {
|
| 74 |
+
var iframes = document.querySelectorAll('iframe');
|
| 75 |
+
iframes.forEach(function(iframe) {
|
| 76 |
+
iframe.onload = function() {
|
| 77 |
+
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
| 78 |
+
var style = document.createElement('style');
|
| 79 |
+
style.innerHTML = 'body { font-size: 14px; }';
|
| 80 |
+
iframeDocument.head.appendChild(style);
|
| 81 |
+
};
|
| 82 |
+
});
|
| 83 |
};
|
| 84 |
</script>
|
| 85 |
</head>
|
|
|
|
| 88 |
<h1>{{ sample_id + 1 }} / 10</h1>
|
| 89 |
<p><strong>Task description:</strong> {{ statement }}</p>
|
| 90 |
<div class="visualization-container">
|
| 91 |
+
<div class="visualization">
|
| 92 |
+
<h2>{{ method_a }}</h2>
|
| 93 |
+
<iframe src="{{ visualization_a }}"></iframe>
|
| 94 |
+
</div>
|
| 95 |
+
<div class="visualization">
|
| 96 |
+
<h2>{{ method_b }}</h2>
|
| 97 |
+
<iframe src="{{ visualization_b }}"></iframe>
|
| 98 |
+
</div>
|
| 99 |
</div>
|
| 100 |
+
<p>Which explanation provides a clearer and more accurate reasoning process?</p>
|
| 101 |
<div class="buttons">
|
| 102 |
<form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
|
| 103 |
<input type="hidden" name="username" value="{{ username }}">
|
| 104 |
+
<button type="submit" name="feedback" value="{{ method_a }}">{{ method_a }}</button>
|
| 105 |
</form>
|
| 106 |
<form action="{{ url_for('feedback') }}" method="post" style="width: 48%;">
|
| 107 |
<input type="hidden" name="username" value="{{ username }}">
|
| 108 |
+
<button type="submit" name="feedback" value="{{ method_b }}">{{ method_b }}</button>
|
| 109 |
</form>
|
| 110 |
</div>
|
| 111 |
</div>
|
templates/index.html
CHANGED
|
@@ -15,22 +15,22 @@
|
|
| 15 |
}
|
| 16 |
.container {
|
| 17 |
text-align: center;
|
| 18 |
-
background-color: #ffffff;
|
| 19 |
padding: 60px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
width: 60%;
|
| 23 |
}
|
| 24 |
h1 {
|
| 25 |
-
color: #000000;
|
| 26 |
-
font-size: 48px;
|
| 27 |
margin-bottom: 30px;
|
| 28 |
}
|
| 29 |
label {
|
| 30 |
display: block;
|
| 31 |
margin: 20px 0 10px;
|
| 32 |
-
color: #000000;
|
| 33 |
-
font-size: 24px;
|
| 34 |
}
|
| 35 |
input[type="text"], input[type="number"] {
|
| 36 |
width: 80%;
|
|
@@ -38,47 +38,28 @@
|
|
| 38 |
margin-bottom: 20px;
|
| 39 |
border: 1px solid #ddd;
|
| 40 |
border-radius: 5px;
|
| 41 |
-
font-size: 18px;
|
| 42 |
}
|
| 43 |
-
.method-buttons {
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
}
|
| 49 |
-
|
| 50 |
-
.method-button {
|
| 51 |
-
width: 45%; /* Makes the buttons smaller */
|
| 52 |
-
padding: 15px; /* Adjusts padding to make the buttons smaller */
|
| 53 |
-
font-size: 20px; /* Reduces the font size */
|
| 54 |
-
border-radius: 10px;
|
| 55 |
-
cursor: pointer;
|
| 56 |
-
transition: background-color 0.3s ease, border 0.3s ease;
|
| 57 |
-
border: 2px solid transparent; /* Add border for highlighting */
|
| 58 |
-
font-weight: bold;
|
| 59 |
-
text-align: center; /* Ensures text is centered */
|
| 60 |
-
}
|
| 61 |
-
|
| 62 |
-
.method-button.chain-of-table {
|
| 63 |
-
background-color: #e0f0ff;
|
| 64 |
-
color: #1e90ff; /* Blue text color */
|
| 65 |
-
}
|
| 66 |
-
|
| 67 |
-
.method-button.plan-of-sqls {
|
| 68 |
-
background-color: #ffcc80; /* Orange background color */
|
| 69 |
-
color: #e65100; /* Darker orange text color */
|
| 70 |
-
}
|
| 71 |
-
|
| 72 |
-
.method-button.chain-of-table:hover {
|
| 73 |
-
background-color: #d0e8ff;
|
| 74 |
}
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
}
|
| 79 |
-
|
| 80 |
.method-button.selected {
|
| 81 |
-
border-color: #000000;
|
| 82 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
| 83 |
}
|
| 84 |
button {
|
|
@@ -88,7 +69,7 @@
|
|
| 88 |
border: none;
|
| 89 |
border-radius: 5px;
|
| 90 |
cursor: pointer;
|
| 91 |
-
font-size: 24px;
|
| 92 |
transition: background-color 0.3s ease;
|
| 93 |
margin-top: 20px;
|
| 94 |
}
|
|
@@ -97,29 +78,35 @@
|
|
| 97 |
}
|
| 98 |
</style>
|
| 99 |
<script>
|
| 100 |
-
|
| 101 |
-
document.getElementById('method').value = method;
|
| 102 |
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
}
|
| 108 |
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
}
|
| 115 |
}
|
| 116 |
|
| 117 |
function validateForm() {
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
alert("Please fill in all fields and select a method.");
|
| 123 |
return false;
|
| 124 |
}
|
| 125 |
return true;
|
|
@@ -139,10 +126,16 @@
|
|
| 139 |
<input type="hidden" id="method" name="method" required>
|
| 140 |
|
| 141 |
<div class="method-buttons">
|
| 142 |
-
<div class="method-button
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
Chain-of-Table
|
| 144 |
</div>
|
| 145 |
-
<div class="method-button
|
| 146 |
Plan-of-SQLs
|
| 147 |
</div>
|
| 148 |
</div>
|
|
@@ -151,4 +144,4 @@
|
|
| 151 |
</form>
|
| 152 |
</div>
|
| 153 |
</body>
|
| 154 |
-
</html>
|
|
|
|
| 15 |
}
|
| 16 |
.container {
|
| 17 |
text-align: center;
|
| 18 |
+
background-color: #ffffff;
|
| 19 |
padding: 60px;
|
| 20 |
border-radius: 10px;
|
| 21 |
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
| 22 |
width: 60%;
|
| 23 |
}
|
| 24 |
h1 {
|
| 25 |
+
color: #000000;
|
| 26 |
+
font-size: 48px;
|
| 27 |
margin-bottom: 30px;
|
| 28 |
}
|
| 29 |
label {
|
| 30 |
display: block;
|
| 31 |
margin: 20px 0 10px;
|
| 32 |
+
color: #000000;
|
| 33 |
+
font-size: 24px;
|
| 34 |
}
|
| 35 |
input[type="text"], input[type="number"] {
|
| 36 |
width: 80%;
|
|
|
|
| 38 |
margin-bottom: 20px;
|
| 39 |
border: 1px solid #ddd;
|
| 40 |
border-radius: 5px;
|
| 41 |
+
font-size: 18px;
|
| 42 |
}
|
| 43 |
+
.method-buttons {
|
| 44 |
+
display: flex;
|
| 45 |
+
flex-wrap: wrap;
|
| 46 |
+
justify-content: space-between;
|
| 47 |
+
margin-bottom: 20px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
+
.method-button {
|
| 50 |
+
width: 45%;
|
| 51 |
+
padding: 15px;
|
| 52 |
+
font-size: 20px;
|
| 53 |
+
border-radius: 10px;
|
| 54 |
+
cursor: pointer;
|
| 55 |
+
transition: background-color 0.3s ease, border 0.3s ease;
|
| 56 |
+
border: 2px solid transparent;
|
| 57 |
+
font-weight: bold;
|
| 58 |
+
text-align: center;
|
| 59 |
+
margin-bottom: 10px;
|
| 60 |
}
|
|
|
|
| 61 |
.method-button.selected {
|
| 62 |
+
border-color: #000000;
|
| 63 |
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
| 64 |
}
|
| 65 |
button {
|
|
|
|
| 69 |
border: none;
|
| 70 |
border-radius: 5px;
|
| 71 |
cursor: pointer;
|
| 72 |
+
font-size: 24px;
|
| 73 |
transition: background-color 0.3s ease;
|
| 74 |
margin-top: 20px;
|
| 75 |
}
|
|
|
|
| 78 |
}
|
| 79 |
</style>
|
| 80 |
<script>
|
| 81 |
+
let selectedMethods = [];
|
|
|
|
| 82 |
|
| 83 |
+
function selectMethod(method) {
|
| 84 |
+
const index = selectedMethods.indexOf(method);
|
| 85 |
+
if (index > -1) {
|
| 86 |
+
selectedMethods.splice(index, 1);
|
| 87 |
+
} else if (selectedMethods.length < 2) {
|
| 88 |
+
selectedMethods.push(method);
|
| 89 |
+
} else {
|
| 90 |
+
return;
|
| 91 |
}
|
| 92 |
|
| 93 |
+
document.getElementById('method').value = selectedMethods.join(',');
|
| 94 |
+
|
| 95 |
+
const buttons = document.getElementsByClassName('method-button');
|
| 96 |
+
for (let button of buttons) {
|
| 97 |
+
if (selectedMethods.includes(button.getAttribute('data-method'))) {
|
| 98 |
+
button.classList.add('selected');
|
| 99 |
+
} else {
|
| 100 |
+
button.classList.remove('selected');
|
| 101 |
+
}
|
| 102 |
}
|
| 103 |
}
|
| 104 |
|
| 105 |
function validateForm() {
|
| 106 |
+
const username = document.getElementById('username').value;
|
| 107 |
+
const seed = document.getElementById('seed').value;
|
| 108 |
+
if (!username || !seed || selectedMethods.length !== 2) {
|
| 109 |
+
alert("Please fill in all fields and select exactly two methods.");
|
|
|
|
| 110 |
return false;
|
| 111 |
}
|
| 112 |
return true;
|
|
|
|
| 126 |
<input type="hidden" id="method" name="method" required>
|
| 127 |
|
| 128 |
<div class="method-buttons">
|
| 129 |
+
<div class="method-button" onclick="selectMethod('No-XAI')" data-method="No-XAI">
|
| 130 |
+
No-XAI
|
| 131 |
+
</div>
|
| 132 |
+
<div class="method-button" onclick="selectMethod('Dater')" data-method="Dater">
|
| 133 |
+
Dater
|
| 134 |
+
</div>
|
| 135 |
+
<div class="method-button" onclick="selectMethod('Chain-of-Table')" data-method="Chain-of-Table">
|
| 136 |
Chain-of-Table
|
| 137 |
</div>
|
| 138 |
+
<div class="method-button" onclick="selectMethod('Plan-of-SQLs')" data-method="Plan-of-SQLs">
|
| 139 |
Plan-of-SQLs
|
| 140 |
</div>
|
| 141 |
</div>
|
|
|
|
| 144 |
</form>
|
| 145 |
</div>
|
| 146 |
</body>
|
| 147 |
+
</html>
|