Esempio n. 1
0
    private void Initialize(int aid,string reg)
    {
        try
        {
            //aid
            Assessment ass = new Assessment();
            ass=ass.GetAssessmentByOID(aid);
            if (ass.AssessmentName != null&&reg =="")
            {
                FormsAuthentication.SetAuthCookie("Student", false);
                Response.Redirect("~/pg/answer/home.aspx?aid=" + aid,true);

            }
            else if (ass.AssessmentName != null && reg == "yes"&&Request.QueryString["id"] != null)
            {
                FormsAuthentication.SetAuthCookie("Student", false);
                string url="~/pg/answer/home.aspx?aid=" + aid+"&reg=yes&id="+Request.QueryString["id"];
                Response.Redirect(url, true);
            }
            else
            {
                Response.Write("Your link is not correct");
            }

        }
        catch (Exception ex)
        { }
    }
Esempio n. 2
0
    protected void lnkAddQuestions_Click(object sender, EventArgs e)
    {
        string retMsg = ValidateData();
        if (retMsg.Length > 0)
        {
            //need to display this msg in the page
            return;
        }

        Assessment obj = new Assessment(CurrentUserId);
        obj.ID = (AssessmentId > 0) ? AssessmentId : 0;
        obj.Name = txtAssessmentName.Text;
        obj.AssessmentGroupId = Convert.ToInt32(ddlAssessGroup.SelectedValue);
        //obj.AssessmentGroupName = ddlAssessGroup.SelectedItem.Text;
        obj.Description = txtDescription.Text;
        if (txtEffectiveFrom.Text != "")
        {
            obj.EffectiveFrom = Convert.ToDateTime(txtEffectiveFrom.Text);
        }
        if (txtEffectiveTo.Text != "")
        {
            obj.EffectiveTo = Convert.ToDateTime(txtEffectiveTo.Text);
        }
        obj.Status = chkStatus.Checked == true ? 'A' : 'I';
        obj.NarrativeHeader = tbNarrativeHeader.Text;
        obj.NarrativeFooter = tbNarrativeFooter.Text;
        Session["objAssessment"] = obj;
        //save this and go to the next page
        obj.Save();
        if (obj.ID > 0)
        {
            Response.Redirect("AddAssessmentQuestions.aspx?ID=" + obj.ID);
        }
        //Response.Redirect("AddAssessmentQuestions.aspx");
    }
Esempio n. 3
0
    private void Initialize(int aoid)
    {
        try
        {
            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(aoid);

            foreach (Section s in ass.SectionList)
            {
                foreach (Question q in s.QuestionList)
                {

                    if (q.RespAction == "Radio Button")
                    {
                        ;//For Radion Button
                    }
                    else if (q.RespAction == "Drop Down")
                    {
                        ;//For DropDown
                    }

                }

            }
        }
        catch (Exception ex)
        { }
    }
        public ActionResult Grade(Assessment assessment)
        {
            if (ModelState.IsValid)
            {
                db.Entry(assessment).State = EntityState.Modified;
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(assessment);
        }
Esempio n. 5
0
 private void Initialize()
 {
     try
     {
         Assessment ass = new Assessment();
         GridViewAssessment.DataSource=ass.GetAllAssessmnet();
         GridViewAssessment.DataBind();
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 6
0
 public static string GetColumnNameList(int aoid)
 {
     Assessment ass = new Assessment();
     string col = ass.GetColumnNameList(aoid);
     string JsonCol = "";
     string[] colArray = col.Split(',');
     foreach (string str in colArray)
     {
         JsonCol = JsonCol + "\"" + str + "\"" + ":" + str + ",";
     }
     JsonCol = JsonCol.Substring(0, JsonCol.Length - 1);
     return ass.GetColumnNameList(aoid);
 }
Esempio n. 7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["objAssessment"] != null)
     {
         objAssessment = (Assessment)Session["objAssessment"];
         lblName.Text = objAssessment.Name;
         lblGroupName.Text = objAssessment.AssessmentGroupName;
         lblEffectiveFrom.Text = objAssessment.EffectiveFrom.ToString("MM/dd/yyyy");
         lblEffectiveTo.Text = objAssessment.EffectiveTo.ToString("MM/dd/yyyy");
     }
     if (!IsPostBack)
     {
         populateData();
     }
 }
Esempio n. 8
0
    // private void PopulateAssessment(string BannerID,int AOID)
    private void PopulateAssessment(int AOID)
    {
        ddlAssessment.Items.Clear();
        Assessment ass = new Assessment();
        ass.GetAssessmentByAssessmentOID(AOID);
        if (ass != null)
        {
            ddlAssessment.Items.Add(ass.AssessmentName);
        }
        //Collection<Assessment> assList = new Collection<Assessment>();
        //assList = ass.GetAssessmentBySOID(BannerID);
        //foreach (Assessment assment in assList)
        //{
        //    ddlAssessment.Items.Add(assment.AssessmentName);

        //}
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsQueryStringMissingParameter(X_ID))
            {
                RedirectToPortalSelectionScreen();
            }
            else
            {
                _assessmentID = GetDecryptedEntityId(X_ID);
            }

            ScriptManager.RegisterStartupScript(this, typeof(string), "encryptedUserID", "var FieldTestFormId=" + AssessmentForm.FieldTestFormId + ";" +
                                                                                            " var UpdatedDataAttached=" + (int)ActionResult.GenericStatus.UpdatedDataAttached + ";"
                                                                                            , true);

            ImageWebFolder = (Request.ApplicationPath.Equals("/") ? "" : Request.ApplicationPath) + "/Images/";
            _selectedAssessment = Assessment.GetAssessmentAndQuestionsByID(_assessmentID);
            _selectedAssessment.LoadForms(true);
            if (_selectedAssessment == null)
            {
                return;
                //_selectedAssessment = Base.Classes.Assessment.GetAssessmentAndQuestionsByID(_assessmentID);
                //Cache.Insert(key, _selectedAssessment, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromHours(2));
            }

            if (!IsPostBack)
            {
                bool hasPermission = SessionObject.LoggedInUser.HasPermission(Permission.Access_SecureTesting);

                if (_assessmentID != 0)
                {
                    selectedAssessment = Thinkgate.Base.Classes.Assessment.GetAssessmentByID(_assessmentID);
                    dictionaryItem = Base.Classes.TestTypes.TypeWithSecureFlag(selectedAssessment.TestCategory);
                    isSecuredFlag = dictionaryItem.Where(x => Boolean.Parse(x.Value.ToString())).Select(y => y.Key).ToList().Distinct().Any();
                    SecureTitle = hasPermission && isSecuredFlag && SecureType;
                        
                }
             
                BindAssessmentItems(_selectedAssessment.Items);
                BindFormData();
                BindRadtab_Forms();
            }

        }
        public void BuildQuestionViewModel_GivenAssessmentWithQuestionThatHasPreviouslySelectedOption_ChosenOptionPropertiesShouldBeSelected()
        {
            var selectedId    = Guid.NewGuid();
            var notSelectedId = Guid.NewGuid();

            _assessment = new Assessment()
            {
                WorkflowQuestion = new WorkflowQuestion()
                {
                    WorkflowStage = A.Fake <WorkflowStage>(),
                    Question      = new Question()
                    {
                        QuestionOptions = new List <QuestionOption>()
                        {
                            new QuestionOption()
                            {
                                QuestionOptionId = selectedId,
                                Option           = A.Fake <Option>()
                            },
                            new QuestionOption()
                            {
                                QuestionOptionId = notSelectedId,
                                Option           = A.Fake <Option>()
                            }
                        }
                    }
                }
            };

            var questionAnswer = new QuestionAnswer()
            {
                QuestionOptionId = selectedId
            };

            var result = _questionViewModelBuilder.BuildQuestionViewModel(_assessment, questionAnswer);

            result.ChosenOption.Should().Be(selectedId);
            result.Options.First(x => x.Selected).QuestionOptionId.Should().Be(selectedId);
            result.Options.Count(x => x.Selected).Should().Be(1);
            result.Options.First(x => !x.Selected).QuestionOptionId.Should().Be(notSelectedId);
            result.Options.Count(x => !x.Selected).Should().Be(1);
        }
Esempio n. 11
0
        /// <summary>
        /// Resets the dynamic fields.
        /// </summary>
        /// <param name="assessment">The assessment.</param>
        /// <param name="resetId">Determines whether Id should be reset.</param>
        private static void ResetDynamicFields(Assessment assessment, bool resetId)
        {
            if (resetId)
            {
                assessment.Id = 0;
            }

            foreach (var item in assessment.FunctionPerformedSites)
            {
                item.Id = 0;
            }
            foreach (var item in assessment.PriorFunctionChanges)
            {
                item.Id = 0;
            }
            foreach (var item in assessment.FutureFunctionChanges)
            {
                item.Id = 0;
            }
            foreach (var item in assessment.KPISLAAssessments)
            {
                item.Id = 0;
            }

            foreach (var item in assessment.FunctionalAreaProcessAssessments)
            {
                item.Id = 0;
                foreach (var child in item.ControlAssessments)
                {
                    child.Id = 0;
                }
            }

            foreach (var item in assessment.ProcessRiskAssessments)
            {
                item.Id = 0;
                foreach (var child in item.ControlAssessments)
                {
                    child.Id = 0;
                }
            }
        }
Esempio n. 12
0
        public void CreatePdfForAssessment_CalledWithNoAssessmentEndDate_ShouldCreatePdfWithNoAssessmentCompleteDate()
        {
            PdfDocument pdfDocumentCreated;

            var assessment = new Assessment()
            {
                AssessmentId           = Guid.NewGuid(),
                Stage1DecisionToBeMade = "Decision",
                Patient =
                    new Patient()
                {
                    FirstName        = "First name",
                    LastName         = "Last name",
                    DateOfBirth      = new DateTime(1956, 1, 02),
                    NhsNumber        = 4010232137,
                    ClinicalSystemId = "1234567890"
                },
                AssessorName          = "assessor",
                DateAssessmentStarted = _dateTimeProvider.Now,
                Role = new Role {
                    RoleId = (int)RoleIdEnum.Assessor, Description = "A random role"
                },
            };

            _pdfGenerator.CreatePdfForAssessment(assessment, out pdfDocumentCreated);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.McaSubject, false, true)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.Name, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AppendText(" " + assessment.Patient.FirstName + " " + assessment.Patient.LastName)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.Dob, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AppendText(" " + assessment.Patient.DateOfBirth.ToLongDateString())).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.NhsNumber, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AppendText(" " + assessment.Patient.NhsNumber)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.AssessmentStartDateText, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.ClinicianNameText, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.Stage1Text, false, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.DecisionToBeMade, false, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.WriteText(assessment.Stage1DecisionToBeMade)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.AssessmentCompleteDateText, true, false)).MustNotHaveHappened();
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.RoleText, true, false)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AppendText(" " + assessment.Role.Description)).MustHaveHappened(Repeated.Exactly.Once);
            A.CallTo(() => _pdfHelper.AddTitle(ApplicationStringConstants.DecisionMakerText, true, false)).MustNotHaveHappened();
        }
Esempio n. 13
0
    protected void btnDeleteSection_Click(object sender, EventArgs e)
    {
        Sections sec = new Sections();
        Question ques=new Question ();
        Assessment ass = new Assessment();
        AnswerDetail ansDetail = new AnswerDetail();
        CVTCMenu menu=new CVTCMenu ();
        QuestionResponse qr=new QuestionResponse ();
        int sectOID = Convert.ToInt32(Request.QueryString["soid"].ToString());
        int AssOID = sec.GetAssessmentOIDBySectionOID(sectOID);
        if (ass.GetAssessmentStatusByOID(Convert.ToInt32(AssOID)) == 1)
        {
            LabelMessage.Text = "This group can not be deleted.It has been Locked";
            return;
        }
        else
        {
            string menuURL = "pg/assessment/section.aspx?soid=" + sectOID + "";
            //Delete from AnswerDetails and Question Table by SectionOID
            bool DeleteFromAnswerDetail=ansDetail.DeleteAnswerDetailBySectionOID(sectOID);
            Collection<Question> qList = new Collection<Question>();
            qList = ques.GetQuestionOIDBySectionOID(sectOID);
            foreach (Question q in qList )
            {
                qr.DeleteQuestionBySectionOID(q.QuestionOID);
            }
            bool DeleteFromQuestion = ques.DeleteQuestionBySectionOID(sectOID);
            bool DeleteFromMenu = menu.DeleteMenuByMenuURL(menuURL);
            bool DeleteFromSection = sec.DeleteSectionBySectionOID(sectOID);
            if (DeleteFromSection && DeleteFromMenu)
            {

                InitializeQuestion(sectOID);
                LabelMessage.Text = "This question group has been deleted successfully";
            }
            else
            {
                LabelMessage.Text = "This question group can not be deleted.Please try again..";
            }
            ButtonRefresh_Click(null, null);
        }
    }
Esempio n. 14
0
        // TODO: initialization for Experts?

        // Load data from samples
        private void LoadSampleDataToAssessment(Assessment assessment)
        {
            AssessmentType assessmentType = (unit.AssessmentTypeRepository.Get(a => a.Id == assessment.AssessmentTypeId)).FirstOrDefault <AssessmentType>();

            if (assessmentType != null)
            {
                foreach (AreaSample areaSample in assessmentType.AreaSamples)
                {
                    Area newArea = new Area()
                    {
                        Name        = areaSample.Name,
                        Description = areaSample.Description
                    };

                    foreach (CriteriaSample criteriaSample in areaSample.CriteriaSamples)
                    {
                        Criterion newCriterion = new Criterion()
                        {
                            CostConstraintImpactId    = criteriaSample.CostConstraintImpactId,
                            QualityConstraintImpactId = criteriaSample.QualityConstraintImpactId,
                            ScopeConstraintImpactId   = criteriaSample.ScopeConstraintImpactId,
                            TimeConstraintImpactId    = criteriaSample.TimeConstraintImpactId,
                            Name = criteriaSample.Name
                        };

                        foreach (IndicatorSample indicatorSample in criteriaSample.IndicatorSamples)
                        {
                            Indicator newIndicator = new Indicator()
                            {
                                Name = indicatorSample.Name
                            };

                            newCriterion.Indicators.Add(newIndicator);
                        }

                        newArea.Criteria.Add(newCriterion);
                    }

                    assessment.Areas.Add(newArea);
                }
            }
        }
Esempio n. 15
0
        /// <summary>
        /// 删除Employee
        /// </summary>
        /// <param name="id">自增型ID</param>
        public int DeleteEmployeeByID(int id)
        {
            Registration _registration = new Registration();

            _registration.EmployeeID = id;
            IList <Registration> _registrationList = _registrationService.GetBaseRegistration(_registration);

            foreach (Registration Registration in _registrationList)
            {
                _registrationService.DeleteRegistrationByID(Registration.ID);
            }

            ReportCard _reportCard = new ReportCard();

            _reportCard.EmployeeID = id;
            IList <ReportCard> _reportCardList = _reportCardService.GetBaseReportCard(_reportCard);

            foreach (ReportCard reportCard in _reportCardList)
            {
                _reportCardService.DeleteReportCardByID(reportCard.ID);
            }

            Assessment _assessment = new Assessment();

            _assessment.EmployeeID = id;
            IList <Assessment> _assessmentList = _assessmentService.GetBaseAssessment(_assessment);

            foreach (Assessment studentAssessment in _assessmentList)
            {
                _assessmentService.DeleteAssessmentByID(studentAssessment.ID);
            }

            int[] _userID = new int[] { id };
            IList <DeviceToken> _deviceTokenList = _deviceTokenService.GetDeviceToken(string.Empty, string.Empty, _userID);

            foreach (DeviceToken deviceTokenRegisterInfo in _deviceTokenList)
            {
                _deviceTokenService.DeleteDeviceTokenByID(deviceTokenRegisterInfo.ID);
            }

            return(_employeeDao.DeleteEmployeeByID(id));
        }
Esempio n. 16
0
        public void Get_One_Assessment()
        {
            // Arrange
            Assessment fakeAssessment = new Assessment()
            {
                Id = 1000, Name = "test fake assessment"
            };

            assessmentRepository.Setup(x => x.GetByID(1000)).Returns(fakeAssessment);

            assessmentManager = new AssessmentManager(null, assessmentRepository.Object, null);

            //// Act
            var assessment = assessmentManager.Get(1000);

            //// Assert
            Assert.IsNotNull(assessment, "Result is null");
            Assert.IsInstanceOfType(assessment, typeof(Assessment), "Wrong Model");
            Assert.AreEqual(1000, assessment.Id, "Got wrong number of Assessments");
        }
Esempio n. 17
0
        public void UpdateAssessment(Assessment assessment)
        {
            var ToUpdate = GetAssessment(assessment.id);

            if (ToUpdate == null)
            {
                throw new Exception("the assessment to update not found");
            }
            using (var db = new Project_Db_Context())
            {
                foreach (Location_ l in assessment.Locations)
                {
                    db.Locations.Add(l);
                    db.SaveChanges();
                }
                db.Entry(assessment);
                db.Assessments.AddOrUpdate(assessment);
                db.SaveChanges();
            }
        }
Esempio n. 18
0
        public ActionResult AddAssessment(Assessment model)
        {
            if (ModelState.IsValid)
            {
                ViewBag.Message  = "Saved Successfully !!";
                ViewData["abc"]  = "something";
                TempData["key1"] = "test";

                var abc = TempData["key1"];
                TempData.Keep("key1");

                // var abc = TempData.Peek("key1");
            }
            else
            {
                ViewBag.Message = "Model Validation Failed..";
            }

            return(View("AddAssessmentComplete"));
        }
        public ActionResult SaveAssessment(Entities.Assessment obj)
        {
            using (ApplicationDbContext data = new ApplicationDbContext())
            {
                if (obj.Id == 0)
                {
                    data.Assessments.Add(obj);
                }
                else
                {
                    Assessment asses = data.Assessments.FirstOrDefault(f => f.Id == obj.Id);
                    asses.Name        = obj.Name;
                    asses.Description = obj.Description;
                }

                data.SaveChanges();
            }

            return(null);
        }
Esempio n. 20
0
 public ActionResult Create(HttpPostedFileBase selectedFile, Assessment assessment)
 {
     if (selectedFile != null && selectedFile.ContentLength > 0)
     {
         var fileName = Path.GetFileName(selectedFile.FileName);
         var filePath = Path.Combine(Server.MapPath("~/UploadedFiles/"),
                                     fileName);
         selectedFile.SaveAs(filePath);
         if (ModelState.IsValid)
         {
             assessment.AssessmentDate  = DateTime.Now;
             assessment.AssessmentLink  = fileName;
             assessment.AssessmentGrade = -1;
             db.Assessments.Add(assessment);
             db.SaveChanges();
             return(RedirectToAction("Index"));
         }
     }
     return(View(assessment));
 }
Esempio n. 21
0
        public void TestNew()
        {
            BusinessLayer.AssessmentsBL assess = new BusinessLayer.AssessmentsBL();
            List <Assessment>           asm    = assess.GetAssessments().ToList();
            int      count = asm.Count;
            Guid     gud   = Guid.NewGuid();
            DateTime date  = DateTime.Now;

            Assessment a = new Assessment()
            {
                AssesmentId = gud, Date = date.Date, duration = 5, time = date.ToString("HH:mm"), AssesmentType_fk = new Guid("d728a9e6-76fc-4daa-8ed3-6960e98ba4d4"), Worker_fk = new Guid("8901adf4-0164-4951-a4c1-71c2c8b297a6"), Origin_fk = new Guid("fa549819-b9ed-470c-b12c-1ad6f7e4321a"), Description = "hai", ConfirmationDate = date.Date, PatientId_fk = 1
            };


            assess.AddAssessment(a);

            asm = assess.GetAssessments().ToList();

            Assert.IsTrue(asm.Count > count);
        }
Esempio n. 22
0
        public IActionResult AddAssessment(Assessment model)
        {
            string  message = "Lisääminen onnistui";
            Boolean status  = true;

            try
            {
                model.ResponseOptionsId = 1;
                model.CreatedAt         = DateTime.Now;
                _context.Assessments.Add(model);
                _context.SaveChanges();
            }
            catch (Exception)
            {
                status  = false;
                message = "Lisääminen ei onnistunut";
            }

            return(Json(new { status = status, message = message }));
        }
Esempio n. 23
0
        public async Task <IActionResult> Share([Bind("Id,Name,CoverPage,QuestionList,Appendix,UserEmail,ModifiedDate")] Assessment assessment)
        {
            if (!UserExists(assessment.UserEmail))
            {
                ViewData["Message"] = "Could not find user with email: " + assessment.UserEmail;
                return(View(assessment));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    assessment.Id = Guid.NewGuid();
                    _context.Add(assessment);
                    await _context.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
                return(View(assessment));
            }
        }
Esempio n. 24
0
        /// <summary>
        /// Shows the result.
        /// </summary>
        private void ShowResult(ConflictProfileService.AssessmentResults result, Assessment assessment)
        {
            pnlInstructions.Visible = false;
            pnlQuestion.Visible     = false;
            pnlResult.Visible       = true;

            var allowRetakes = GetAttributeValue(AttributeKeys.AllowRetakes).AsBoolean();
            var minDays      = assessment.AssessmentType.MinimumDaysToRetake;

            if (!_isQuerystringPersonKey && allowRetakes && assessment.CompletedDateTime.HasValue && assessment.CompletedDateTime.Value.AddDays(minDays) <= RockDateTime.Now)
            {
                btnRetakeTest.Visible = true;
            }
            else
            {
                btnRetakeTest.Visible = false;
            }

            // Resolve the text field merge fields
            var mergeFields = Rock.Lava.LavaHelper.GetCommonMergeFields(this.RockPage, _targetPerson);

            if (_targetPerson != null)
            {
                _targetPerson.LoadAttributes();
                mergeFields.Add("Person", _targetPerson);

                // The five Mode scores
                mergeFields.Add("Winning", result.ModeWinningScore);
                mergeFields.Add("Avoiding", result.ModeAvoidingScore);
                mergeFields.Add("Compromising", result.ModeCompromisingScore);
                mergeFields.Add("Yielding", result.ModeYieldingScore);
                mergeFields.Add("Resolving", result.ModeResolvingScore);

                // The optional 'Conflict Engagement Profile' scores:
                mergeFields.Add("EngagementProfileSolving", result.EngagementSolvingScore);
                mergeFields.Add("EngagementProfileAccommodating", result.EngagementAccommodatingScore);
                mergeFields.Add("EngagementProfileWinning", result.EngagementWinningScore);
            }

            lResult.Text = GetAttributeValue(AttributeKeys.ResultsMessage).ResolveMergeFields(mergeFields);
        }
Esempio n. 25
0
        public ActionResult AddAssessment(SearchViewModel collection, Assessment question)
        {
            try
            {
                DB41Entities db = new DB41Entities();
                Question     s  = new Question();
                string       d  = collection.Type;
                s.Name  = question.Detail;
                s.Marks = question.Marks;

                //var Id = db.Courses
                //  .Where(x => x.Title== collection.Type)
                //  .Select(x => x.CourseID)
                //  .FirstOrDefault();
                string userid = User.Identity.GetUserId();
                int    g      = Convert.ToInt32(userid);
                var    person = db.Instructors.Where(y => y.InstructorID == g).First();
                var    per    = db.Courses.Where(y => y.InstructorID == g).First();
                // var person = db.Courses.Where(y => y.Title == collection.Type).SingleOrDefault();
                s.CourseID     = per.CourseID;
                s.Department   = person.Department;
                s.InstructorID = g;

                //var Idee= db.Courses
                //  .Where(x => x.CourseID == Id)
                //  .Select(x => x.InstructorID)
                //  .FirstOrDefault();

                ////string userid = User.Identity.GetUserId();
                ////int g = Convert.ToInt32(userid);
                //s.InstructorID = Idee;

                db.Questions.Add(s);
                db.SaveChanges();
                return(RedirectToAction("Index", "Instructor"));
            }
            catch (Exception e)
            {
                throw e;
            }
        }
Esempio n. 26
0
        private ResponseMessage <Assessment> Calculate(Assessment assessment)
        {
            ResponseMessage <Assessment> responseMessage;

            try
            {
                Assessment assessmentDb = _repository.Context
                                          .Assessments
                                          .Include(a => a.AdditionalServices)
                                          .Include(a => a.ServicesValues)
                                          .FirstOrDefault(a => a.IdAssessment == assessment.IdAssessment);

                if (assessmentDb == null)
                {
                    return(ResponseMessage <Assessment> .Fault("Orçamento não encontrado."));
                }

                assessmentDb.Parts = _repository.Context
                                     .Parts
                                     .Include(a => a.Services)
                                     .Where(a => a.IdAssessment == assessmentDb.IdAssessment)
                                     .ToList();

                assessmentDb.Total = assessmentDb.Parts.Sum(a => a.TotalPrice + a.TotalMaterial + a.TotalService) +
                                     assessmentDb.AdditionalServices.Sum(a => a.Value);

                //update
                _repository.Update(assessmentDb);

                //COMMIT
                _repository.SaveChanges();

                responseMessage = ResponseMessage <Assessment> .Ok(assessmentDb);
            }
            catch (Exception ex)
            {
                responseMessage = ResponseMessage <Assessment> .Fault(ex.StackTrace);
            }

            return(responseMessage);
        }
Esempio n. 27
0
        static void Main(string[] args)
        {
            //List<T> is an instance class
            //the class will hold different data from a second List<T>
            List <Assessment> StudentList = new List <Assessment>();

            //default Assessment constructor
            Assessment defaultItem = new Assessment();

            //fill it
            defaultItem.FirstName      = "don";
            defaultItem.LastName       = "welch";
            defaultItem.Mark           = 100.0;
            defaultItem.AssessmentName = "default";

            StudentList.Add(defaultItem);

            //Greedy Constructor
            Assessment greedyItem = new Assessment("bob", "harry", "greedie", 35.6, "greed never pays");

            StudentList.Add(greedyItem);

            //foreach (Assessment item in StudentList)
            //{
            //    Console.WriteLine($"Name: {item.LastName}, {item.FirstName}, Assessment {item.AssessmentName} Mark:{item.Mark} Comment: >{item.Comment}<");
            //}

            //for (int i = 0; i < StudentList.Count; i++)
            //{
            //    Console.WriteLine($"Name: {StudentList[i].LastName}, {StudentList[i].FirstName}, Assessment {StudentList[i].AssessmentName} Mark:{StudentList[i].Mark} Comment: >{StudentList[i].Comment}<");
            //}

            Console.WriteLine($"\n\n File reading, List loading, using Assessment class\n");

            ReadAndLoadList(StudentList);

            foreach (Assessment item in StudentList)
            {
                Console.WriteLine($"Name: {item.LastName}, {item.FirstName}, Assessment {item.AssessmentName} Mark:{item.Mark} Comment: >{item.Comment}<");
            }
        }
Esempio n. 28
0
        public ActionResult Edit(int?assessmentPK)
        {
            if (assessmentPK != null)
            {
                IAssessmentsRepository assessmentsRepository = new AssessmentsRepository(db);
                Assessment             assessment            = assessmentsRepository.GetAssessmentByPK((int)assessmentPK);
                AssessmentsView        assessmentView        = new AssessmentsView();

                assessmentView.ConvertFrom(assessment, assessmentView);

                IAssessmentTypesRepository assessmentTypesRepository = new AssessmentTypesRepository(db);
                assessmentView.AssessmentTypes = new SelectList(assessmentTypesRepository.GetValid().OrderBy("Name ASC").ToList(), "AssessmentTypePK", "Name");

                // Assessment types ddl
                IAssessmentGroupsRepository    assessmentGroupsRepository    = new AssessmentGroupsRepository(db);
                IAssessmentQuestionsRepository assessmentQuestionsRepository = new AssessmentQuestionsRepository(db);

                ILegalEntitiesRepository legalEntitiesRepository = new LegalEntitiesRepository(db);
                LegalEntity legalEntity = legalEntitiesRepository.GetLegalEntityByPK((int)assessment.LegalEntityFK);
                assessmentView.LegalEntityName = legalEntity.Name + " (" + legalEntity.OIB + ")";

                FormCollection form = new FormCollection();

                IAssessmentAnswersRepository   assessmentAnswersRepository = new AssessmentAnswersRepository(db);
                IQueryable <AssessmentAnswers> assessmentAnswers           = assessmentAnswersRepository.GetAssessmentAnswersByAssessment((int)assessmentPK);

                foreach (var assessmentAnswer in assessmentAnswers)
                {
                    string answer = assessmentAnswer.AssessmentAnswer == null ? "NP": (bool)assessmentAnswer.AssessmentAnswer ? "Da" : "Ne";
                    form.Add("answer[" + assessmentAnswer.AssessmentQuestionFK + "]", answer);
                }

                assessmentView.AssessmentsTypesView = AssessmentsView.FillQuiz(assessmentTypesRepository.GetValid(), assessmentGroupsRepository, assessmentQuestionsRepository, form);

                return(View(assessmentView));
            }
            else
            {
                return(RedirectToAction("Index", "Assessment"));
            }
        }
Esempio n. 29
0
 public ActionResult CreateAssessment(Assessment Assessment)
 {
     if (ModelState.IsValid)
     {
         string message = AssessmentService.Save(Assessment, User.Identity.Name);
         if (string.IsNullOrEmpty(message))
         {
             TempData["Success"] = Messages.Created;
             return(RedirectToAction("Index"));
         }
         else
         {
             ViewData["Warning"] = message;
         }
     }
     else
     {
         ViewData["Error"] = Messages.InvalidField;
     }
     return(View());
 }
Esempio n. 30
0
            public void MoveToGroupSession()
            {
                Univercity U       = new Univercity("test");
                ISession   session = new Session(SessionType.Winter, DateTime.Now.Year);
                ISubject   subject = new Subject("test", SubjectType.Credited);
                IGroup     group   = new Group(new NumberGroup(Specialty.Service, DateTime.Now.Year));
                var        ng      = group.NumberGroup;
                var        id      = new Id(ng, new Id());
                IStudent   student = new Student(new FullName("test", "test", "test"), new DateTime(2000, 12, 14), id);
                Assessment a       = Assessment.Four;

                U.Groups.Add(group);
                group.AddStudent(student);
                U.Sessions.Add(session);
                U.Subjects.Add(subject);
                //        session.AddSubjects(student, U.Subjects);
                session.MoveToSubjectAssessment(student, subject, a);
                var result = student.Subjects.Find(s => s.Equals(subject)).Assessment;

                ReferenceEquals(a, result);
            }
Esempio n. 31
0
 // GET: Assessments/Delete/5
 public ActionResult Delete(int? id, string fromPage = "PostAssessmentItems")
 {
     if (id == null)
     {
         return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
     }
     Assessment assessment = db.Assessments.Find(id);
     if (assessment == null)
     {
         return HttpNotFound();
     }
     var lesson = assessment.AssessmentItem.PreLesson ?? assessment.AssessmentItem.PostLesson;
     ViewBag.CourseName = lesson.Unit.Semester.CourseCatalog.SideName;
     ViewBag.SemesterName = lesson.Unit.Semester.Title;
     ViewBag.UnitName = lesson.Unit.Title;
     ViewBag.LessonName = lesson.Title;
     var isPreAssessment = assessment.AssessmentItem.PreLesson == null;
     ViewBag.CurrentAssessmentId = isPreAssessment ? assessment.AssessmentItem.PreLessonId : assessment.AssessmentItem.PostLessonId;
     ViewBag.FromPage = fromPage;
     return View(assessment);
 }
        private Assessment SetupSuccessfulPut(Assessment localAssessment)
        {
            var clonedLocalAssessment = new Assessment {
                ObjectId = localAssessment.ObjectId
            };
            var savedAssessment = new Assessment {
                ObjectId = localAssessment.ObjectId
            };
            var url = Connection.GenerateTableUrl <Assessment>(localAssessment.ObjectId);

            _jsonSerializer.Clone(localAssessment).Returns(clonedLocalAssessment);
            var serializedObject = $"{savedAssessment.ObjectId}-serialized";

            _jsonSerializer.Serialize(clonedLocalAssessment).Returns(serializedObject);
            var jsonResponse = $"{savedAssessment.ObjectId}-response";

            _restServiceCaller.Put(url, Arg.Any <Dictionary <string, string> >(), serializedObject)
            .Returns(Task.FromResult(jsonResponse));
            _responseParser.Parse <Assessment>(jsonResponse).Returns(BackendlessResponse <Assessment> .Success(savedAssessment));
            return(savedAssessment);
        }
Esempio n. 33
0
        private int GetDifferenceOfTodayAndAssessmentDate(Assessment assessment)
        {
            var todayYear      = DateTime.Today.Year;
            var assessmentYear = assessment.AssessmentDate.Year;

            if (todayYear - assessmentYear >= 4)
            {
                return(0);
            }
            if (todayYear - assessmentYear >= 2 &&
                todayYear - assessmentYear < 4)
            {
                return(1);
            }
            if (todayYear - assessmentYear >= 0 &&
                todayYear - assessmentYear < 2)
            {
                return(2);
            }
            return(3);
        }
        private BackendlessResponse <Assessment> SetupFailedPost(Assessment localAssessment, string errorMessage)
        {
            var clonedLocalAssessment = new Assessment {
                ObjectId = localAssessment.ObjectId
            };
            var savedAssessment = CreateSavedAssessment();
            var url             = Connection.GenerateTableUrl <Assessment>();

            _jsonSerializer.Clone(localAssessment).Returns(clonedLocalAssessment);
            var serializedObject = $"{savedAssessment.ObjectId}-serialized";

            _jsonSerializer.Serialize(clonedLocalAssessment).Returns(serializedObject);
            var jsonResponse = $"{savedAssessment.ObjectId}-failedResponse";

            _restServiceCaller.Post(url, Arg.Any <Dictionary <string, string> >(), serializedObject)
            .Returns(Task.FromResult(jsonResponse));
            var backendlessResponse = BackendlessResponse <Assessment> .Failed("error", errorMessage);

            _responseParser.Parse <Assessment>(jsonResponse).Returns(backendlessResponse);
            return(backendlessResponse);
        }
Esempio n. 35
0
        /// <summary>
        /// Maps the assessment section to its dto.
        /// </summary>
        /// <param name="assessment">The assessment.</param>
        /// <param name="section">The section.</param>
        /// <param name="subSection">The sub section.</param>
        /// <returns>The dto of the assessment section.</returns>
        public static object MapAssessmentSection(Assessment assessment, string section, string subSection)
        {
            var name = section;
            var entityPropertyInfo = assessment.GetType().GetProperty(section);
            var entityToGet        = entityPropertyInfo.GetValue(assessment);

            if (entityToGet == null && section == "ReviewSection")
            {
                entityToGet = Activator.CreateInstance <ReviewSection> ();
            }
            var entityType = entityPropertyInfo.PropertyType;

            if (subSection != null)
            {
                name = subSection;
                entityPropertyInfo = entityType.GetProperty(subSection);
                entityToGet        = entityPropertyInfo.GetValue(entityToGet);
                entityType         = entityPropertyInfo.PropertyType;
            }
            return(Mapper.Map(entityToGet, entityType, DtoTypeCache[name]));
        }
Esempio n. 36
0
        private bool VerifySkillListFailed(Assessment assess)
        {
            if (currentScript.verifySkills == null)
            {
                return(false);
            }

            List <string> list   = new List <string> (assess.GetSkills());
            List <string> skills = new List <string>(currentScript.verifySkills.Split(','));

            for (int i = 0; i < list.Count; i++)
            {
                if (list[i] != skills[i])
                {
                    Console.WriteLine("FAILURE:  Skill List for assessment doesn't match.");
                    PrintSkillLists(list);
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 37
0
        protected List <Profiles.TechnologyItem> ConvertProfile(Assessment assessment, List <Profiles.TechnologyItem> technologiesList)
        {
            Dictionary <string, string> assessmentTechnologyList = new Dictionary <string, string>();

            assessment.GetTechnologyScales()
            .ForEach(t =>
            {
                if (!assessmentTechnologyList.ContainsKey(t.Technology))
                {
                    assessmentTechnologyList.Add(t.Technology, t.Scale);
                }
            });

            foreach (var technology in technologiesList)
            {
                var    scales = GetScales(assessmentTechnologyList, technology.MapToTechnologies);
                string scale  = GetScale(scales, technology.Method);
                technology.Scale = scale;
            }
            return(technologiesList);
        }
Esempio n. 38
0
        public async Task <Assessment> Create(Assessment assessment)
        {
            assessment.Identifier        = Guid.NewGuid().ToString();
            assessment.NamespaceProperty = await _odsApiSettingsProvider.GetAssessmentNamespace();

            var ods = await _odsApiClientProvider.NewResourcesClient();

            var response = await ods.Post("assessments", assessment);

            var createdAssessmentId = await ods.HandleHttpResponseGetCreatedResourceId(response);

            var createdAssessment = await ods.Get <Assessment>($"assessments/{createdAssessmentId}");

            var cachedAssessments = await _cacheProvider.Get <IList <Assessment> >(CacheKeys.Assessments);

            cachedAssessments.Add(createdAssessment);

            await _cacheProvider.TrySet(CacheKeys.Assessments, cachedAssessments);

            return(createdAssessment);
        }
Esempio n. 39
0
        public async Task <IActionResult> ShareAll([Bind("Id,Name,CoverPage,QuestionList,Appendix,UserEmail,ModifiedDate")] Assessment assessment)
        {
            if (!UserExists(assessment.UserEmail))
            {
                return(RedirectToAction(nameof(Share), new { id = assessment.Id, message = "Could not find user with email: " + assessment.UserEmail }));
            }
            else
            {
                if (ModelState.IsValid)
                {
                    var questionList = _service.shareAllQuestions(assessment.QuestionList, assessment.UserEmail, assessment.ModifiedDate);
                    assessment.Id           = Guid.NewGuid();
                    assessment.QuestionList = questionList;
                    _context.Add(assessment);
                    await _context.SaveChangesAsync();

                    return(RedirectToAction(nameof(Index)));
                }
                return(RedirectToAction(nameof(Share), new { id = assessment.Id }));
            }
        }
Esempio n. 40
0
        public string SubmitAssessment(Assessment assessment)
        {
            // should be over ssl

            try
            {
                Student s = db.students.Where(a => a.userName == assessment.Student.userName).Single();

                assessment.Student = s;

                db.assessments.Add(assessment);

                db.SaveChanges();

                return("true");
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
 public AssessementMessage(Assessment AssessmentToSend)
 {
     this.AssessmentToSend = AssessmentToSend;
 }
Esempio n. 42
0
        private async void LoadData(Bundle bundle)
        {
            ProgressDialog dialog = null;

            currentStage = AssessmentStage.Preparing;

            RunOnUiThread(() =>
            {
                dialog = new ProgressDialog(this);
                dialog.SetTitle("Downloading...");
                dialog.SetMessage("Please wait while we prepare your assessment.");
                dialog.SetCancelable(false);
                dialog.Show();
            });

            int id = Intent.GetIntExtra("ActivityId", -1);

            if (id >= 0)
            {
                assessment = (Assessment)await AppData.Session.FetchActivityWithId(id);
            }
            else
            {
                assessment = await ServerData.FetchAssessment();
            }

            if (assessment == null)
            {
                RunOnUiThread(() =>
                {
                    dialog.Hide();
                    SelfDestruct("It looks like you're offline...",
                        "Oops! We couldn't download your assessment - check your internet connection and try again later!");
                });
                return;
            }

            helpers = await assessment.PrepareTasks();

            FindViewById<TextView>(Resource.Id.assessment_preamble).Text = assessment.Description;

            tasks = assessment.AssessmentTasks;
            zipPath = Path.Combine(AppData.Exports.Path, assessment.Id + "_assessmentRes.zip");
            results = new ScenarioResult(assessment.Id, zipPath) { IsAssessment = true };

            if (bundle != null)
            {
                var previous = bundle.GetInt("ASSESSMENT_PROGRESS", -1);

                if (previous >= 0 && previous < tasks.Length)
                {
                    taskIndex = previous;
                    StartAssessment(bundle.GetInt("TASK_PROGRESS", -1));
                }
                else
                {
                    currentStage = AssessmentStage.Preamble;
                    preambleContainer.Visibility = ViewStates.Visible;
                    recButton.Visibility = ViewStates.Visible;
                    helpButton.Visibility = ViewStates.Visible;
                }
            }
            else
            {
                currentStage = AssessmentStage.Preamble;
                preambleContainer.Visibility = ViewStates.Visible;
                recButton.Visibility = ViewStates.Visible;
                helpButton.Visibility = ViewStates.Gone;
            }

            RunOnUiThread(() => { dialog.Hide(); });
        }
Esempio n. 43
0
 public List<Assessment> GetAssessmentsForMember(int MemberMasterID, int CurrentUserID)
 {
     List<Assessment> items = new List<Assessment>();
     const string procName = "GET_ASSESSMENTS_FOR_MEMBER";
     using (dbhAssessments = new DBHelper(ConnectionStrings.DefaultDBConnection))
     {
         dbhAssessments.AddParameter("@MemberMasterID", MemberMasterID);
         dbhAssessments.AddParameter("@CURRENTUSERID", CurrentUserID);
         IDataReader dr = dbhAssessments.ExecuteReader(procName);
         while (dr.Read())
         {
             Assessment a = new Assessment(CurrentUserID);
             a.LoadAssessmentInfoForMember(dr);
             items.Add(a);
         }
         dbhAssessments.Dispose();
     }
     return items;
 }
Esempio n. 44
0
    public void UpdateIntervention(int aid, int rlst)
    {
        try
        {
            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(aid);

            ResultLetterDetail letterDetail = null;
            ResultLetter resultLetter = new ResultLetter();
            resultLetter = resultLetter.GetResultLetterByAOID(aid);

            Collection<Student> studentList = new Student().GetAllStudentByResultLetterSentTimes(rlst);

            StringBuilder sb = new StringBuilder();
            string dateStr = System.DateTime.Today.ToString();
            foreach (Student student in studentList)
            {
                sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%; page-break-after: always; margin:0px 20px 0px 20px'>");

                sb.Append("<tr>");
                sb.Append("<td> " + dateStr + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> " + student.FullName + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> " + student.AddressOne + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> " + student.AddressTwo + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> " + student.AddressThree + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td align='right'> Student ID: " + student.StudentID + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> Dear " + student.FirstName + ":</td>");
                sb.Append("</tr>");

                if (resultLetter != null)
                {
                    sb.Append("<tr>");
                    sb.Append("<td>" + resultLetter.Header + "</td>");
                    sb.Append("</tr>");
                }

                sb.Append("<tr>");
                sb.Append("<td>");
                sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%;'>");
                sb.Append("<tr>");
                sb.Append("<td style='background-color:Gray; width:30%; border: thin solid #000000;'>CATEGORY</td>");
                sb.Append("<td style='background-color:Gray; width:70%; border: thin solid #000000;'>DEFINITION</td>");
                sb.Append("</tr>");

                //Collection<StudentRank> studentRankList_ = new StudentRank().GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID);

                foreach (Section s in ass.SectionList)
                {
                    string definition = "", starValue = "";
                    if (resultLetter != null)
                    {
                        if (resultLetter.LetterDetail != null)
                        {
                            var tmp = from detail in resultLetter.LetterDetail
                                      where detail.SectionOID == s.SectionOID
                                      select detail;
                            letterDetail = tmp != null ? tmp.First() : null;
                        }
                    }

                    sb.Append("<tr>");

                    //foreach (StudentRank SR in studentRankList)
                    //{
                    //    if (SR.SectionOID == s.SectionOID)
                    //    {
                    //        if (SR.Rank < s.Flag)
                    //        {
                    //            starValue = " *";
                    //            break;
                    //        }
                    //        else
                    //        { starValue = ""; }
                    //    }
                    //}

                    sb.Append("<td style='width:30%; border: thin solid #000000'>" + s.SectionName + starValue + "</td>");
                    definition = (letterDetail != null) ? letterDetail.SectionDefinition : "";

                    sb.Append("<td style='width:70%; border: thin solid #000000'>" + definition + "</td>");
                    sb.Append("</tr>");
                }
                sb.Append("</table>");

                if (resultLetter != null)
                {
                    sb.Append("<tr>");
                    sb.Append("<td>" + resultLetter.ShowAboveResult + "</td>");
                    sb.Append("</tr>");
                }

                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");
            }
            //print_div1.InnerHtml = sb.ToString();
            Response.Write(sb.ToString());
            return;
        }
        catch (Exception ex)
        {

        }
    }
Esempio n. 45
0
 protected void Page_Load(object sender, EventArgs e)
 {
     int sectOID;
     if (!Page.IsPostBack)
     {
         LabelMessage.Text = "";
         sectOID = Convert.ToInt32(Request.QueryString["soid"].ToString());
         Session["soid"] = sectOID;
         HiddenSectionID.Value = sectOID.ToString ();
         InitializeQuestion(sectOID);
         Sections sec = new Sections();
         Assessment ass = new Assessment();
         int AssOID = sec.GetAssessmentOIDBySectionOID(sectOID);
         if (ass.GetAssessmentStatusByOID(Convert.ToInt32(AssOID)) == 1)
         {
             HiddenAssessmentLocked.Value = "1";
         }
         else
         {
             HiddenAssessmentLocked.Value = "0";
         }
     }
     else
     {
        // sectOID=Convert.ToInt32(Session["soid"]);
         //InitializeQuestion(sectOID);
     }
 }
Esempio n. 46
0
    private void Initialize(int AOID)
    {
        try
        {

            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(AOID);
            Label lblSect;
            Label lineBreak=new Label();
            lineBreak.Text = "<br />";
            //LabelAssessment.Text = "Exam for assessment " + ass.AssessmentName;

            foreach (Section s in ass.SectionList)
            {
                //lblSect = new Label();
                //lblSect.Text = s.SectionName;
                //PlaceHolderMain.Controls.Add(lblSect);

                //PlaceHolderMain.Controls.Add(InsertLineBreaks(1));
                //Each Question
                foreach (Question q in s.QuestionList)
                {
                   // PlaceHolderMain.Controls.Add(InsertLineBreaks(1));
                    lblSect = new Label();
                    lblSect.Text = q.OrderNo+". "+q.QuestionText;
                    PlaceHolderMain.Controls.Add(lblSect);

                    if (q.RespAction == "Radio Button")
                    {
                        //Panel p = new Panel();

                        RadioButtonList rblist = new RadioButtonList();
                        rblist.ID = q.QuestionOID.ToString();

                        //Each Question Response
                        foreach (QuestionResponse resp in q.QuestionRespList)
                        {
                            rblist.Items.Add(resp.Response);
                        }
                        //p.Controls.Add(rblist);
                        ///PlaceHolderMain.Controls.Add(InsertLineBreaks(1));
                        PlaceHolderMain.Controls.Add(rblist);
                    }
                    else if (q.RespAction == "Check Box")
                    {
                        //Panel p = new Panel();
                        CheckBoxList chlist = new CheckBoxList();
                        chlist.ID = q.QuestionOID.ToString();

                        //Each Question Response
                        foreach (QuestionResponse resp in q.QuestionRespList)
                        {
                            chlist.Items.Add(resp.Response);
                        }
                        //p.Controls.Add(chlist);
                        //PlaceHolderMain.Controls.Add(InsertLineBreaks(1));
                        PlaceHolderMain.Controls.Add(chlist);
                    }

                    else if (q.RespAction == "Drop Down")
                    {
                        //Panel p = new Panel();
                        DropDownList ddl = new DropDownList();
                        ddl.ID = q.QuestionOID.ToString();

                        //Each Question Response
                        foreach (QuestionResponse resp in q.QuestionRespList)
                        {
                            ddl.Items.Add(resp.Response);
                        }
                        //p.Controls.Add(ddl);
                        PlaceHolderMain.Controls.Add(ddl);
                    }

                    PlaceHolderMain.Controls.Add(InsertLineBreaks(1));
                }
                //PlaceHolderMain.Controls.Add(InsertLineBreaks(1));

            }
        }
        catch (Exception ex)
        { }
    }
Esempio n. 47
0
    private void NonScoreTable(int AOID)
    {
        StringBuilder sb = new StringBuilder();

        Assessment ass = new Assessment();
        if (AOID != 0)
        {
            ass = ass.GetAssessmentByOID_QuestionSheet(AOID);
            Section sec;
            for (int sn = 0; sn < ass.SectionList.Count; sn++)
            {
                sec = ass.SectionList[sn];

                if (sec.SectionName == "NoScore")
                {
                   // AllQList.Clear();
                    Collection<Question> QList = new Collection<Question>();
                    QList = sec.QuestionList;

                for (int i = 0; i < QList.Count; i++)
                {

                    Question qu = QList[i];
                    {
                        AllQList.Add(qu);
                    }
                }

                sb.Append(" <table width ='100%' >");

                sb.Append("<tr>");
                sb.Append("<td width='100%' valign='top'>");
                sb.Append(" <table width ='100%' >");
                sb.Append("<tr>");

                int countLoop = 0;
                int modCounter = 0;
                foreach (Question q in AllQList)
                {
                    sb.Append(" <td class='Groupnonscorequestion_" + QuestionCounter + "'>");
                    sb.Append("<div  class='qustion_title_bg' id='div" + q.QuestionOID + "'>" + q.QuestionText + "</div> <br />");
                    //sb.Append("<div id ='" + q.QuestionOID + "'>" + q.QuestionRespList.Count + "</div> <br />");
                    sb.Append("<input type= 'hidden' id ='" + q.QuestionOID + "' value= '" + q.QuestionRespList.Count + "' />");
                    countLoop = 0;
                    modCounter++;

                    foreach (QuestionResponse resp in q.QuestionRespList)
                    {
                        countLoop = countLoop + 1;
                        sb.Append("<label><input class='nonscorequestions_" + QuestionCounter +"' id='Radio" + q.QuestionOID + countLoop + "' value =" + resp.Response + " name='A" + q.QuestionOID + resp.QuestionResponseOID + "' onclick=' clearAllRadios(" + q.QuestionOID + countLoop + ", " + q.QuestionRespList.Count + ",0)' type='radio' runat='server' enableviewstate='true'/>" + resp.Response + "</label><br />");
                    }
                    sb.Append("</td>");
                    if (modCounter % 2 == 0)
                    {
                        sb.Append("</tr>");
                        sb.Append("<tr>");

                    }
                    QuestionCounter++;

                }
                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append(" </table>");
                sb.Append(" </td>");
                sb.Append("</tr>");

                sb.Append(" </table>");

            }
            }
            divSoreTable.InnerHtml = sb.ToString();

        }
    }
Esempio n. 48
0
    //Save Value For Score Section
    private void GetValueForScore( int answerOID)
    {
        bool res = false;
        try
        {
            string fieldName1 = null;
            string fieldName2 = null;
            string fieldName3 = null;
            string fieldName4 = null;
            string fieldName5 = null;
            string fieldName6 = null;

            string fieldName11 = null;
            string fieldName22 = null;
            string fieldName33 = null;
            string fieldName44 = null;
            string fieldName55 = null;
            string fieldName66 = null;

            Student student = (Student)(Session["currentStd"]);
            int aoid = Convert.ToInt32(Session["aoid"].ToString());

            //Get Assessment By OID
            ass = ass.GetAssessmentByOID(aoid);
            //Assign Value to Answer
            ans = ans.GetAnswerByStudentOIDAndAOID(student.StudentOID, aoid);
          // if (ans == null)
            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)
                        {
                            ansDetail = new AnswerDetail();
                            ansDetail.CreatedBy = 1;
                            ansDetail.SectionOID = s.SectionOID;
                            ansDetail.QuestionOID = q.QuestionOID;

                            fieldName11 = Convert.ToString("A1" + q.QuestionOID);
                            fieldName1 = Request.Form[fieldName11];
                            fieldName22 = Convert.ToString("A2" + q.QuestionOID);
                            fieldName2 = Request.Form[fieldName22];
                            fieldName33 = Convert.ToString("A3" + q.QuestionOID);
                            fieldName3 = Request.Form[fieldName33];
                            fieldName44 = Convert.ToString("A4" + q.QuestionOID);
                            fieldName4 = Request.Form[fieldName44];
                            fieldName55 = Convert.ToString("A5" + q.QuestionOID);
                            fieldName5 = Request.Form[fieldName55];
                            fieldName66 = Convert.ToString("A6" + q.QuestionOID);
                            fieldName6 = Request.Form[fieldName66];

                            if (fieldName1 == "on")
                            {
                                response = "Not true at all";

                                answerPoint = q.Reverse==0? 1:6;
                                //res = true;
                            }

                            else if (fieldName2 == "on")
                            {
                                response = "Somewhat Untrue";
                                answerPoint = q.Reverse == 0 ? 2 : 5;
                                //res = true;
                            }
                            else if (fieldName3 == "on")
                            {
                                response = "Slightly Untrue ";
                                answerPoint = q.Reverse == 0 ? 3 : 4;
                                //res = true;
                            }
                            else if (fieldName4 == "on")
                            {
                                response = "Slightly True ";
                                answerPoint = q.Reverse == 0 ? 4 : 3;
                                //res = true;
                            }
                            else if (fieldName5 == "on")
                            {
                                response = "Somewhat True ";
                                answerPoint = q.Reverse == 0 ? 5 : 2;
                                //res = true;
                            }
                            else if (fieldName6 == "on")
                            {
                                response = "Completely True";
                                answerPoint = q.Reverse == 0 ? 6 : 1;
                                //res = true ;
                            }
                            //else
                            //{
                            //    response = "No Answer";
                            //    answerPoint = 0;
                            //    //res = true ;
                            //}
                            QuestionResponse  Qres=new QuestionResponse ();

                            //int answerPoint=Qres.GetQuestionFlagPointByQOIDAndResponse(q..QuestionOID ,response);
                            ansDetail.AnswerPoint = answerPoint;
                            ansDetail.Response = response;
                            ansDetailList.Add(ansDetail);
                        }
                    }
                }

                //Assign Answer Details List to
                ans.AnswerDetailList = ansDetailList;

                //Save
                if (answerOID > 0)
                {
                    ans.addAnswerDetails(answerOID);
                }
                //else
                //{
                //    ans.AddAnswer();
                //}
            }
        }
        catch
        { }
        //return res;
    }
Esempio n. 49
0
    //Save Value For NonScore Section
    private int GetValueNonScore()
    {
        try
        {
            int answerOID = 0;

            Student student = (Student)(Session["currentStd"]);
            int aoid = Convert.ToInt32(Session["aoid"].ToString());

            //Get Assessment By OID
            ass = ass.GetAssessmentByOID_QuestionSheet(aoid);
            //Assign Value to Answer
            ans = ans.GetAnswerBySOIDAndAOID(student.StudentOID, aoid);
            if (ans == null)
            {
                ans = new Answer();
                ans.CreatedDate = DateTime.Now;
                ans.AssessmentOID = ass.AssessmentOID;
                ans.CreatedBy = 1;
                ans.NumberOfPrinted = 0;
                ans.BannerID = student.StudentID;
                ans.StudentOID = student.StudentOID;//Get Currently Login Student OID
                ansDetailList.Clear();
                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;
                                }
                                //else
                                //{
                                //    response = "No Answer";
                                //}

                            }

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

                //Assign Answer Details List to
                ans.AnswerDetailList = ansDetailList;

                //Save
                if (ans.AnswerOID > 0)
                {
                    ans.addAnswerDetails(ans.AnswerOID);
                    ansDetailList.Clear();
                }
                else
                {
                    answerOID = ans.AddAnswer();
                    ansDetailList.Clear();
                }

            }
            return answerOID;
        }
        catch
        {
            return 0;
        }
    }
Esempio n. 50
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;
        }
    }
Esempio n. 51
0
    //Check Value For Score
    private bool CheckValueForScore()
    {
        bool res = true;
        try
        {
            #region Variable
            string fieldName1 = null;
            string fieldName2 = null;
            string fieldName3 = null;
            string fieldName4 = null;
            string fieldName5 = null;
            string fieldName6 = null;

            string fieldName11 = null;
            string fieldName22 = null;
            string fieldName33 = null;
            string fieldName44 = null;
            string fieldName55 = null;
            string fieldName66 = null;
            #endregion
            Student student = (Student)(Session["currentStd"]);
            int aoid = Convert.ToInt32(Session["aoid"].ToString());
            ass = ass.GetAssessmentByOID(aoid);
            ans = ans.GetAnswerBySOIDAndAOID(student.StudentOID, aoid);
            if (ans == null)
            {
                ans = new Answer();
                foreach (Section s in ass.SectionList)
                {
                    if (s.SectionName != "NoScore")
                    {

                        foreach (Question q in s.QuestionList)
                        {
                            #region Initialization
                            ansDetail = new AnswerDetail();
                            fieldName11 = Convert.ToString("A1" + q.QuestionOID);
                            fieldName1 = Request.Form[fieldName11];
                            fieldName22 = Convert.ToString("A2" + q.QuestionOID);
                            fieldName2 = Request.Form[fieldName22];
                            fieldName33 = Convert.ToString("A3" + q.QuestionOID);
                            fieldName3 = Request.Form[fieldName33];
                            fieldName44 = Convert.ToString("A4" + q.QuestionOID);
                            fieldName4 = Request.Form[fieldName44];
                            fieldName55 = Convert.ToString("A5" + q.QuestionOID);
                            fieldName5 = Request.Form[fieldName55];
                            fieldName66 = Convert.ToString("A6" + q.QuestionOID);
                            fieldName6 = Request.Form[fieldName66];
                            #endregion

                            #region Check
                            if (fieldName1 == "on")
                            {
                              res = true;
                            }

                            else if (fieldName2 == "on")
                            {
                               res = true;
                            }
                            else if (fieldName3 == "on")
                            {
                               res = true;
                            }
                            else if (fieldName4 == "on")
                            {
                               res = true;
                            }
                            else if (fieldName5 == "on")
                            {
                               res = true;
                            }
                            else if (fieldName6 == "on")
                            {
                               res = true;
                            }
                            else
                            {

                                res = false;
                                return res;

                            }

                            #endregion
                        }
                    }
                }

            }
        }
        catch
        { }
        return res;
    }
Esempio n. 52
0
    protected void Page_Load(object sender, EventArgs e)
    {
        lblAssessmentName.Text = "";
        Label1.Text = "";
        if (!Page.IsPostBack)
        {
            //int assOID = Convert.ToInt32(Request.QueryString["aid"].ToString());
            //int sectOID = Convert.ToInt32(Request.QueryString["sid"].ToString());
            int aid = (Session["aoid"] != null) ? Convert.ToInt32(Session["aoid"].ToString()) : 0;
            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(aid);
            if (ass!=null )
            {
                lblAssessmentName.Text = ass.AssessmentName;
            }
            StringBuilder sb = new StringBuilder();
            //Session["soid"] = sectOID;
            //Initialize(aid);
            Student student = (Student)(Session["currentStd"]);
            if (student != null)
            {
                lblStudentID.Text = student.StudentID;
                string strFullName = student.FullName;
                string[] strNames = null;
                if (strFullName.Contains(','))
                {
                    strNames = strFullName.Split(',');
                }
                else
                {
                    strNames = strFullName.Split(' ');
                }
                //lblFirstName.Text = strNames[0];
                lblFirstName.Text = student.FirstName;
                //lblLastName.Text = strNames[1];
                lblLastName.Text = student.LastName ;
                if (student.BirthDate  != null)
                {
                    lblBirthDate.Text = Convert.ToDateTime(student.BirthDate.ToString()).ToShortDateString();
                }
                lblProgram.Text = student.MajorProgramEnrollment ;

            }
            if (!IsExist( aid))
            {

                NonScoreTable(aid);
                ScoreTable(aid);

            }
            else
            {
                //ButtonSubmit.Visible = true  ;
                Response.Write("<b>You have already sit for this section</b>");
            }

        }
    }
 public void AddToAssessments(Assessment assessment)
 {
     base.AddObject("Assessments", assessment);
 }
Esempio n. 54
0
    private void PrintIntervention(int aid, string studentID,string StuEmail)
    {
        try
        {
            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(aid);
            ResultEmail resultEmail = new ResultEmail();
            resultEmail = resultEmail.GetResultEmailByAOID(aid);

            if (resultEmail == null)
                return;

            Student student = new Student().GetStudentByStudentOID(studentID);

            StringBuilder sb = new StringBuilder();
            sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:100%; margin:0px 30px 0px 30px'>");

            sb.Append("<tr>");
            sb.Append("<td align='center'  style='font-size:24px; font-weight:bold;'> " + ass.AssessmentName + " Feedback Report</td>");
            sb.Append("</tr>");
            sb.Append("<tr>");
            sb.Append("<td>CVTC applicant: <b>" + student.FullName + "</b> Program Interest: <b>" + student.MajorProgramEnrollment + "</b></td>");
            sb.Append("</tr>");
            sb.Append("<tr>");
            sb.Append("<td > <br />" + resultEmail.Header + "</td>");
            sb.Append("</tr>");
            sb.Append("<tr>");
            sb.Append("<td ><br /><b>*Your individual Inventory of Student Success assessment results suggest . . .</b><br /></td>");
            sb.Append("</tr>");

            StudentRank studentRank = new StudentRank();
            Collection<StudentRank> studentRankList = studentRank.GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID);

            int i = 0;
            string txtSign = "", txtComments = "";
            sb.Append("<td>");
            sb.Append("<table cellpadding='0px' cellspacing='0px' style='width:80%;'>");
            foreach (StudentRank SR in studentRankList)
            {
                txtComments = SR.Comment;
                foreach (Section s in ass.SectionList)
                {
                    if (SR.SectionOID == s.SectionOID)
                    {
                        if (SR.Rank >= s.Medium)
                        {
                            txtSign = "+";
                        }
                        else if ((SR.Rank < s.Medium) && (SR.Rank >= s.Low))
                        {
                            txtSign = "~";
                        }
                        else if ((SR.Rank < s.Low))
                        {
                            txtSign = "-";
                        }
                        //else
                        //{
                        //    txtSign = "-";
                        //    //txtComments = "";
                        //}
                        break;
                    }
                }

                if (i % 2 == 0)
                {
                    sb.Append("<tr>");
                    sb.Append("<td align='right' valign='middle' style='width:2%'><b>" + txtSign + "</b></td>");
                    sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + txtComments + " </td>");
                    //sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + SR.Rank + " </td>");
                }
                else
                {
                    sb.Append("<td align='right'  valign='middle' style='width:2%'><b>" + txtSign + "</b></td>");
                    sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + txtComments + " </td>");
                    //sb.Append("<td style='width:48%; border: thin solid #000000; padding:10px;'> " + SR.Rank + " </td>");
                    sb.Append("</tr>");
                }
                i++;
                txtSign = "";
                txtComments = "";
            }

            if (studentRankList.Count % 2 == 0)
            {
                sb.Append("<tr>");
                sb.Append("<td colspan='4'><br />*( +above average ~average -below average )</td>");
                sb.Append("</tr>");
            }
            else
            {
                sb.Append("<td colspan='2'><br /> *( +above average ~average -below average )</td>");
                sb.Append("</tr>");
            }
            sb.Append("</table>");
            sb.Append("</td>");
            sb.Append("<tr>");
            sb.Append("<td > <br />" + resultEmail.ShowAboveResult + "</td>");
            sb.Append("</tr>");
            sb.Append("</table>");

            string StudentEmail=null;
            if (ConfigurationManager.AppSettings["productionMode"].ToString() == "OFF")
            {
                StudentEmail = System.Web.Configuration.WebConfigurationManager.AppSettings["asseeementEmail"].ToString();
            }
            else if (ConfigurationManager.AppSettings["productionMode"].ToString() == "ON")
            {
                StudentEmail = StuEmail;
                if (StudentEmail == null || StudentEmail == "")
                {
                    StudentEmail = System.Web.Configuration.WebConfigurationManager.AppSettings["asseeementEmail"].ToString();
                }
            }

            this.SendMail(StudentEmail, "Assesment feedback report ", sb.ToString());
            //this.SendMail("*****@*****.**", "Assesment feedback report ", sb.ToString());

        }
        catch (Exception ex)
        { }
    }
Esempio n. 55
0
    private void PrintIntervention(int POID, int RiskOID, string BannerID,int AOID)
    {
        try
        {
            Interventions intervention = new Interventions();
            intervention = intervention.GetInterventionByOID(POID);

            if (intervention != null)
            {
                 Student stdnt = new Student();

                int StdOID = stdnt.GetStudentOIDByStudentBannerID(Request.QueryString["soid"]);
                stdnt = stdnt.GetStudentByOID(StdOID);

                if (stdnt != null)
                {
                    string html = "";
                    Assessment ass = new Assessment();

                    //Create Html
                    html += "<table width='100%' ><tr><td><img alt='Logo' src='../../images/chippewavtc_logo.jpg' /></td><td style='text-align:center;'><span style='font-size:medium;font-weight:bold;'> Steps to Success: CVTC's commitment to helping YOU succeed!</span><br/><span style='text-align:center;'> Inventory of Student Success: Personalized Success Plan </span></td></tr></table>";
                    html += "<table width='100%'><tr><td style='width:45%;'>Success Steps For:<br /><b>First Name :</b>" + stdnt.FirstName + "  <b>Last Name :</b> " + stdnt.LastName + "</td><td> <div style='background-color: #C0C0C0;float:left;width:20%;'>Program&nbsp;&nbsp;</div><div style='padding-left:10px;border:solid 1px black;width:75%; float:left;'>" + stdnt.MajorProgramEnrollment + "</div></td></tr></table>";
                    //ass.GetAssessmentByAssessmentOID(AOID);
                    //if (ass != null)
                    //{
                    //html += "<table width='100%'><tr><td style='width:45%;'><b>Assessment Name :  </b><b>" + ass.AssessmentName + "</b></td><td> </td></tr></table>";
                    //}

                    html += "<table width='100%'><tr><td style='border:solid 1px black;'>Inventory of Student Success results provide comparsions of your attitudes and confidence with other<br />    entering CVTC students in key focus areas that could affect your academic performance and program<br /> persistance:     </td></tr></table>";

                    //Collection<Interventions> interventions = intervention.GetInterventionByStudentOID(intervention.StudentOID);

                    Collection<Interventions> interventions = new Collection<Interventions>();
                    interventions = intervention.GetInterventionByAssOID(StdOID, RiskOID,AOID);

                     foreach (Interventions inter in interventions)
                     {
                         //Start
                         html += "<table style='width: 100%;'>";
                         //Get Sectionwise Student Rank
                         StudentRank studentRank = new StudentRank();
                         // Collection<StudentRank> _list = studentRank.GetStudentRankByOID(stdnt.StudentOID);
                         int AssessmentOID = 0;
                         //Assessment ass = new Assessment();

                        // AssessmentOID = ass.GetAssessmentOIDByAssessmentName(ddlAssessment.SelectedItem.Text);

                        // Collection<Assessment> assList = new Collection<Assessment>();
                         //assList = ass.GetAssessmentBySOID(BannerID);
                         ass.GetAssessmentByAssessmentOID(AOID);
                         if (ass != null)
                         {
                             //foreach (Assessment assessment in assList)
                             //{
                             Collection<StudentRank> _list = studentRank.GetStudentRankBySOIDandAOID(StdOID, ass.AssessmentOID);
                             //if
                             //for (int i = 0; i < 5; i++)
                             foreach (StudentRank stRank in _list)
                             {

                                 html += "<tr>";
                                 html += "<td style='border:solid 1px black;background-color:#727272;width:200px;'>" + stRank.SectionName + "</td>";
                                 html += "<td style='border:solid 1px black;width:50px;text-align:center;'>" + stRank.Rank.ToString() + "</td>";
                                 html += "<td style='border:solid 1px black;'>" + stRank.Comment + "</td>";
                                 html += "</tr>";
                                 //break;
                             } break;
                             //}
                         }
                             html += "</table>";

                             //End

                     }
                    html += "<table style='width: 100%; border:solid 1px black;'>    <tr  >    <td>COMPASS test scores measure your academic readiness for college coursework in four broad areas:</td>    </tr>        </table>";

                    html += " <table style='width: 60%; '>    <tr><td style='background-color:#727272;width:200px;'>COMPASS Pre-Algebra</td><td style='width:100px; border:solid 1px black;'>" + stdnt.PrealgebraTestScore + "</td><td style='background-color:#727272;width:200px;'>COMPASS Writing</td><td style='width:100px; border:solid 1px black;'>" + stdnt.CompassWrittingTestScore + "</td></tr>   <tr><td style='background-color:#727272;width:200px;'>COMPASS Algebra</td><td style='width:100px; border:solid 1px black;'>" + stdnt.CompassalgebraTestScore + "</td><td style='background-color:#727272;width:200px;'>COMPASS Reading</td><td style='width:100px; border:solid 1px black;'>" + stdnt.CompassReadingTestScore + "</td></tr> </table>";
                    html += "<br/>";

                    int counter = 0;
                    //Collection<Interventions> interventionsList = intervention.GetInterventionByStudentOID(StdOID,RiskOID);

                    foreach (Interventions inter in interventions)
                    {
                        counter++;
                        #region Printing Checkboxes

                        html += "<table style='width: 100%; '>";
                        html += "<tr><td style='width:60px;font-size:medium;font-weight:bold;'></td><td style='background-color:#727272;width:100px;'> Assessment Name  : </td><td>" + inter .AssessmentName   + "</td><td></td></tr>";
                        html += "<tr><td style='width:60px;font-size:medium;font-weight:bold;'>Step " + counter.ToString() + "</td><td style='background-color:#727272;width:100px;'> Plan Target</td><td>" + inter.DomainName + "</td><td></td></tr>";
                        html += "<tr><td >&nbsp;</td><td style='background-color:#727272;width:100px;'> Intervention</td><td>" + inter.InterventionName + "</td><td></td></tr>";
                        html += "<tr><td >&nbsp;</td><td > &nbsp;</td><td style='background-color:#727272; width:150px;'>CVTC Advocate </td><td>" + inter.UserName + "</td></tr>";
                        html += "<tr><td >&nbsp;</td><td > &nbsp;</td><td style='background-color:#727272; width:100px;'>Action Date </td><td>" + inter.LatestActionDate;

                        html += "&nbsp;&nbsp;Prescribed&nbsp;";
                        if (inter.Prescribed == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }

                        html += "&nbsp;Participating&nbsp;";
                        if (inter.Participating == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }

                        html += "&nbsp;Internal&nbsp;";
                        if (inter.Internal == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }

                        html += "&nbsp;Urgent&nbsp;";
                        if (inter.Urgent == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }

                        html += "&nbsp;Completed&nbsp;";
                        if (inter.Completed == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }

                        html += "</td></tr>";
                        html += "<tr><td >&nbsp;</td><td > &nbsp;</td><td style='background-color:#727272; width:100px;'>Contact Date </td><td>" + inter.LatestContact;
                        html += "&nbsp;&nbsp;Email&nbsp;";
                        if (inter.Email == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }
                        html += "&nbsp;&nbsp;Telephone&nbsp;";
                        if (inter.Telephone == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }
                        html += "&nbsp;&nbsp;In Person&nbsp;";
                        if (inter.InPerson == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }
                        html += "&nbsp;&nbsp;Hand-Off&nbsp;";
                        if (inter.HandOff == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }
                        html += "&nbsp;&nbsp;Testing&nbsp;";
                        if (inter.Testing == 1)
                        {
                            html += "<img alt='' src='../../images/tic-pic.png' />";
                        }
                        else
                        {
                            html += "<img alt='' src='../../images/nonetic-pic.png' />";
                        }
                        #endregion
                        html += "</td></tr>";
                        html += "<tr><td >&nbsp;</td><td > &nbsp;</td><td style='background-color:#727272; width:150px;'>Comments :  </td><td>" + inter.Comment  + "</td></tr>";
                        html += "</table>";
                        html += "<br /><br />";

                        //End

                    }//foreach

                    //html += "<script type =\"text/javascript\">";
                    //html += "printDiv();";
                    //html += "</script>";
                    Response.Write(html.ToString());
                    //print_div1.InnerHtml = html;

                }//std
            }

        }
        catch (Exception ex)
        { }
    }
Esempio n. 56
0
    private void ScoreTable(int AOID)
    {
        StringBuilder sb = new StringBuilder();
        Assessment ass = new Assessment();
        # region Dummy JS
        //// Working For No Score
        //sb.Append("<script type='text/javascript'>");
        //sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); ");
        //sb.Append(" var mySplitLength = radioList.length; ");
        //sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); ");
        //sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); ");
        //sb.Append(" var firstDigit = radioList.substring(0,1); ");
        //sb.Append("i = parseInt(radioList); j= i ;");
        //sb.Append("var k = count - lastDigit;");
        //sb.Append("var i = parseInt(SplitResult) + '1';");
        //sb.Append(" alert('i='+i);alert('j+k='+(j+k));");
        //sb.Append(" for(i=i; i< j+k; i++){");
        //sb.Append("if( i != parseInt(radioList)) { ");
        //sb.Append(" var test111 = position + i;");
        //sb.Append(" alert(test111);");
        //sb.Append("document.getElementById(test111).checked = false;");
        //// End of IF
        //sb.Append("}");
        //// End of For
        //sb.Append("}");
        //// End of Function
        //sb.Append("}");

        //sb.Append("</script>");
        /// End of Working For No Score

           // //Working For Both
           //          sb.Append("<script type='text/javascript'>");
           //          sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); ");
           //          sb.Append(" var mySplitLength = radioList.length; ");
           //          sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); ");
           //          sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); ");
           //          sb.Append(" var firstDigit = radioList.substring(0,1); ");
           //          sb.Append("i = parseInt(radioList); j= i ;");
           //          sb.Append(" if(position =='Radio')  k = (count - lastDigit)-1; else k = count - lastDigit;");

           //          sb.Append("var i = parseInt(SplitResult) + '1';");
           //          //sb.Append(" alert('i='+i);alert('j+k='+(j+k));");
           //          sb.Append(" for(i=i; i<= j+k; i++){");
           //          sb.Append("if( i != parseInt(radioList)) { ");
           //          sb.Append(" var test111 = position + i;");
           //          //sb.Append(" alert(test111);");
           //          sb.Append("document.getElementById(test111).checked = false;");
           // // End of IF
           //          sb.Append("}");
           // // End of For
           //          sb.Append("}");
           // // End of Function
           //          sb.Append("}");

           //          sb.Append("</script>");
        ////End of Working For Both
        #endregion

        #region Active JS
        //Working For Both
        sb.Append("<script type='text/javascript'>");
        sb.Append(" function clearAllRadios(radioList, count,position){ if(count == '') count = 7; if(position==0) position = 'Radio'; else if(position==1) position = 'RadioButonLeft'; else position = 'RadioButonRight'; radioList = radioList.toString(); ");
        sb.Append(" var mySplitLength = radioList.length; ");
        sb.Append(" var SplitResult = radioList.substring(0,mySplitLength-1); ");
        sb.Append(" var lastDigit = radioList.substring(mySplitLength-1,mySplitLength); ");
        sb.Append(" var firstDigit = radioList.substring(0,1); ");
        sb.Append("i = parseInt(radioList); j= i ;");
        sb.Append(" if(position =='Radio')  k = (count - lastDigit)-1; else k = count - lastDigit;");

        sb.Append("var i = parseInt(SplitResult) + '1';");
        //sb.Append(" alert('i='+i);alert('j+k='+(j+k));");
        sb.Append(" for(i=i; i<= j+k; i++){");
        sb.Append("if( i != parseInt(radioList)) { ");
        sb.Append(" var test111 = position + i;");
        //sb.Append(" alert(test111);");
        sb.Append("document.getElementById(test111).checked = false;");
        // End of IF
        sb.Append("}");
        // End of For
        sb.Append("}");
        // End of Function
        sb.Append("}");

        sb.Append("</script>");
        //End of Working For Both
        #endregion

        sb.Append(" <table width ='100%' class='answer_table'cellpadding='0' cellspacing='0' >");

              //First tr
              sb.Append("  <tr> <td width='80%' style='padding:5px;'>        For the remaining questions, choose one response for each statement that            indicates your level of agreement or disagreement with the statement. Measuring         attitudes is hard to do, so asking the same questions again in different ways is         necessary to reduce error. Please be patient and answer each item as naturally         as you can without trying to recall previous responses. Bear in mind that there         are no 'right' or 'wrong' answers, simply provide the answer that best fits you.         For questions on study habits and teachers, reference mainly your pre-college experiences.</td>");

              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;><div  class ='answer11' > <img src='images/Untitled1.png' alt='Not true at all'/> </div> </td>");
              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div  class ='answer11' > <img src='images/Untitled2.png' alt='Somewhat Untrue'/> </div></td>");
              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div  class ='answer11' > <img src='images/Untitled3.png' alt='Slightly Untrue'/> </div></td>");
              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div  class ='answer11' > <img src='images/Untitled4.png' alt='Slightly True'/> </div></td>");
              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div  class ='answer11' >  <img src='images/Untitled5.png' alt='Somewhat True'/> </div> </td>");
              sb.Append("<td valign='bottom' width='3%' align='center' style='padding-left:5px;> <div  class ='answer11' >  <img src='images/Untitled6.png' alt='Completely True'/> </div> </td>");
              sb.Append("</tr>");
              //End first tr
            if (AOID != 0)
            {
                ass = ass.GetAssessmentByOID(AOID);
                Section sec ;
                int count = 0;
                for (int sn = 0; sn < ass.SectionList.Count; sn++)
                {

                    sec = ass.SectionList[sn];

                if (sec.SectionName != "NoScore")
                {
                    foreach (Question q in sec.QuestionList)
                    {

                        count++;
                        //Second tr
                        sb.Append("<tr>");

                        //Question td
                          #region Question td
                        if (q.QuestionOID % 2 == 0)
                        {

                            sb.Append("<td width='80%' style='padding:10px;' align='right' class='qustion_title_bg'>");

                        }
                        else
                        {
                            sb.Append("<td width='80%' style='padding:10px;' align='right' class='qustion_title_bg_alt'>");

                        }

                        sb.Append("<span id='span" + q.QuestionOID + "'>" + q.QuestionText + "</span> <br />");
                        sb.Append("</td>");
                        #endregion
                        //End Question td

                        //Responses td
                        sb.Append("<td colspan='6' width='20%'>");
                       // sb.Append("<div >");
                        sb.Append("<table class='Groupnonscorequestion_" + QuestionCounter + "' cellpadding='0' cellspacing='0'width='100%' >");
                        sb.Append("<tr>");

                        #region Responses

                        sb.Append("<td  align='center' width='3%' class ='answer1' >");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 1 + "' class='nonscorequestions_" + QuestionCounter + "'  title='Not true at all' name='A1" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 1 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        sb.Append("<td align='center' width='3%' class ='answer1'>");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 2 + "' class='nonscorequestions_" + QuestionCounter + "' title='Somewhat Untrue' name='A2" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 2 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        sb.Append("<td align='center' width='3%' class ='answer1'>");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 3 + "'  class='nonscorequestions_" + QuestionCounter + "' title='Slightly Untrue' name='A3" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 3 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        sb.Append("<td align='center' width='3%' class ='answer1' >");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 4 + "'  class='nonscorequestions_" + QuestionCounter + "' title='Slightly True' name='A4" + q.QuestionOID + "' type='radio' onclick=' clearAllRadios(" + q.QuestionOID + 4 + ", 7,0)' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        sb.Append("<td align='center' width='3%' class ='answer1'>");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 5 + "' class='nonscorequestions_" + QuestionCounter + "' title='Somewhat True' name='A5" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 5 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        sb.Append("<td align='center' width='3%' class ='answer1'>");
                        sb.Append("<label><input id='Radio" + q.QuestionOID + 6 + "'  class='nonscorequestions_" + QuestionCounter + "' title='Completely True' name='A6" + q.QuestionOID + "' onclick=' clearAllRadios(" + q.QuestionOID + 6 + ", 7,0)' type='radio' enableviewstate='true'runat='server'/></label>");
                        sb.Append("</td>");

                        #endregion

                        sb.Append("</tr>");
                        sb.Append("</table>");
                        //sb.Append("</div>");
                        sb.Append("</td>");
                        //End Responses td
                        sb.Append("</tr>");

                        //End Second tr
                    //}
                        QuestionCounter++;
                }
                }
            }
            sb.Append(" </table>");
            divNonScoreTable.InnerHtml = sb.ToString();
        }
    }
Esempio n. 57
0
    private void populateDropdownList()
    {
        Collection<Answer> answers = new Collection<Answer>();
        Answer ans = new Answer();
        answers = ans.GetAOIDByStudentID(lbtnID.Text);
        Assessment As = new Assessment();
        //if (answers == null)
        //{
            ddlAssesment.Items.Clear();
        //}
        foreach (Answer a in answers)
        {

            Collection<Assessment> assList = new Collection<Assessment>();
            assList = As.GetAssessmentByAssessmentOID(a.AssessmentOID);
            foreach (Assessment asmnt in assList)
            {
                ddlAssesment.Items.Add(asmnt.AssessmentName);
            }

            //ddlAssesment.DataSource = As.GetAssessmentByAssessmentOID(a.AssessmentOID);

        }
        ddlAssesment.DataBind();
        //int AssessmentOID = 0;

        //ans = ans.GetAnswerByStudentID(lbtnID.Text);
        //if (ans != null)
        //{
        //    AssessmentOID = ans.AssessmentOID;
        //}

        //Assessment As = new Assessment();

        //ddlAssesment.DataSource = As.GetAssessmentByAssessmentOID(AssessmentOID);
        //ddlAssesment.DataBind();
    }
Esempio n. 58
0
 public Assessment GetAssessmentsById(int CurrentUserId, int ID)
 {
     Assessment item = null;
     const string procName = "GET_ASSESSMENT_BY_ID";
     using (dbhAssessments = new DBHelper(ConnectionStrings.DefaultDBConnection))
     {
         dbhAssessments.AddParameter("@ID", ID);
         dbhAssessments.AddParameter("@CURRENTUSERID", CurrentUserId);
         IDataReader dr = dbhAssessments.ExecuteReader(procName);
         while (dr.Read())
         {
             item = new Assessment(dr);
         }
         dbhAssessments.Dispose();
     }
     return item;
 }
 public static Assessment CreateAssessment(int assessmentKey, int perceptionAssessmentMID, int perceptionAssessmentLID, int revisionNumber, string name, string description, string assessmentType, string author, string lastEditedBy, bool assessmentRandomlyAdministered, bool assessmentHasTimeLimit, int assessmentTimeLimit, string tenantId, string language)
 {
     Assessment assessment = new Assessment();
     assessment.AssessmentKey = assessmentKey;
     assessment.PerceptionAssessmentMID = perceptionAssessmentMID;
     assessment.PerceptionAssessmentLID = perceptionAssessmentLID;
     assessment.RevisionNumber = revisionNumber;
     assessment.Name = name;
     assessment.Description = description;
     assessment.AssessmentType = assessmentType;
     assessment.Author = author;
     assessment.LastEditedBy = lastEditedBy;
     assessment.AssessmentRandomlyAdministered = assessmentRandomlyAdministered;
     assessment.AssessmentHasTimeLimit = assessmentHasTimeLimit;
     assessment.AssessmentTimeLimit = assessmentTimeLimit;
     assessment.TenantId = tenantId;
     assessment.Language = language;
     return assessment;
 }
Esempio n. 60
0
    public void PrintIntervention(int aid, int rlst,string riskName)
    {
        try
        {
            Assessment ass = new Assessment();
            ass = ass.GetAssessmentByOID(aid);

            ResultLetterDetail letterDetail = null;
            ResultLetter resultLetter = new ResultLetter();
            resultLetter = resultLetter.GetResultLetterByAOID(aid);

            Collection<Answer> answers = new Answer().GetAnswerByAOIDAndRLST_ForPrintResultLetter(aid, rlst);

            //Collection<Student> studentList = new Student().GetAllStudentByResultLetterSentTimes(rlst);
            Collection<Student> studentList = new Collection<Student>();// new Student().GetAllStudentByResultLetterSentTimes(rlst);
            foreach (Answer answer in answers)
            {
                //Student student = new Student();
                Student student = new Student().GetStudentByStudentOID(answer.BannerID.ToString());
                RiskCalculation riskCalculation = new RiskCalculation();
                if (student != null)
                {
                    riskCalculation = riskCalculation.GetRiskCalculationByAOIDAndSOIDAndRiskName(aid, student.StudentOID,riskName);

                }

                // if (student.StudentOID == 0) break ;
                bool isContain = false;
                foreach (Student std in studentList)
                {
                    if (student.StudentOID == std.StudentOID)
                    {
                        isContain = true;
                    }
                }

                  if (!isContain && riskCalculation != null && student != null)
                  //if (!isContain && riskCalculation != null)

                    {
                        answer.UpdateAnswer_ForNumberofPrinted(aid, rlst, Convert.ToInt32(student.StudentOID));
                        answer.UpdateScoreDetailsTable_ForNumberofPrinted(aid, rlst, Convert.ToInt32(student.StudentOID));
                        studentList.Add(student);

                    }

            }

           // bool updateStatus = new Student().UpdateAllStudentByResultLetterSentTimes(rlst);

            List<ScoreDetailTable> scoreDetailTableList = new ScoreDetailTable().GetScoreDetailTableByAOID(ass.AssessmentOID);
            //List<ScoreDetailTable> scoreDetailTableList = new List<ScoreDetailTable>();
            StringBuilder sb = new StringBuilder();
            string dateStr = System.DateTime.Today.ToLongDateString();
            foreach (Student student in studentList)
            {
                //sb.Append("<table cellpadding='0' cellspacing='0'  style='page-break-after:always; width:90%; margin:0px 0px 0px 0px;' >");
                #region Header
                sb.Append("<table cellpadding='0' cellspacing='0'   style='width:100%; margin:10px 10px 5px 10px;font-size:12px; page-break-after:always; height:100%'>");

                sb.Append("<tr>");
                sb.Append("<td> " + dateStr + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> <br/>" + student.FullName + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> " + student.AddressOne + "</td>");
                sb.Append("</tr>");

                sb.Append("<tr>");
                sb.Append("<td> ");

                sb.Append("<table cellpadding='0' cellspacing='0' style='width:100%;'>");
                sb.Append("<tr>");
                sb.Append("<td align='left' style='font-size:12px'>");

                if (!string.IsNullOrEmpty(student.City))
                {
                    sb.Append(student.City);
                }
                if (!string.IsNullOrEmpty(student.State))
                {
                    sb.Append(", " + student.State);
                }
                if (!string.IsNullOrEmpty(student.ZIPCode))
                {
                    sb.Append(", " + student.ZIPCode);
                }

                sb.Append("</td> ");
                sb.Append("<td align='right'> Student ID: " + student.StudentID + "</td>");
                sb.Append("<tr>");
                sb.Append("</table>");

                sb.Append("</td>");
                sb.Append("</tr>");
                #endregion

                #region StudentName
                string studentFirstName = student.FullName;
                if (!string.IsNullOrEmpty(studentFirstName))
                {
                    try
                    {
                        if (studentFirstName.Contains(','))
                        {
                            studentFirstName = studentFirstName.Split(',')[1];
                        }
                    }
                    catch
                    { }
                }
                #endregion

                sb.Append("<tr>");
                sb.Append("<td><br/>Dear " + studentFirstName + ":</td>");
                sb.Append("</tr>");
               // sb.Append("</br><div id='Header' style='height:150px;position: relative;vertical-align:top;border:1px solid red'>");
                if (resultLetter != null)
                {

                    sb.Append("<tr>");

                    sb.Append("<td style='font-size:12px;border:1px''>" + resultLetter.Header + "</td>");
                    sb.Append("</tr>");

                }
               // sb.Append("</div>");
                sb.Append("<tr>");
                sb.Append("<td><br/>");
                sb.Append("<table cellpadding='0' cellspacing='0' style='width:98%;'>");
                sb.Append("<tr>");
                sb.Append("<td style='background:#d7d7d7; width:29%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>CATEGORY</b></td>");
                sb.Append("<td style='background:#d7d7d7; width:69%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>DEFINITION</b></td>");
                sb.Append("</tr>");

                //Collection<StudentRank> studentRankList_ = new StudentRank().GetStudentRankBySOIDandAOID(student.StudentOID, ass.AssessmentOID);

                #region SectionList
                foreach (Section s in ass.SectionList)
                {
                    if (s.SectionName == "NoScore") continue;
                    string definition = "", starValue = "";
                    if (resultLetter != null)
                    {
                        if (resultLetter.LetterDetail != null)
                        {
                            var tmp = from detail in resultLetter.LetterDetail
                                      where detail.SectionOID == s.SectionOID
                                      select detail;
                            letterDetail = tmp != null ? tmp.First() : null;
                        }
                    }
                #endregion
                    sb.Append("<tr>");
                    #region unused
                    //foreach (StudentRank SR in studentRankList)
                    //{
                    //    if (SR.SectionOID == s.SectionOID)
                    //    {
                    //        if (SR.Rank < s.Flag)
                    //        {
                    //            starValue = " *";
                    //            break;
                    //        }
                    //        else
                    //        { starValue = ""; }
                    //    }
                    //}
                    //scoreDetailTableList
                    #endregion

                    #region Star
                    foreach (ScoreDetailTable SR in scoreDetailTableList)
                    {
                        if ((SR.StudentOID == student.StudentOID) && (SR.SectionOID == s.SectionOID))
                        {
                            //if ((SR.Score*s.TotalQuestion) < s.Flag)
                            if ((SR.Rank) < s.Flag)
                            {
                                starValue = " *";
                                break;
                            }
                            else
                            {
                                starValue = "";
                                break;
                            }
                        }
                    }
                    #endregion

                    sb.Append("<td style='width:29%; border: thin solid #999; padding:8px;font-family:Calibri;font-size:10px;'><b>" + s.SectionName + starValue + "</b></td>");
                    definition = (letterDetail != null) ? letterDetail.SectionDefinition : "";

                    sb.Append("<td style='width:69%; border: thin solid #999; padding:8px; text-align:left; font-family:Calibri;font-size:10px;'>" + definition + "</td>");

                }

                sb.Append("</table>");
                //sb.Append("<div id='Footer' style='height:150px;position: relative;vertical-align:top;border:1px solid red'>");
                if (resultLetter != null)
                {
                    sb.Append("<tr>");
                    sb.Append("<td style='valign:top;font-size:12px;border:1px''><br/>" + resultLetter.ShowAboveResult + "</td>");
                    sb.Append("</tr>");
                }

                //sb.Append("</div>");

                sb.Append("</td>");
                sb.Append("</tr>");
                sb.Append("</table>");
                sb.Append("</table>");

            }
            ////print_div1.InnerHtml = sb.ToString();
            Response.Write(sb.ToString());
            return;
        }
        catch (Exception ex)
        {

        }
    }