Implement quick add functionality for incorrect answers; return collapsed partial for quick suggestions in the answers table.

This commit is contained in:
Ross
2025-11-11 13:42:34 +00:00
parent e4bab4a509
commit d88a626a76
2 changed files with 102 additions and 0 deletions
+4
View File
@@ -1469,6 +1469,10 @@ def question_suggest_incorrect_answers(request, pk):
existing.append(suggestion)
question.answer_suggest_incorrect = existing
question.save()
# If this is a quick add (from the answers table) return the collapsed partial
if request.POST.get("quick"):
return render(request, "anatomy/partials/suggest_incorrect_collapsed.html", {"question": question})
# Recompute candidates and render the edit fragment
form = SuggestIncorrectAnswerForm(instance=question)
candidates = build_candidates(question)