protected void Page_Load(object sender, System.EventArgs e) { //此頁面部份功能隱藏 請搜索20110324 並把註解取消 this.Initiate(); Ajax.Utility.RegisterTypeForAjax(typeof(Paper_Presentation)); //接收參數 this.getParameter(); //建立標題和按鈕的多國語言 this.setupText(); //建立選項區域 this.setupPresentationSelection(); //是否同時存在tableContent和tableRandom bool bExist = true; //建立Paper_Content clsPresentTable myTable = new clsPresentTable(); Table tableContent = new Table(); //將OLD的跳題與回饋機制隱藏 20110324 //tableContent = myTable.setupSuggestedQuestionTableByPaperID(strPaperID, strCaseID, Convert.ToInt32(strClinicNum), strSectionName); if (tableContent.Rows.Count > 0) { tdMainTable.Controls.Add(tableContent); } else { trMainTable.Style["DISPLAY"] = "none"; trMainTableHR.Style["DISPLAY"] = "none"; bExist = false; } //建立Paper_RandomNum Table tableRandom = myTable.getListTableFromRandomNum(strPaperID); if (tableRandom.Rows.Count > 0) { tdRandomTable.Controls.Add(tableRandom); } else { trRandomTable.Style["DISPLAY"] = "none"; bExist = false; } //如果兩個表格沒有同時出現,則隱藏兩個表格中間的<HR> if (bExist == false) { trHR.Style["DISPLAY"] = "none"; } btnNext.ServerClick += new EventHandler(btnNext_ServerClick); //暫時將ASSIGN QUESTION功能隱藏 不知道功能用途20110324 btnPreAssign.Style["DISPLAY"] = "none"; }
/// <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> public Table setupSuggestedQuestionTableByPaperID(string strPaperID, string strCaseID, int intClinicNum, string strSectionName) { DataReceiver myReceiver = new DataReceiver(); clsPresentTable myTable = new clsPresentTable(); SQLString mySQL = new SQLString(); //取得此問卷的所有題目(Paper_Content) int intContentQuestionCount = myReceiver.getPaperContentQuestionNum(strPaperID); //取得此問卷的所有題目(Paper_RandomQuestionNum) int intRandomQuestionCount = myReceiver.getTotalQuestionNumFromRandomQuestion(strPaperID); //取得此問卷的所有題目總數 int intTotalQuestion = intContentQuestionCount + intRandomQuestionCount; //目前顯示的題號 int intQuestionIndex = 1; //建立問卷的本體表格 Table table = new Table(); table.Style.Add("WIDTH", "98%"); //建立此問卷中的所有問題 for (int i = 1; i <= intContentQuestionCount; i++) { TableRow tr = new TableRow(); table.Rows.Add(tr); TableCell tc = new TableCell(); tr.Cells.Add(tc); //取得問題的資料(From Paper_Content) DataRow[] drQuestion = myReceiver.getQIDFromPaper_ContentByQuestionIndex(strPaperID, intQuestionIndex); if (drQuestion.Length > 0) { //取得要顯示問題的QID string strQID = drQuestion[0]["cQID"].ToString(); //QuestionType string strQuestionType = drQuestion[0]["cQuestionType"].ToString(); //QuestionMode string strQuestionMode = drQuestion[0]["cQuestionMode"].ToString(); //問題是選擇題還是問答題? switch (drQuestion[0]["cQuestionType"].ToString()) { case "2": //問答題 //呼叫建立問答題表格的Function break; default: //選擇題 tc.Controls.Add(this.setupSingleSelectionQuestionTableByPlainView(strPaperID, strCaseID, intClinicNum, strSectionName, strQID, intQuestionIndex)); break; } } intQuestionIndex += 1; } return(table); }