From bd0c71140c343880c335bf87a73e15e238ed0e67 Mon Sep 17 00:00:00 2001 From: Ross Date: Wed, 25 Mar 2026 21:21:50 +0000 Subject: [PATCH] Update button elements in selection controls to ensure proper type attribute for improved accessibility --- generic/tables.py | 4 ++-- rapids/views.py | 26 ++++++++++++++++---------- templates/base.html | 4 ++-- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/generic/tables.py b/generic/tables.py index e36a3288..d1f29a64 100644 --- a/generic/tables.py +++ b/generic/tables.py @@ -74,8 +74,8 @@ class SelectionTable(tables.Table): "
" " " "
" - " " - " " + " " + " " "
" "
" "
" diff --git a/rapids/views.py b/rapids/views.py index 553cc936..062b18e1 100755 --- a/rapids/views.py +++ b/rapids/views.py @@ -859,24 +859,30 @@ def exam_migrate_rapids_to_shorts(request, pk): raise PermissionDenied() from shorts.models import Question as ShortQuestion + created = [] + skipped = [] + failed = [] for rapid in exam.exam_questions.all(): try: q = ShortQuestion.from_rapid(rapid) if q is None: - # skipped normal - continue - except Exception: - # continue on error + skipped.append(str(rapid.id)) + else: + created.append(str(q.id)) + except Exception as e: + failed.append(str(rapid.id)) continue - messages.success(request, "Exam migration attempted. Normal questions were skipped.") + if created: + messages.success(request, f"Created shorts questions: {', '.join(created)}") + if skipped: + messages.info(request, f"Skipped normal rapids (not migrated): {', '.join(skipped)}") + if failed: + messages.error(request, f"Failed to migrate rapids: {', '.join(failed)}") - # Redirect to the exam overview for shorts if available, otherwise back to rapids exam - try: - return redirect("shorts:exam_overview", pk=exam.pk) - except Exception: - return redirect("rapids:exam_overview", pk=exam.pk) + # Redirect back to the Rapids exam overview (shorts exam may not exist) + return redirect("rapids:exam_overview", pk=exam.pk) class ExamClone(ExamCloneMixin, ExamCreate): diff --git a/templates/base.html b/templates/base.html index 08cd19fd..a60421b3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -369,8 +369,8 @@ + '
' + ' ' + ' ' + '
' + '
'