Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update chat_application/templates/room.html
Browse files
chat_application/templates/room.html
CHANGED
|
@@ -62,7 +62,8 @@
|
|
| 62 |
<p>By clicking yes, you will exit the experiment <strong>without</strong> completing the final survey.</p>
|
| 63 |
<p>We encourage you to message us about any concerns or to <a href="{{ feedback_form_url | default('https://umw.qualtrics.com/jfe/form/SV_08v26NssCOwZTP8') }}" target="_blank">provide feedback here</a>.</p>
|
| 64 |
<div class="modal-buttons">
|
| 65 |
-
<button class="modal-btn" id="abortYesBtn">
|
|
|
|
| 66 |
<button class="modal-btn" id="abortNoBtn">Cancel</button>
|
| 67 |
</div>
|
| 68 |
</div>
|
|
@@ -117,6 +118,7 @@
|
|
| 117 |
};
|
| 118 |
// Creates the post-survey link (based on the bot names)
|
| 119 |
const endpoint = "{{ url_for('post_survey') }}";
|
|
|
|
| 120 |
socketio.on("message", function (message) { createChatItem(message.message, message.sender) });
|
| 121 |
function createChatItem(message, sender) {
|
| 122 |
//autoscroll capabilities
|
|
@@ -203,7 +205,9 @@
|
|
| 203 |
document.getElementById("abortNoBtn-pre").onclick = function () {
|
| 204 |
modal.style.display = "none";
|
| 205 |
};
|
| 206 |
-
|
|
|
|
|
|
|
| 207 |
//block browser confirmation popup
|
| 208 |
e.stopPropagation();
|
| 209 |
// Mark that user aborted and redirect to ending survey
|
|
@@ -225,6 +229,29 @@
|
|
| 225 |
document.getElementById("abortNoBtn").onclick = function () {
|
| 226 |
abortModalConfirm.style.display = "none";
|
| 227 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 228 |
|
| 229 |
// add auto scroll
|
| 230 |
function isNearBottom(container, threshold = 120) {
|
|
|
|
| 62 |
<p>By clicking yes, you will exit the experiment <strong>without</strong> completing the final survey.</p>
|
| 63 |
<p>We encourage you to message us about any concerns or to <a href="{{ feedback_form_url | default('https://umw.qualtrics.com/jfe/form/SV_08v26NssCOwZTP8') }}" target="_blank">provide feedback here</a>.</p>
|
| 64 |
<div class="modal-buttons">
|
| 65 |
+
<button class="modal-btn" id="abortYesBtn">End early with code "C9V2XFDU"</button>
|
| 66 |
+
<button class="modal-btn" id="abortYesBtn-SurveyAnyway">Flag my data and take the survey anyway.</button>
|
| 67 |
<button class="modal-btn" id="abortNoBtn">Cancel</button>
|
| 68 |
</div>
|
| 69 |
</div>
|
|
|
|
| 118 |
};
|
| 119 |
// Creates the post-survey link (based on the bot names)
|
| 120 |
const endpoint = "{{ url_for('post_survey') }}";
|
| 121 |
+
const endpointQuitEarly = "https://app.prolific.com/submissions/complete?cc=C9V2XFDU";
|
| 122 |
socketio.on("message", function (message) { createChatItem(message.message, message.sender) });
|
| 123 |
function createChatItem(message, sender) {
|
| 124 |
//autoscroll capabilities
|
|
|
|
| 205 |
document.getElementById("abortNoBtn-pre").onclick = function () {
|
| 206 |
modal.style.display = "none";
|
| 207 |
};
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
document.getElementById("abortYesBtn-SurveyAnyway").onclick = function (e) {
|
| 211 |
//block browser confirmation popup
|
| 212 |
e.stopPropagation();
|
| 213 |
// Mark that user aborted and redirect to ending survey
|
|
|
|
| 229 |
document.getElementById("abortNoBtn").onclick = function () {
|
| 230 |
abortModalConfirm.style.display = "none";
|
| 231 |
};
|
| 232 |
+
|
| 233 |
+
document.getElementById("abortYesBtn").onclick = function (e) {
|
| 234 |
+
//block browser confirmation popup
|
| 235 |
+
e.stopPropagation();
|
| 236 |
+
// Mark that user aborted and redirect to ending survey
|
| 237 |
+
fetch("/abort", { method: "POST" })
|
| 238 |
+
.then(() => {
|
| 239 |
+
window.open(endpointQuitEarly, "_blank");
|
| 240 |
+
});
|
| 241 |
+
modal.style.display = "none";
|
| 242 |
+
textarea.disabled = true;
|
| 243 |
+
textarea.placeholder = "The chat has ended.";
|
| 244 |
+
document.getElementById("send-btn").disabled = true;
|
| 245 |
+
document.getElementById("end-exp-btn").disabled = true;
|
| 246 |
+
document.getElementById("abort-exp-btn").disabled = true;
|
| 247 |
+
if (socketio) {
|
| 248 |
+
socketio.close();
|
| 249 |
+
}
|
| 250 |
+
abortModalConfirm.style.display = "none";
|
| 251 |
+
};
|
| 252 |
+
document.getElementById("abortNoBtn").onclick = function () {
|
| 253 |
+
abortModalConfirm.style.display = "none";
|
| 254 |
+
};
|
| 255 |
|
| 256 |
// add auto scroll
|
| 257 |
function isNearBottom(container, threshold = 120) {
|