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; }
//This function will start a questionlist once the teacher starts a selected questionlist private void LIFactory_startList(int list,bool tempo) { mainForm.setTempo(tempo); QuestionListFactory listFactory = new QuestionListFactory(); listFactory.FindById(list,mainForm.getView().GetHandler(),listStartedCallbackHandler); SignalRClient.GetInstance().SubscribeList(list); if (mainForm.getController().getCurrentQuestionIndex() > -1) { mainForm.getController().setCurrentQuestionIndex(-1); mainForm.getQuestionList().OpenQuestions.Clear(); mainForm.getQuestionList().MCQuestions.Clear(); } }
public void setupQuestionManager(int activitySection, Language codeLanguage) { Question.setGameObjects(codeBox, questionTextBox, statusText, checkButton, yesButton, noButton, continueButton, dropRegion, correctSound, incorrectSound); QuestionFactory.setCodeLanguage(codeLanguage); questionList = QuestionListFactory.generateQuestionList(activitySection); }