示例#1
0
        /// <summary>
        /// Clones the current option.
        /// </summary>
        /// <param name="newIdQuestion">The new question Id.</param>
        /// <returns>The id of the cloned option.</returns>
        public int Clone(int newIdQuestion)
        {
            ExamOption clonedOption = new ExamOption();

            clonedOption.IdQuestion = newIdQuestion;
            clonedOption.OptionText = OptionText;
            clonedOption.Points     = Points;
            clonedOption.Create();
            return(clonedOption.IdOption);
        }
示例#2
0
        /// <summary>
        /// Gathers all options and saves them in memory.
        /// </summary>
        public void GatherOptions()
        {
            options = new List <ExamOption>();
            List <Dictionary <string, string> > option = Common.GetRS("SELECT * FROM ExamOption WHERE IdQuestion = " + IdQuestion);

            foreach (Dictionary <string, string> record in option)
            {
                ExamOption examOption = new ExamOption(Convert.ToInt32(record["IdOption"]));
                options.Add(examOption);
            }
        }
示例#3
0
 /// <summary>
 /// Gathers all options and saves them in memory.
 /// </summary>
 public void GatherOptions()
 {
     options = new List<ExamOption>();
     List<Dictionary<string, string>> option = Common.GetRS("SELECT * FROM ExamOption WHERE IdQuestion = " + IdQuestion);
     foreach (Dictionary<string, string> record in option)
     {
         ExamOption examOption = new ExamOption(Convert.ToInt32(record["IdOption"]));
         options.Add(examOption);
     }
 }
示例#4
0
 /// <summary>
 /// Clones the current option.
 /// </summary>
 /// <param name="newIdQuestion">The new question Id.</param>
 /// <returns>The id of the cloned option.</returns>
 public int Clone(int newIdQuestion)
 {
     ExamOption clonedOption = new ExamOption();
     clonedOption.IdQuestion = newIdQuestion;
     clonedOption.OptionText = OptionText;
     clonedOption.Points = Points;
     clonedOption.Create();
     return clonedOption.IdOption;
 }