r7428 - dumbhippo/trunk/server/src/com/dumbhippo/server/dm



Author: otaylor
Date: 2008-04-16 18:07:09 -0500 (Wed, 16 Apr 2008)
New Revision: 7428

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/dm/AccountQuestionBlockDMO.java
Log:
Remove buttons when the account question is answered

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/dm/AccountQuestionBlockDMO.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/dm/AccountQuestionBlockDMO.java	2008-04-16 22:14:37 UTC (rev 7427)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/dm/AccountQuestionBlockDMO.java	2008-04-16 23:07:09 UTC (rev 7428)
@@ -1,6 +1,7 @@
 package com.dumbhippo.server.dm;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 
 import com.dumbhippo.dm.annotations.DMO;
@@ -39,11 +40,17 @@
 	
 	@DMProperty(defaultInclude=true)
 	public List<String> getButtons() {
-		List<String> result = new ArrayList<String>();
-		for (AccountQuestionButton button : ((AccountQuestionBlockView)blockView).getQuestion().getButtons()) {
-			result.add(button.getResponse() + ":" + button.getText());
+		AccountQuestionBlockView questionBlockView = (AccountQuestionBlockView)blockView;
+
+		if (questionBlockView.getAnswer() == null) {
+			List<String> result = new ArrayList<String>();
+			for (AccountQuestionButton button : questionBlockView.getQuestion().getButtons()) {
+				result.add(button.getResponse() + ":" + button.getText());
+			}
+			
+			return result;
+		} else {
+			return Collections.emptyList();
 		}
-		
-		return result;
 	}
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]