protected void fillCLODropDown(String courseId) { DropDownList3.Items.Clear(); AppDao appDaoObj = new AppDao(); List <AppCLO> CLOList = appDaoObj.getCLOList(courseId); if (CLOList != null) { foreach (AppCLO CLO in CLOList) { ListItem att2 = new ListItem(); att2.Value = CLO.cloId.ToString(); att2.Text = CLO.cloStatement.ToString(); DropDownList3.Items.Add(att2); } } }
protected void GenerateQuestions(object sender, EventArgs e) { LogUtils.myLog.Info(numberQuestions.Text); String courseId = Session["CourseID"].ToString(); LogUtils.myLog.Info("Session[\"CourseID\"] : " + Session["CourseID"]); LogUtils.myLog.Info("Before courseId : " + courseId); if (courseId == null || courseId == "") { courseId = "4"; } LogUtils.myLog.Info("After courseId : " + courseId); LogUtils.myLog.Info("Button Generate Questions clicked." + DateTime.Now.ToString()); AppDao appDaoObj = new AppDao(); List <AppCourseTopic> topicList = appDaoObj.getCourseTopicList(courseId); List <AppCLO> CLOList = appDaoObj.getCLOList(courseId); QueDao queDaoObj = new QueDao(); String courseIdLocal = Session["CourseID"].ToString(); List <QueAttribute> attrList = queDaoObj.getAttrbuteList(courseIdLocal); foreach (QueAttribute attr in attrList) { attr.optionsList = queDaoObj.getAttributeOptionListByAttrID(attr.attributeID.ToString()); } foreach (AppCLO clo in CLOList) { List <AppSO> SOList = appDaoObj.getSOList(clo.cloId.ToString()); clo.soList = SOList; } foreach (AppCourseTopic courseTopic in topicList) { LogUtils.myLog.Info("Course Topic : " + courseTopic.topic); foreach (AppCLO clo in CLOList) { LogUtils.myLog.Info("CLO : " + clo.cloStatement); foreach (AppSO so in clo.soList) { LogUtils.myLog.Info("SO : " + so.statement); QueQuestion queDetails = new QueQuestion(); queDetails.cloId = clo.cloId; queDetails.soId = so.id; queDetails.courseTopicId = courseTopic.id; queDetails.courseId = Int32.Parse(courseId); queDetails.attrOptionIds = new List <int>(); try { SqlConnection myConnection = new SqlConnection(MyConstants.DBConnectionString); //LogUtils.myLog.Info(MyConstants.DBConnectionString); myConnection.Open(); display(attrList, attrList.Count, queDetails, myConnection); myConnection.Close(); } catch (Exception ex) { LogUtils.myLog.Debug(e.ToString(), ex); } LogUtils.myLog.Info("After inserting questions. Total Questions : " + totalQuesCount); } } } /*List<QueAttribute> attrList = new List<QueAttribute>(); * QueAttribute attr1 = new QueAttribute(); * attr1.attributeID = 1; * attr1.attributeStatement = "Time"; * attr1.optionsList = new List<QueAttributeOption>(); * QueAttributeOption o1 = new QueAttributeOption(); * o1.attributeId = 1; * o1.optionStatement = "5 mins"; * o1.attributeOptionId = 1; * attr1.optionsList.Add(o1); * * QueAttributeOption o2 = new QueAttributeOption(); * o2.attributeId = 1; * o2.optionStatement = "10 mins"; * o2.attributeOptionId = 2; * attr1.optionsList.Add(o2); * * QueAttributeOption o5 = new QueAttributeOption(); * o5.attributeId = 1; * o5.optionStatement = "15 mins"; * o5.attributeOptionId = 5; * attr1.optionsList.Add(o5); * * QueAttribute attr2 = new QueAttribute(); * attr2.attributeID = 1; * attr2.attributeStatement = "Type"; * attr2.optionsList = new List<QueAttributeOption>(); * QueAttributeOption o3 = new QueAttributeOption(); * o3.attributeId = 2; * o3.optionStatement = "MCQ"; * o3.attributeOptionId = 1; * attr2.optionsList.Add(o3); * * QueAttributeOption o4 = new QueAttributeOption(); * o4.attributeId = 2; * o4.optionStatement = "FB"; * o4.attributeOptionId = 2; * attr2.optionsList.Add(o4); * * attrList.Add(attr1); * attrList.Add(attr2); * display(attrList, attrList.Count); */ }