/// <summary>
        /// 建構新的子問題
        /// </summary>
        public void add_sub_question(string new_Sub_QID)
        {
            QuestionItemControlTable sub_Question_Tb = new QuestionItemControlTable(this.Question_Edit_Type, this.author_UserID, new_Sub_QID, "", this.Page, this.intLevel + 1, hidenRecordDisplayItemID, strCaseID);

            if (recordDisplayItemID.IndexOf(this.ID + ";") == -1)
            {
                hidenRecordDisplayItemID.Value += this.ID + ";";
                this.recordDisplayItemID       += this.ID + ";";
            }
            if (this.Question_Edit_Type == "Script_Question" || this.Question_Edit_Type == "Interrogation_Enquiry")
            {
                sub_Question_Tb.addQuestionAnswer(this.Page);
            }
            this.Rows.Add(new TableRow());
            this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell());
            this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(sub_Question_Tb);
            if (this.recordDisplayItemID.IndexOf(this.ID + ";") != -1 && this.Question_Edit_Type != "Interrogation_Enquiry")
            {
                //表示使用者尚未點選,因此應該隱藏起來
                for (int j = 0; j < this.Rows.Count - 1; j++)
                {
                    this.Rows[j].Style.Add("DISPLAY", "");
                }
                ((TableRow)this.Parent.Parent).Style.Add("DISPLAY", "");
                SelectionLabel.Text = "&nbsp;<b>Selection</b></nobr>";
            }
        }
        private void newFirstLevelQuestion()
        {
            QuestionItemControlTable qItemControlTable = null;                    //QuestionItemControlTable
            string QID = CommonQuestionUtility.GetNewID(this.UserID, "Question"); //下面回圈所處理問題ID

            qItemControlTable = new QuestionItemControlTable(this.Question_Edit_Type, this.UserID, QID, "", this, 1, recordDisplayItemID, CaseID);
            this.LayoutTable.Rows.Add(new TableRow());
            this.LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells.Add(new TableCell());
            this.LayoutTable.Rows[LayoutTable.Rows.Count - 1].Cells[0].Controls.Add(qItemControlTable);
            this.qAccessor.add_New_Question(QID);
            qItemControlTable.addQuestionAnswer(this.Page);

            if ((Question_Edit_Type == "Group_Question" || Question_Edit_Type == "Choice_Question") && !Convert.ToBoolean(Session["bModify"]))
            {
                Session["CurrentEditQuestionNum"] = Convert.ToInt32(Session["totalQuestionNum"]);
            }
            Session["totalQuestionNum"] = Convert.ToInt32(Session["totalQuestionNum"]) + 1;
        }
Exemple #3
0
        /// <summary>
        /// 建構新的子問題
        /// </summary>
        public void add_sub_question(string new_Sub_QID)
        {
            QuestionItemControlTable sub_Question_Tb = new QuestionItemControlTable(this.Question_Edit_Type, this.author_UserID, new_Sub_QID, "", this.Page, this.intLevel + 1, hidenRecordDisplayItemID, this.strCaseID);

            if (recordDisplayItemID.IndexOf(this.ID + ";") == -1)
            {
                hidenRecordDisplayItemID.Value += this.ID + ";";
            }
            if (this.Question_Edit_Type == "Script_Question" || this.Question_Edit_Type == "Interrogation_Enquiry")
            {
                sub_Question_Tb.addQuestionAnswer(this.Page);
            }
            this.Rows.Add(new TableRow());
            this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell());
            this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(sub_Question_Tb);

            for (int i = 0; i < this.Rows.Count - 1; i++)
            {
                this.Rows[i].Style.Add("display", "");
            }
            string imgSrc = "/HINTS/AuthoringTool/CaseEditor/Paper/CommonQuestionEdit/Image/minus.gif";

            QuestionLabel.Text = "<nobr>&nbsp;<img style='cursor:hand;' onclick=\"displaySubQuestion('" + this.ID + "');\" src='" + imgSrc + "'>&nbsp;<b>Question:</b></nobr>";

//			if(this.recordDisplayItemID.IndexOf(this.ID+";")==-1 && this.Question_Edit_Type!="Interrogation_Enquiry")
//			{
//				//表示使用者尚未點選,因此應該隱藏起來
//				for(int j=0;j<this.Rows.Count-1;j++)
//				{
//					this.Rows[j].Style.Add("DISPLAY","");
//				}
//				((TableRow)this.Parent.Parent).Style.Add("DISPLAY","");
//				string imgSrc = "../image/minus.gif";
//				SelectionLabel.Text = "<nobr>&nbsp;<img style='cursor:hand;' onclick=\"displaySubQuestion('"+this.ID+"');\" src='"+imgSrc+"'>&nbsp;<b>Selection:</b></nobr>";
//			}
        }