Beispiel #1
0
        protected override async Task OnStart()
        {
            TutorRole = await Constants.Role.Tutor();

            if (!IsPostBack)
            {
                if (Session["QuestionObjectId"] != null)
                {
                    Question = await Question.GetFullQuestionById(Session["QuestionObjectId"].ToString());

                    FillWithQuestionInfo();
                }
                else
                {
                    cbInBundle.Enabled        = true;
                    pnlExtraQuestions.Visible = true;
                }
            }
        }
        protected void grdQuestions_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "View")
            {
                SelectedQuestionId = e.CommandArgument.ToString();
                Question question = AsyncHelpers.RunSync <Question>(() => Question.GetFullQuestionById(SelectedQuestionId));
                if (question.InBundle)
                {
                    pnlBundle.Visible = true;
                    Image1.ImageUrl   = question.Bundle.Image == null ? "" : question.Bundle.Image.Url.ToString();
                    lbBundleText.Text = question.Bundle.PassageText;
                }
                else
                {
                    pnlBundle.Visible = false;
                }
                QuestionBlock questionBlock = (QuestionBlock)LoadControl("~/UserControls/QuestionBlock.ascx");
                questionBlock.FillContents(question);
                pnlQuestions.Controls.Add(questionBlock);

                popup.Show();
            }
        }