예제 #1
0
        public virtual ScormPackageSettings CreateForUpdateSettings(Int32 idPerson, String ipAddress, String proxyIpAddress, liteRepositoryItemVersion version, EvaluationType evaluation, dtoScormItemEvaluationSettings dto)
        {
            ScormPackageSettings item = new ScormPackageSettings()
            {
                IdItem = version.IdItem, IdVersion = version.Id, UniqueIdItem = version.UniqueIdItem, UniqueIdVersion = version.UniqueIdVersion, Repository = version.Repository
            };

            item.CreateMetaInfo(idPerson, ipAddress, proxyIpAddress);
            item.ActivityCount        = ActivityCount;
            item.EvaluationType       = evaluation;
            item.CheckScore           = false;
            item.CheckScormCompletion = false;
            item.CheckTime            = false;
            item.MinScore             = 0;
            item.MinTime        = 0;
            item.UseScoreScaled = false;

            switch (evaluation)
            {
            case ScormSettings.EvaluationType.CustomForPackage:
                if (dto != null)
                {
                    item.CheckScore           = dto.CheckScore;
                    item.CheckScormCompletion = dto.CheckScormCompletion;
                    item.CheckTime            = dto.CheckTime;
                    if (dto.CheckTime)
                    {
                        item.MinTime = dto.MinTime;
                    }
                    if (dto.CheckScore)
                    {
                        item.MinScore       = dto.MinScore;
                        item.UseScoreScaled = dto.UseScoreScaled;
                    }
                }
                break;

            case ScormSettings.EvaluationType.FromScormEvaluation:
                item.CheckScormCompletion = true;
                break;
            }
            item.IsValid     = IsValid;
            item.PackageGuid = version.UniqueIdVersion.ToString();
            item.PackagePath = PackagePath;
            item.ValidUntil  = null;
            item.IsCurrent   = true;
            return(item);
        }
예제 #2
0
        public virtual ScormItemSettings CreateForUpdateSettings(long idPackage, long idOrganization, long idParentItem, EvaluationType evaluation, dtoScormItemEvaluationSettings dto)
        {
            ScormItemSettings item = new ScormItemSettings()
            {
                IdScormPackageSettings = idPackage, IdScormOrganizationSettings = idOrganization, IdParentItem = idParentItem
            };

            item.IsVisible            = IsVisible;
            item.Title                = Title;
            item.ScormType            = ScormType;
            item.CheckScore           = false;
            item.CheckScormCompletion = false;
            item.CheckTime            = false;
            item.MinScore             = 0;
            item.MinTime              = 0;
            item.UseScoreScaled       = false;
            item.ActivityId           = ActivityId;
            item.IsLeaf               = IsLeaf;

            if (evaluation == EvaluationType.CustomForActivities && dto != null)
            {
                item.CheckScore           = dto.CheckScore;
                item.CheckScormCompletion = dto.CheckScormCompletion;
                item.CheckTime            = dto.CheckTime;
                if (dto.CheckTime)
                {
                    item.MinTime = dto.MinTime;
                }
                if (dto.CheckScore)
                {
                    item.MinScore       = dto.MinScore;
                    item.UseScoreScaled = dto.UseScoreScaled;
                }
            }

            return(item);
        }