Esempio n. 1
0
        public virtual ScormPackageSettings Copy(Int32 idPerson, String ipAddress, String proxyIpAddress, long idItem,
                                                 Guid uniqueId, long idVersion, Guid uniqueIdVersion, RepositoryIdentifier repository, DateTime?validUntil = null, String packagePath = "")
        {
            ScormPackageSettings item = new ScormPackageSettings()
            {
                IdItem = idItem, IdVersion = idVersion, UniqueIdItem = uniqueId, UniqueIdVersion = uniqueIdVersion, Repository = repository
            };

            item.CreateMetaInfo(idPerson, ipAddress, proxyIpAddress);
            item.ActivityCount        = ActivityCount;
            item.CheckScore           = CheckScore;
            item.CheckScormCompletion = CheckScormCompletion;
            item.CheckTime            = CheckTime;
            item.EvaluationType       = EvaluationType;
            item.IsCurrent            = IsCurrent;
            item.IsValid        = IsValid;
            item.MinScore       = MinScore;
            item.MinTime        = MinTime;
            item.UseScoreScaled = UseScoreScaled;

            item.PackageGuid = uniqueIdVersion.ToString();
            item.PackagePath = (String.IsNullOrWhiteSpace(packagePath) ? PackagePath.Replace(UniqueIdVersion.ToString() + "\\", uniqueIdVersion.ToString() + "\\") : packagePath);
            item.ValidUntil  = validUntil;
            return(item);
        }
Esempio n. 2
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);
        }