GetExercise(ExercicesRow data)
        {
            Exercise res;

            if ((data.IscodePhraseNull() || data.codePhrase == 0) &&
                (data.IscodeVerbeNull() || data.codeVerbe == 0))
            {
                // TODO
                // Les exos de vocabulaire, sont des exos pour lesquels il n'y a pas de
                // phrase, ni de n° de verbe et par contre des lignes resultant d'une jointure
                // avec la table ConcerneMots.
                res = new exoVocab(data);
            }
            else if (data.completeON)
            {
                res = new exoPhraseDesordre(data);
            }
            else if (!data.IslisteMotsNull())
            {
                res = new exoMissingWords(data);
            }
            else
            {
                res = null;     //TODO exo conjugaison ?
            }
            return(res);
        }
        exoMissingWords(ExercicesRow data) : base(data)
        {
            PhrasesRow sentence = (PhrasesRow)Phrases.Select("codePhrase = '" + data.codePhrase + "'")[0];

            lblSentence.Text = sentence.traducPhrase;
            _solution        = sentence.textePhrase;
            CreateChallenge(_solution, data.listeMots);
        }
 Exercise(ExercicesRow data)
 {
     UseWaitCursor = true;
     this.data     = data;
     InitializeComponent();
     lblHeader.Text = data.enonceExo;
     UseWaitCursor  = false;
 }
        exoVocab(ExercicesRow data) : base(data)
        {
            VocabCard card;

            MotsRow[] words = tblRelatedWords.Select(
                "numCours = '" + data.numCours + "' AND numLecon = '" + data.numLecon + "' AND numExo = '" + data.numExo + "'"
                ).Select(cm => tblWords[((ConcerneMotsRow)cm).numMot]).ToArray();
            foreach (MotsRow word in words)
            {
                card            = new VocabCard(word);
                card.CellPaint += new TableLayoutCellPaintEventHandler(CallUpdateStatus);
                flpChallenge.Controls.Add(card);
            }

            Width = (words.Length > 0) ? words.Length * (flpChallenge.Controls[0].Width + 20) : 0;
            rowSentence.Height = 0;
        }
        exoPhraseDesordre(ExercicesRow data) : base(data)
        {
            PhrasesRow sentence = (PhrasesRow)Phrases.Select("codePhrase = '" + data.codePhrase + "'")[0];

            lblSentence.Text = sentence.traducPhrase;
            flpSentence      = new FlowLayoutPanel()
            {
                BackColor = Color.FromArgb(229, 229, 229),
                Width     = flpChallenge.Width,
                //AutoSize	= true
            };
            flpSentence.ControlAdded   += new ControlEventHandler(CallUpdateStatus);
            flpSentence.ControlRemoved += new ControlEventHandler(CallUpdateStatus);
            flpChallenge.Controls.Add(flpSentence);
            _solution = sentence.textePhrase;
            CreateChallenge(_solution);
        }