From 88768eb1d184cc545da8a41566c893ea81a03c03 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 24 Jan 2020 09:51:21 +0100 Subject: [PATCH] fix(exam-correct): fix addRow rowInfo --- frontend/src/utils/exam-correct/exam-correct.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/utils/exam-correct/exam-correct.js b/frontend/src/utils/exam-correct/exam-correct.js index bdf3a253d..de8b77eac 100644 --- a/frontend/src/utils/exam-correct/exam-correct.js +++ b/frontend/src/utils/exam-correct/exam-correct.js @@ -189,7 +189,7 @@ export class ExamCorrect { if (Object.keys(results).length <= 0) return; const rowInfo = { - users: [{ id: userId, name: user }], + users: [userId || user], results: results, status: STATUS.LOADING, }; @@ -297,6 +297,7 @@ export class ExamCorrect { // TODO special style for server time? newEntry.users = [response.user]; newEntry.results = response.results; + newEntry.date = response.time; } // TODO replace results with results from response // TODO set edit button visibility @@ -443,7 +444,7 @@ export class ExamCorrect { } else if (rowInfo.users.length === 1) { const user = rowInfo.users[0]; userCell.innerHTML = userToHTML(user); - userCell.setAttribute(EXAM_CORRECT_USER_ATTR, user.id || user.name); + userCell.setAttribute(EXAM_CORRECT_USER_ATTR, user); } else { userCell = this._showUserList(newRow, rowInfo.users, rowInfo.results); }