From dfd3a699b955dd001cf9622c381c6c7e15613ba5 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Sat, 30 Mar 2013 11:09:44 -0400 Subject: [PATCH] Accept either a list of possible values, or a string as a value for comparison of correctness in multiple choice. Multiple choice code is scattered and sometimes sends a list of choices for the value, and sometimes a single string. We used to use "in" which scarily handled both cases (list or substring search), but that caused a bug when you had two choices like choice_1 and choice10. Moving to == caused us to break when lists were sent to us. So this ugly code is extra paranoid and checks both possibilities. This really needs a better cleanup. --- common/lib/capa/capa/templates/choicegroup.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/lib/capa/capa/templates/choicegroup.html b/common/lib/capa/capa/templates/choicegroup.html index 758e2ffba1..c9cc3fd28d 100644 --- a/common/lib/capa/capa/templates/choicegroup.html +++ b/common/lib/capa/capa/templates/choicegroup.html @@ -17,7 +17,7 @@ % for choice_id, choice_description in choices: