From 4d13f1563c36d1eb4bf6b2901a507e17b8a23b5f Mon Sep 17 00:00:00 2001 From: mantaqaaoheen Date: Sun, 13 Dec 2020 19:43:20 -0500 Subject: [PATCH] Letter grade booster. Lets gooo --- nginx/public/officeHours.js | 2 +- src/main/scala/model/StudentInQueue.scala | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nginx/public/officeHours.js b/nginx/public/officeHours.js index 3514c14..872e6e2 100644 --- a/nginx/public/officeHours.js +++ b/nginx/public/officeHours.js @@ -11,7 +11,7 @@ function displayQueue(queueJSON) { const queue = JSON.parse(queueJSON); let formattedQueue = ""; for (const student of queue) { - formattedQueue += student['username'] + " has been waiting since " + student['timestamp'] + "
" + formattedQueue += student['username'] + " is number " + student['timestamp'] + " today to ask for help" + "
" } document.getElementById("queue").innerHTML = formattedQueue; } diff --git a/src/main/scala/model/StudentInQueue.scala b/src/main/scala/model/StudentInQueue.scala index 464108f..321ff50 100644 --- a/src/main/scala/model/StudentInQueue.scala +++ b/src/main/scala/model/StudentInQueue.scala @@ -25,11 +25,13 @@ object StudentInQueue { class StudentInQueue(val username: String, val timestamp: Long) { + var pos: Long = 1 def asJsValue(): JsValue ={ val messageMap: Map[String, JsValue] = Map( "username" -> Json.toJson(username), - "timestamp" -> Json.toJson(timestamp) + "timestamp" -> Json.toJson(pos) ) + pos += 1 Json.toJson(messageMap) }