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)
}