riderle commited on
Commit
cdf264c
·
verified ·
1 Parent(s): cb49766

Update chat_application/templates/room.html

Browse files
chat_application/templates/room.html CHANGED
@@ -49,25 +49,15 @@
49
  <div id="abort-modal" class="modal">
50
  <div class="modal-content">
51
  <h3>Are you sure you want to leave this experiment?</h3>
52
- <p>This action is permanent. You will be redirected to the post-survey and will not be able to return to the chat room.</p>
53
  <p><strong>If you finished your 20 minutes in the chatroom, do NOT exit via this button. Use the "End Chat Session" button instead.</strong></p>
54
- <div class="modal-buttons">
55
- <button class="modal-btn" id="abortYesBtn-pre">Yes</button>
56
- <button class="modal-btn" id="abortNoBtn-pre">Cancel</button>
57
- </div>
58
- </div>
59
- </div>
60
- <div id="abort-modal-confirm" class="modal">
61
- <div class="modal-content">
62
- <h3>Confirmation</h3>
63
  <p>By clicking yes, you will exit the experiment <strong>without</strong> completing the final survey.</p>
64
- <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>
65
  <div class="modal-buttons">
66
  <button class="modal-btn" id="abortYesBtn">End early with code "C9V2XFDU"</button>
67
  <button class="modal-btn" id="abortNoBtn">Cancel</button>
68
  </div>
69
  </div>
70
  </div>
 
71
  <div id="feedback-modal" class="modal">
72
  <div class="modal-content">
73
  <h3>Feedback</h3>
@@ -127,6 +117,7 @@
127
  document.getElementById("send-btn").disabled = true;
128
  document.getElementById("end-exp-btn").disabled = true;
129
  document.getElementById("abort-exp-btn").disabled = true;
 
130
  if (socketio) {
131
  socketio.close();
132
  }
@@ -221,25 +212,18 @@
221
  document.getElementById("send-btn").disabled = true;
222
  document.getElementById("end-exp-btn").disabled = true;
223
  document.getElementById("abort-exp-btn").disabled = true;
 
224
  if (socketio) {
225
  socketio.close();
226
  }
227
  };
228
  // Handler for the Abort Experiment confirmation pop-up
229
  let modal = document.getElementById("abort-modal");
230
- let abortModalConfirm = document.getElementById("abort-modal-confirm");
231
  document.getElementById("abort-exp-btn").onclick = function () {
232
  modal.style.display = "block";
233
  };
234
- document.getElementById("abortYesBtn-pre").onclick = function () {
235
- abortModalConfirm.style.display = "block";
236
- modal.style.display = "none";
237
- };
238
- document.getElementById("abortNoBtn-pre").onclick = function () {
239
- modal.style.display = "none";
240
- };
241
  document.getElementById("abortNoBtn").onclick = function () {
242
- abortModalConfirm.style.display = "none";
243
  };
244
 
245
  document.getElementById("abortYesBtn").onclick = function (e) {
@@ -256,13 +240,10 @@
256
  document.getElementById("send-btn").disabled = true;
257
  document.getElementById("end-exp-btn").disabled = true;
258
  document.getElementById("abort-exp-btn").disabled = true;
 
259
  if (socketio) {
260
  socketio.close();
261
  }
262
- abortModalConfirm.style.display = "none";
263
- };
264
- document.getElementById("abortNoBtn").onclick = function () {
265
- abortModalConfirm.style.display = "none";
266
  };
267
 
268
  //handler for feedback modal popup
@@ -299,11 +280,12 @@
299
  socketio.emit("feedback_given", { feedback }, (response) => {
300
  if (response?.status === "True" || response?.status === true) {
301
  feedbackConfirm.style.display = "block";
 
 
 
 
302
  }
303
  });
304
-
305
- form.reset();
306
- document.getElementById("feedback-modal").style.display = "none";
307
  });
308
 
309
  // add auto scroll
 
49
  <div id="abort-modal" class="modal">
50
  <div class="modal-content">
51
  <h3>Are you sure you want to leave this experiment?</h3>
 
52
  <p><strong>If you finished your 20 minutes in the chatroom, do NOT exit via this button. Use the "End Chat Session" button instead.</strong></p>
 
 
 
 
 
 
 
 
 
53
  <p>By clicking yes, you will exit the experiment <strong>without</strong> completing the final survey.</p>
 
54
  <div class="modal-buttons">
55
  <button class="modal-btn" id="abortYesBtn">End early with code "C9V2XFDU"</button>
56
  <button class="modal-btn" id="abortNoBtn">Cancel</button>
57
  </div>
58
  </div>
59
  </div>
60
+
61
  <div id="feedback-modal" class="modal">
62
  <div class="modal-content">
63
  <h3>Feedback</h3>
 
117
  document.getElementById("send-btn").disabled = true;
118
  document.getElementById("end-exp-btn").disabled = true;
119
  document.getElementById("abort-exp-btn").disabled = true;
120
+ document.getElementById("feedback-btn").disabled = true; //since without socket io, it won't submit
121
  if (socketio) {
122
  socketio.close();
123
  }
 
212
  document.getElementById("send-btn").disabled = true;
213
  document.getElementById("end-exp-btn").disabled = true;
214
  document.getElementById("abort-exp-btn").disabled = true;
215
+ document.getElementById("feedback-btn").disabled = true; //since without socket io, it won't submit
216
  if (socketio) {
217
  socketio.close();
218
  }
219
  };
220
  // Handler for the Abort Experiment confirmation pop-up
221
  let modal = document.getElementById("abort-modal");
 
222
  document.getElementById("abort-exp-btn").onclick = function () {
223
  modal.style.display = "block";
224
  };
 
 
 
 
 
 
 
225
  document.getElementById("abortNoBtn").onclick = function () {
226
+ modal.style.display = "none";
227
  };
228
 
229
  document.getElementById("abortYesBtn").onclick = function (e) {
 
240
  document.getElementById("send-btn").disabled = true;
241
  document.getElementById("end-exp-btn").disabled = true;
242
  document.getElementById("abort-exp-btn").disabled = true;
243
+ document.getElementById("feedback-btn").disabled = true; //since without socket io, it won't submit
244
  if (socketio) {
245
  socketio.close();
246
  }
 
 
 
 
247
  };
248
 
249
  //handler for feedback modal popup
 
280
  socketio.emit("feedback_given", { feedback }, (response) => {
281
  if (response?.status === "True" || response?.status === true) {
282
  feedbackConfirm.style.display = "block";
283
+ form.reset();
284
+ document.getElementById("feedback-modal").style.display = "none";
285
+ } else {
286
+ feedbackFail.style.display = "block";
287
  }
288
  });
 
 
 
289
  });
290
 
291
  // add auto scroll