Update button elements in selection controls to ensure proper type attribute for improved accessibility
This commit is contained in:
+2
-2
@@ -74,8 +74,8 @@ class SelectionTable(tables.Table):
|
||||
" <div>"
|
||||
" <button class=\"btn btn-outline-secondary btn-sm\" id=\"toggle-row-selection-{}\" type=\"button\">Enable row selection</button>"
|
||||
" <div id=\"selection-controls-{}\" class=\"btn-group ms-2\" role=\"group\" style=\"display:none;\">"
|
||||
" <button class=\"btn btn-sm btn-outline-primary\" id=\"select-all-{}\">Select all</button>"
|
||||
" <button class=\"btn btn-sm btn-outline-secondary\" id=\"clear-selection-{}\">Clear</button>"
|
||||
" <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" id=\"select-all-{}\">Select all</button>"
|
||||
" <button type=\"button\" class=\"btn btn-sm btn-outline-secondary\" id=\"clear-selection-{}\">Clear</button>"
|
||||
" </div>"
|
||||
" </div>"
|
||||
" <div>"
|
||||
|
||||
+16
-10
@@ -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):
|
||||
|
||||
+2
-2
@@ -369,8 +369,8 @@
|
||||
+ ' <div>'
|
||||
+ ' <button class="btn btn-outline-secondary btn-sm" id="toggle-row-selection-' + token + '" type="button">Enable row selection</button>'
|
||||
+ ' <div id="selection-controls-' + token + '" class="btn-group ms-2" role="group" style="display:none;">'
|
||||
+ ' <button class="btn btn-sm btn-outline-primary" id="select-all-' + token + '">Select all</button>'
|
||||
+ ' <button class="btn btn-sm btn-outline-secondary" id="clear-selection-' + token + '">Clear</button>'
|
||||
+ ' <button type="button" class="btn btn-sm btn-outline-primary" id="select-all-' + token + '">Select all</button>'
|
||||
+ ' <button type="button" class="btn btn-sm btn-outline-secondary" id="clear-selection-' + token + '">Clear</button>'
|
||||
+ ' </div>'
|
||||
+ ' </div>'
|
||||
+ ' <div>'
|
||||
|
||||
Reference in New Issue
Block a user