diff --git a/sbas/tables.py b/sbas/tables.py index 84157c75..a77911b5 100644 --- a/sbas/tables.py +++ b/sbas/tables.py @@ -77,6 +77,15 @@ class QuestionTable(tables.Table): return format_html("
{}
{}", title, mark_safe(value)) return mark_safe(value) + def render_best_answer(self, value, record=None, **kwargs): + """Show only the capitalised first character of the best_answer.""" + if value is None: + return "" + s = str(value).strip() + if not s: + return "" + return s[0].upper() + class UserAnswerTable(tables.Table):