示例#1
0
        public async Task <IActionResult> EditAssessmentType(AssessmentType assessmentModel)
        {
            if (ModelState.IsValid)
            {
                AssessmentType objAssessment = await _TeacherTestRepository.GetAssessmentById(assessmentModel.Assessment_Type_Id);

                objAssessment.Assessment_Type_Name = assessmentModel.Assessment_Type_Name;


                int result = await _TeacherTestRepository.UpdateAssessmentType(objAssessment);

                if (result == 1)
                {
                    TempData["Success"] = "Assessment Type Updated Successfully";
                    return(RedirectToAction("assessments", "Test", new { area = "Teachers" }));
                }
                else
                {
                    TempData["Error"] = "Updating Assessment Type Failed ";
                    return(RedirectToAction("assessments", "Test", new { area = "Teachers" }));
                }
            }

            return(View());
        }
示例#2
0
        public async Task <IActionResult> AddAssessmentType(AssessmentType objAssessment)
        {
            if (ModelState.IsValid)
            {
                AssessmentType newClass = new AssessmentType
                {
                    Assessment_Type_Name = objAssessment.Assessment_Type_Name
                };

                int result = await _TeacherTestRepository.AddAssessmentType(newClass);

                if (result == 1)
                {
                    TempData["Success"] = " Assessment Type Added Successfully";
                    return(RedirectToAction("assessments", "Test", new { area = "Teachers" }));
                }
                else
                {
                    TempData["Error"] = "Adding Assessment Type Failed";
                    return(RedirectToAction("assessments", "Test", new { area = "Teachers" }));
                }
            }

            return(View());
        }
示例#3
0
        /// <summary>
        /// Gets the specified entity data model and sets it as the current model, or retrieves the current model if none is specified.
        /// If the entity cannot be found, a newly-initialized model is created.
        /// </summary>
        /// <param name="entityId">The connection type identifier.</param>
        /// <returns></returns>
        private AssessmentType GetTargetEntity(int?entityId = null)
        {
            if (entityId == null)
            {
                entityId = hfEntityId.ValueAsInt();
            }

            string key = string.Format("AssessmentType:{0}", entityId);

            var entity = RockPage.GetSharedItem(key) as AssessmentType;

            if (entity == null)
            {
                var rockContext = this.GetDataContext();

                entity = new AssessmentTypeService(rockContext).Queryable()
                         .Where(c => c.Id == entityId)
                         .FirstOrDefault();

                if (entity == null)
                {
                    entity = new AssessmentType
                    {
                        Id       = 0,
                        IsActive = true
                    };
                }

                RockPage.SaveSharedItem(key, entity);
            }

            return(entity);
        }
示例#4
0
        /// <summary>
        /// Returns a long-form description of the enumeration.
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        public static string Description(this AssessmentType item)
        {
            string description = "";

            switch (item)
            {
            case AssessmentType.CommitteeDiscussion:
                description = "Committee chair uploads a document or set of documents (usually a PDF, e.g., an exit survey summary) to be discussed by committee asynchronously.";
                break;

            case AssessmentType.ReviewOfStudentWork:
                description = "A course instructor or committee chair uploads (if work does not exist in OSBLE), or flags in OSBLE (if work exists in OSBLE) student work for assessment. Either course instructor or the assessment committee then review the work against an assessment rubric specifying one or more target outcomes";
                break;

            case AssessmentType.CommitteeReview:
                description = "Committee engages in online discussion of their previous (independent) reviews of student work. (This assessment must be linked to a “Committee Review of Student Work” assessement).";
                break;

            case AssessmentType.AggregateAssessment:
                description = "Merges all reviews of student work for a given year, and reports average assessment ratings by outcome and student achievement level (low, medium, high).";
                break;

            default:
                description = "This assessment does not yet have a description. You should not see this message!.";
                break;
            }
            return(description);
        }
        public IEnumerable <AssessmentTypeModel> Index()
        {
            AssessmentType assessmentType = new AssessmentType(conStr);
            var            data           = assessmentType.Items();

            return(data);
        }
示例#6
0
        private void cmbAssessmentType_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            List <AssessmentType> assessmentTypes = cmbAssessmentType.Tag as List <AssessmentType>;
            AssessmentType        assessmentType  = assessmentTypes[cmbAssessmentType.SelectedIndex];

            txtSurcharge.Text = assessmentType.Surcharge.ToString();
        }
 public ICollection <AssessmentBaseController> GetComponentsForAssignmentType(AssessmentType type)
 {
     return(AllComponents
            .Cast <AssessmentBaseController>()
            .Where(a => a.ValidAssessmentTypes.Contains(type))
            .ToList());
 }
示例#8
0
        public static List <AssessmentType> GetAssessmentTypes()
        {
            List <AssessmentType> assessmentTypes = new List <AssessmentType>();

            using (SqlConnection conn = new SqlConnection(Connection.StringConnection))
            {
                conn.Open();
                using (SqlCommand comm = new SqlCommand("SELECT * FROM settings.assessment_types ORDER BY AssessmentTypeID ASC", conn))
                {
                    using (SqlDataReader reader = comm.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            AssessmentType type = new AssessmentType()
                            {
                                AssessmentTypeID = Convert.ToInt32(reader["AssessmentTypeID"]),
                                EducationLevel   = Convert.ToString(reader["EducationLevel"]),
                                AssessmentCode   = Convert.ToString(reader["AssessmentType"]),
                                Surcharge        = Convert.ToDouble(reader["Surcharge"]),
                                SchoolYearID     = Convert.ToInt32(reader["SchoolYearID"])
                            };
                            assessmentTypes.Add(type);
                        }
                    }
                }
            }
            return(assessmentTypes);
        }
示例#9
0
        /// <summary>
        /// Shows a form that allows the entity properties to be updated.
        /// </summary>
        /// <param name="assessmentType">Type of the connection.</param>
        private void ShowEditDetails(AssessmentType assessmentType)
        {
            if (assessmentType == null)
            {
                assessmentType = new AssessmentType();
            }
            if (assessmentType.Id == 0)
            {
                lReadOnlyTitle.Text = ActionTitle.Add(_entityType.FriendlyName).FormatAsHtmlTitle();
            }
            else
            {
                lReadOnlyTitle.Text = assessmentType.Title.FormatAsHtmlTitle();
            }

            SetEditMode(true);

            hlInactive.Visible = false;

            // General properties
            tbTitle.Text       = assessmentType.Title;
            cbIsActive.Checked = assessmentType.IsActive;
            tbDescription.Text = assessmentType.Description;

            tbAssessmentPath.Text = assessmentType.AssessmentPath;
            tbResultsPath.Text    = assessmentType.AssessmentResultsPath;

            cbRequiresRequest.Checked = assessmentType.RequiresRequest;

            if (assessmentType.MinimumDaysToRetake > 0)
            {
                nbDaysBeforeRetake.Text = assessmentType.MinimumDaysToRetake.ToString();
            }
        }
示例#10
0
 public IActionResult OnGet()
 {
     AssessmentType            = new AssessmentType();
     AssessmentType.Creator    = _UserManager.GetUserName(User);
     AssessmentType.CreateDate = DateTime.Now;
     return(Page());
 }
示例#11
0
        public ActionResult DeleteConfirmed(int id)
        {
            AssessmentType assessmentType = db.AssessmentTypes.Find(id);

            db.AssessmentTypes.Remove(assessmentType);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#12
0
        public void ParseAssesmentTypeParameterNull_Test()
        {
            // Arrange
            AssessmentTypeDTO assessmentTypeDTO = null;

            // Act
            AssessmentType assessmentType = factory.Parse(assessmentTypeDTO);
        }
示例#13
0
 public Assessment(string title, AssessmentType type, int weight, double result, CourseObjectChangedHandler callbackChanged)
 {
     this.title   = title;
     this.type    = type;
     this.weight  = (((weight >= 0) && (weight <= 100)) ? (weight) : (0));
     this.result  = (((result >= 0) && (result <= 100)) ? (result) : (0));
     this.Change += callbackChanged;
 }
    public void StartAssessment(AssessmentType assessmentType)
    {
        // here we make a new trial on-the-fly
        // this allows us to have a dynamic number of assessments controlled via the UI.
        var newTrial = mainBlock.CreateTrial();

        newTrial.settings.SetValue("assessment_type", assessmentType);
        newTrial.Begin();
        Invoke("EndAssessment", newTrial.settings.GetFloat("assessment_time"));
    }
示例#15
0
 public AddAssessment(Course course, AssessmentType type)
 {
     InitializeComponent();
     currentCourse           = course;
     assessmentType          = type;
     courseID                = currentCourse.CourseId;
     newAssessment.Type      = assessmentType.ToString();
     newAssessment.CourseID  = courseID;
     SaveAssessment.Clicked += SaveAssessmentClicked;
 }
示例#16
0
 public ActionResult Edit([Bind(Include = "AssessmentTypeID,Type")] AssessmentType assessmentType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(assessmentType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(assessmentType));
 }
示例#17
0
 public Assessment(AssessmentType type, double passingRate)
 {
     AssessmentType = type;
     SetAKeys       = CreateItems(type);
     SetBKeys       = CreateItems(type);
     SetCKeys       = CreateItems(type);
     SetBEnabled    = false;
     SetCEnabled    = false;
     PassingRate    = passingRate;
 }
示例#18
0
 public AssessmentTypeDTO Create(AssessmentType assessmentType)
 {
     return(new AssessmentTypeDTO()
     {
         Id = assessmentType.Id,
         Name = assessmentType.Name,
         Description = assessmentType.Description,
         URL = assessmentType.URL
     });
 }
示例#19
0
        public ActionResult Create([Bind(Include = "AssessmentTypeID,Type")] AssessmentType assessmentType)
        {
            if (ModelState.IsValid)
            {
                db.AssessmentTypes.Add(assessmentType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(assessmentType));
        }
示例#20
0
        private void LoadAssessmentTypes()
        {
            List <AssessmentType> assessmentTypes = AssessmentType.GetAssessmentTypes();

            cmbAssessmentType.Items.Clear();
            cmbAssessmentType.Tag = assessmentTypes;
            foreach (var item in assessmentTypes)
            {
                cmbAssessmentType.Items.Add(item.AssessmentCode);
            }
        }
示例#21
0
        public static AssessmentItem[] CreateItems(AssessmentType assessmentType)
        {
            int count = 0;

            switch (assessmentType)
            {
            case AssessmentType.Item10:
                count = 10;
                break;

            case AssessmentType.Item20:
                count = 20;
                break;

            case AssessmentType.Item30:
                count = 30;
                break;

            case AssessmentType.Item40:
                count = 40;
                break;

            case AssessmentType.Item50:
                count = 50;
                break;

            case AssessmentType.Item60:
                count = 60;
                break;

            case AssessmentType.Item70:
                count = 70;
                break;

            case AssessmentType.Item80:
                count = 80;
                break;

            case AssessmentType.Item90:
                count = 90;
                break;

            case AssessmentType.Item100:
                count = 100;
                break;
            }
            AssessmentItem[] items = new AssessmentItem[count];
            for (int i = 0; i < count; i++)
            {
                items[i] = new AssessmentItem(Key.A);
            }
            return(items);
        }
示例#22
0
        public static Assessment GetAssessment(AssessmentType assessmentType)
        {
            if (!Directory.Exists(Extension.AssetsDir))
            {
                Directory.CreateDirectory(Extension.AssetsDir);
            }
            string filepath = "";

            switch (assessmentType)
            {
            case AssessmentType.Item50:
                filepath = Extension.Item50;
                break;

            case AssessmentType.Item60:
                filepath = Extension.Item60;
                break;

            case AssessmentType.Item70:
                filepath = Extension.Item70;
                break;

            case AssessmentType.Item80:
                filepath = Extension.Item80;
                break;

            case AssessmentType.Item90:
                filepath = Extension.Item90;
                break;

            case AssessmentType.Item100:
                filepath = Extension.Item100;
                break;
            }
            if (!string.IsNullOrEmpty(filepath))
            {
                if (!File.Exists(filepath))
                {
                    File.WriteAllText(filepath, "");
                }
                string assessment = File.ReadAllText(filepath);
                if (string.IsNullOrEmpty(assessment))
                {
                    return(new Assessment(assessmentType, 75));
                }
                return(new Assessment(assessment));
            }
            else
            {
                return(null);
            }
        }
示例#23
0
        // GET: AssessmentTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AssessmentType assessmentType = db.AssessmentTypes.Find(id);

            if (assessmentType == null)
            {
                return(HttpNotFound());
            }
            return(View(assessmentType));
        }
示例#24
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssessmentSetType" /> class.
        /// </summary>
        /// <param name="inputs">List of courses serving as competency contexts</param>
        /// <returns></returns>
        public static AssessmentSetType Map(List <Assessment> inputs)
        {
            var contexts = new List <AssessmentType>();

            foreach (var input in inputs)
            {
                AssessmentType def = Map(input);
                contexts.Add(def);
            }

            AssessmentSetType type = new Models.AssessmentSetType(contexts);

            return(type);
        }
示例#25
0
        public async Task <int> UpdateAssessmentType(AssessmentType objAssessment)
        {
            try
            {
                _lmsDbContext.AssessmentType.Update(objAssessment);

                await _lmsDbContext.SaveChangesAsync();

                return(1);
            }
            catch (Exception ex)
            {
                return(-1);
            }
        }
示例#26
0
        public async Task <IActionResult> OnGetAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            AssessmentType = await _context.AssessmentType.FirstOrDefaultAsync(m => m.ID == id);

            if (AssessmentType == null)
            {
                return(NotFound());
            }
            return(Page());
        }
示例#27
0
        public async Task <int> AddAssessmentType(AssessmentType objAssessment)
        {
            try
            {
                await _lmsDbContext.AssessmentType.AddAsync(objAssessment);

                await _lmsDbContext.SaveChangesAsync();

                return(1);
            }
            catch (Exception ex)
            {
                // _logger.LogError($"The message is {ex.Message}. " + $"Stack trace is {ex.StackTrace}");
                return(-1);
            }
        }
示例#28
0
        public IList <ListViewModel> ListBranchByAssessmentType(AssessmentType assessmentType, Guid currentUserId)
        {
            var branchRepository       = _genericUnitOfWork.GetRepository <Branch, Guid>();
            IList <ListViewModel> list = new List <ListViewModel>();
            var userBranchIds          = _genericUnitOfWork.GetRepository <UserBranch, Guid>().GetAll().Where(y => y.UserId == currentUserId).Select(x => x.BranchId).ToList();

            if (assessmentType == AssessmentType.Self)
            {
                list = _mapper.Map <IList <Branch>, IList <ListViewModel> >(branchRepository.GetAll().Where(x => x.IsActive && userBranchIds.Contains(x.Id) && x.Id != new Guid(ApplicationConstants.HQBranchId)).ToList());
            }
            else if (assessmentType == AssessmentType.Cross)
            {
                list = _mapper.Map <IList <Branch>, IList <ListViewModel> >(branchRepository.GetAll().Where(x => x.IsActive && !userBranchIds.Contains(x.Id) && x.Id != new Guid(ApplicationConstants.HQBranchId)).OrderBy(c => c.Name).ToList());
            }
            return(list);
        }
示例#29
0
        public ActionResult Delete(int?assessmentTypePK)
        {
            IAssessmentTypesRepository assessmentTypesRepository = new AssessmentTypesRepository(db);

            if (assessmentTypePK != null)
            {
                AssessmentType assessmentType = assessmentTypesRepository.GetAssessmentTypeByPK((int)assessmentTypePK);

                assessmentType.Deleted = true;

                assessmentTypesRepository.SaveChanges();

                TempData["message"] = LayoutHelper.GetMessage("DELETE", assessmentType.AssessmentTypePK);
            }

            return(Redirect(Request.UrlReferrer.AbsoluteUri));
        }
示例#30
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            AssessmentType = await _context.AssessmentType.FindAsync(id);

            if (AssessmentType != null)
            {
                _context.AssessmentType.Remove(AssessmentType);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Index"));
        }
示例#31
0
 public AssessmentEvent(AssessmentType type, string location, SubjectDelivery subject, DateTime startDate, DateTime endDate)
     : this(type, location, subject)
 {
     TimePeriod = new TimePeriod(startDate, endDate);
 }
示例#32
0
 public AssessmentEvent(AssessmentType type, string location, SubjectDelivery subject, DateTime briefingDate)
     : this(type, location, subject)
 {
     BriefingDate = briefingDate;
 }
示例#33
0
 public AssessmentEvent(AssessmentType type, string location, SubjectDelivery subject)
 {
     Type = type;
     Location = location;
     Subject = subject;
 }
示例#34
0
 /// <summary>
 /// Sets the value of the <c>&lt;AssessmentType&gt;</c> element.
 /// </summary>
 /// <param name="val">A AssessmentType object</param>
 /// <remarks>
 /// <para>The SIF specification defines the meaning of this element as: "Indicates whether this assessment (form) is a standard administration or alternate."</para>
 /// <para>Version: 2.5</para>
 /// <para>Since: 2.4</para>
 /// </remarks>
 public void SetAssessmentType( AssessmentType val )
 {
     SetField( AssessmentDTD.ASSESSMENTFORM_ASSESSMENTTYPE, val );
 }