Beispiel #1
0
 public QuizDetails(TestFormv2 form, QuizMasterServiceClient quizClient)
 {
     this.form       = form;
     this.quizClient = quizClient;
     //this.user = user;
     InitializeComponent();
 }
 /// <summary>
 /// Creates a proxy class with question from service with a list of answers
 /// </summary>
 /// <param name="quizClient"></param>
 /// <param name="form"></param>
 public CreateQuestion(QuizMasterServiceClient quizClient, TestFormv2 form)
 {
     InitializeComponent();
     this.question       = quizClient.CreateQuestion();
     this.answersControl = new List <CreateAnswer>();
     this.quizClient     = quizClient;
     this.form           = form;
 }
Beispiel #3
0
 public QuizLobby(QuizMasterServiceClient quizClient, TestFormv2 form) : this()
 {
     this.quizClient         = quizClient;
     this.quiz               = form.ActiveQuiz;
     this.form               = form;
     txtQuizInfo.Text        = quiz.Title;
     form.ActiveQuizInstance = quizClient.OpenQuiz(quiz, form.ActiveUser);
 }
Beispiel #4
0
 /// <summary>
 /// UI constructor
 ///
 /// </summary>
 /// <param name="form"></param>
 /// <param name="quizClient"></param>
 public Login(TestFormv2 form, QuizMasterServiceClient quizClient)
 {
     InitializeComponent();
     this.form       = form;
     this.quizClient = quizClient;
     //"Easy-login" functionality
     UsernameTextBox.Text = "Knud";
     PasswordTextBox.Text = "1234";
 }
Beispiel #5
0
 public QuestionListView(TestFormv2 form, QuizMasterServiceClient quizClient)
 {
     InitializeComponent();
     this.quizClient = quizClient;
     this.form       = form;
     questions       = quizClient.GetQuestions().ToList();
     data            = new BindingList <Question>();
     FillDataList();
     listBoxQuestion.DisplayMember = "Header";
     listBoxQuestion.DataSource    = data;
 }
Beispiel #6
0
 public QuizListView(TestFormv2 form, QuizMasterServiceClient quizClient)
 {
     InitializeComponent();
     this.quizClient = quizClient;
     this.form       = form;
     quizzes         = quizClient.GetQuizes();
     data            = new BindingList <Quiz>();
     FillDataList();
     listBoxQuiz.DisplayMember = "Title";
     listBoxQuiz.DataSource    = data;
 }
        /// <summary>
        /// Constructor for this view.
        /// It gets the questions for the quiz and all questions
        /// then makes a list of all questions not on the list to display
        /// beside the list of questions that is on the list.
        /// </summary>
        /// <param name="form"></param>
        /// <param name="quizClient"></param>
        public QuizQuestionView(TestFormv2 form, QuizMasterServiceClient quizClient)
        {
            InitializeComponent();
            this.form         = form;
            this.quizClient   = quizClient;
            allQuestions      = quizClient.GetQuestions();
            quizQuestions     = quizClient.GetAllByQuizId(form.ActiveQuiz.Id);
            includedQuestions = new BindingList <Question>(quizQuestions);

            // Get all questions not on the quiz
            var result = allQuestions.Where(aq => !quizQuestions.Any(qq => aq.Id == qq.Id)).ToList();

            excludedQuestions = new BindingList <Question>(result);
            listBoxQuestionsOnQuiz.DisplayMember    = "Header";
            listBoxQuestionsNotOnQuiz.DisplayMember = "Header";
            listBoxQuestionsOnQuiz.DataSource       = includedQuestions;
            listBoxQuestionsNotOnQuiz.DataSource    = excludedQuestions;
        }
Beispiel #8
0
 /// <summary>
 /// Initialize UI-element
 /// </summary>
 /// <param name="quizClient">The service-reference</param>
 public CreateUser(QuizMasterServiceClient quizClient, TestFormv2 form)
 {
     InitializeComponent();
     this.quizClient = quizClient;
     this.form       = form;
 }
Beispiel #9
0
 public QuizRunning(TestFormv2 form, QuizMasterServiceClient quizClient) : this()
 {
     this.quizClient = quizClient;
     this.form       = form;
     lblQuiz.Text    = "Quizzen " + form.ActiveQuiz.Title + " kører nu";
 }