Example #1
0
    //private void  CheckValueNonScore()
    //Check Value For NonScore
    private bool CheckValueNonScore()
    {
        try
        {
            bool ResultNonScore = true;

            Student student = (Student)(Session["currentStd"]);
            int aoid = Convert.ToInt32(Session["aoid"].ToString());
            Assessment asst = new Assessment();
            int ansOID = asst.GetAnswerOIDByAssessmentOID(aoid);
            //Get Assessment By OID
            ass = ass.GetAssessmentByOID(aoid);
            //Assign Value to Answer
            ans = ans.GetAnswerBySOIDAndAOID(student.StudentOID, aoid);
            if (ans == null)
            {
                ans = new Answer();
                ans.AssessmentOID = ass.AssessmentOID;
                //ans.CreatedBy = 1;
                //ans.NumberOfPrinted = 0;
                //ans.BannerID = student.StudentID;
                //ans.StudentOID = student.StudentOID;//Get Currently Login Student OID
                foreach (Section s in ass.SectionList)
                {
                    if (s.SectionName == "NoScore")
                    {
                        //to do for section
                        //Each Question

                        foreach (Question q in s.QuestionList)
                        {
                            QResponselistPerOID.Clear();
                            QResponselistPerOID = qresponse.GetQuestionRespByQOID(q.QuestionOID);

                            ansDetail = new AnswerDetail();
                            //ansDetail.CreatedBy = 1;
                            //ansDetail.SectionOID = s.SectionOID;
                            //ansDetail.QuestionOID = q.QuestionOID;

                            response = null;
                            foreach (QuestionResponse qr in QResponselistPerOID)
                            {

                                fieldName1 = Convert.ToString("A" + q.QuestionOID + qr.QuestionResponseOID);
                                fieldName1 = Request.Form[fieldName1];
                                if (fieldName1 != null)
                                {
                                    response = qr.Response;
                                }

                            }
                            if (response == null)
                            {
                             ResultNonScore = false;
                             return ResultNonScore;

                                //Alert.Show("Please Answer All NonScore  Questions");
                                //break ;
                            }

                            //ansDetail.Response = response;
                            //ansDetailList.Add(ansDetail);
                        }
                    }
                }

            }
            return ResultNonScore;
        }
        catch(Exception ax)
        {
            return false;
        }
    }