[gbrainy/stable] Bug #643401. Accept the words as valid answers in multioptions answers



commit 6f093f699db0c04f103eebd2fcdb71f61bde8517
Author: Jordi Mas <jmas softcatala org>
Date:   Sun Mar 13 11:30:44 2011 +0100

    Bug #643401. Accept the words as valid answers in multioptions answers

 src/Core/Main/Verbal/AnalogiesMultipleOptions.cs   |   17 ++++++++++++++++-
 .../Main/Verbal/AnalogiesPairOfWordsOptions.cs     |   17 ++++++++++++++++-
 2 files changed, 32 insertions(+), 2 deletions(-)
---
diff --git a/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs b/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
index ffaeb77..fe39b99 100644
--- a/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
+++ b/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
@@ -76,6 +76,21 @@ namespace gbrainy.Core.Main.Verbal
 			get { return analogies; }
 		}
 
+		public override string Answer {
+			get {
+				if (current == null)
+					return base.Answer;
+
+				string tmp, rslt;
+
+				tmp = right_answer;
+				right_answer = GetPossibleAnswer (current.right);
+				rslt = base.Answer;
+				right_answer = tmp;
+				return rslt;
+			}	
+		}
+
 		protected override void Initialize ()
 		{
 			current = GetNext ();
@@ -83,7 +98,7 @@ namespace gbrainy.Core.Main.Verbal
 			if (current == null || current.answers == null)
 				return;
 
-			right_answer = GetPossibleAnswer (current.right);
+			right_answer = GetPossibleAnswer (current.right) + AnalogiesFactory.Separator  + current.answers[current.right];
 
 			Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, current.answers.Length * 0.15);
 			AddWidget (container);
diff --git a/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs b/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
index 7f75dd3..8ec5d21 100644
--- a/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
+++ b/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
@@ -75,6 +75,21 @@ namespace gbrainy.Core.Main.Verbal
 			}
 		}
 
+		public override string Answer {
+			get {
+				if (current == null)
+					return base.Answer;
+
+				string tmp, rslt;
+
+				tmp = right_answer;
+				right_answer = GetPossibleAnswer (current.right);
+				rslt = base.Answer;
+				right_answer = tmp;
+				return rslt;
+			}	
+		}
+
 		protected override void Initialize ()
 		{
 			current = GetNext ();
@@ -93,7 +108,7 @@ namespace gbrainy.Core.Main.Verbal
 
 			samples = items [0].Trim ();
 
-			right_answer = GetPossibleAnswer (current.right);
+			right_answer = GetPossibleAnswer (current.right) + AnalogiesFactory.Separator  + current.answers[current.right];
 
 			Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, current.answers.Length * 0.15);
 			AddWidget (container);



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