/// <summary> /// 建立選項區域 /// </summary> private void setupPresentationSelection() { clsPresentTable myTable = new clsPresentTable(); Table table = new Table(); tdSelect.Controls.Add(table); //Switch myTable.getSwitchSelectionTable(table, strPaperID); //Mark myTable.getMarkSelectionTable(table, strPaperID); //Modify myTable.getModifySelectionTable(table, strPaperID); //Assign method myTable.getAssignSelectionTable(table, strPaperID); //Random select myTable.getRandomSelectionSelectionTable(table, strPaperID); //Test Duration myTable.getTestDurationTable(table, strPaperID); //顯示正確答案 myTable.getCorrectAnswerTable(table, strPaperID); //Present method myTable.getPresentMethodSelectionTable(table, strPaperID, strCaseID, Convert.ToInt32(strClinicNum), strSectionName); //重作機制設定 myTable.getAnsProcess(table, strPaperID, strCaseID); //Table Driven //myTable.getTableDriven(table, strPaperID, strCaseID); //選擇情境題模式設定 myTable.getQuestionSituationMode(table, strPaperID, strCaseID); //批改問答題時否顯示學生姓名 myTable.getStudentNameVisibleMode(table, strPaperID, strCaseID); //設定CSS TableAttribute.setupTopHeaderTableStyle(table, "TableName", 1, "70%", 5, 0, GridLines.Both, false); }
/// <summary> /// 建立顯示某問卷隨機出題的清單 /// </summary> /// <param name="strPaperID"></param> /// <returns></returns> public Table getListTableFromRandomNum(string strPaperID) { Table table = new Table(); //取得RandomNum的資料 DataTable dtRandom = SQLString.getPaperInformationFromPaper_RandomQuestionNumWithGroupName(strPaperID); if (dtRandom.Rows.Count > 0) { //建立標頭欄位 TableRow trTitle = new TableRow(); table.Rows.Add(trTitle); //QuestionGroupName TableCell tcGroupNameTitle = new TableCell(); trTitle.Cells.Add(tcGroupNameTitle); tcGroupNameTitle.Text = "Group name"; //QustionNum TableCell tcQustionNumTitle = new TableCell(); trTitle.Cells.Add(tcQustionNumTitle); tcQustionNumTitle.Text = "Question number"; for (int i = 0; i < dtRandom.Rows.Count; i++) { TableRow tr = new TableRow(); table.Rows.Add(tr); //QuestionGroupName TableCell tcGroupName = new TableCell(); tr.Cells.Add(tcGroupName); tcGroupName.Text = dtRandom.Rows[i]["cNodeName"].ToString(); //QustionNum TableCell tcQuestionNum = new TableCell(); tr.Cells.Add(tcQuestionNum); tcQuestionNum.Style["width"] = "180px"; tcQuestionNum.Attributes["align"] = "center"; tcQuestionNum.Text = dtRandom.Rows[i]["sQuestionNum"].ToString(); } } //CSS TableAttribute.setupTopHeaderTableStyle(table, "TableName", 1, "60%", 5, 0, GridLines.Both, true); return(table); }
/// <summary> /// 建立一個可以顯示建議與非建議選項選擇題的表格 /// </summary> /// <returns></returns> public Table setupSingleSelectionQuestionTableByPlainView(string strPaperID, string strCaseID, int intClinicNum, string strSectionName, string strQID, int intQuestionIndex) { DataReceiver myReceiver = new DataReceiver(); Table table = new Table(); //題目 TableRow trQuestion = new TableRow(); table.Rows.Add(trQuestion); //題號 TableCell tcNum = new TableCell(); trQuestion.Cells.Add(tcNum); tcNum.Text = intQuestionIndex.ToString(); tcNum.Attributes.Add("align", "center"); tcNum.Style.Add("WIDTH", "10px"); //Question string strQuestion = myReceiver.getSelectionQuestionContent(strQID); TableCell tcQuestion = new TableCell(); trQuestion.Cells.Add(tcQuestion); tcQuestion.Text = strQuestion; //設定回饋機制 TableCell tcRetry = new TableCell(); trQuestion.Cells.Add(tcRetry); tcRetry.Attributes["align"] = "center"; tcRetry.Style["width"] = "220px"; HtmlInputButton btnRetry = new HtmlInputButton("button"); tcRetry.Controls.Add(btnRetry); btnRetry.Style["width"] = "150px"; btnRetry.Style["height"] = "30px"; btnRetry.Value = "設定回饋機制"; btnRetry.Attributes.Add("class", "button_continue"); btnRetry.Attributes["onclick"] = "callRetrySetting('" + strPaperID + "' , '" + strCaseID + "' , '" + intClinicNum + "' , '" + strSectionName + "' , '" + strQID + "')"; //選項 SQLString mySQL = new SQLString(); string strSQL = mySQL.getAllSelections(strQID); SqlDB myDB = new SqlDB(System.Configuration.ConfigurationSettings.AppSettings["connstr"]); DataSet dsSelection = myDB.getDataSet(strSQL); if (dsSelection.Tables[0].Rows.Count > 0) { for (int i = 0; i < dsSelection.Tables[0].Rows.Count; i++) { TableRow trSelection = new TableRow(); table.Rows.Add(trSelection); string strSelectionID = dsSelection.Tables[0].Rows[i]["cSelectionID"].ToString(); int intSeq = Convert.ToInt32(dsSelection.Tables[0].Rows[i]["sSeq"]); string strSelection = dsSelection.Tables[0].Rows[i]["cSelection"].ToString(); bool bSuggested = Convert.ToBoolean(dsSelection.Tables[0].Rows[i]["bCaseSelect"]); //顯示建議或是非建議選項的圖片 TableCell tcControl = new TableCell(); trSelection.Cells.Add(tcControl); tcControl.Attributes.Add("align", "center"); tcControl.Style.Add("WIDTH", "10px"); //img HtmlImage img = new HtmlImage(); tcControl.Controls.Add(img); if (bSuggested == true) { //Suggested img.Src = "/Hints/Summary/Images/smiley4.gif"; } else { //Un-Suggested img.Src = "/Hints/Summary/Images/smiley11.gif"; } //Selection TableCell tcSelection = new TableCell(); trSelection.Cells.Add(tcSelection); tcSelection.Text = strSelection; //NextStep TableCell tcNextStep = new TableCell(); trSelection.Cells.Add(tcNextStep); tcNextStep.Style["width"] = "220px"; tcNextStep.Controls.Add(this.getNextStepTable(strPaperID, strCaseID, intClinicNum, strSectionName, strQID, strSelectionID, bSuggested, intQuestionIndex)); } } dsSelection.Dispose(); //設定外觀 TableAttribute.setupTopHeaderTableStyle(table, "TableName", 1, "100%", 5, 0, GridLines.Both, true); return(table); }