public StudentFormController(Student.QuestionForm mainform)
        {
            this.mainForm = mainform;
            view = mainForm.getView();

            //Connect (this) client to the session
            client = SignalRClient.GetInstance();
            client.ConnectionStatusChanged += Client_connectionStatusChanged;
            client.Connect();

            //Adds an event to the QuestionAdded function which is called when a new question is added by the teacher.
            QuestionFactory questionFactory = new QuestionFactory();
            questionFactory.QuestionAdded += Factory_questionAdded;

            //Adds an event to the QuestionListContinue function which is called when the teacher presses "Next" button for the next question.
            QuestionListFactory listFactory = new QuestionListFactory();
            listFactory.QuestionListContinue += LIFactory_continue;
            listFactory.QuestionListStarted += LIFactory_startList;
            listFactory.QuestionListStopped += LIFactory_stopped;

            //Adds an event to the PredefinedAnswerAdded function which is called for each PredefinedAnswer in the next question.
            PredefinedAnswerFactory PAFactory = new PredefinedAnswerFactory();
            PAFactory.PredefinedAnswerAdded += PAFactory_predefinedAnswerAdded;

            //Adds event, when an openquestion is added
            OpenQuestionFactory OpenQuestionFactory = new OpenQuestionFactory();
            OpenQuestionFactory.OpenQuestionAdded += openQuestionAdded;
        }
Пример #2
0
        //Initializing controller & view
        public QuestionForm(int List_Id)
        {
            InitializeComponent();
            this.List_Id = List_Id;
            this.view = new StudentForm(this);
            this.controller = new StudentFormController(this);

            this.sendOpenQuestionBtn.Click += new System.EventHandler(controller.AnswerOpenQuestionSaveHandler);

            this.view.setController();
            view.initControlLocations();
            view.initWaitScreen();
            questionTimer.Interval = 100;
            questionTimer.Tick += Question_Timer;
        }