Example #1
0
        public static QuizDTO Entity2QuizDto(this vw_QZ_CourseQuizzes entity, bool certAvailable)
        {
            if (entity == null)
            {
                return(new QuizDTO());
            }

            return(new QuizDTO
            {
                QuizId = entity.QuizId
                , Sid = entity.Sid
                , Title = entity.Title
                , CourseId = entity.CourseId
                , Description = entity.Description
                , Instructions = entity.Instructions
                , IsMandatory = entity.IsMandatory
                , IsBackAllowed = entity.IsBackAllowed
                , Attempts = entity.Attempts
                , TimeLimit = entity.TimeLimit
                , AvailableAfter = entity.AvailableAfter
                , Status = Utils.ParseEnum <QuizEnums.eQuizStatuses>(entity.StatusId)
                , ScoreRule = Utils.ParseEnum <QuizEnums.eScoreRules>(entity.ScoreRuleId)
                , PassPercent = entity.PassPercent
                , RandomOrder = entity.RandomOrder
                , TotalQuestions = entity.TotalQustions
                , IsQuizValid = entity.IsValid ?? false
                , IsAttached = entity.IsAttached
                , CertificateAvailable = certAvailable
                , AttachCertificate = entity.AttachCertificate
            });
        }
Example #2
0
        public static QuizListDTO Entity2QuizListDto(this vw_QZ_CourseQuizzes entity)
        {
            if (entity == null)
            {
                return(new QuizListDTO());
            }

            return(new QuizListDTO
            {
                QuizId = entity.QuizId
                , Sid = entity.Sid
                , Title = entity.Title
                , CourseId = entity.CourseId
                , CourseName = entity.CourseName
                , Status = Utils.ParseEnum <QuizEnums.eQuizStatuses>(entity.StatusId)
                , AddOn = entity.AddOn
                , Completed = entity.TotalCompleted
                , Attempts = entity.Attempts
                , PassPercent = entity.PassPercent
                , TimeLimit = entity.TimeLimit
                , AvailableAfter = entity.AvailableAfter
                , IsMandatory = entity.IsMandatory
                , Taken = entity.TotalTaken
                , TotalFailed = entity.TotalFailed
                , TotalPass = entity.TotalPass
                , IsQuizValid = entity.IsValid ?? false
                , IsAttached = entity.IsAttached
                , AttachCertificate = entity.AttachCertificate
                , AvgScore = 0
                , OpenRequests = entity.OpenRequests
                , Author = new BaseUserInfoDTO {
                    UserId = entity.AuthorUserId, FullName = entity.Entity2AuthorFullName(), Email = entity.Email
                }
            });
        }
Example #3
0
 public static SelectListItem Entity2SelectListItem(this vw_QZ_CourseQuizzes entity)
 {
     return(new SelectListItem
     {
         Value = entity.QuizId.ToString()
         , Text = entity.Title
     });
 }
Example #4
0
 //
 public static string Entity2AuthorFullName(this vw_QZ_CourseQuizzes entity)
 {
     return(CombineFullName(entity.FirstName, entity.LastName, entity.Nickname));
 }