Exemple #1
0
 public AmericanQuestionData(AmericanQuestionData aq) : base(aq)
 {
     this.correctAnswer = aq.correctAnswer;
     this.firstAnswer   = aq.firstAnswer;
     this.secondAnswer  = aq.secondAnswer;
     this.thirdAnswer   = aq.thirdAnswer;
     this.fourthAnswer  = aq.fourthAnswer;
     this.counterFirst  = 0;
     this.counterSecond = 0;
     this.counterThird  = 0;
     this.counterFourth = 0;
 }
 public AmericanLogData(AmericanQuestionData aq, DateTime d) : base(aq, d)
 {
     this.correctAnswer = aq.correctAnswer;
     this.firstAnswer = aq.firstAnswer;
     this.secondAnswer = aq.secondAnswer;
     this.thirdAnswer = aq.thirdAnswer;
     this.fourthAnswer = aq.fourthAnswer;
     this.counterFirst = aq.counterFirst;
     this.counterSecond = aq.counterSecond;
     this.counterThird = aq.counterThird;
     this.counterFourth = aq.counterFourth;
 }
 public AmericanQuestionData(AmericanQuestionData aq) : base(aq)
 {
     this.correctAnswer = aq.correctAnswer;
     this.firstAnswer = aq.firstAnswer;
     this.secondAnswer = aq.secondAnswer;
     this.thirdAnswer = aq.thirdAnswer;
     this.fourthAnswer = aq.fourthAnswer;
     this.counterFirst = 0;
     this.counterSecond = 0;
     this.counterThird = 0;
     this.counterFourth = 0;
 }
 public AmericanLogData(AmericanQuestionData aq, DateTime d) : base(aq, d)
 {
     this.correctAnswer = aq.correctAnswer;
     this.firstAnswer   = aq.firstAnswer;
     this.secondAnswer  = aq.secondAnswer;
     this.thirdAnswer   = aq.thirdAnswer;
     this.fourthAnswer  = aq.fourthAnswer;
     this.counterFirst  = aq.counterFirst;
     this.counterSecond = aq.counterSecond;
     this.counterThird  = aq.counterThird;
     this.counterFourth = aq.counterFourth;
 }
        public ExperimentData(ExperimentData exp) : base(exp)
        {
            this.expID = -1;
            this.ExperimentQuestion = exp.ExperimentQuestion;
            this.Type = "Experiment";
            RoadScholarContext rsContext = new RoadScholarContext();

            this.activities = new List <ActivityData>();
            foreach (ActivityData act in exp.activities)
            {
                ActivityData copiedActivity = null;
                if (act is TrueFalseQuestionData)
                {
                    copiedActivity = new TrueFalseQuestionData((TrueFalseQuestionData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is AmericanQuestionData)
                {
                    copiedActivity = new AmericanQuestionData((AmericanQuestionData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is ShortAnswerQuestionData)
                {
                    copiedActivity = new ShortAnswerQuestionData((ShortAnswerQuestionData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is InstructionData)
                {
                    copiedActivity = new InstructionData((InstructionData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is ImageData)
                {
                    copiedActivity = new ImageData((ImageData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is VideoData)
                {
                    copiedActivity = new VideoData((VideoData)act);
                    rsContext.addActivity(copiedActivity);
                }
                else if (act is MeasurementData)
                {
                    copiedActivity = new MeasurementData((MeasurementData)act);
                    rsContext.addActivity(copiedActivity);
                }
                this.activities.Add(copiedActivity);
            }
        }
 public ExperimentData(ExperimentData exp) : base(exp)
 {
     this.expID = -1;
     this.ExperimentQuestion = exp.ExperimentQuestion;
     this.Type = "Experiment";
     RoadScholarContext rsContext = new RoadScholarContext();
     this.activities = new List<ActivityData>();
     foreach (ActivityData act in exp.activities)
     {
         ActivityData copiedActivity = null;
         if (act is TrueFalseQuestionData)
         {
             copiedActivity = new TrueFalseQuestionData((TrueFalseQuestionData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is AmericanQuestionData)
         {
             copiedActivity = new AmericanQuestionData((AmericanQuestionData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is ShortAnswerQuestionData)
         {
             copiedActivity = new ShortAnswerQuestionData((ShortAnswerQuestionData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is InstructionData)
         {
             copiedActivity = new InstructionData((InstructionData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is ImageData)
         {
             copiedActivity = new ImageData((ImageData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is VideoData)
         {
             copiedActivity = new VideoData((VideoData)act);
             rsContext.addActivity(copiedActivity);
         }
         else if (act is MeasurementData)
         {
             copiedActivity = new MeasurementData((MeasurementData)act);
             rsContext.addActivity(copiedActivity);
         }
         this.activities.Add(copiedActivity);
     }
 }
Exemple #7
0
        public static AmericanQuestion getAmericanQuestionFromData(AmericanQuestionData aqData)
        {
            AmericanQuestion aq = new AmericanQuestion();
            aq.ActivityName = aqData.ActivityName;
            aq.expID = aqData.expID;
            aq.id = aqData.id;
            aq.isMainActivity = aqData.isMainActivity;
            aq.RoomId = aqData.RoomId;
            aq.Type = aqData.Type;

            aq.question = aqData.question;
            aq.explaination = aqData.explaination;

            aq.counterFirst = aqData.counterFirst;
            aq.counterSecond = aqData.counterSecond;
            aq.counterThird = aqData.counterThird;
            aq.counterFourth = aqData.counterFourth;
            aq.correctAnswer = aqData.correctAnswer;

            aq.firstAnswer = aqData.firstAnswer;
            aq.secondAnswer = aqData.secondAnswer;
            aq.thirdAnswer = aqData.thirdAnswer;
            aq.fourthAnswer = aqData.fourthAnswer;

            aq.studentsAnswers = new List<AnswerByPhone>();
            if (aqData.studentsAnswers != null)
            {
                foreach (AnswerByPhoneData abpData in aqData.studentsAnswers)
                {
                    aq.studentsAnswers.Add(getAnswerByPhoneFromData(abpData));
                }
            }
            return aq;
        }