[gbrainy] Move AnswerShow to Answer class
- From: Jordi Mas <jmas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gbrainy] Move AnswerShow to Answer class
- Date: Sat, 5 Mar 2011 16:46:26 +0000 (UTC)
commit 1535944801d3b37388aac710f87e3b57177c4ee0
Author: Jordi Mas <jmas softcatala org>
Date: Sat Mar 5 17:47:47 2011 +0100
Move AnswerShow to Answer class
src/Core/Main/Game.cs | 9 +--
src/Core/Main/GameAnswer.cs | 16 +++++-
src/Core/Main/Verbal/Analogies.cs | 59 ++++++++++----------
src/Core/Main/Verbal/AnalogiesMultipleOptions.cs | 27 +++++----
.../Main/Verbal/AnalogiesPairOfWordsCompare.cs | 17 +++---
.../Main/Verbal/AnalogiesPairOfWordsOptions.cs | 28 +++++-----
src/Core/Main/Verbal/AnalogiesQuestionAnswer.cs | 10 ++-
src/Core/Main/Xml/GameXml.cs | 26 +++++----
src/Games/Calculation/CalculationOperator.cs | 5 +-
src/Games/Calculation/CalculationRatio.cs | 5 +-
src/Games/Calculation/CalculationTwoNumbers.cs | 5 +-
src/Games/Logic/PuzzleBuildTriangle.cs | 5 +-
src/Games/Logic/PuzzleFigureLetter.cs | 18 +-----
13 files changed, 111 insertions(+), 119 deletions(-)
---
diff --git a/src/Core/Main/Game.cs b/src/Core/Main/Game.cs
index 4b9b624..d9cbf57 100644
--- a/src/Core/Main/Game.cs
+++ b/src/Core/Main/Game.cs
@@ -92,12 +92,6 @@ namespace gbrainy.Core.Main
get { return GameTypes.LogicPuzzle;}
}
- // Right answer as shown to the user. Usually equals to right_answer, can be different
- // when the answer contains multiple options (e.g. 1 | 2 shown as 1 and 2).
- public virtual string AnswerValue {
- get { return Answer.Correct; }
- }
-
// Indicates in which difficulty levels the game should be shown
public virtual GameDifficulty Difficulty {
get { return GameDifficulty.Master | GameDifficulty.Medium | GameDifficulty.Easy; }
@@ -131,7 +125,8 @@ namespace gbrainy.Core.Main
get {
string str;
- str = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("The correct answer is {0}."), AnswerValue);
+ str = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("The correct answer is {0}."),
+ Answer.CorrectShow);
if (String.IsNullOrEmpty (Rationale))
return str;
diff --git a/src/Core/Main/GameAnswer.cs b/src/Core/Main/GameAnswer.cs
index eb6e9d4..b6bf1fc 100644
--- a/src/Core/Main/GameAnswer.cs
+++ b/src/Core/Main/GameAnswer.cs
@@ -33,6 +33,7 @@ namespace gbrainy.Core.Main
{
static char separator = '|';
const int MAX_POSSIBLE_ANSWER = 7;
+ string correct;
public GameAnswer ()
{
@@ -44,7 +45,20 @@ namespace gbrainy.Core.Main
get { return separator; }
}
- public string Correct { get; set; }
+ // Correct answer as shown to the user. Usually equals to Correct, but can be different
+ // when the answer contains multiple options (e.g. 1 | 2 shown as 1 and 2).
+ public string CorrectShow { get; set; }
+
+ // This is the correct answer used for validating the answer (a | b)
+ public string Correct {
+ get { return correct;}
+ set {
+ correct = value;
+ if (CorrectShow == null) // Set default answer to show
+ CorrectShow = correct;
+ }
+ }
+
public string CheckExpression { get; set; }
public bool Draw { get; set; }
diff --git a/src/Core/Main/Verbal/Analogies.cs b/src/Core/Main/Verbal/Analogies.cs
index 124869a..f9fcde8 100644
--- a/src/Core/Main/Verbal/Analogies.cs
+++ b/src/Core/Main/Verbal/Analogies.cs
@@ -27,33 +27,34 @@ namespace gbrainy.Core.Main.Verbal
{
public abstract class Analogies : Game
{
- protected Analogy current;
+ public Analogy Current { get; set; }
public override string Question {
get {
- if (current == null)
+ if (Current == null)
return string.Empty;
- return current.question;
+ return Current.question;
}
}
public override string Tip {
get {
- if (current == null)
+ if (Current == null)
return null;
else
- return current.tip;
+ return Current.tip;
}
}
public override string AnswerText {
get {
string str;
- if (current == null || current.MultipleAnswers == false)
+ if (Current == null || Current.MultipleAnswers == false)
return base.AnswerText;
- str = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Possible correct answers are: {0}."), AnswerValue);
+ str = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Possible correct answers are: {0}."),
+ Answer.CorrectShow);
if (String.IsNullOrEmpty (Rationale))
return str;
@@ -65,34 +66,35 @@ namespace gbrainy.Core.Main.Verbal
public override string Rationale {
get {
- if (current == null)
+ if (Current == null)
return string.Empty;
- return current.rationale;
+ return Current.rationale;
}
}
- public override string AnswerValue {
- get {
- if (current == null || current.MultipleAnswers == false)
- return Answer.Correct;
-
- string [] items;
- string str = string.Empty;
-
- items = Answer.Correct.Split (AnalogiesFactory.Separator);
-
- for (int i = 0 ; i < items.Length; i++)
- {
- str += items [i].Trim ();
- if (i + 1 < items.Length) {
- // Translators: this the separator used when concatenating multiple possible answers for verbal analogies
- // For example: "Possible correct answers are: sleep, rest."
- str += ServiceLocator.Instance.GetService <ITranslations> ().GetString (", ");
- }
+ protected void SetAnswerCorrectShow ()
+ {
+ if (Current == null ||
+ Current.MultipleAnswers == false ||
+ String.IsNullOrEmpty (Answer.Correct))
+ return;
+
+ string [] items;
+ string str = string.Empty;
+
+ items = Answer.Correct.Split (AnalogiesFactory.Separator);
+
+ for (int i = 0 ; i < items.Length; i++)
+ {
+ str += items [i].Trim ();
+ if (i + 1 < items.Length) {
+ // Translators: this the separator used when concatenating multiple possible answers for verbal analogies
+ // For example: "Possible correct answers are: sleep, rest."
+ str += ServiceLocator.Instance.GetService <ITranslations> ().GetString (", ");
}
- return str;
}
+ Answer.CorrectShow = str;
}
public override GameTypes Type {
@@ -170,7 +172,6 @@ namespace gbrainy.Core.Main.Verbal
analogy.answers = answers;
}
}
-
return analogy;
}
}
diff --git a/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs b/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
index 2711ff8..8c650e4 100644
--- a/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
+++ b/src/Core/Main/Verbal/AnalogiesMultipleOptions.cs
@@ -47,17 +47,17 @@ namespace gbrainy.Core.Main.Verbal
get {
string str = string.Empty;
- if (current == null)
+ if (Current == null)
return string.Empty;
- if (current.answers == null)
- return current.question;
+ if (Current.answers == null)
+ return Current.question;
- for (int n = 0; n < current.answers.Length; n++)
+ for (int n = 0; n < Current.answers.Length; n++)
{
str+= GameAnswer.GetMultiOption (n);
- if (n +1 < current.answers.Length) {
+ if (n +1 < Current.answers.Length) {
// Translators: this the separator used when concatenating possible options for answering verbal analogies
// For example: "Possible correct answers are: a, b, c, d."
str += ServiceLocator.Instance.GetService <ITranslations> ().GetString (", ");
@@ -67,7 +67,7 @@ namespace gbrainy.Core.Main.Verbal
// Translators: {0} is replaced by a question and {1} by the suggestions on how to answer
// E.g: What is the correct option? Answer A, B, C.
return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} Answer {1}."),
- current.question,
+ Current.question,
str);
}
}
@@ -78,17 +78,17 @@ namespace gbrainy.Core.Main.Verbal
protected override void Initialize ()
{
- current = GetNext ();
+ Current = GetNext ();
- if (current == null || current.answers == null)
+ if (Current == null || Current.answers == null)
return;
- Answer.Correct = GameAnswer.GetMultiOption (current.right);
+ Answer.Correct = GameAnswer.GetMultiOption (Current.right);
- Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, current.answers.Length * 0.15);
+ Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, Current.answers.Length * 0.15);
AddWidget (container);
- for (int i = 0; i < current.answers.Length; i++)
+ for (int i = 0; i < Current.answers.Length; i++)
{
DrawableArea drawable_area = new DrawableArea (0.8, 0.1);
drawable_area.X = DrawAreaX;
@@ -102,16 +102,17 @@ namespace gbrainy.Core.Main.Verbal
int n = (int) e.Data;
e.Context.MoveTo (0.05, 0.02);
- e.Context.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0}) {1}"), GameAnswer.GetMultiOption (n), current.answers[n].ToString ()));
+ e.Context.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0}) {1}"), GameAnswer.GetMultiOption (n), Current.answers[n].ToString ()));
};
}
+ SetAnswerCorrectShow ();
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
{
base.Draw (gr, area_width, area_height, rtl);
- if (current == null || current.answers == null)
+ if (Current == null || Current.answers == null)
return;
gr.SetPangoLargeFontSize ();
diff --git a/src/Core/Main/Verbal/AnalogiesPairOfWordsCompare.cs b/src/Core/Main/Verbal/AnalogiesPairOfWordsCompare.cs
index c5d2bb9..5962b23 100644
--- a/src/Core/Main/Verbal/AnalogiesPairOfWordsCompare.cs
+++ b/src/Core/Main/Verbal/AnalogiesPairOfWordsCompare.cs
@@ -47,11 +47,11 @@ namespace gbrainy.Core.Main.Verbal
public override string Question {
get {
- if (current == null)
+ if (Current == null)
return string.Empty;
- if (current.answers == null)
- return current.question;
+ if (Current.answers == null)
+ return Current.question;
return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString (
"Given the relationship between the two words below, which word has the same relationship to '{0}'?"),
@@ -61,14 +61,14 @@ namespace gbrainy.Core.Main.Verbal
protected override void Initialize ()
{
- current = GetNext ();
+ Current = GetNext ();
- if (current == null || current.answers == null)
+ if (Current == null || Current.answers == null)
return;
string [] items;
- items = current.question.Split (AnalogiesFactory.Separator);
+ items = Current.question.Split (AnalogiesFactory.Separator);
if (items.Length == 2)
sample = items [1].Trim ();
@@ -76,7 +76,8 @@ namespace gbrainy.Core.Main.Verbal
sample = string.Empty;
samples = items [0].Trim ();
- Answer.Correct = current.answers [current.right];
+ Answer.Correct = Current.answers [Current.right];
+ SetAnswerCorrectShow ();
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
@@ -85,7 +86,7 @@ namespace gbrainy.Core.Main.Verbal
base.Draw (gr, area_width, area_height, rtl);
- if (current == null || current.answers == null)
+ if (Current == null || Current.answers == null)
return;
gr.SetPangoLargeFontSize ();
diff --git a/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs b/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
index c876e71..78f6c83 100644
--- a/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
+++ b/src/Core/Main/Verbal/AnalogiesPairOfWordsOptions.cs
@@ -48,17 +48,17 @@ namespace gbrainy.Core.Main.Verbal
get {
string str = string.Empty;
- if (current == null)
+ if (Current == null)
return string.Empty;
- if (current.answers == null)
- return current.question;
+ if (Current.answers == null)
+ return Current.question;
- for (int n = 0; n < current.answers.Length; n++)
+ for (int n = 0; n < Current.answers.Length; n++)
{
str+= GameAnswer.GetMultiOption (n);
- if (n +1 < current.answers.Length) {
+ if (n +1 < Current.answers.Length) {
// Translators: this the separator used when concatenating possible options for answering verbal analogies
// For example: "Possible correct answers are: a, b, c, d."
str += ServiceLocator.Instance.GetService <ITranslations> ().GetString (", ");
@@ -73,14 +73,14 @@ namespace gbrainy.Core.Main.Verbal
protected override void Initialize ()
{
- current = GetNext ();
+ Current = GetNext ();
- if (current == null || current.answers == null)
+ if (Current == null || Current.answers == null)
return;
string [] items;
- items = current.question.Split (AnalogiesFactory.Separator);
+ items = Current.question.Split (AnalogiesFactory.Separator);
if (items.Length == 2)
sample = items [1].Trim ();
@@ -89,12 +89,12 @@ namespace gbrainy.Core.Main.Verbal
samples = items [0].Trim ();
- Answer.Correct = GameAnswer.GetMultiOption (current.right);
+ Answer.Correct = GameAnswer.GetMultiOption (Current.right);
- Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, current.answers.Length * 0.15);
+ Container container = new Container (DrawAreaX + 0.1, 0.50, 0.5, Current.answers.Length * 0.15);
AddWidget (container);
- for (int i = 0; i < current.answers.Length; i++)
+ for (int i = 0; i < Current.answers.Length; i++)
{
DrawableArea drawable_area = new DrawableArea (0.8, 0.1);
drawable_area.X = DrawAreaX;
@@ -107,18 +107,18 @@ namespace gbrainy.Core.Main.Verbal
{
int n = (int) e.Data;
- //e.Context.SetPangoLargeFontSize ();
e.Context.MoveTo (0.05, 0.02);
- e.Context.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0}) {1}"), GameAnswer.GetMultiOption (n), current.answers[n].ToString ()));
+ e.Context.ShowPangoText (String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0}) {1}"), GameAnswer.GetMultiOption (n), Current.answers[n].ToString ()));
};
}
+ SetAnswerCorrectShow ();
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
{
double y = DrawAreaY;
- if (current == null || current.answers == null || current.answers.Length <= 1)
+ if (Current == null || Current.answers == null || Current.answers.Length <= 1)
return;
base.Draw (gr, area_width, area_height, rtl);
diff --git a/src/Core/Main/Verbal/AnalogiesQuestionAnswer.cs b/src/Core/Main/Verbal/AnalogiesQuestionAnswer.cs
index 0ded272..57ef914 100644
--- a/src/Core/Main/Verbal/AnalogiesQuestionAnswer.cs
+++ b/src/Core/Main/Verbal/AnalogiesQuestionAnswer.cs
@@ -44,13 +44,15 @@ namespace gbrainy.Core.Main.Verbal
protected override void Initialize ()
{
- current = GetNext ();
+ Current = GetNext ();
- if (current == null)
+ if (Current == null)
return;
- if (current.answers != null)
- Answer.Correct = current.answers [current.right];
+ if (Current.answers != null)
+ Answer.Correct = Current.answers [Current.right];
+
+ SetAnswerCorrectShow ();
}
}
}
diff --git a/src/Core/Main/Xml/GameXml.cs b/src/Core/Main/Xml/GameXml.cs
index 001dbda..2e4d482 100644
--- a/src/Core/Main/Xml/GameXml.cs
+++ b/src/Core/Main/Xml/GameXml.cs
@@ -52,17 +52,17 @@ namespace gbrainy.Core.Main.Xml
DefinitionLocator current;
GameXmlDefinition game;
- string question, answer, rationale, answer_value;
+ string question, answer, rationale, answer_show;
List <OptionDrawingObject> options;
+
+ void SetAnswerCorrectShow ()
+ {
+
+ if (String.IsNullOrEmpty (answer_show))
+ return;
- public override string AnswerValue {
- get {
- if (String.IsNullOrEmpty (answer_value))
- return base.AnswerValue;
-
- return answer_value;
- }
+ Answer.CorrectShow = answer_show;
}
static public List <GameXmlDefinition> Definitions {
@@ -188,16 +188,16 @@ namespace gbrainy.Core.Main.Xml
rationale = CatalogGetString (game.Rationale);
if (variants && game.Variants[current.Variant].AnswerShow != null)
- answer_value = CatalogGetString (game.Variants[current.Variant].AnswerShow);
+ answer_show = CatalogGetString (game.Variants[current.Variant].AnswerShow);
else
- answer_value = CatalogGetString (game.AnswerShow);
+ answer_show = CatalogGetString (game.AnswerShow);
if (String.IsNullOrEmpty (variables) == false)
{
question = CodeEvaluation.ReplaceVariables (question);
rationale = CodeEvaluation.ReplaceVariables (rationale);
answer = CodeEvaluation.ReplaceVariables (answer);
- answer_value = CodeEvaluation.ReplaceVariables (answer_value);
+ answer_show = CodeEvaluation.ReplaceVariables (answer_show);
}
if (options != null && options.Count > 0)
@@ -228,7 +228,8 @@ namespace gbrainy.Core.Main.Xml
}
SetCheckExpression ();
- SetCheckAttributes ();
+ SetCheckAttributes ();
+ SetAnswerCorrectShow ();
}
void CreateDrawingObjects (GameXmlDefinitionVariant game)
@@ -388,6 +389,7 @@ namespace gbrainy.Core.Main.Xml
SetCheckExpression ();
SetCheckAttributes ();
+ SetAnswerCorrectShow ();
}
}
diff --git a/src/Games/Calculation/CalculationOperator.cs b/src/Games/Calculation/CalculationOperator.cs
index c3a0626..2db6fc5 100644
--- a/src/Games/Calculation/CalculationOperator.cs
+++ b/src/Games/Calculation/CalculationOperator.cs
@@ -47,10 +47,6 @@ namespace gbrainy.Games.Calculation
get {return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("Which operators make {0}, {1}, and {2} equal {3}? Answer using '+-/*'."), number_a, number_b, number_c, total);}
}
- public override string AnswerValue {
- get { return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), oper1, oper2); }
- }
-
private double ProcessOperation (double total, double number, char op)
{
switch (op) {
@@ -111,6 +107,7 @@ namespace gbrainy.Games.Calculation
Answer.Correct = String.Format ("{0} | {1}", oper1, oper2);
Answer.CheckExpression = "[+*-/]";
Answer.CheckAttributes = GameAnswerCheckAttributes.Trim | GameAnswerCheckAttributes.MatchAll;
+ Answer.CorrectShow = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), oper1, oper2);
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
diff --git a/src/Games/Calculation/CalculationRatio.cs b/src/Games/Calculation/CalculationRatio.cs
index ce74a24..3795c1d 100644
--- a/src/Games/Calculation/CalculationRatio.cs
+++ b/src/Games/Calculation/CalculationRatio.cs
@@ -55,10 +55,6 @@ namespace gbrainy.Games.Calculation
get { return ServiceLocator.Instance.GetService <ITranslations> ().GetString ("A ratio specifies a proportion between two numbers. A ratio a:b means that for every 'a' parts you have 'b' parts.");}
}
- public override string AnswerValue {
- get { return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), number_a, number_b); }
- }
-
protected override void Initialize ()
{
int random_max;
@@ -88,6 +84,7 @@ namespace gbrainy.Games.Calculation
Answer.Correct = String.Format ("{0} | {1}", number_a, number_b);
Answer.CheckExpression = "[0-9]+";
Answer.CheckAttributes = GameAnswerCheckAttributes.Trim | GameAnswerCheckAttributes.MatchAll;
+ Answer.CorrectShow = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), number_a, number_b);
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
diff --git a/src/Games/Calculation/CalculationTwoNumbers.cs b/src/Games/Calculation/CalculationTwoNumbers.cs
index ec16230..8825149 100644
--- a/src/Games/Calculation/CalculationTwoNumbers.cs
+++ b/src/Games/Calculation/CalculationTwoNumbers.cs
@@ -58,10 +58,6 @@ namespace gbrainy.Games.Calculation
}
}
- public override string AnswerValue {
- get { return String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), number_a, number_b); }
- }
-
protected override void Initialize ()
{
Answer.CheckAttributes = GameAnswerCheckAttributes.Trim | GameAnswerCheckAttributes.MatchAll;
@@ -102,6 +98,7 @@ namespace gbrainy.Games.Calculation
op2 = number_a * number_b;
Answer.Correct = String.Format ("{0} | {1}", number_a, number_b);
Answer.CheckExpression = "[-0-9]+";
+ Answer.CorrectShow = String.Format (ServiceLocator.Instance.GetService <ITranslations> ().GetString ("{0} and {1}"), number_a, number_b);
}
public override void Draw (CairoContextEx gr, int area_width, int area_height, bool rtl)
diff --git a/src/Games/Logic/PuzzleBuildTriangle.cs b/src/Games/Logic/PuzzleBuildTriangle.cs
index c6201bc..1cffb00 100644
--- a/src/Games/Logic/PuzzleBuildTriangle.cs
+++ b/src/Games/Logic/PuzzleBuildTriangle.cs
@@ -61,10 +61,6 @@ namespace gbrainy.Games.Logic
get { return ServiceLocator.Instance.GetService <ITranslations> ().GetString ("The resulting triangle is isosceles.");}
}
- public override string AnswerValue {
- get { return answers[0] + answers[1] + answers[2]; }
- }
-
protected override void Initialize ()
{
switch (CurrentDifficulty) {
@@ -101,6 +97,7 @@ namespace gbrainy.Games.Logic
Answer.Correct = answers[0] + " | " + answers[1] + " | " + answers[2];
Answer.CheckExpression = Answer.GetMultiOptionsExpression ();
Answer.CheckAttributes = GameAnswerCheckAttributes.Trim | GameAnswerCheckAttributes.IgnoreCase | GameAnswerCheckAttributes.MatchAll;
+ Answer.CorrectShow = answers[0] + answers[1] + answers[2];
}
private static void DrawFigure (CairoContextEx gr, double x, double y, Figures figure)
diff --git a/src/Games/Logic/PuzzleFigureLetter.cs b/src/Games/Logic/PuzzleFigureLetter.cs
index ea371b3..d20e8d9 100644
--- a/src/Games/Logic/PuzzleFigureLetter.cs
+++ b/src/Games/Logic/PuzzleFigureLetter.cs
@@ -54,21 +54,6 @@ namespace gbrainy.Games.Logic
}
}
- public override string AnswerValue {
- get {
- switch (question) {
- case QuestionType.TwoSquares:
- return "ABF";
- case QuestionType.TwoCercles:
- return "CDF";
- case QuestionType.ThreeCercles:
- return "ACE";
- default:
- throw new InvalidOperationException ();
- }
- }
- }
-
protected override void Initialize ()
{
question = (QuestionType) random.Next ((int) QuestionType.Length);
@@ -76,12 +61,15 @@ namespace gbrainy.Games.Logic
switch (question) {
case QuestionType.TwoSquares:
Answer.Correct = "A | B | F";
+ Answer.CorrectShow = "ABF";
break;
case QuestionType.TwoCercles:
Answer.Correct = "C | D | F";
+ Answer.CorrectShow = "CDF";
break;
case QuestionType.ThreeCercles:
Answer.Correct = "A | C | E";
+ Answer.CorrectShow = "ACE";
break;
default:
throw new InvalidOperationException ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]