fix(exam-correct): correctly htmlify user on failure
This commit is contained in:
parent
53ff6298e2
commit
595f46d860
@ -513,10 +513,12 @@ function removeAllChildren(element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function userToHTML(user) {
|
function userToHTML(user) {
|
||||||
if (user && user['display-name'] && user['surname']) {
|
if (user) {
|
||||||
return user['display-name'].replace(new RegExp(user['surname']), `<strong>${user['surname']}</strong>`) + (user['mat-nr'] ? ` (${user['mat-nr']})` : '');
|
if (user['display-name'] && user['surname']) {
|
||||||
} else if (user && user.name) {
|
return user['display-name'].replace(new RegExp(user['surname']), `<strong>${user['surname']}</strong>`) + (user['mat-nr'] ? ` (${user['mat-nr']})` : '');
|
||||||
return user.name;
|
} else {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error('Unable to format invalid user response');
|
console.error('Unable to format invalid user response');
|
||||||
return '';
|
return '';
|
||||||
|
|||||||
Reference in New Issue
Block a user