fixed Exam description

This commit is contained in:
anhefti 2024-01-16 16:01:56 +01:00
parent f267e9f1b3
commit 90401da1ed
3 changed files with 5 additions and 4 deletions

View file

@ -427,7 +427,7 @@ public final class Exam implements GrantEntity {
builder.append(", name=");
builder.append(this.name);
builder.append(", description=");
builder.append(Utils.truncateText(this.getDescription(), 255));
builder.append(Utils.truncateText(this.getDescription(), 32));
builder.append(", startTime=");
builder.append(this.startTime);
builder.append(", endTime=");

View file

@ -466,7 +466,7 @@ public class ExamForm implements TemplateComposer {
QuizData.QUIZ_ATTR_DESCRIPTION,
FORM_DESCRIPTION_TEXT_KEY,
exam.getDescription())
.asHTMLOrArea(50, exam.lmsSetupId != null)
.asHTML(50)
.readonly(true)
.withInputSpan(7)
.withEmptyCellSeparation(false))
@ -562,7 +562,7 @@ public class ExamForm implements TemplateComposer {
QuizData.QUIZ_ATTR_DESCRIPTION,
FORM_DESCRIPTION_TEXT_KEY,
exam.getDescription())
.asArea()
.asHTMLOrArea(50, hasLMS)
.readonly(hasLMS))
.withAdditionalValueMapping(QuizData.QUIZ_ATTR_DESCRIPTION)

View file

@ -10,6 +10,7 @@ package ch.ethz.seb.sebserver.gui.form;
import java.util.function.Consumer;
import ch.ethz.seb.sebserver.gbl.util.Utils;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.rap.rwt.RWT;
import org.eclipse.swt.SWT;
@ -187,7 +188,7 @@ public final class TextFieldBuilder extends FieldBuilder<String> {
private String createHTMLText(final String text) {
return HTML_TEXT_BLOCK_START
+ text
+ Utils.formatHTMLLinesForceEscaped( text)
.replace("<a", "<span")
.replace("</a", "</span")
.replace("<A", "<span")