Beispiel #1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Lesson" /> class.
        ///     To be properly instanciated, the lesson need a name, the path of the PDF and the current number of pages of this
        ///     document.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <param name="nbPages">The nb pages.</param>
        public Lesson(string name, int nbPages)
        {
            Name = name;

            // Preparation of the slides
            Slides = new SlideHolder();
            for (var i = 0; i < nbPages; i++)
            {
                Slides.AddNewContent();
            }

            Slides.AddLayer("Mes notes");

            // Preparation of the global notes (free note zone)
            GlobalNotes = new GlobalNotesHolder();
            GlobalNotes.AddNewContent("Default");
            GlobalNotes.AddLayer("Notes libres");

            // Preparation of the exercice holder
            Exercises = new ExerciseHolder();

            // Test, adding one quiz layer
            var             exFactory = new ExerciseContent.ExerciseFactory(Exercises);
            ExerciseContent ex        = exFactory.GetQCM("QCM Démonstration");

            (ex as QuizContent).AddQuestionLayer("Question");
            (ex as QuizContent).AddAnswerLayer("Réponse");
            Exercises.Contents.Add(ex);
        }
 public SharedExerciseLayer(ExerciseContent content, int uid, string userName, bool isTeacher)
     : base(content, uid, userName, isTeacher)
 {
     // Nom of the exercise
     Name  = content.Name;
     Layer = content.GetLayerByUid(uid) as BasicLayer;
 }
Beispiel #3
0
 public GraphicalAnswerLayer(ExerciseContent content, string name, Collection <Point> points,
                             bool isRenameable = false, bool isHideable = true, bool isDeletable = false, bool isShareable = false,
                             bool isInkable    = true)
     : base(content, name, isRenameable, isHideable, isDeletable, isShareable, isInkable)
 {
     SaliencyMap    = new SaliencyMap(points);
     NbParticipants = 0;
 }
        /// <summary>
        ///     Adds the received layers to the specified holder.
        /// </summary>
        /// <param name="holder">The holder.</param>
        public override void AddThem(Holder holder)
        {
            ExerciseContent content = null;

            try
            {
                content = (holder as ExerciseHolder).GetContentByUID(UID);
                content.ImportLayer(Layer);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            WebcamContent = new WebCamContent();
            FixSitContent fixSitContent = new FixSitContent();

            ExerciseContent = new ExerciseContent();
            SetContent(fixSitContent);
            FixSitWPF.Controller.Controller controller = new FixSitWPF.Controller.Controller(this);

            _NotifyIcon = new System.Windows.Forms.NotifyIcon {
                Icon = System.Drawing.SystemIcons.Application
            };
            _NotifyIcon.Click  += _NotifyIcon_Click;
            FixSitButton.Click += (sender, e) =>
            {
                SetContent(fixSitContent);
            };

            WebcamButton.Click += (sender, e) => {
                SetContent(WebcamContent);
            };



            ExerciseButton.Click += (sender, e) =>
            {
                Random        rnd              = new Random();
                int           itemsNeeded      = 4;
                List <string> gifs             = new List <string>(itemsNeeded);
                List <int>    numbers          = new List <int>(itemsNeeded);
                List <int>    availableNumbers = new List <int>();
                for (int i = 0; i < 9; i++)
                {
                    availableNumbers.Add(i + 1);
                }
                for (int i = 0; i < itemsNeeded; i++)
                {
                    int index = rnd.Next(0, availableNumbers.Count);
                    numbers.Add(availableNumbers[index]);
                    availableNumbers.Remove(numbers[i]);
                }

                string[] splitDirData    = Environment.CurrentDirectory.Split(new[] { @"\" }, StringSplitOptions.None);
                string   pathToResources = string.Join("/", splitDirData.Take(splitDirData.Length - 2)) + "/Views/Resources/exercise";
                Console.WriteLine(pathToResources);
                string gif1 = pathToResources + numbers[0].ToString() + ".gif";
                string gif2 = pathToResources + numbers[1].ToString() + ".gif";
                string gif3 = pathToResources + numbers[2].ToString() + ".gif";
                string gif4 = pathToResources + numbers[3].ToString() + ".gif";
                gifs.Add(gif1);
                gifs.Add(gif2);
                gifs.Add(gif3);
                gifs.Add(gif4);
                ExerciseContent.ShowGifs(gifs);
                SetContent(ExerciseContent);
            };

            SettingsButton.Click += (sender, e) =>
            {
                SetContent(new SettingsContent(controller.SettingsModel));
            };

            QuitButton.Click += Quit_Click;

            controller.CreatePythonModel();
        }