Example #1
0
        /*
         * Remove custom slides.
         */
        public void addCustomSlides(Slides slidesAfterAdding, List <int> slideIdsBeforeAdding)
        {
            // identify all removed slides
            List <int> addedSlides = new List <int>();

            foreach (Slide slideIdAfter in slidesAfterAdding)
            {
                bool isNewSlide = true;
                foreach (int slideIdBefore in slideIdsBeforeAdding)
                {
                    // slide is still existing
                    if (slideIdBefore == slideIdAfter.SlideID)
                    {
                        isNewSlide = false;
                        break;
                    }
                }

                if (isNewSlide)
                {
                    addedSlides.Add(slideIdAfter.SlideID);
                }
            }

            // update slideIdsBeforeAdding
            foreach (int addedId in addedSlides)
            {
                slideIdsBeforeAdding.Add(addedId);
            }
        }
Example #2
0
        public static void divideToLines(Slides slides, Slide slide, TextRange textRange)
        {
            var    slideNumber    = slide.SlideIndex;
            float  slideDuration  = slide.SlideShowTransition.AdvanceTime;
            int    divisionNumber = textRange.Lines().Count;
            float  duration       = durationAfterDivisions(slideDuration, divisionNumber / 2);
            string textFrmLines   = "";

            foreach (TextRange line in textRange.Lines())
            {
                if (textFrmLines.Length > 0)
                {
                    textFrmLines += line.Text;
                    SlidesManipulation.createNewSlide(slides, ++slideNumber, textFrmLines.Trim(), duration);
                    SlidesManipulation.createNewSlide(slides, ++slideNumber, "", 0.01F);
                    textFrmLines = "";
                }
                else
                {
                    textFrmLines += line.Text;
                }
            }
            //add the rest of textFrmLines
            if (textFrmLines.Length > 0)
            {
                SlidesManipulation.createNewSlide(slides, ++slideNumber, textFrmLines, duration);
                SlidesManipulation.createNewSlide(slides, ++slideNumber, "", 0.1F);
            }
            //delete slides
            slide.Delete();
            slides[slideNumber].Delete();
        }
Example #3
0
        private static async Task Get(HttpResponse res, int index)
        {
            var show = await Slides.LoadAsync();

            if (Interlocked.Exchange(ref _started, 1) == 0)
            {
                await StartOnline(show);
            }
            if (show.TryGetSlide(index, out var slide))
            {
                var backgroundImage = slide.Metadata.GetStringOrDefault("backgroundImage", show.Metadata.GetStringOrEmpty("backgroundImage"));
                var html            = Web.template_html.Utf8ToString()
                                      .Replace("{{title}}", slide.Metadata.GetStringOrDefault("title", show.Metadata.GetStringOrEmpty("title")))
                                      .Replace("{{layout}}", slide.Metadata.GetStringOrDefault("layout", show.Metadata.GetStringOrDefault("layout", "blank")))
                                      .Replace("{{inlineStyle}}", BackgroundStyle.Generate(backgroundImage))
                                      .Replace("{{content}}", slide.Html)
                                      .Replace("{{previousIndex}}", (index - 1).ToString(CultureInfo.InvariantCulture))
                                      .Replace("{{nextIndex}}", (index + 1).ToString(CultureInfo.InvariantCulture))
                                      .Replace("{{deckhub}}", _options.Api);

                res.ContentType = "text/html";
                res.StatusCode  = 200;
                await res.WriteAsync(html);

                return;
            }

            res.StatusCode = 404;
        }
        public Presentation(FileInfo file)
        {
            var tempRootDir = Path.GetTempPath();
            var tempDirName = $"pmpp_{Guid.NewGuid():N}";

            while (Directory.Exists(Path.Combine(tempRootDir, tempDirName)))
            {
                tempDirName = $"pmpp_{Guid.NewGuid():N}";
            }
            tempDir = Path.Combine(tempRootDir, tempDirName);

            ZipFile.ExtractToDirectory(file.FullName, tempDir);


            var archive    = new DirectoryInfo(tempDir);
            var masterFile = archive.GetFiles("master.png").FirstOrDefault();
            var files      = archive.GetFiles().Where(x => slideRegex.IsMatch(x.Name)).OrderBy(x => x.Name);

            if (masterFile != null)
            {
                Master = ToMemory(Image.FromFile(masterFile.FullName));
            }

            foreach (var slideFile in files)
            {
                Slides.AddLast(() => ToMemory(Image.FromFile(slideFile.FullName)));
            }
            currentNode = Slides.First;
            UpdateSlide();
        }
Example #5
0
 public PptBuilder()
 {
     Presentations presentations = this.ppt.Presentations;
     this.presentation = presentations.Add();
     this.presentation.PageSetup.SlideSize = PpSlideSizeType.ppSlideSizeOnScreen16x10;
     this.slides = this.presentation.Slides;
 }
Example #6
0
 public static void divideToLines(Slides slides, Slide slide, TextRange textRange)
 {
     var slideNumber = slide.SlideIndex;
     float slideDuration = slide.SlideShowTransition.AdvanceTime;
     int divisionNumber = textRange.Lines().Count;
     float duration = durationAfterDivisions(slideDuration, divisionNumber / 2);
     string textFrmLines = "";
     foreach (TextRange line in textRange.Lines())
     {
         if (textFrmLines.Length > 0)
         {
             textFrmLines += line.Text;
             SlidesManipulation.createNewSlide(slides, ++slideNumber, textFrmLines.Trim(), duration);
             SlidesManipulation.createNewSlide(slides, ++slideNumber, "", 0.01F);
             textFrmLines = "";
         }
         else
         {
             textFrmLines += line.Text;
         }
     }
     //add the rest of textFrmLines
     if (textFrmLines.Length > 0)
     {
         SlidesManipulation.createNewSlide(slides, ++slideNumber, textFrmLines, duration);
         SlidesManipulation.createNewSlide(slides, ++slideNumber, "", 0.1F);
     }
         //delete slides
         slide.Delete();
         slides[slideNumber].Delete();
 }
Example #7
0
        public async Task <IHttpActionResult> PutSlides(int id, Slides slides)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != slides.id)
            {
                return(BadRequest());
            }

            db.Entry(slides).State = EntityState.Modified;

            try
            {
                await db.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SlidesExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #8
0
 public static void twoLinesFilter(Slides slides)
 {
     foreach (Slide slide in slides)
     {
         Microsoft.Office.Interop.PowerPoint.Shape shape = slide.Shapes[1];
         if (shape.HasTextFrame == MsoTriState.msoTrue)
         {
             if (shape.TextFrame.HasText == MsoTriState.msoTrue)
             {
                 var textRange = shape.TextFrame.TextRange;
                 //check if there are more than two lines, and needs additional divisions
                 if (textRange.Lines().Count > 2)
                 {
                     if (textRange.Sentences().Count > 1)
                     {
                         divideToSentences(slides, slide, textRange);
                     }
                     else
                     {
                         divideToLines(slides, slide, textRange);
                     }
                 }
             }
         }
     }
 }
Example #9
0
        /// <summary>
        /// Removes a specified slide from this part (can be undone).
        /// </summary>
        /// <param name="slide"></param>
        public void RemoveSlide(SongSlide slide)
        {
            if (slide == null)
            {
                throw new ArgumentNullException("slide");
            }

            if (Slides.Count <= 1)
            {
                throw new InvalidOperationException("Can't remove last slide in a part.");
            }

            int i = Slides.IndexOf(slide);

            if (i < 0)
            {
                throw new InvalidOperationException("Slide is not in this part.");
            }

            Undo.ChangeFactory.OnChanging(this,
                                          () => { slides.Insert(i, slide); },
                                          () => { slides.Remove(slide); },
                                          "RemoveSlide");
            slides.Remove(slide);
        }
Example #10
0
 public static void Slide(Form form, Slides Direction)
 {
     if (Direction == Slides.Up)
     {
         for (int i = 0; i <= form.Height; i++)
         {
             form.Location = new System.Drawing.Point((Screen.PrimaryScreen.WorkingArea.Size.Width - form.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Size.Height - i) / 6);
         }
     }
     else if (Direction == Slides.Down)
     {
         for (int i = form.Height; i >= 0; i--)
         {
             form.Location = new System.Drawing.Point((Screen.PrimaryScreen.WorkingArea.Size.Width - form.Width) / 2, (Screen.PrimaryScreen.WorkingArea.Size.Height - i) / 6);
         }
     }
     else if (Direction == Slides.Left)
     {
         for (int i = 0; i <= form.Width; i++)
         {
             form.Location = new System.Drawing.Point((Screen.PrimaryScreen.WorkingArea.Size.Width - i) / 2, (Screen.PrimaryScreen.WorkingArea.Size.Height - form.Height) / 2);
         }
     }
     else if (Direction == Slides.Right)
     {
         for (int i = form.Width; i >= 0; i--)
         {
             form.Location = new System.Drawing.Point((Screen.PrimaryScreen.WorkingArea.Size.Width - i) / 3, (Screen.PrimaryScreen.WorkingArea.Size.Height - form.Height) / 2);
         }
     }
 }
Example #11
0
        public static void createEmptySlide(Slides oSlides, int slideNumber)
        {
            Slide oSlide = oSlides.Add(slideNumber, PpSlideLayout.ppLayoutBlank);

            oSlide.FollowMasterBackground        = MsoTriState.msoFalse;
            oSlide.Background.Fill.ForeColor.RGB = colorizing(System.Windows.Media.Colors.Black);
        }
Example #12
0
 public Block()
 {
     BlockType  = GetNewRandShape();
     Next_shape = GetNewRandShape();
     Slide      = Slides.BOTTOM;
     ResetBlock();
 }
Example #13
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            XmlDocument document = new XmlDocument();
            XmlElement  root     = document.CreateElement("slideshow");

            if (DisplayTime > 0)
            {
                root.SetAttribute("displayTime", DisplayTime.ToString());
            }

            if (TransitionTime > 0)
            {
                root.SetAttribute("transitionTime", TransitionTime.ToString());
            }

            var valid    = Slides.Where(slide => !string.IsNullOrEmpty(slide.ImageUrl));
            var elements = valid.Select(slide => slide.ToXmlElement(document)).ToList();

            elements.ForEach(element => root.AppendChild(element));

            document.AppendChild(root);

            ConfigXml      = HttpUtility.UrlEncode(document.OuterXml);
            FlashAvailable = elements.Count > 0;
        }
        private void app_SlideShowNextSlide(PP.SlideShowWindow Wn)
        {
            if (SlideIndexChanged == null)
            {
                return;
            }

            //logic to handle slideshow using timings reaching end, go to first slide of next slideshow
            if (Wn.View.State == PP.PpSlideShowState.ppSlideShowDone)
            {
                Slide slide = Slides.FirstOrDefault(s => s.PSlide == Wn.Presentation.Slides[Wn.Presentation.Slides.Count]);
                if (slide != null)
                {
                    app.SlideShowNextSlide -= new PP.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
                    //to change slideshow state from ppSlideShowDone so this method does not continuously run
                    Wn.View.Last();
                    //if first slide of next slideshow has timings, go to slide in order to reset timings to allow it to advance (view reset timings method seemed to have no effect)
                    if (Slides[slide.SlideIndex].PSlide != null)
                    {
                        GoTo(Slides[slide.SlideIndex]);
                    }
                    app.SlideShowNextSlide += new PP.EApplication_SlideShowNextSlideEventHandler(app_SlideShowNextSlide);
                    Application.Current.Dispatcher.Invoke(new Action(() => { SlideIndexChanged(this, new SlideShowEventArgs(-1, slide.SlideIndex + 1)); }));
                }
            }
            else
            {
                Slide slide = Slides.FirstOrDefault(s => s.PSlide == Wn.View.Slide);
                if (slide != null)
                {
                    Application.Current.Dispatcher.Invoke(new Action(() => { SlideIndexChanged(this, new SlideShowEventArgs(-1, slide.SlideIndex)); }));
                }
            }
        }
Example #15
0
 public void Clear()
 {
     Slides.Clear();
     AutoPlay = false;
     DwellTimeMilliseconds = 0;
     Loop = false;
 }
Example #16
0
        private void SubmitClick(object sender, RoutedEventArgs e)
        {
            // Create new Slide
            slides = pptPresentation.Slides;
            slide  = slides.AddSlide(1, customLayout);

            // Add title
            objText = slide.Shapes[1].TextFrame.TextRange;
            System.Windows.Documents.TextRange titleRange = new System.Windows.Documents.TextRange
                                                                (TitleBox.Document.ContentStart, TitleBox.Document.ContentEnd);
            objText.Text = titleRange.Text;

            // Add text
            objText = slide.Shapes[2].TextFrame.TextRange;
            System.Windows.Documents.TextRange textRange = new System.Windows.Documents.TextRange
                                                               (TextBox.Document.ContentStart, TextBox.Document.ContentEnd);
            objText.Text = textRange.Text;

            int numPics = 0;

            if (selected != null)
            {
                numPics = selected.Count();
            }

            Console.WriteLine("\n\nSelected Image URLs, \n");
            Microsoft.Office.Interop.PowerPoint.Shape photo = slide.Shapes[2];
            for (int i = 0; i < numPics && i < 3; i++)
            {
                Console.WriteLine(selected[i] + "\n");
                slide.Shapes.AddPicture(selected[i], MsoTriState.msoFalse, MsoTriState.msoTrue, (i * 200), 300, photo.Width, photo.Height);
            }
            Console.WriteLine("\n\n");
        }
        protected override void ProcessSlideSizeFolder(StorageDirectory sizeFolder, SlideFormatEnum format)
        {
            var orderFiles = new[]
            {
                Path.Combine(sizeFolder.LocalPath, "thumb_order.txt"),
                Path.Combine(sizeFolder.LocalPath, "slide_order.txt")
            };

            var orderFile = orderFiles.FirstOrDefault(File.Exists);

            if (orderFile == null)
            {
                return;
            }

            var folderNames = File.ReadAllLines(orderFile).Where(line => !String.IsNullOrWhiteSpace(line)).ToList();

            foreach (var folderName in folderNames)
            {
                var slideContentsFolder  = new StorageDirectory(sizeFolder.RelativePathParts.Merge(folderName));
                var slideTemplatesFolder = new StorageDirectory(_slideTemplatesDirectory.RelativePathParts.Merge(
                                                                    new[] { sizeFolder.RelativePathParts.Last(), folderName }));
                if (slideContentsFolder.ExistsLocal())
                {
                    var slideMaster = new SlideMaster(slideContentsFolder, slideTemplatesFolder)
                    {
                        Group  = "Default",
                        Format = format
                    };
                    slideMaster.Load();
                    Slides.Add(slideMaster);
                }
            }
        }
Example #18
0
        public void ClickedSlide(object slide)
        {
            if (Slides.canSelect)
            {
                var selected = slide as PictureViewModelM;
                Slides.SelectSlide(selected);
            }

            if (!Slides.areSlidesActive)
            {
                if (Slides.CheckIfMatched())
                {
                    GameInfo.Award(); //Correct match
                }
                else
                {
                    if (turno)
                    {
                        CartaEquivocada(calbacpapa);
                    }

                    GameInfo.Penalize();//Incorrect match
                }
            }

            GameStatus();
        }
        void PresenterInterface.StartPresintation()
        {
            Application ppApp = new Application();

            ppApp.Visible = MsoTriState.msoTrue;
            Presentations     ppPresens = ppApp.Presentations;
            Presentation      objPres   = ppPresens.Open(@"E:\\courseWork\\CourseProject\\CourseWork\\CourseWork\\exports\\presentation.pptx", MsoTriState.msoFalse, MsoTriState.msoTrue, MsoTriState.msoTrue);
            Slides            objSlides = objPres.Slides;
            int               n         = objSlides.Count; //получаю количество слайдов в показываемой презентации
            SlideShowWindows  objSSWs;
            SlideShowSettings objSSS;


            objSSS             = objPres.SlideShowSettings;
            objSSS.EndingSlide = n - 2;
            objSSS.Run();
            objSSWs = ppApp.SlideShowWindows;

            Thread.Sleep(n * 5000);// пауза между слайдами так как 1 секунда переход 2 секунды слайд

            objPres.Close();
            ppApp.Quit();

            //закрываем потоки
            var processes = System.Diagnostics.Process.GetProcessesByName("POWERPNT");

            foreach (var p in processes)
            {
                p.Kill();
            }
        }
Example #20
0
 public bool load(string file)
 {
     if (this.powerpoint == null)
     {
         return(false);
     }
     try
     {
         string fileName = file.Trim();
         presentations = powerpoint.Presentations;
         presentation  = presentations.Open(fileName,
                                            Microsoft.Office.Core.MsoTriState.msoFalse,
                                            Microsoft.Office.Core.MsoTriState.msoFalse,
                                            Microsoft.Office.Core.MsoTriState.msoTrue);
         slides = presentation.Slides;
         return(true);
     }
     catch
     {
         presentation = null;
         slides       = null;
         return(false);
     }
     //Thread.Sleep(5000);
 }
Example #21
0
 internal void Clear()
 {
     Slides.Clear();
     ProjectVariables.Clear();
     SourceCode = "";
     slidenum   = 0;
 }
Example #22
0
        public void OpenNew(bool visible = false)
        {
            _presentation = visible ?
                            _app.Presentations.Add(MsoTriState.msoTrue):
                            _app.Presentations.Add(MsoTriState.msoFalse);

            _slides = _presentation.Slides;
        }
        private void ViewPresentation()
        {
            Presentations presentations = Globals.ThisAddIn.Application.Presentations;

            #region initialize powerpoint template
            //now open the template format for the presentation
            if (_directoryPath.Length == 0)
            {
                if (!File.Exists(Config.PPTTemplate))
                {
                    throw new ApplicationException("Template not found.");
                }

                //Globals.ThisAddIn.Application.ActivePresentation.Close();

                //ByteToFile(Properties.Resources.packageTemplate, Config.PPTTemplate);

                //presentation = presentations.Open(
                //    Config.PPTTemplate,
                //    MsoTriState.msoCTrue,
                //    MsoTriState.msoCTrue,
                //    MsoTriState.msoCTrue);
            }
            else
            {
                presentation = Globals.ThisAddIn.Application.ActivePresentation;
            }
            //get the template slides
            slides = presentation.Slides;
            if (slides.Count < 5)
            {
                throw new ApplicationException("Template was altered.");
            }
            #endregion


            /* Create package poster */
            CreatePackageSlide();
            CreateEventSlide();
            CreateChartSlide();
            //delete the four template slide
            for (int i = 1; i <= 4; i++)
            {
                slides[1].Delete();
            }

            if (_directoryPath.Length > 0)
            {
                _pptxFileName += DateTime.Now.ToString("MMddyyyyhhmmss");
                presentation.SaveAs(
                    Path.Combine(_directoryPath, _pptxFileName),
                    PpSaveAsFileType.ppSaveAsDefault,
                    MsoTriState.msoTrue);
                File.SetAttributes(_fullName, FileAttributes.Archive);
                File.Delete(_fullName);
            }
        }
        public IActionResult Index(int slide = 0)
        {
            if (slide < 0 || slide > Slides.Get().Length - 1)
            {
                throw new Exception("Get lost!");
            }

            return(View(Slides.Get(slide).View, new _LayoutModel(Slides.Get(), slide)));
        }
Example #25
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Slides slides = await db.Slides.FindAsync(id);

            db.Slides.Remove(slides);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Example #26
0
        public void RemoveSlide(string slideName)
        {
            var slide = GetSlideByName(slideName);

            if (slide != null)
            {
                Slides.Remove(slide);
            }
        }
Example #27
0
        /// <summary>
        /// Create new slide
        /// </summary>
        /// <param name="pptPresentation">current ppt presentation file</param>
        /// <param name="customLayout">custom layout for slide</param>
        private void CreateNewSlide(Presentation pptPresentation, CustomLayout customLayout)
        {
            // Create new Slide
            slides = pptPresentation.Slides;
            slide  = slides.AddSlide(slide.SlideIndex + 1, customLayout);

            Microsoft.Office.Interop.PowerPoint.Shape shape = slide.Shapes.AddLabel(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 120, 500, 200, 70);
            shape.TextFrame.TextRange.Text = "Footer text goes here" + slide.SlideIndex.ToString();
        }
Example #28
0
        public void initPPTAutomation()
        {
            _pptApplication = new Application();

            _pptPresentation = _pptApplication.Presentations.Add(Office.MsoTriState.msoTrue);

            _customLayout = _pptPresentation.SlideMaster.CustomLayouts[PpSlideLayout.ppLayoutText];

            // 새 슬라이드 생성
            _slides = _pptPresentation.Slides;
            _slide  = _slides.AddSlide(1, _customLayout);

            // 타이틀 추가
            _objText      = _slide.Shapes[1].TextFrame.TextRange;
            _objText.Text = "제목입니당";
            //TOAN : 01/28/2019. FontName에서 Exception이 발생하는듯 하다.
            //_objText.Font.Name = "Gulim";
            //_objText.Font.Size = 32;
            _objText.Font.Size = 20;
            _objText           = _slide.Shapes[2].TextFrame.TextRange;
            //_objText.Text = "1번째줄\n2번째줄\n3번째줄";
            int ioop = 0;

            //int ioop = 48;
            for (ioop = 0; ioop < 10; ioop++)
            {
                _objText.Text += ioop.ToString();
                _objText.Text += "\n";
                //아래 코드를 사용하면 루프중에 프로그램이 종료되버린다.
                //Delay(1000);
            }

            //TOAN : 01/28/2019. Temporary Blocking
            _slide.NotesPage.Shapes[2].TextFrame.TextRange.Text = "여기는 슬라이드 설명쓰는곳입니당.";

            //File저장 영역은 현재 디렉토리에 저장을 시켜 준다.
            //_pptPresentation.SaveAs(@"c:\COOLA\ppttest.pptx", PpSaveAsFileType.ppSaveAsDefault, Office.MsoTriState.msoTrue);

            _slide = _slides.AddSlide(2, _customLayout);
            // 타이틀 추가
            _objText = _slide.Shapes[1].TextFrame.TextRange;
            //_objText.Text = "제목입니당";
            _objText.Font.Size = 32;
            _objText.Text      = "제목";

            //Delay(5000);

            _objText.Text      = _objText.Text + "입니당";
            _objText.Font.Name = "Gulim";
            _objText.Font.Size = 32;

            _objText      = _slide.Shapes[2].TextFrame.TextRange;
            _objText.Text = "4번째줄\n5번째줄\n6번째줄";

            _slide.NotesPage.Shapes[2].TextFrame.TextRange.Text = "여기는 슬라이드 설명쓰는곳입니당.";
        }
        private void ClearSlides()
        {
            Slides slides = presentation.Slides;

            do
            {
                Slide slide = slides[1];
                slide.Delete();
            } while (slides.Count != 0);
        }
    void Start()
    {
        Slides slides = new Slides("LessonVariability");

        // Talk about how data points differ from each other
        slides.Add(new Slide(
                       "Variability\n\n" +
                       "Variability is how \"spread out\" a group of data points are. It is a way of expressing how data points differ from each other."
                       ));

        // Talk about different kinds of variability: Range, mean, variance, and standard deviation.
        slides.Add(new Slide(
                       "There are different ways of measuring variability: range, mean, variance, and standard deviation."
                       ));

        // Range
        slides.Add(new Slide(
                       "Range is a measure of how far apart the furthest data points are from each other, and it is the simplest measure of variability to calculate.\n\n" +
                       "Simply take the largest data point and subtract the value of the lowest data point.\n\n" +
                       "Take the group of numbers 2, 4, 6. The range is 6 - 4, which is 2."
                       ));

        // Mean
        slides.Add(new Slide(
                       "The mean is a measure of what the average data point is.  Simply sum all of your data points and divide by the number of data points you have.\n\n" +
                       "Take the group of numbers 2, 4, 6. The average is (2 + 4 + 6) / 2, which is 4."
                       ));

        // Variance
        slides.Add(new Slide(
                       "Variance is a measure of how close the data points are to the average.\n\n" +
                       "To calculate the variance, you will need the mean, μ (pronounced \"mu\").\n\n" +
                       "Then take each point and substract μ from it. Square these values and add them all together. Then divide by the number of data points."
                       ));

        slides.Add(new Slide(
                       "Take the group of numbers 2, 4, 6. The average is (2 + 4 + 6) / 2, which is 4.\n\n" +
                       "Then, we subtract μ from each value, and square the result: (2 - 4)*(2 - 4), (4 - 4)*(4 - 4), and (6 - 4)*(6 - 4).\n\n" +
                       "We then take the sum of the squares, and divide by the number of data points: (2 + 0 + 2)/3 = 1.333"
                       ));

        // Variance continued
        slides.Add(new Slide(
                       "The equation to calculate variance (σ²) is: ∑(X - μ)²/N.\n\n" +
                       "Where X is the value of each data point, N is the number of data points, and ∑ means sum all of the values (X - μ)² for each data point."
                       ));


        // TODO Talk about histograms, what they are

        // TODO Talk about histograms, how to read them

        this.slides = slides;
    }
Example #31
0
        public async Task <IHttpActionResult> GetSlides(int id)
        {
            Slides slides = await db.Slides.FindAsync(id);

            if (slides == null)
            {
                return(NotFound());
            }

            return(Ok(slides));
        }
Example #32
0
        public async Task <ActionResult> Edit([Bind(Include = "id,UrlImagen,Encabezado,Titulo,Descripcion,UrlDestino,TxtBoton,Habilitado")] Slides slides)
        {
            if (ModelState.IsValid)
            {
                db.Entry(slides).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(slides));
        }
    void Start()
    {
        Slides slides = new Slides("LessonVariability");

        // Talk about how data points differ from each other
        slides.Add (new Slide (
            "Variability\n\n" +
            "Variability is how \"spread out\" a group of data points are. It is a way of expressing how data points differ from each other."
        ));

        // Talk about different kinds of variability: Range, mean, variance, and standard deviation.
        slides.Add(new Slide(
            "There are different ways of measuring variability: range, mean, variance, and standard deviation."
        ));

        // Range
        slides.Add(new Slide(
            "Range is a measure of how far apart the furthest data points are from each other, and it is the simplest measure of variability to calculate.\n\n" +
            "Simply take the largest data point and subtract the value of the lowest data point.\n\n" +
            "Take the group of numbers 2, 4, 6. The range is 6 - 4, which is 2."
        ));

        // Mean
        slides.Add(new Slide(
            "The mean is a measure of what the average data point is.  Simply sum all of your data points and divide by the number of data points you have.\n\n" +
            "Take the group of numbers 2, 4, 6. The average is (2 + 4 + 6) / 2, which is 4."
        ));

        // Variance
        slides.Add(new Slide(
            "Variance is a measure of how close the data points are to the average.\n\n" +
            "To calculate the variance, you will need the mean, μ (pronounced \"mu\").\n\n" +
            "Then take each point and substract μ from it. Square these values and add them all together. Then divide by the number of data points."
        ));

        slides.Add (new Slide (
            "Take the group of numbers 2, 4, 6. The average is (2 + 4 + 6) / 2, which is 4.\n\n" +
            "Then, we subtract μ from each value, and square the result: (2 - 4)*(2 - 4), (4 - 4)*(4 - 4), and (6 - 4)*(6 - 4).\n\n" +
            "We then take the sum of the squares, and divide by the number of data points: (2 + 0 + 2)/3 = 1.333"
        ));

        // Variance continued
        slides.Add(new Slide(
            "The equation to calculate variance (σ²) is: ∑(X - μ)²/N.\n\n" +
            "Where X is the value of each data point, N is the number of data points, and ∑ means sum all of the values (X - μ)² for each data point."
        ));

        // TODO Talk about histograms, what they are

        // TODO Talk about histograms, how to read them

        this.slides = slides;
    }
    void Start()
    {
        Slides slides = new Slides("LessonAboutThisApp");

        slides.Add(new Slide(
            "To advance through the lessons, use the \"continue\" and \"go back\" buttons. You can return to the Main Menu by clicking \"Go back to Main Menu\"."
        ));

        slides.Add(new Slide(
            "This application requires you to download a set of images for the Augmented Reality part of the game. You can download these images by clicking on \"Get the AR Targets for These Lessons\" from the main menu or by visiting our website at http://studysessions.mantarayar.com/."
        ));

        this.slides = slides;
    }
    public Slide(Slide s)
    {
        this.text = s.text;
        this.gui = s.gui;
        this.parent = s.parent;
        s.experience.SetOwner (this);
        this.experience = (Experience) Activator.CreateInstance(s.experience.GetType(), s.experience);
        this.question = s.question;
        this.state = s.state;

        if (this.state == SlideState.DONE) {
            this.state = SlideState.AR;
        }
    }
    void Start()
    {
        slides = new Slides ("LessonProbability");

        slides.Add (new Slide (
            "What is Probability?\n\nProbability deals with chance."
        ));

        slides.Add(new Slide(
            "Whenever you ask yourself \"what is the chance that I will roll a 2 on a six-sided dice\" or a similar question, you are dealing with probability. Probability is the chance of something happening."
        ));

        slides.Add (new Slide (
            "In this lesson, you will learn what probability is, how to use it, and some of the related vocabulary associated with it. Click \"continue\" to get started."
        ));

        slides.Add (new Slide(
            "What is probability?\n\n" +
            "Probability is the extent to which something is probable; the likelihood of something happening or being the case."
        ));

        slides.Add (new Slide (
            "Fractions, Decimals, and Percentages\n\n" +
            "So far, we have expressed probability in the form of a percentage. However, probability can be expressed in the form of ratios and fractions."
        ));

        slides.Add (new Slide(
            "Ratios\n\n" +
            "We'll first talk about ratios. A ratio is a comparison often expressed in the form of two numbers with a colon in between like 1:2 or 3:4. " +
            "These are read as \"1 to 2\" or \"3 to 4\", and referred to as \"the odds of an event occurring.\""
        ));

        slides.Add (new Slide (
            "Let's look at an example. If we have 3 sick fish out of 10, we would say that 30% of the fish are sick.\n\n" +
            "With ratios however, you compare the sick fish to the not sick fish. The ratio of sick fish to healthy fish is 3:7 (read as 3 to 7). In other words, the odds that a fish is affected from this sample is 3 to 7."
        ));

        slides.Add (new Slide(
            "While confusing at first, ratios are commonly used in everyday life. For instance, a cake recipe may call for \"3 parts flour to 1 part milk\", or in other words, 75% flour to 25 % milk."
        ));

        slides.Add (new Slide(
            "It is much easier to multiply amounts using ratios than percentages. If you wanted to make two batches of the cake recipe, you could simply multiply the ratio by two to get 6 parts flour to 2 parts milk, or 6:2."
        ));

        slides.Add (new Slide(
            "Now that we have discussed probability, you are ready for the next lesson. Tap “continue” to go to the next lesson."
        ));
    }
Example #37
0
 public static void divideToSentences(Slides slides, Slide slide, TextRange textRange)
 {
     var slideNumber = slide.SlideIndex;
     float slideDuration = slide.SlideShowTransition.AdvanceTime;
     //the number represents to how many slides to divide
     int divisionNumber = textRange.Sentences().Count;
     float duration = durationAfterDivisions(slideDuration, divisionNumber);
     foreach (TextRange sentence in textRange.Sentences())
     {
         SlidesManipulation.createNewSlide(slides, ++slideNumber, sentence.Text.Trim(), duration);
         SlidesManipulation.createNewSlide(slides, ++slideNumber, "", 0.01F);
     }
     //delete slides
     slide.Delete();
     slides[slideNumber].Delete();
 }
    // Use this for initialization
    void Start()
    {
        slides = new Slides ("LessonIntroduction");

        slides.Add (new Slide (
            "Welcome to Introduction to Basic Statistics!"
        ));

        slides.Add (new Slide (
            //"Whenever you ask yourself \"What is the chance that I will roll a two on a six-sided dice\" or similar questions you are dealing with probability."
            "This application's purpose is to teach and reinforce the basic concepts of sampling, probability and variance through Augmented Reality."
        ));

        slides.Add (new Slide (
            "In these lessons, we will explore what probability is, how to express it, and identifying some probabilities through an augmented reality investigation."
        ));

        slides.Add (new Slide (
            "To advance through the lessons, use the \"continue\" and \"go back\" buttons. You can return to the Main Menu by clicking \"Go back to Main Menu\"."
        ));

        slides.Add (new Slide (
            "This application requires you to download a set of images for the Augmented Reality part of the game.\n\n" +
            "You can download these images by clicking on \"Get the AR Targets for These Lessons\" from the main menu or by visiting our website at http://studysessions.mantarayar.com/."
        ));

        slides.Add (new Slide(
            "In order to get the most out of this mobile application, you should have a firm understanding of basic math skills such as:\n" +
            "\u2022 Addition\n" +
            "\u2022 Subtraction\n" +
            "\u2022 Multiplication\n" +
            "\u2022 Division\n" +
            "\u2022 Fractions"
        ));

        slides.Add (new Slide(
            "Upon completion of this course, you will be able to:\n" +
            "\u2022 Obj 1: Build and describe a sample\n" +
            "\u2022 Obj 2: Calculate a probability of a sample\n" +
            "\u2022 Obj 3: Recognize the variability between samples\n" +
            "\u2022 Obj 4: Describe the effect of sample size on how well a sample resembles a population\n" +
            "\u2022 Obj 5: Explain the differences between sample and population distributions\n"
        ));
    }
    void Start()
    {
        Slides slides = new Slides ("LessonReporting");

        slides.Add (new Slide (
            "Reporting Your Data\n\n" +
            "After a day of investigating fish, your boss wants you to report your findings to her. Let’s convert some of your findings to make it easier to understand."
        ));

        // ----------------------- Question Slide 1 ---------------- //
        Slide qSlide = new Slide("");
        Question q = new Question();
        q.SetText("We have observed that 3 of 10 fish have been affected by pollution from one of our samples. How do we express that as a ratio of affected fish to not affected fish?");
        q.SetAnswers("3:7", "7:3", "1:3","7:1");
        q.SetRightAnswer("3:7");
        q.SetHint("Make sure to pay attention to the order of the numbers in the wording.");
        q.SetDescriptionOfRightAnswer("Correct. If we have 3 affected fish, then that means we have 7 not affected fish. Thus, the ratio is 3 to 7.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 2 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("You observed that 20% of fish have been affected by pollution from the total of the two samples. How do you express this as a ratio of affected fish to not affected fish?");
        q.SetAnswers("1:5", "20:1", "2:5", "2:8");
        q.SetRightAnswer("2:8");
        q.SetHint("TMake sure to pay attention to the order of the numbers in the wording. Remember that percentages are different than ratios.");
        q.SetDescriptionOfRightAnswer("Correct. If we have 2 affected fish, then that means we have 8 not affected fish. Thus, the ratio is 2 to 8.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        slides.Add (new Slide (
            "Your boss appreciates your work! Converting your data to make it easy to understand is not very hard. However, your work is not done. "
            // TODO support histograms
            /*  + "Next, you will need to create a chart of your results..." */
        ));

        this.slides = slides;
    }
    void Start()
    {
        slides = new Slides("LessonProbabilityPractice");

        slides.Add(new Slide(
            "Exercise 2: Discovering Probability\n\nIn the following exercise, you will practice calculating probability."
        ));

        slides.Add (new Slide (
            "In this scenario, after a day of investigating fish, your boss wants you to report your findings to him!  We need to calcuate the probability of randomly selecting a fish that has been affected by oil!"
        ));

        // ----------------------- Question Slide ---------------- //
        Slide qSlide = new Slide("");
        Question q = new Question();
        q.SetText("If 3 out of 10 fish had been affected by oil, what would the probability be of randomly selected a fish the has been affected by oil?");
        q.SetAnswers("70%", "50%", "0%", "30%");
        q.SetRightAnswer("30%");
        q.SetHint("Calculate 3/10 and then multiply by 100 to get the percentage for the probability.");
        q.SetDescriptionOfRightAnswer("Correct! The probability of selecting a fish that has been affected by oil is 30%, or 3/10.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("If 3 out of 10 fish had been affected by oil, what would the probability be of randomly selected a fish the has NOT been affected by oil?");
        q.SetAnswers("70%", "20%", "0%", "30%");
        q.SetRightAnswer("70%");
        q.SetHint("Remember that the total probability of selecting a fish that has been affected by oil and has not been affected by oil is 100%");
        q.SetDescriptionOfRightAnswer("Great! If the probability of selecting a fish that has been affected by oil is 30%, then 100% - 30% = 70%, which is the probability of selecting a fish that has NOT been affected by oil.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        slides.Add(new Slide(
            "Your boss appreciates the work!"
        ));
    }
Example #41
0
 public bool load(string file)
 {
     if (this.powerpoint == null) return false;
       try
       {
     string fileName = file.Trim();
     presentations = powerpoint.Presentations;
     presentation = presentations.Open(fileName,
                                   Microsoft.Office.Core.MsoTriState.msoFalse,
                                   Microsoft.Office.Core.MsoTriState.msoFalse,
                                   Microsoft.Office.Core.MsoTriState.msoTrue);
     slides = presentation.Slides;
     return true;
       }
       catch
       {
     presentation = null;
     slides = null;
     return false;
       }
       //Thread.Sleep(5000);
 }
        public static void createNewSlide(Slides oSlides, int slideNumber, string slideText, float advanceSec)
        {
            /*Slide oSlide=null;
            if (slideText == "")
            {
                oSlide = oSlides.Add(slideNumber, PpSlideLayout.ppLayoutBlank);
                oSlide.FollowMasterBackground = MsoTriState.msoFalse;
                oSlide.Background.Fill.ForeColor.RGB = colorizing(System.Windows.Media.Colors.Black);
            }
            else
            {*/
            // Slide oSlide = oSlides.Add(slideNumber, PpSlideLayout.ppLayoutText);
            Slide oSlide = oSlides.Add(slideNumber, PpSlideLayout.ppLayoutTitleOnly);

            oSlide.FollowMasterBackground = MsoTriState.msoFalse;
            oSlide.Background.Fill.ForeColor.RGB = colorizing(System.Windows.Media.Colors.Black);

            Microsoft.Office.Interop.PowerPoint.Shapes oShapes = oSlide.Shapes;
            Microsoft.Office.Interop.PowerPoint.Shape oShape = oShapes[1];
            Microsoft.Office.Interop.PowerPoint.TextFrame oTxtFrame = oShape.TextFrame;

            TextRange oTxtRange = oTxtFrame.TextRange;

            oTxtRange.Text = slideText;
            // oTxtRange = setItalic(oTxtRange);

            oTxtRange.Font.Size = 44;
            oTxtRange.Font.Name = "Arial";
            oTxtRange.ParagraphFormat.Alignment = PpParagraphAlignment.ppAlignCenter;
            oTxtRange.Font.Color.RGB = colorizing(System.Windows.Media.Colors.White);

            //repositing text in the shape does not work
            //oTxtFrame.MarginTop = 10;
            //oShape.Top = 2;
            // }

            addTimecodeToSlide(oSlide, advanceSec);
        }
    void Start()
    {
        Slides slides = new Slides ("LessonSampling");

        slides.Add (new Slide (
            "Introduction to Statistical Sampling\n\n" +
            "In statistics, sampling is concerned with the selection of a subset of individuals from within a statistical population to estimate characteristics of the whole population."
        ));

        slides.Add (new Slide (
            "By conducting a statistical sample, our workload can be cut down immensely. Rather than tracking the behaviors of billions or millions, we only need to examine those of thousands or hundreds."
        ));

        slides.Add (new Slide (
            "Types of Sampling\n\n" +
            "There are many different types of sampling, but the most common is simple random sampling. Random sampling is one in which any member of the population is equally likely to be selected for the sample."
        ));

        slides.Add (new Slide (
            "With random sampling, being random helps eliminate bias when we make statistical conclusions in which any member of the population is equally likely to be selected for the sample."
        ));

        this.slides = slides;
    }
Example #44
0
        public Boolean Open()
        {
            try
            {
                pptApp = new Application();
                pptFile = pptApp.Presentations.Open(this.ppt.get_absolute_path(),
                     Microsoft.Office.Core.MsoTriState.msoFalse,
                     Microsoft.Office.Core.MsoTriState.msoTrue,
                     Microsoft.Office.Core.MsoTriState.msoTrue);

                pptSlides = pptFile.Slides;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                return false;
            }
            return true;
        }
Example #45
0
        public bool startSlideShow()
        {
            if (this.powerpoint == null) return false;
              if (this.powerpoint.Presentations.Count == 0) return false;

              stopSlideShow();
              if (slides == null)
              {
              presentations = powerpoint.Presentations;
              presentation = presentations._Index(1);
              if (presentation != null)
              {
              slides = presentation.Slides;
              }
              }
              if (slides != null)
              {

              int all = slides.Count;
              int[] SlideIdx = new int[all];
              for (int i = 0; i < all; i++) SlideIdx[i] = i + 1;
              slideRange = slides.Range(SlideIdx);

              slideShowTransition = slideRange.SlideShowTransition;
              slideShowTransition.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse;
              slideShowTransition.EntryEffect = Microsoft.Office.Interop.PowerPoint.PpEntryEffect.ppEffectBoxOut;

              //Prevent Office Assistant from displaying alert messages:
              //dumps if NotFiniteNumberException installed   bAssistantOn = powerpoint.Assistant.On;
              //   powerpoint.Assistant.On = false;
              //Run the Slide show
              slideShowSettings = presentation.SlideShowSettings;
              slideShowSettings.StartingSlide = 1;
              slideShowSettings.EndingSlide = all;
              slideShowWindow = slideShowSettings.Run();
              slideShowWindows = powerpoint.SlideShowWindows;
              }

              return true;
        }
    void Start()
    {
        Assets assets = Assets.GetInstance();
        Slides slides = new Slides("LessonExploringVariability");

        slides.Add(new Slide(
            "Comparing Different Samples\n\n" +
            "Let's discover first hand what variability is and how we can use it in real world situations."
        ));

        slides.Add (new Slide (
            "HWe return to the area of the oil spill that has caused fish to become sick.\n\n" +
            "Let's compare the results we took from the Pier and compare them with new data from the Shallow Area of the lake."
        ));

        // --------------------- Experience Slide ---------------- //
        Slide arSlide = new Slide(
            "Point your device at the Shallow Area."
        );

        FishExperience e = new FishExperience(typeof(FishBehavior), arSlide);
        e.SetTarget(GameObject.Find (assets.ShallowArea));
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.SetTotalNumberOfFish (12);

        arSlide.AttachExperience(e);

        slides.Add(arSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        Slide qSlide = new Slide("");
        Question q = new Question();
        q.SetText("What fraction of fish have been affected by oil based on the 12 fish you have investigated (there were 8 fish that were not affected by oil)?");
        q.SetAnswers("1/12", "3/12", "4/12", "7/12");
        q.SetRightAnswer("4/12");
        q.SetHint("Take the number of fish that have been affected by oil and divide it by the total number of fish.");
        q.SetDescriptionOfRightAnswer("Great!  Dividing the number of affected fish by the total number of fish, we can derive that 4/12ths of the fish have been affected by pollution!");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("What is 4/12ths as a percentage?");
        q.SetAnswers("10%", "33.3%", "66.7%", "100%");
        q.SetRightAnswer("33.3%");
        q.SetHint("The probability that the next fish is affected by oil is the same as the observed fraction of fish that have been affected by oil.");
        q.SetDescriptionOfRightAnswer("That's correct!  4/12 = 1/3, which is 33.3%.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("Last time, we noticed that 3/10 fish were affected.  Is that a higher or lower percentage of fish than this time (which was 4/12)?");
        q.SetAnswers("Higher", "Lower", "The Same", "");
        q.SetHint ("Calculate what 3/10ths is and calculate what 4/12ths is as a percentage.");
        q.SetRightAnswer("Lower");
        //q.SetHint("The probability that the next fish is affected by oil is the same as the observed fraction of fish that have been affected by oil.");
        q.SetDescriptionOfRightAnswer("That's right!  By counting more fish, we have discovered that the percentage of fish is actually lower than we originally estimated.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        slides.Add (new Slide (
            "Let's collect one more data set from a Tributary of the lake before we look into the variability of the data we have collected."
        ));

        // --------------------- Experience Slide ---------------- //
        arSlide = new Slide(
            "Point your device at the Tributary Area."
        );

        e = new FishExperience(typeof(FishBehavior), arSlide);
        e.SetTarget(GameObject.Find (assets.TributaryArea));
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.SetTotalNumberOfFish (10);

        arSlide.AttachExperience(e);

        slides.Add(arSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("So far, we have collected the following sets of data of the percentage of fish that have been affected: 30%, 33.3%, and 50%.\n\n"  +
                  "What is the range of this data?");
        q.SetAnswers("20", "33.3", "30", "50");
        q.SetHint ("Remember that the range is the value of the largest data point minus the smallest data point.");
        q.SetRightAnswer("20");
        q.SetDescriptionOfRightAnswer("That's right! By taking the largest data point (50%) and subtracting the smallest data point (30%), we get 20 as the range!");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("If you were to estimate the mean of 30%, 33.3%, and 50%, what would your approximation be?");
        q.SetAnswers("20% - 30%", "35% - 40%", "50% - 60%", "0% - 10%");
        q.SetHint ("If you are having trouble calculating the mean, try to visually imagine where the middle of 30, 33 and 50 would be.");
        q.SetRightAnswer("35% - 40%");
        q.SetDescriptionOfRightAnswer("Good job!  The exact mean is 37.7%!");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        this.slides = slides;
    }
    void Start()
    {
        Slides slides = new Slides("Lesson9");

        slides.Add(new Slide(
            "Probability Quiz\n\nTo check your knowledge, please answer the following 10 questions. Good luck!"
            ));
        // ----------------------- Question Slide 1 ---------------- //
        Slide qSlide = new Slide("");
        Question q = new Question();
        q.SetText("If something is likely to happen, than it should have a probability of...");
        q.SetAnswers("0", "0.5", "0.2", "1");
        q.SetRightAnswer("1");
        q.SetHint("The closer to 1 of probability the more likely it is to happen.");
        q.SetDescriptionOfRightAnswer("The closer to 1 of probability the more likely it is to happen.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 2 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("If something is likely to happen, than it should have a probability of between...");
        q.SetAnswers("0 and 0.5", "0.5 and 1", "1 and 2", "None of the above");
        q.SetRightAnswer("0.5 and 1");
        q.SetHint("The closer to 1 a probabiltiy, the more likely it is to happen.");
        q.SetDescriptionOfRightAnswer("The closer to 1 a probabiltiy, the more likely it is to happen.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 3 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("We have a box of jelly beans with 3 orange, 1 lemon, and 2 cherry jelly beans inside it.  \n\nWhat is the probability of randomly selecting an orange jelly bean?");
        q.SetAnswers("3 out of 6", "1 out of 6", "2 out of 6", "4 out of 6");
        q.SetRightAnswer("3 out of 6");
        q.SetHint("Count the number of orange jelly beans and the total number of jelly beans.");
        q.SetDescriptionOfRightAnswer("Good job!  By counting the total of the orange jelly beans and to the total amount of jelly beans, we can determine that 3 out of 6 of the jelly beans are orange.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 4 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("We have a box of jelly beans with 3 orange, 1 lemon, and 2 cherry jelly beans inside it.  \n\nWhat is the probability of randomly selecting a lemon jelly bean?");
        q.SetAnswers("3 out of 6", "1 out of 6", "2 out of 6", "4 out of 6");
        q.SetRightAnswer("1 out of 6");
        q.SetHint("Count the number of lemon jelly beans and the total number of jelly beans.");
        q.SetDescriptionOfRightAnswer("Good job!  By counting the total of the lemon jelly beans and to the total amount of jelly beans, we can determine that 1 out of 6 of the jelly beans are lemon.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 5 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("We have a box of jelly beans with 3 orange, 1 lemon, and 2 cherry jelly beans inside it.  \n\nWhat is the probability of randomly selecting a cherry jelly bean?");
        q.SetAnswers("3 out of 6", "1 out of 6", "2 out of 6", "4 out of 6");
        q.SetRightAnswer("2 out of 6");
        q.SetHint("Count the number of cherry jelly beans and the total number of jelly beans.");
        q.SetDescriptionOfRightAnswer("Good job!  By counting the total of the cherry jelly beans and to the total amount of jelly beans, we can determine that 2 out of 6 of the jelly beans are cherry.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 6 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("We have a box of jelly beans with 3 orange, 1 lemon, and 2 cherry jelly beans inside it.  \n\nWhich flavor would have the largest probability of being randomly selected?");
        q.SetAnswers("Cherry", "Lemon", "Orange", "All equal");
        q.SetRightAnswer("Orange");
        q.SetHint("Count which flavor has the highest amount.");
        q.SetDescriptionOfRightAnswer("Good job!");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 7 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("We have a box of jelly beans with 3 orange, 1 lemon, and 2 cherry jelly beans inside it.  \n\nWhich flavor would have the lowest probability of being randomly selected?");
        q.SetAnswers("Cherry", "Lemon", "Orange", "All equal");
        q.SetRightAnswer("Lemon");
        q.SetHint("Count which flavor has the lowest amount.");
        q.SetDescriptionOfRightAnswer("Good job!");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 8 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("A fair coin is tossed 10 times. It lands on heads 8 times and lands on tails 2 times. What is the probability that the coin will land on heads with the next throw?");
        q.SetAnswers("80%", "20%", "10%", "50%");
        q.SetRightAnswer("50%");
        q.SetHint("Don't be fooled into thinking that the past coin flips influence future coin flips.");
        q.SetDescriptionOfRightAnswer("Good job! Past coin flips do not influence future coin flips.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 9 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("The weatherman reported that there was a 70% chance of rain tomorrow. How else could we show this amount?");
        q.SetAnswers("7:3", "7/10", "0.7", "All of the above");
        q.SetRightAnswer("All of the above");
        q.SetHint("There is more than one way to represent a probability.");
        q.SetDescriptionOfRightAnswer("Great! Probabilities can be represented as fractions, ratios, decimals, as well as percentages.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        // ----------------------- Question Slide 10 ---------------- //
        qSlide = new Slide("");
        q = new Question();
        q.SetText("A recipe calls for 2 cups of milk for every 3 cups of cake mix. How can we show this as a ratio of milk to cake mix?");
        q.SetAnswers("2:3", "3:2", "0:5", "5:0");
        q.SetRightAnswer("2:3");
        q.SetHint("There is more than one way to represent a probability.");
        q.SetDescriptionOfRightAnswer("Great! Probabilities can be represented as fractions, ratios, decimals, as well as percentages.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        slides.Add(new Slide(
            "Congrats on finishing the probability quiz! Now that you've learned what probability is, check out our other mobile learning applications!"
            ));

        this.slides = slides;
    }
 public static void SetCurrentSlides(Slides s)
 {
     FlowControl.currentSlides = s;
 }
Example #49
0
 public static void twoLinesFilter(Slides slides)
 {
     foreach (Slide slide in slides)
     {
         Microsoft.Office.Interop.PowerPoint.Shape shape = slide.Shapes[1];
         if (shape.HasTextFrame == MsoTriState.msoTrue)
         {
             if (shape.TextFrame.HasText == MsoTriState.msoTrue)
             {
                 var textRange = shape.TextFrame.TextRange;
                 //check if there are more than two lines, and needs additional divisions
                 if (textRange.Lines().Count > 2)
                 {
                     if (textRange.Sentences().Count > 1)
                     {
                         divideToSentences(slides, slide, textRange);
                     } else {
                         divideToLines(slides, slide, textRange);
                     }
                 }
             }
         }
     }
 }
    void Start()
    {
        Assets assets = Assets.GetInstance();
        Slides slides = new Slides("LessonSamplePractice");

        slides.Add (new Slide (
            "Let's discover first hand what probability is and how we can use it in real world situations."
        ));

        slides.Add (new Slide (
            "Here is a scenario: An oil spill has caused fish in a bay area to become sick. You have been tasked to figure out the effects of that oil spill on the first population of fish."
        ));

        slides.Add (new Slide (
            "Begin by taking a tally of how many fish you can find that have been affected by the pollution."
        ));

        slides.Add (new Slide (
            "Let's practice:\n" +
            "1. To begin, locate the first area of water, called the Bay Area.\n" +
            "2. Point the camera on your mobile device at the Bay Area.\n" +
            "3. Take a sample of the 10 fish in the water by tapping the fish on the screen."
        ));

        slides.Add (new Slide (
            "4. To determine if a fish is infected by oil, look for oil streaks.\n" +
            "5. Once you’ve looked at all 10 fish, calculate the percentage of fish affected by pollution and answer any related questions. If you need help, tap “hint” for more information.\n" +
            "6. After answering all the questions for the area of water, tap [finished]."
        ));

        // --------------------- Experience Slide ---------------- //
        Slide arSlide = new Slide(
            "Point your device at Pier Area."
        );

        FishExperience e = new FishExperience(typeof(FishBehavior), arSlide);
        e.SetTarget(GameObject.Find (assets.PierArea));
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomHealthyFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.AddGameObject(assets.RandomSickFish());
        e.SetTotalNumberOfFish (10);

        arSlide.AttachExperience(e);

        slides.Add(arSlide);
        // -------------------------------------------------------- //

        slides.Add (new Slide (
            "Results\n\n" +
            "It looks like you sampled 3 out of 10 fish that have been affected by the oil spill."
        ));

        slides.Add (new Slide (
            "In other words, 30 percent of the fish have been affected by the oil spill.\n\n" +
            "Based on that, we can assume that of the next 10 fish we randomly select from the lake, 3 will also be affected by the pollution."
        ));

        // ----------------------- Question Slide ---------------- //
        Slide qSlide = new Slide("");
        Question q = new Question();
        q.SetText("You have observed that 3 of 10 fish have been affected by pollution for this sample. How many fish would you expect to be affected by the oil spill if you sampled a total of 100 fish from the same lake?");
        q.SetAnswers("10", "30", "50", "100");
        q.SetRightAnswer("30");
        q.SetHint("Take the number of fish that have been affected by oil and divide it by the total number of fish and multiply by 100.");
        q.SetDescriptionOfRightAnswer("By calculating that 30% of your sample was infected, you can make an estimation that 30% of the 100 fish will also be affected by the oil spill, which is 30 fish.");

        qSlide.AttachQuestion(q);
        slides.Add (qSlide);
        // -------------------------------------------------------- //

        slides.Add (new Slide (
            "That is how you take a sample of a population."
        ));

        this.slides = slides;
    }
Example #51
0
 public static void createEmptySlide(Slides oSlides, int slideNumber)
 {
     Slide oSlide = oSlides.Add(slideNumber, PpSlideLayout.ppLayoutBlank);
     oSlide.FollowMasterBackground = MsoTriState.msoFalse;
     oSlide.Background.Fill.ForeColor.RGB = colorizing(System.Windows.Media.Colors.Black);
 }