Ejemplo n.º 1
0
        public void GenerateExam(Int64 QuestionLimit, Int64 ItemsLimit, ClsApplicant Obj_Applicant, Int64 CategoryID)
        {
            this.mObj_Applicant = Obj_Applicant;

            DataSet Ds = this.mEm.GenerateExam(QuestionLimit, CategoryID);
            this.mDs = Ds;
            this.mDt_Question = Ds.Tables[0];
            this.mDt_Question_Answer = Ds.Tables[1];

            this.mDt_Question.Columns.Add("Ct", typeof(Int64));
            this.mDt_Question.Columns.Add("IsCorrect", typeof(bool));
            Int64 Ct = 0;
            foreach (DataRow Dr in this.mDt_Question.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            this.mDt_Question_Answer.Columns.Add("Ct", typeof(Int64));
            this.mDt_Question_Answer.Columns.Add("IsAnswered", typeof(bool));
            Ct = 0;
            foreach (DataRow Dr in this.mDt_Question_Answer.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            //[-]

            this.mItemsLimit = ItemsLimit;
            this.mItems = this.mDt_Question.Rows.Count;

            this.mPages = this.mItems / this.mItemsLimit;
            if (this.mItems % this.mItemsLimit > 0)
            { this.mPages++; }

            this.mCategoryID = CategoryID;

            //[-]

            this.mDateStart = DateTime.Now;
        }
Ejemplo n.º 2
0
        public void LoadExam(Int64 ExamID, Int64 ItemsLimit)
        {
            DataTable Dt_Exam = Do_Methods_Query.GetQuery("RecruitmentTestExams", "", "RecruitmentTestExamsID = " + ExamID);
            Int64 ApplicantID = 0;
            if (Dt_Exam.Rows.Count > 0)
            {
                this.mDr_Exam = Dt_Exam.Rows[0];
                ApplicantID = Convert.ToInt64(Do_Methods.IsNull(this.mDr_Exam["RecruitmentTestApplicantID"], 0));
            }
            else
            { throw new Exception("Exam Data not found."); }

            Keys Key = new Keys();
            Key.Add("RecruitmentTestApplicantID", ApplicantID);

            this.mObj_Applicant = new ClsApplicant();
            this.mObj_Applicant.Load(Key);

            DataSet Ds = this.mEm.LoadExam(ExamID);
            this.mDs = Ds;
            this.mDt_Question = Ds.Tables[0];
            this.mDt_Question_Answer = Ds.Tables[1];

            this.mDt_Question.Columns.Add("Ct", typeof(Int64));
            Int64 Ct = 0;
            foreach (DataRow Dr in this.mDt_Question.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            this.mDt_Question_Answer.Columns.Add("Ct", typeof(Int64));
            Ct = 0;
            foreach (DataRow Dr in this.mDt_Question_Answer.Rows)
            {
                Ct++;
                Dr["Ct"] = Ct;
            }

            this.mItemsLimit = ItemsLimit;
            this.mItems = this.mDt_Question.Rows.Count;

            this.mPages = this.mItems / this.mItemsLimit;
            if (this.mItems % this.mItemsLimit > 0)
            { this.mPages++; }
        }