/// <summary> /// 增加問題選項 /// </summary> /// <param name="selectionID">選項ID</param> public void addSelection(string new_SelectionID) { DataRow[] drs = getSelectionDataRow(); SelectionItemControlTable selection_Tb = new SelectionItemControlTable(this.Question_Edit_Type, this.author_UserID, this.strQID, new_SelectionID, "", "", false, this.Page, this.intLevel, hidenRecordDisplayItemID, drs.Length - 1, this.strCaseID); if (recordDisplayItemID.IndexOf(this.ID + ";") == -1) { hidenRecordDisplayItemID.Value += this.ID + ";"; } if (this.Question_Edit_Type == "Script_Question") { Table container = ((Table)this.Rows[1].Cells[0].Controls[0]); container.Rows[0].Cells[2].Controls.Add(selection_Tb.add_Sub_Question_Btn); selection_Tb.add_Sub_Question_Btn.Height = Unit.Pixel(27); } //selection_Tb.Style.Add("display",""); 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(selection_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> <img style='cursor:hand;' onclick=\"displaySubQuestion('" + this.ID + "');\" src='" + imgSrc + "'> <b>Question:</b></nobr>"; }
/// <summary> /// 加入問題選項或問題的子問題 /// </summary> public void addSelections_SubQuestion() { string follow_up_ID = ""; //ID string follow_up_Text = ""; //內容 string follow_up_Response_Text = ""; //Response bool bIs_Selection_Correct; //選項正確與否 DataRow[] drs = getSelectionDataRow(); SelectionItemControlTable selection_Tb = null; QuestionItemControlTable question_Tb = null; for (int i = 0; i < drs.Length; i++) { follow_up_ID = drs[i]["cSelectionID"].ToString(); follow_up_Text = drs[i]["cSelection"].ToString(); follow_up_Response_Text = drs[i]["cResponse"].ToString(); if (drs[i]["bCaseSelect"] != System.DBNull.Value) { //因為bCaseSelect不是Null,因此表示為問題的選項 bIs_Selection_Correct = Convert.ToBoolean(drs[i]["bCaseSelect"]); selection_Tb = new SelectionItemControlTable(this.Question_Edit_Type, this.author_UserID, this.strQID, follow_up_ID, follow_up_Text, follow_up_Response_Text, bIs_Selection_Correct, this.Page, this.intLevel + 1, hidenRecordDisplayItemID, i, this.strCaseID); if (this.Question_Edit_Type == "Script_Question") { set_recordDisplayItemID(follow_up_ID, "Selection"); Table container = ((Table)this.Rows[1].Cells[0].Controls[0]); container.Rows[0].Cells[2].Controls.Add(selection_Tb.add_Sub_Question_Btn); selection_Tb.add_Sub_Question_Btn.Height = Unit.Pixel(27); } this.Rows.Add(new TableRow()); if (this.recordDisplayItemID.IndexOf(this.ID + ";") == -1) { set_recordDisplayItemID(follow_up_ID, "Question"); //表示使用者尚未點選,因此應該隱藏起來 //若不是問診編輯類型,則也將答案部分隱藏起來 this.Rows[this.Rows.Count - 1].Style.Add("DISPLAY", "none"); } this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell()); this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(selection_Tb); } else { //因為bCaseSelect為Null,因此表示為問題的子問題 question_Tb = new QuestionItemControlTable(this.Question_Edit_Type, this.author_UserID, follow_up_ID, follow_up_Text, this.Page, this.intLevel + 1, this.hidenRecordDisplayItemID, this.strCaseID); this.Rows.Add(new TableRow()); if (this.recordDisplayItemID.IndexOf(this.ID + ";") == -1 && this.Question_Edit_Type != "Interrogation_Enquiry") { //表示使用者尚未點選,因此應該隱藏起來 this.Rows[this.Rows.Count - 1].Style.Add("DISPLAY", "none"); } this.Rows[this.Rows.Count - 1].Cells.Add(new TableCell()); this.Rows[this.Rows.Count - 1].Cells[0].Controls.Add(question_Tb); } } }