Exemple #1
0
        public Exercises(LayerStack layerStack, int width, int height)
        {
            // Create child DataContext by passing initilized model
            LayerStack = layerStack;

            Width = width;
            Height = height;
        }
Exemple #2
0
        public MainPage()
        {
            InitializeComponent();
            layerStack = LayerStack.DataContext as LayerStack;
            lessonPage = LessonPage.DataContext as Lesson;
            appBar = AppBar.DataContext as AppBarState;

            lessonPage.SetComponents(LessonPage, LessonSidebar.ThumbsContainer);
            layerStack.Viewport.SetComponents(LessonContainer, LessonContent, DrawingAreaBound, RadialMenu);
        }
Exemple #3
0
        public FreeNotesPage()
        {
            InitializeComponent();
            LessonPage = (Catalog.Instance.GetPage("MainPage") as MainPage).LessonPage.DataContext as Lesson;

            LayerStackDC = new LayerStack(Data.Instance.Lesson.GlobalNotes, Data.Instance.Lesson);
            LayerStackDC.Init(LessonPage);
            LayerStackDC.Viewport.SetComponents(LessonContainer, LessonContent, DrawingAreaBound, RadialMenu);

            appBar = AppBar.DataContext as AppBarState;

            DataContext = this;
        }
Exemple #4
0
        public Lesson()
        {
            // Create child DataContext by passing initilized model
            LayerStack = new LayerStack(Data.Instance.Lesson.Slides, Data.Instance.Lesson);
            LayerStack.Init(this);

            // Render the Bitmap for current page and thumbs
            Render();

            // As teacher, when i'm joining a lesson, I'm sharing my current position
            if (Data.Instance.Role == Role.TEACHER)
                SendTeacherPosition();
            else // As student, i'm asking what is the position of the teacher on his slide
                LinkIOImp.Instance.send("slide-index", new AskingSlide(0), new List<User>() { User.getTestUsers()[0]});
        }
Exemple #5
0
        public Layer(LayerStack layerStack, Lessons.Lesson lessonModel, AbstractLayer layerModel)
        {
            this.layerStack  = layerStack;
            this.lessonModel = lessonModel;
            this.layerModel  = layerModel;
            Strokes          = StrokeConverter.ToWindowsStrokes(layerModel.Strokes);

            if (layerModel.GetType() == typeof(QuizAnswerLayer))
            {
                DisplayChart();
            }
            else if (layerModel.GetType() == typeof(GraphicalAnswerLayer))
            {
                DisplaySaliencyMap();
            }
        }
Exemple #6
0
        public Layer(LayerStack layerStack, Lessons.Lesson lessonModel, AbstractLayer layerModel)
        {
            this.layerStack = layerStack;
            this.lessonModel = lessonModel;
            this.layerModel = layerModel;
            Strokes = StrokeConverter.ToWindowsStrokes(layerModel.Strokes);

            if (layerModel.GetType() == typeof (QuizAnswerLayer))
            {
                DisplayChart();
            }
            else if (layerModel.GetType() == typeof (GraphicalAnswerLayer))
            {
                DisplaySaliencyMap();
            }
        }
Exemple #7
0
        public QuestionsPage()
        {
            InitializeComponent();
            var LessonModel = Data.Instance.Lesson;

            LayerStackDC = new LayerStack(
                LessonModel.Exercises,
                LessonModel);
            LessonPage = new Exercises(LayerStackDC, (int) DrawingAreaBound.Width, (int) DrawingAreaBound.Height);
            LessonPage.SetComponents(null, LessonSidebar.ThumbsContainer);
            LayerStackDC.Init(LessonPage);

            LayerStackDC.Viewport.SetComponents(LessonContainer, LessonContent, DrawingAreaBound, RadialMenu);

            appBar = AppBar.DataContext as AppBarState;

            DataContext = this;
        }
Exemple #8
0
        internal override void ChangeCurrentPage(int newPageIndex = -1)
        {
            if (newPageIndex == -1)
            {
                newPageIndex = LayerStack.holderModel.Contents.Count - 1;
            }

            if (CurrentPageIndex == newPageIndex || newPageIndex < 0 || newPageIndex >= PageCount)
            {
                return;
            }

            if (Data.Instance.Lesson.Exercises.Contents[newPageIndex].Layers.Count > 1 &&
                Data.Instance.Lesson.Exercises.Contents[newPageIndex].GetType() == typeof(ExerciseContent) &&
                Data.Instance.Lesson.Exercises.Contents[newPageIndex].GetType() != typeof(QuizContent) &&
                !Data.Instance.User.IsTeacher)
            {
                LayerStack.CurrentLayerIndex = 1;
            }
            else
            {
                LayerStack.CurrentLayerIndex = 0;
            }

            CurrentPageIndex = newPageIndex;
            LayerStack.SetLayers();

            // Scrolls to current thumb inside the SideBar
            var currentThumb =
                thumbsContainerComponent.ItemContainerGenerator.ContainerFromIndex(CurrentPageIndex) as ContentPresenter;

            if (currentThumb == null)
            {
                return;
            }

            currentThumb.BringIntoView();

            RaisePropertyChanged("CanCollect");
            RaisePropertyChanged("CanAnswer");
            RaisePropertyChanged("CanBeStart");
        }
Exemple #9
0
        public Lesson()
        {
            // Create child DataContext by passing initilized model
            LayerStack = new LayerStack(Data.Instance.Lesson.Slides, Data.Instance.Lesson);
            LayerStack.Init(this);

            // Render the Bitmap for current page and thumbs
            Render();

            // As teacher, when i'm joining a lesson, I'm sharing my current position
            if (Data.Instance.Role == Role.TEACHER)
            {
                SendTeacherPosition();
            }
            else // As student, i'm asking what is the position of the teacher on his slide
            {
                LinkIOImp.Instance.send("slide-index", new AskingSlide(0), new List <User>()
                {
                    User.getTestUsers()[0]
                });
            }
        }
Exemple #10
0
 public LayerStackViewport(LayerStack layerStack)
 {
     this.layerStack = layerStack;
 }
 public LayerStackViewport(LayerStack layerStack)
 {
     this.layerStack = layerStack;
 }