Example #1
0
        protected void GoToPart3Button_Click(object sender, EventArgs e)
        {
            DataView dv = (DataView)ReadingTextSqlDataSource.Select(DataSourceSelectArguments.Empty);

            ReadingTextTitle.Text = dv.Table.Rows[0]["Title"].ToString();
            ReadingTextId         = Int32.Parse(dv.Table.Rows[0]["Id"].ToString());

            StudentReadingAnswerSqlDataSource.Delete();

            StudentExamReading = (DataView)StudentReadingAnswerSqlDataSource.Select(DataSourceSelectArguments.Empty);


            if (StudentExamReading.Table.Rows.Count == 0)
            {
                dv = (DataView)ExamQuestionsSqlDataSource.Select(DataSourceSelectArguments.Empty);
                foreach (DataRow row in dv.Table.Rows)
                {
                    QuestionOrder = Int32.Parse(row["RowNumber"].ToString());
                    QuestionId    = Int32.Parse(row["Id"].ToString());
                    StudentReadingAnswerSqlDataSource.Insert();
                }
                StudentExamReading = (DataView)StudentReadingAnswerSqlDataSource.Select(DataSourceSelectArguments.Empty);
            }

            ButtonsRepeater.DataSource = StudentExamReading;
            ButtonsRepeater.DataBind();
            QuestionsRepeater.DataSource = StudentExamReading;
            QuestionsRepeater.DataBind();
            ShowQuestion(1);
            ActivateWizardStep(3);
            SetVisiblePanel(TestPanels.Part3Panel);
        }