private void SyncClickItems()
        {
            bool removeAzureAudioIfAccountInvalid  = false;
            bool removeWatsonAudioIfAccountInvalid = false;

            if (IsAzureVoiceSelected())
            {
                removeAzureAudioIfAccountInvalid = !AzureRuntimeService.IsAzureAccountPresentAndValid;
            }
            if (IsWatsonVoiceSelected())
            {
                removeWatsonAudioIfAccountInvalid = !WatsonRuntimeService.IsWatsonAccountPresentAndValid;
            }
            // also align eLL first item click No to be the same as first click No on animation pane
            SyncCustomAnimationToTaskpane(uncheckAzureAudio: removeAzureAudioIfAccountInvalid,
                                          uncheckWatsonAudio: removeWatsonAudioIfAccountInvalid);
            List <ExplanationItem> items = Items.Where(x => x is ExplanationItem)
                                           .Cast <ExplanationItem>().ToList();
            ELearningService eLearningService = new ELearningService(slide, items);

            RemoveLabAnimationsFromAnimationPane(eLearningService);
            // align first click No on animation pane to be the same as eLL first click No
            AlignFirstClickNumberForCustomItem();
            ELearningLabTextStorageService.StoreSelfExplanationTextToSlide(
                Items.Where(x => x is ExplanationItem && !((ExplanationItem)x).IsEmpty)
                .Cast <ExplanationItem>().ToList(), slide);
            SyncLabItemToAnimationPane(eLearningService);
        }
示例#2
0
        public ProcessingStatusForm(int totalValue, BackgroundWorkerType workerType, ELearningService service = null)
        {
            InitializeComponent();
            Dispatcher.Invoke(() => { progressBar.Value = 0; });
            label.Content   = string.Format(ELearningLabText.ProgressStatusLabelFormat, 0);
            this.totalValue = totalValue;
            this.workerType = workerType;
            this.service    = service;
            worker          = new BackgroundWorker();
            worker.WorkerReportsProgress      = true;
            worker.WorkerSupportsCancellation = true;
            switch (workerType)
            {
            case BackgroundWorkerType.AudioGenerationService:
                worker.DoWork += Worker_DoWorkForAudioGenerationService;
                break;

            case BackgroundWorkerType.ELearningLabService:
                worker.DoWork += Worker_DoWorkForELearningLabService;
                break;

            default:
                break;
            }
            worker.ProgressChanged    += Worker_ProgressChanged;
            worker.RunWorkerCompleted += Worker_RunWorkerCompleted;
            worker.RunWorkerAsync();
        }
        private void SyncLabItemToAnimationPane(ELearningService service)
        {
            int totalSelfExplanationItemsCount   = service.GetExplanationItemsCount();
            ProcessingStatusForm progressBarForm =
                new ProcessingStatusForm(totalSelfExplanationItemsCount, BackgroundWorkerType.ELearningLabService, service);

            progressBarForm.ShowThematicDialog();
        }
示例#4
0
        public JsonResult GetAllActiveHeader()
        {
            string serverResponse = "";

            var header = ELearningService.GetAllHeader(1, out serverResponse);

            return(Json(new { error = serverResponse, header = header }));
        }
        public void TestRemoveLabAnimations()
        {
            PowerPointSlide  slide   = PowerPointSlide.FromSlideFactory(PpOperations.SelectSlide(1));
            ELearningService service = new ELearningService(slide, null);

            service.RemoveLabAnimationsFromAnimationPane();
            Assert.IsTrue(Util.SlideUtil.IsAnimationsRemoved(slide.GetNativeSlide(), ELearningLabText.Identifier));
        }
示例#6
0
        public ActionResult Submit(ELearningItemModel _model, Guid _resultID, string _answer)
        {
            string serverResponse = "";

            ELearningService.SubmitAnswer(_model, _resultID, _answer, out serverResponse);

            return(Json(new { error = serverResponse }));
        }
示例#7
0
        public JsonResult GetItems(Guid _headerID)
        {
            string serverResponse = "";

            var items = ELearningService.GetAllItem(_headerID, out serverResponse);

            return(Json(new { items = items, error = serverResponse }));
        }
示例#8
0
        public ActionResult GetRandomQuestion(Guid?_headerID)
        {
            string serverResponse = "";

            var question = ELearningService.GetRandomQuestion(_headerID, out serverResponse);

            var examCount = ELearningService.GetTakeExamCount(_headerID, out serverResponse);

            return(Json(new { question = question, error = serverResponse,
                              examCount = examCount }));
        }
示例#9
0
        public JsonResult SaveHeader(ELearningHeaderModel _header)
        {
            string serverResponse = "";

            if (_header != null)
            {
                ELearningService.SaveHeader(_header, out serverResponse);
            }

            return(Json(serverResponse));
        }
示例#10
0
        public JsonResult DeleteAttachment(ElearningAttachmentModel _file)
        {
            string serverResponse = "";

            if (_file != null)
            {
                _file.Status = 0;

                ELearningService.UpdateAttachment(_file, out serverResponse);
            }

            return(Json(serverResponse));
        }
示例#11
0
        public JsonResult SaveItem(ELearningItemModel _item, Guid?_attachmentID, Guid _headerID)
        {
            string serverResponse = "";

            if (_item != null)
            {
                _item.HeaderID = _headerID;

                ELearningService.SaveItem(_item, _attachmentID, out serverResponse);
            }

            return(Json(serverResponse));
        }
示例#12
0
        public JsonResult DeleteItem(ELearningItemModel _item, Guid?_attachmentID)
        {
            string serverResponse = "";

            if (_item != null)
            {
                _item.Status = 0;

                ELearningService.SaveItem(_item, _attachmentID, out serverResponse);
            }

            return(Json(serverResponse));
        }
 private void RemoveLabAnimationsFromAnimationPane(ELearningService service)
 {
     service.RemoveLabAnimationsFromAnimationPane();
 }