public DateTime(Scorm1_2.DateTime i)
 {
     if (i != null)
         datetime = i.datetime;
     else
         datetime = new System.DateTime();
 }
        /// <summary>
        /// Not yet complete
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public static Scorm2004.correctResponsesType Translate(Scorm1_2.correctResponsesType i)
        {
            if (i == null) return null;

            Scorm2004.correctResponsesType ret = new Scorm2004.correctResponsesType();

            ret.Items = i.Items;
            ret.ItemsElementName = Arrays.Translate(i.ItemsElementName);
            return ret;
        }
        public static Scorm2004.interactionType Translate(Scorm1_2.interactionType i)
        {
            if (i == null) return null;

            Scorm2004.interactionType ret = new Scorm2004.interactionType();
            ret.attemptNumber = i.attemptNumber;
            ret.correct_responses = Types.Translate(i.correct_responses);
            ret.description = new Scorm2004.interactionTypeDescription();
            ret.description.lang = "en-US";
            ret.description.Value = "";
            ret.id = i.id;
            ret.latency = i.latency;
            ret.learner_response = Types.Translate(i.student_response);
            ret.objectives = Arrays.Translate(i.objectives);
            ret.result = Enums.Translate(i.result);
            ret.timestamp = new Scorm2004.DateTime(i.time);
            ret.type = Enums.Translate(i.type);
            ret.weighting = i.weighting;
            return ret;
        }
        public static Scorm2004.objectiveType Translate(Scorm1_2.objectiveType i)
        {
            if (i == null) return null;

            Scorm2004.objectiveType ret = new Scorm2004.objectiveType();
            ret.completion_status = Enums.Translate(i.status);
            ret.description = new Scorm2004.objectiveTypeDescription();
            ret.description.lang = "en-US";
            ret.description.Value = "";
            ret.id = i.id;
            ret.progress_measure = null;
            ret.score = Types.Translate(i.score);
            ret.success_status = Enums.TranslateSuccess(i.status);
            return ret;
        }
        public static Scorm2004.successStatusType TranslateSuccess(Scorm1_2.lessonStatusType i)
        {
            if (i == Scorm1_2.lessonStatusType.failed) return Scorm2004.successStatusType.failed;
            if (i == Scorm1_2.lessonStatusType.passed) return Scorm2004.successStatusType.passed;

            return Scorm2004.successStatusType.not_set;
        }
        public static Scorm2004.DataModel Translate(Scorm1_2.DataModel i)
        {
            if (i == null) return null;

            Scorm2004.DataModel ret = new Scorm2004.DataModel();
            ret.learner_name = new Scorm2004.learnerName();
            ret.score = new Scorm2004.scoreType();
            ret.learner_preference = new Scorm2004.learnerPreferenceType();

            ret.attemptNumber = i.attemptNumber;

            if (i.comments_from_lms != "" && i.comments_from_lms != null)
            {
                ret.comments_from_lms = new System.Collections.Generic.List<Scorm2004.commentType>();
                ret.comments_from_lms.Add(new Scorm2004.commentType());
                ret.comments_from_lms[0].comment = new Scorm2004.commentTypeComment();
                ret.comments_from_lms[0].comment.Value = i.comments_from_lms;
                ret.comments_from_lms[0].id = "Comment:1";
                ret.comments_from_lms[0].location = "";
                ret.comments_from_lms[0].timestamp = new Scorm2004.DateTime(System.DateTime.Now);
            }

            if (i.comments != "" && i.comments != null)
            {
                ret.comments_from_learner = new System.Collections.Generic.List<Scorm2004.commentType>();
                ret.comments_from_learner.Add(new Scorm2004.commentType());
                ret.comments_from_learner[0].comment = new Scorm2004.commentTypeComment();
                ret.comments_from_learner[0].comment.Value = i.comments;
                ret.comments_from_learner[0].id = "Comment:1";
                ret.comments_from_learner[0].location = "";
                ret.comments_from_learner[0].timestamp = new Scorm2004.DateTime(System.DateTime.Now);
            }
            if (i.core != null)
            {
                ret.completion_status = Enums.Translate(i.core.lesson_status);
                ret.credit = Enums.Translate(i.core.credit);
                ret.entry = Enums.Translate(i.core.entry);
                ret.exit = Enums.Translate(i.core.exit);
                ret.learner_id = i.core.student_id;
                ret.learner_name.Value = i.core.student_name;
                ret.mode = Enums.Translate(i.core.lesson_mode);
                if(i.core.score != null)
                    ret.score = Types.Translate(i.core.score);
                ret.session_time = new Scorm2004.TimeSpan(i.core.session_time);
                ret.total_time = new Scorm2004.TimeSpan(i.core.total_time);
                ret.location = i.core.lesson_location;

                if (i.core.lesson_status == Scorm1_2.lessonStatusType.failed)
                    ret.success_status = Scorm2004.successStatusType.failed;
                else if (i.core.lesson_status == Scorm1_2.lessonStatusType.passed)
                    ret.success_status = Scorm2004.successStatusType.passed;
                else
                    ret.success_status = Scorm2004.successStatusType.not_set;

            }
            if (i.student_data != null)
            {
                ret.scaled_passing_score = i.student_data.mastery_score;
                ret.time_limit_action = Enums.Translate(i.student_data.time_limit_action);
                ret.max_time_allowed = new Scorm2004.TimeSpan(i.student_data.max_time_allowed);
            }

            ret.dataModelVersion = "Scorm 2004";

            if(i.interactions != null)
                ret.interactions = Arrays.Translate(i.interactions);

            ret.launch_data = i.launch_data;

            ret.learner_name.lang = "en-US";

            if(i.student_preference != null)
                ret.learner_preference = Types.Translate(i.student_preference);

            if(i.objectives != null)
                ret.objectives = Arrays.Translate(i.objectives);

            ret.suspend_data = i.suspend_data;

            return ret;
        }
 public TimeSpan(Scorm1_2.TimeSpan t)
 {
     if (t != null)
         timespan = t.timespan;
     else
         timespan = new System.TimeSpan();
 }
        public static Scorm2004.objectiveIDType Translate(Scorm1_2.objectiveIDType i)
        {
            if (i == null) return null;

            Scorm2004.objectiveIDType ret = new Scorm2004.objectiveIDType();
            ret.id = i.id;
            return ret;
        }
        public static Scorm2004.ItemsChoiceType1 Translate(Scorm1_2.ItemsChoiceType1 i)
        {
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseFillIn) return Scorm2004.ItemsChoiceType1.learnerResponseLongFillIn;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseLikert) return Scorm2004.ItemsChoiceType1.learnerResponseLikert;
               // if (i == Scorm1_2.ItemsChoiceType1.studentResponseLongFillIn) return Scorm2004.ItemsChoiceType1.learnerResponseLongFillIn;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseMatching) return Scorm2004.ItemsChoiceType1.learnerResponseMatching;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseMultipleChoice) return Scorm2004.ItemsChoiceType1.learnerResponseMultipleChoice;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseNumeric) return Scorm2004.ItemsChoiceType1.learnerResponseNumeric;
              //  if (i == Scorm1_2.ItemsChoiceType1.studentResponseOther) return Scorm2004.ItemsChoiceType1.learnerResponseOther;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponsePerformance) return Scorm2004.ItemsChoiceType1.learnerResponsePerformance;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseSequencing) return Scorm2004.ItemsChoiceType1.learnerResponseSequencing;
            if (i == Scorm1_2.ItemsChoiceType1.studentResponseTrueFalse) return Scorm2004.ItemsChoiceType1.learnerResponseTrueFalse;

            return Scorm2004.ItemsChoiceType1.not_set;
        }
        public static Scorm2004.interactionTypeType Translate(Scorm1_2.interactionTypeType i)
        {
            if (i == Scorm1_2.interactionTypeType.fill_in) return Scorm2004.interactionTypeType.long_fill_in;
            if (i == Scorm1_2.interactionTypeType.likert) return Scorm2004.interactionTypeType.likert;
               //     if (i == Scorm1_2.interactionTypeType.long_fill_in) return Scorm2004.interactionTypeType.long_fill_in;
            if (i == Scorm1_2.interactionTypeType.matching) return Scorm2004.interactionTypeType.matching;
            if (i == Scorm1_2.interactionTypeType.multiple_choice) return Scorm2004.interactionTypeType.multiple_choice;
            if (i == Scorm1_2.interactionTypeType.numeric) return Scorm2004.interactionTypeType.numeric;
               //     if (i == Scorm1_2.interactionTypeType.other) return Scorm2004.interactionTypeType.other;
            if (i == Scorm1_2.interactionTypeType.performance) return Scorm2004.interactionTypeType.performance;
            if (i == Scorm1_2.interactionTypeType.sequencing) return Scorm2004.interactionTypeType.sequencing;
            if (i == Scorm1_2.interactionTypeType.true_false) return Scorm2004.interactionTypeType.true_false;

            return Scorm2004.interactionTypeType.not_set;
        }
        public static Scorm2004.interactionTypeResult Translate(Scorm1_2.interactionTypeResult i)
        {
            if (i == Scorm1_2.interactionTypeResult.correct) return Scorm2004.interactionTypeResult.correct;
            if (i == Scorm1_2.interactionTypeResult.wrong) return Scorm2004.interactionTypeResult.incorrect;
            if (i == Scorm1_2.interactionTypeResult.neutral) return Scorm2004.interactionTypeResult.neutral;
            if (i == Scorm1_2.interactionTypeResult.unanticipated) return Scorm2004.interactionTypeResult.unanticipated;

            return Scorm2004.interactionTypeResult.not_set;
        }
        public static Scorm2004.exit Translate(Scorm1_2.exit i)
        {
            if (i == Scorm1_2.exit.Item) return Scorm2004.exit.Item;
            if (i == Scorm1_2.exit.logout) return Scorm2004.exit.logout;
            if (i == Scorm1_2.exit.blank) return Scorm2004.exit.normal;
            if (i == Scorm1_2.exit.suspend) return Scorm2004.exit.suspend;
            if (i == Scorm1_2.exit.time_out) return Scorm2004.exit.timeout;

            return Scorm2004.exit.not_set;
        }
        public static Scorm2004.entry Translate(Scorm1_2.entry i)
        {
            if (i == Scorm1_2.entry.ab_initio) return Scorm2004.entry.ab_initio;
            if (i == Scorm1_2.entry.other) return Scorm2004.entry.other;
            if (i == Scorm1_2.entry.resume) return Scorm2004.entry.resume;

            return Scorm2004.entry.not_set;
        }
        public static Scorm2004.credit Translate(Scorm1_2.credit i)
        {
            if (i == Scorm1_2.credit.credit) return Scorm2004.credit.credit;
            if (i == Scorm1_2.credit.no_credit) return Scorm2004.credit.no_credit;

            return Scorm2004.credit.not_set;
        }
        public static Scorm2004.completionStatusType Translate(Scorm1_2.lessonStatusType i)
        {
            if (i == Scorm1_2.lessonStatusType.completed) return Scorm2004.completionStatusType.completed;
            if (i == Scorm1_2.lessonStatusType.incomplete) return Scorm2004.completionStatusType.incomplete;
            if (i == Scorm1_2.lessonStatusType.not_attempted) return Scorm2004.completionStatusType.not_attempted;

            return Scorm2004.completionStatusType.not_set;
        }
        /// <summary>
        /// only supporting LongFillin and Fillin
        /// </summary>
        /// <param name="i"></param>
        /// <returns></returns>
        public static Scorm2004.learnerResponseType Translate(Scorm1_2.studentResponseType i)
        {
            if (i == null) return null;

            if (i.GetType() == typeof(Scorm1_2.studentResponseTypeStudentResponseFillIn))
            {
                Scorm2004.learnerResponseTypeLearnerResponseFillIn ret = new Scorm2004.learnerResponseTypeLearnerResponseFillIn();
                Scorm1_2.studentResponseTypeStudentResponseFillIn val = (Scorm1_2.studentResponseTypeStudentResponseFillIn)i;
                ret.lang = val.lang;
                ret.Value = val.Value;
                return ret;
            }

            return null;
        }
        public static Scorm2004.scoreType Translate(Scorm1_2.scoreType i)
        {
            if (i == null) return null;

            Scorm2004.scoreType ret = new Scorm2004.scoreType();
            ret.max = i.max;
            ret.min = i.min;
            ret.raw = i.raw;
            ret.scaled = (i.raw - i.min) / (i.max - i.min);
            if(ret.scaled.HasValue)
                ret.scaled = System.Math.Round(ret.scaled.Value * 100) / 100;
            return ret;
        }
        public static Scorm2004.learnerPreferenceAudioCaptioning Translate(Scorm1_2.learnerPreferenceAudioCaptioning i)
        {
            if (i == Scorm1_2.learnerPreferenceAudioCaptioning.no_change) return Scorm2004.learnerPreferenceAudioCaptioning.no_change;
            if (i == Scorm1_2.learnerPreferenceAudioCaptioning.off) return Scorm2004.learnerPreferenceAudioCaptioning.off;
            if (i == Scorm1_2.learnerPreferenceAudioCaptioning.on) return Scorm2004.learnerPreferenceAudioCaptioning.on;

            return Scorm2004.learnerPreferenceAudioCaptioning.not_set;
        }
        public static Scorm2004.learnerPreferenceType Translate(Scorm1_2.studentPreferenceType i)
        {
            if (i == null) return null;

            Scorm2004.learnerPreferenceType ret = new Scorm2004.learnerPreferenceType();
            ret.audio_captioning = Enums.Translate(i.text);
            ret.audio_level = i.audio;
            ret.delivery_speed = i.speed;
            ret.language = i.language;
            return ret;
        }
        public static Scorm2004.mode Translate(Scorm1_2.mode i)
        {
            if (i == Scorm1_2.mode.browse) return Scorm2004.mode.browse;
            if (i == Scorm1_2.mode.normal) return Scorm2004.mode.normal;
            if (i == Scorm1_2.mode.review) return Scorm2004.mode.review;

            return Scorm2004.mode.not_set;
        }
        public static Scorm2004.timeLimitAction Translate(Scorm1_2.timeLimitAction i)
        {
            if (i == Scorm1_2.timeLimitAction.continue_message) return Scorm2004.timeLimitAction.continue_message;
            if (i == Scorm1_2.timeLimitAction.continue_no_message) return Scorm2004.timeLimitAction.continue_no_message;
            if (i == Scorm1_2.timeLimitAction.exit_message) return Scorm2004.timeLimitAction.exit_message;
            if (i == Scorm1_2.timeLimitAction.exit_no_message) return Scorm2004.timeLimitAction.exit_no_message;

            return Scorm2004.timeLimitAction.not_set;
        }
Esempio n. 22
0
        public void InitializeBase(IWebDriver objDriver)
        {
            //LoginPage = new MdnHomePage(driver);
            //LoginPage1 = new MdnLoginPage1(driver);
            //HomePage = new MdnHomePage(driver);
            //CommonPage = new MdnCommonPage(driver);

            #region initialize old
            driver                = objDriver;
            CheckOutobj           = new CheckOut(driver);
            takeScreenhsot        = new ScreenShot(driver);
            approvalrequest       = new Approvalrequestobject(driver);
            instructors           = new Instructor(driver);
            approvalrequest       = new Approvalrequestobject(driver);
            DomainConsoleobj      = new DomainConsole(driver);
            ManageGradebookobj    = new ManageGradebook();
            Instructorsobj        = new Instructorspof();
            MyResponsibilitiesobj = new My_Responsibilities(driver);
            manageuserobj         = new ManageUsers(driver);
            objTrainingHome       = new TrainingHomes(driver);
            objCurriculum         = new CreateCurriculum(driver);
            classroomcourse       = new ClassroomCourse(driver);
            ContentSearchobj      = new ContentSearch(driver);
            objCreate             = new Create(driver);
            detailspage           = new Details(driver);


            TrainingHomeobj         = new TrainingHomes(driver);
            AdminstrationConsoleobj = new AdminstrationConsole(driver);
            Testsobj             = new Tests(driver);
            Detailsobj           = new Details(driver);
            EditSummaryobj       = new EditSummary(driver);
            Scorm1_2obj          = new Scorm1_2(driver);
            EditQuestionobj      = new EditQuestion(driver);
            EditQuestionGroupobj = new EditQuestionGroup(driver);

            AddUsrObj = new AddUsers(driver);

            generalcourseobj           = new GeneralCourse(driver);
            myteachingscheduleobj      = new MyTeachingSchedule();
            professionaldevelopmentobj = new ProfessionalDevelopments(driver);
            documentobj                = new Document(driver);
            CreateNewAccountobj        = new CreateNewAccount(driver);
            ManageUsersobj             = new ManageUsers(driver);
            Createobj                  = new Create(driver);
            summaryobj                 = new Summary(driver);
            reauiredtrainingconsoleobj = new RequiredTrainingConsoles(driver);
            requiredtrainingobj        = new RequiredTraining(driver);
            Trainingobj                = new Training(driver);
            Loginobj      = new Login(driver);
            Contentobj    = new Content(driver);
            Creditsobj    = new Credits(driver);
            AddContentobj = new AddContent(driver);
            Summaryobj    = new Summary(driver);
            ScheduleAndManageSectionobj = new ScheduleAndManageSection(driver);
            SearchResultsobj            = new SearchResults(driver);
            CourseSectionobj            = new CreateNewCourseSectionAndEventPage(driver);
            Transcriptsobj              = new Transcripts(driver);
            Productsobj                 = new Products(driver);
            BrowseTrainingCatalogobj    = new BrowseTrainingCatalog(driver);
            ShoppingCartsobj            = new ShoppingCarts(driver);
            ProfessionalDevelopmentsobj = new ProfessionalDevelopments(driver);
            Createnewproficencyscaleobj = new Createnewproficencyscale(driver);
            Createnewcompetencyobj      = new Createnewcompetency(driver);
            CreateNewSucessProfileobj   = new CreateNewSucessProfile(driver);
            SucessProfileobj            = new SucessProfile(driver);
            Searchobj             = new Search(driver);
            TrainingActivitiesobj = new TrainingActivities(driver);
            ProfessionalDevelopments_learnerobj = new ProfessionalDevelopments_learner(driver);
            Organizationobj             = new Organization(driver);
            DevelopmentPlansobj         = new DevelopmentPlans(driver);
            AddDevelopmentActivitiesobj = new AddDevelopmentActivities(driver);
            MyAccountobj            = new MyAccount(driver);
            UsersUtilobj            = new UsersUtil(driver);
            MyCalendersobj          = new MyCalenders(driver);
            MyReportsobj            = new MyReports(driver);
            Config_Reportsobj       = new Config_Reports(driver);
            ConfigurationConsoleobj = new ConfigurationConsole(driver);
            ApprovalPathobj         = new ApprovalPath(driver);
            MyMessageobj            = new MyMessages(driver);
            MessageUtilobj          = new MessageUtil(driver);
            MyRequestsobj           = new MyRequests(driver);
            Blogsobj = new Blogs(driver);
            CollabarationSpacesobj = new CollabarationSpaces(driver);
            Faqsobj                     = new Faqs(driver);
            HomePageFeedobj             = new HomePageFeed(driver);
            ProductTypesobj             = new ProductTypes(driver);
            Surveysobj                  = new Surveys(driver);
            SurveyScalesobj             = new SurveyScales(driver);
            AuditingConsolesobj         = new AuditingConsoles(driver);
            Categoryobj                 = new Category(driver);
            Trainingsobj                = new Trainings(driver);
            VirtualMeetingsobj          = new VirtualMeetings(driver);
            CreditTypeobj               = new CreditType(driver);
            AssignedUserobj             = new AssignedUser(driver);
            AddUsersobj                 = new AddUsers(driver);
            CustomFieldobj              = new CustomField(driver);
            CreateNewCustomFieldobj     = new CreateNewCustomField(driver);
            EditFieldobj                = new EditField(driver);
            EducationLevelobj           = new EducationLevel(driver);
            EditOrganizationobj         = new EditOrganization(driver);
            SelectManagerobj            = new SelectManager(driver);
            Roleobj                     = new Role(driver);
            SelectTrainingPOCobj        = new SelectTrainingPOC(driver);
            Complexobj                  = new Complex(driver);
            AccountCodesobj             = new AccountCodes(driver);
            AccountCodeTypesobj         = new AccountCodeTypes(driver);
            DiscountCodesobj            = new DiscountCodes(driver);
            ManageTaxRatesobj           = new ManageTaxRates(driver);
            TaxItemCategoriesobj        = new TaxItemCategories(driver);
            Certificatesobj             = new Certificates(driver);
            CourseProvidersobj          = new CourseProviders(driver);
            ExternalLearningsobj        = new ExternalLearnings(driver);
            ExternalLearningConsolesobj = new ExternalLearningConsoles(driver);
            ExternalLearningtypesobj    = new ExternalLearningtypes(driver);
            RequiredTrainingConsolesobj = new RequiredTrainingConsoles(driver);
            SelectProfileobj            = new SelectProfile(driver);
            TrainingProfilesobj         = new TrainingProfiles(driver);
            EditTrainingProfileobj      = new EditTrainingProfile(driver);
            MergeUsersobj               = new MergeUsers(driver);
            UserGroupobj                = new UserGroup(driver);
            SelectCertificateobj        = new SelectCertificate(driver);
            ManageProficencyScaleobj    = new ManageProficencyScale(driver);
            ArchivedProficencyScaleobj  = new ArchivedProficencyScale(driver);
            MappedContentobj            = new MappedContent(driver);
            MappedCompetencyobj         = new MappedCompetency(driver);
            ManageSuccessProfileobj     = new ManageSuccessProfile(driver);
            FAQ_lobj                    = new FAQ_l(driver);
            Announcements_lobj          = new Announcements_l(driver);
            JobTitlesobj                = new JobTitles(driver);
            ManageJobTitleobj           = new ManageJobTitle(driver);
            ManagePricingScheduleobj    = new ManagePricingSchedule(driver);
            ExternalLearningSearchobj   = new ExternalLearningSearch(driver);
            urlobj              = new url(driver);
            skinobj             = new skin(driver);
            MyOwnLearningobj    = new MyOwnLearningUtils(driver);
            CurrentTrainingsobj = new CurrentTrainings(driver);
            scormobj            = new Scorm12(driver);
            aicccourse          = new AICC(driver);
            ojtcourse           = new OJT(driver);
            TrainingCatalogobj  = new TrainingCatalogUtil(driver);
            accesskeys          = new AccessKeys(driver);
            #endregion
        }