Пример #1
0
//		/// <summary>
//		/// 修改文字處理方塊的事件
//		/// </summary>
//		private void tb_TextChanged(object sender, EventArgs e)
//		{
//			string tmpQID = ((TextBox)sender).ID.Split('@')[1];//取得問題ID
//			TextBox tb = (TextBox)this.FindControl("Form1").FindControl("QuestionTextBox@" + tmpQID);
//			((QuestionAccessor)this.Page.Session["QuestionAccessor"]).modifyQuestionText(tmpQID,tb.Text);
//		}

        private Table getScriptCategorySelectionSelection()
        {
            Label scriptSelectionLabel = new Label();

            scriptSelectionLabel.Text = "<b>Please select a script category.</b>&nbsp;&nbsp;";

            DropDownList ddl = new DropDownList();

            ddl.ID                    = "ScriptCategorySelection@" + this.strQID;
            ddl.AutoPostBack          = true;
            ddl.SelectedIndexChanged += new EventHandler(ret_SelectedIndexChanged);
            DataTable dt = ((QuestionAccessor)this.Page.Session["QuestionAccessor"]).VocabularyCategoryIndex;

            ddl.Items.Add(new ListItem("Select a script category"));
            foreach (DataRow dr in dt.Rows)
            {
                ddl.Items.Add(new ListItem(dr["cVocabularyCategory"].ToString(), dr["cUsedUnitScriptID"].ToString()));
            }
//			DataRow[] drs = dt.Select("cUsedUnitScriptID = '"+dr["cUsedUnitScriptID"].ToString()+"'");
//			foreach(DataRow dr in drs)
//			{
//				dr["IsSelect"] = "N";
//			}
            Table container = CommonQuestionUtility.get_HTMLTable(1, 2);

            container.Rows[0].Cells[0].Controls.Add(scriptSelectionLabel);
            container.Rows[0].Cells[0].Controls.Add(ddl);
            return(container);
        }
Пример #2
0
        /// <summary>
        /// 建構本身的HTML Table
        /// </summary>
        /// <param name="QuestionItemDataTable"></param>
        private void constructQuestionItemTable()
        {
            if (this.Question_Edit_Type == "Script_Question")
            {
                this.Rows.Add(new TableRow());
                this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell());
                this.Rows[this.Rows.Count - 1].Cells[0].Wrap            = false;
                this.Rows[this.Rows.Count - 1].Cells[0].HorizontalAlign = HorizontalAlign.Center;
                this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(getScriptCategorySelectionSelection());
            }

            this.Rows.Add(new TableRow());
            this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell());
            this.Rows[this.Rows.Count - 1].Cells[0].Wrap          = false;
            this.Rows[this.Rows.Count - 1].Cells[0].VerticalAlign = VerticalAlign.Middle;

            Table controlContainer = CommonQuestionUtility.get_HTMLTable(1, 3);

            controlContainer.BorderWidth = Unit.Pixel(2);
            controlContainer.BorderColor = Color.Purple;
            controlContainer.GridLines   = GridLines.Both;
            controlContainer.Width       = Unit.Parse("100%");
            this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(controlContainer);

            //增加Button
            addQuestionLabel(0);
            addQuestionTextBox(1);
            addButtonControl(2);
            setTableStyle();
            addSelections_SubQuestion();
            //朱君 暫時拿掉LEVEL和分數功能 2013/1/2
            //addQuestionLevel();
            //addQuestionGrade();
        }
Пример #3
0
        /// <summary>
        /// 建構本身的HTML Table
        /// </summary>
        /// <param name="QuestionItemDataTable"></param>
        private void constructSelectionItemTable()
        {
            this.Rows.Add(new TableRow());
            this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell());
            this.Rows[this.Rows.Count - 1].Cells[0].Wrap          = false;
            this.Rows[this.Rows.Count - 1].Cells[0].VerticalAlign = VerticalAlign.Middle;
            Table controlContainer = CommonQuestionUtility.get_HTMLTable(2, 4);

            if (intNumber > 0)
            {
                controlContainer.Rows[0].Visible = false;
            }
            controlContainer.BorderWidth = Unit.Pixel(2);
            controlContainer.BorderColor = Color.Purple;
            controlContainer.GridLines   = GridLines.Both;
            controlContainer.Width       = Unit.Parse("100%");
            this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(controlContainer);

            addSelectionLabel(0, 0);
            addSelectionResponseLabel(0, 1);
            addSelectionCorrectAnswerLabel(0, 2);
            if (intNumber > 0)
            {
                addButtonControl(1, 3);
            }
            else
            {
                addButtonControl(0, 3);
            }
            addSelectionTextBox(1, 0);
            addSelectionResponseTextBox(1, 1);
            addCheckBox(1, 2);

            addPlusImage(true);


            add_sub_question();
            setTableStyle();
        }
        /// <summary>
        /// 初始化要呈現給使用者設定特徵值的操作的介面
        /// </summary>
        private void InititateLayoutTableForFeature()
        {
            LayoutTableForFeature.ID = "LayoutTableForFeature";
            //第一列
            LayoutTableForFeature.Width = Unit.Parse("100%");
            //LayoutTable.BorderWidth = Unit.Parse("3px");
            //LayoutTable.BorderColor = Color.Green;
            LayoutTableForFeature.ID = "LayoutTableForFeature_1";
            LayoutTableForFeature.Rows.Add(new TableRow());
            LayoutTableForFeature.Rows[LayoutTableForFeature.Rows.Count - 1].Cells.Add(new TableCell());
            Label FeatureTitle = new Label();

            FeatureTitle.Text = "SetFeature";

            LayoutTableForFeature.Rows[LayoutTableForFeature.Rows.Count - 1].Cells[0].Controls.Add(FeatureTitle);
            LayoutTableForFeature.Rows[LayoutTableForFeature.Rows.Count - 1].Cells[0].CssClass = "title";

            //第二列
            LayoutTableForFeature.Rows.Add(new TableRow());
            LayoutTableForFeature.Rows[LayoutTableForFeature.Rows.Count - 1].Cells.Add(new TableCell());
            Table containerForFeature = CommonQuestionUtility.get_HTMLTable(1, 2);

            LayoutTableForFeature.Rows[LayoutTableForFeature.Rows.Count - 1].Cells[0].Controls.Add(containerForFeature);
        }
        /// <summary>
        /// 初始化要呈現給使用者操作的介面,因為使用者要操作的介面排版住要是利用LayoutTable來安排位置
        /// </summary>
        private void InititateLayoutTable()
        {
            //LayoutTable的設定
            //第一列
            LayoutTable.Width = Unit.Parse("100%");
            //LayoutTable.BorderWidth = Unit.Parse("3px");
            //LayoutTable.BorderColor = Color.Green;
            LayoutTable.ID = "LayoutTable_1";
            LayoutTable.Rows.Add(new TableRow());
            LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells.Add(new TableCell());
            Label Title = new Label();

            if (ViewState["TitleText"] == null)
            {
                if (this.Question_Edit_Type == "Choice_Question")
                {
                    ViewState["TitleText"] = usi.Section;
                }
                else
                {
                    ViewState["TitleText"] = "Question Editor";
                }
            }

            Title.Text = ViewState["TitleText"].ToString();
            //Title.Font.Size = FontUnit.Parse("25");
            //Title.ForeColor = Color.DarkRed;  // removed by dolphin @ 2006-07-28
            LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells[0].Controls.Add(Title);
            LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells[0].CssClass = "title";


            //第二列
            LayoutTable.Rows.Add(new TableRow());
            LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells.Add(new TableCell());
            Table container = CommonQuestionUtility.get_HTMLTable(1, 2);

            Label questionTypeLabel = new Label();

            questionTypeLabel.Text    = "<b>Question Type:&nbsp;</b>";
            questionTypeLabel.Visible = false;

            ////選擇編輯模式的下拉式選單
            //Question_Edit_Type_DDL = getQuestion_Edit_Type_DDL();


            //新增問題的Button
            Button btnNew = new Button();

            btnNew.BackColor = Color.FromName("#FF9933");
            btnNew.Width     = Unit.Pixel(140);
            btnNew.Text      = "Add New Question";
            btnNew.ID        = "NewItemButton_1";
            btnNew.Click    += new EventHandler(btnNew_Click);

            //container.Rows[container.Rows.Count-1].Cells[0].Controls.Add(questionTypeLabel);
            //container.Rows[container.Rows.Count-1].Cells[0].Controls.Add(Question_Edit_Type_DDL);
            container.Rows[container.Rows.Count - 1].Cells[1].Controls.Add(btnNew);
            container.Rows[container.Rows.Count - 1].Cells[1].Width = Unit.Parse("10%");

            LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells[0].Controls.Add(container);
        }