fix(exam-correct): fix addRow rowInfo

This commit is contained in:
Sarah Vaupel 2020-01-24 09:51:21 +01:00 committed by Gregor Kleen
parent 76cb690303
commit 88768eb1d1

View File

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