コード例 #1
0
        // Method to create questionlist by serializing object and sending it to the API,
        // Icon gets sent to API by saving it to the a temporary cache folder in order to send it to the API
        public int create(Questionlist questionlist)
        {
            if(questionlist.icon != null)
            {
                string url = @"../../Cache/"+questionlist.icon;
                try
                {
                    if (questionlist.image != null)
                    {
                        questionlist.image.Save(url);
                    }
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }

                using (var client = new WebClient())
                {
                    client.UploadFile(bc.url+"/questionlist/uploadicon", "POST", url);
                }
            }

            var result = bc.jsonRequest("/questionlist/create", bc.serialize.Serialize(questionlist));
            if (result != null)
            {
                Questionlist list = bc.serialize.Deserialize<Questionlist>(result);
                return list.id;
            }
            else
            {
                return 0;
            }
        }
コード例 #2
0
        public JsonResult getQuestionListByYear(Questionlist Info)
        {
            User_Backend           bck_end = new User_Backend();
            List <AddTestQuestion> listobj = bck_end.GetfilteredQuestionsByYear(Info);

            return(Json(listobj, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public JsonResult GetfilteredQuestionByTopic(Questionlist Info)
        {
            User_Backend           bck_end = new User_Backend();
            List <AddTestQuestion> Obj     = bck_end.GetfilteredQuestionByTopic(Info);

            return(Json(Obj, JsonRequestBehavior.AllowGet));
        }
コード例 #4
0
 // Method that gets the questionlistlogs from API based on college-code, checks if the result is not null
 public List<Questionlist> getQuestionlistlogs(string college)
 {
     var json = "{\"passkey\":\"" + bc.passkey + "\",\"college\":\"" + college +"\"}";
     var result = bc.jsonRequest("/college/questionlistlog", json);
     if (result != null)
     {
         return bc.serialize.Deserialize<List<Questionlist>>(result);
     }
     else
     {
         Questionlist test = new Questionlist();
         return new List<Questionlist>();
     }
 }
コード例 #5
0
 // Method that gets the questionlists from API, checks if the result is not null
 public List<Questionlist> getQuestionlists()
 {
     var json = "{\"passkey\":\"" + bc.passkey + "\",\"user\":" + bc.user.id + "}";
     var result = bc.jsonRequest("/questionlist/college", json);
     if (result != null)
     {
         return bc.serialize.Deserialize<List<Questionlist>>(result);
     }
     else
     {
         Questionlist test = new Questionlist();
         return new List<Questionlist>();
     }
 }
コード例 #6
0
 // Method that gets the list of Questions from API based on questionlist, checks if the results are not null
 public List<Question> getQuestions(int questionlist)
 {
     var json = "{\"passkey\":\"" + bc.passkey + "\",\"id\":" + questionlist + "}";
     var result = bc.jsonRequest("/question/questionlist", json);
     if (result != null)
     {
         return bc.serialize.Deserialize<List<Question>>(result);
     }
     else
     {
         Questionlist empty = new Questionlist();
         return new List<Question>();
     }
 }
コード例 #7
0
        int timesOpenAnswer = 0; // Keeps track of wich open answer the student is

        #endregion Fields

        #region Constructors

        public ShowQuestionView(BaseController baseController, int id)
        {
            // Gets questionlist and questions
            bc = baseController;
            Questions = bc.sqc.getQuestions(id);
            Questionlists = bc.sqlc.get(id);
            idQuestionlist = id;

            // if not empty
            if (Questions.Count != 0)
            {
                // Initialize Panel
                CreateMainPanel();

                if (Questionlists.type == 0)
                {
                    // Niet synchroon

                    Next.Enabled = true;
                }
                else if (Questionlists.type == 1)
                {
                    // Synchroon

                    // Initialize loop
                    loopThread = new Thread(new ThreadStart(this.MainLoop));
                    loopThread.IsBackground = true;
                    loopThread.Start();
                    Next.Enabled = false;
                }
                else if (Questionlists.type == 2)
                {
                    // Timer
                }

                Handle_Question_Type();

            }
            else
            {
                MessageBox.Show("Hier staan geen vragen in!");
            }
        }
コード例 #8
0
        public ShowQuestionView(BaseController baseController, int id)
        {
            // Gets questionlist and questions
            bc = baseController;
            ListofQuestions = bc.qc.getQuestions(id);
            Questionlist = bc.qlc.get(id);

            CreateMainPanel();

            if (Questionlist.type == 0)
            {
             // Niet synchroon

             }
             else if (Questionlist.type == 1)
             {
                // Synchroon

                Next.Enabled = false;

                NextQuestion.Name = "NextQuestion";
                NextQuestion.Text = "Volgende vraag bij studenten";
                NextQuestion.Size = new Size(250, 50);
                NextQuestion.Font = new Font("Segoe Print", 10f);
                NextQuestion.ForeColor = Color.White;
                NextQuestion.FlatStyle = FlatStyle.Flat;
                NextQuestion.FlatAppearance.BorderColor = Color.White;
                NextQuestion.FlatAppearance.BorderSize = 2;
                NextQuestion.MouseClick += new MouseEventHandler(NextQuestion_Click);
                NextQuestion.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
                AnswerQuestionPanel.Controls.Add(NextQuestion);
            }
            else if (Questionlist.type == 2)
            {
                // Timer
            }

             Handle_Question_Type();
        }
コード例 #9
0
ファイル: JSONReader.cs プロジェクト: AkshaySharmaDEV/Tricola
 // Start is called before the first frame update
 void Start()
 {
     myQuestionlist = JsonUtility.FromJson <Questionlist>(QuizJSON.text);
 }
コード例 #10
0
        public async void GetQuestionList(int len, int amount, bool addon = false, string txt = null)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true; IsEmpty = false;
            try
            {
                string link = Keys.Url_Main + "item-question/get-question/" + Itemid;
                if (txt != null)
                {
                    link += "?Search=" + txt;
                }


                ObservableCollection <mQuestion> result = new ObservableCollection <mQuestion>();
                if (CrossConnectivity.Current.IsConnected)
                {
                    result = await QuestionService.Instance.FetchQuestions(link, len, amount);

                    if (result == null)
                    {
                        if (addon)
                        {
                            isDone = true;
                            return;
                        }
                        IsEmpty = true;
                        return;
                    }
                    OfflineService.Write <ObservableCollection <mQuestion> >(result, Strings.ItemQuestion_Offline_fileName, null);
                }
                else
                {
                    result = await OfflineService.Read <ObservableCollection <mQuestion> >(Strings.ItemQuestion_Offline_fileName, null);
                }


                if (result == null)
                {
                    if (addon)
                    {
                        isDone = true;
                        return;
                    }
                    IsEmpty = true;
                    return;
                }

                if (addon)
                {
                    Questionlist.AddRange(result);
                }
                else
                {
                    Questionlist = result;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(Keys.TAG + ex);
                DialogService.ShowError(Strings.SomethingWrong);
                Crashes.TrackError(ex);
                return;
            }
            finally { IsBusy = false; IsListRefereshing = false; }
        }
コード例 #11
0
        // AnswerQuestionView Constructor
        public AnswerQuestionView(BaseController baseController, string code)
        {
            bc = baseController;
            stats = bc.stc.getAnswersPerStudent(code);
            x = bc.sqlc.get(stats[0].questionlist);

            // Makes the main Panel
            mainPanel = new Panel();
            mainPanel.BackColor = Color.Transparent;
            mainPanel.Height = Screen.PrimaryScreen.Bounds.Height;
            mainPanel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            mainPanel.Location = new Point(225, 0);

            //header Label with all styling.
            header = new Label();
            header.Font = new Font("Segoe print", 26F);
            header.Location = new Point(100, 25);
            header.Name = "Statistics";
            header.Text = "Statistieken van: " + x.title;
            header.Size = new Size(1000, 60);
            mainPanel.Controls.Add(header);

            //generalDataHeader Label with all styling.
            generalDataHeader = new Label();
            generalDataHeader.Font = new Font("Segoe print", 26F);
            generalDataHeader.Location = new Point(1220, 25);
            generalDataHeader.Name = "generalData";
            generalDataHeader.Text = "Algeme statistieken";
            generalDataHeader.Size = new Size(1000, 60);
            mainPanel.Controls.Add(generalDataHeader);

            //generalDataText Label with all styling.
            generalDataText = new Label();
            generalDataText.Font = new Font("Segoe print", 13F);
            generalDataText.Location = new Point(1205, 85);
            generalDataText.Name = "generalData";
            generalDataText.Text = "";
            generalDataText.Size = new Size(375, 62);

            //Back button.
            Stop = new Button();
            Stop.Name = "Stop";
            Stop.Text = char.ConvertFromUtf32(8592) + "Terug naar overzicht";
            Stop.Size = new Size(300, 50);
            Stop.Location = new Point(1920 - 545, Screen.PrimaryScreen.Bounds.Height - 130);
            Stop.Font = new Font("Segoe Print", 17f);
            Stop.ForeColor = Color.White;
            Stop.FlatStyle = FlatStyle.Flat;
            Stop.FlatAppearance.BorderColor = Color.White;
            Stop.FlatAppearance.BorderSize = 2;
            Stop.MouseClick += new MouseEventHandler(Stop_Click);
            Stop.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            mainPanel.Controls.Add(Stop);

            // Makes new Labels and the Table Panel
            Table = new TableLayoutPanel();
            CorrectOrIncorrect = new Label();
            Question = new Label();
            StudentAnswer = new Label();
            CorrectAnswer = new Label();

            // Table Layout
            Table.BackgroundImageLayout = ImageLayout.None;
            Table.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            Table.ColumnCount = 4;
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 375F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 250F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 250F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120F));
            Table.Controls.Add(Question, 0, 0);
            Table.Controls.Add(CorrectAnswer, 1, 0);
            Table.Controls.Add(CorrectOrIncorrect, 3, 0);
            Table.Controls.Add(StudentAnswer, 2, 0);
            Table.Location = new Point(100, 100);
            Table.Name = "Table";
            Table.RowCount = 4;
            Table.RowStyles.Add(new RowStyle(SizeType.Absolute, 27F));
            Table.Size = new Size(1000, y);
            Table.TabIndex = 1;

            // Properties for Question
            Question.Font = new Font("Segoe print", 12F);
            Question.ForeColor = Color.White;
            Question.Name = "Question";
            Question.AutoSize = false;
            Question.Size = new Size(375, 27);
            Question.TabIndex = 0;
            Question.Text = "Vraag";

            // Properties for CorrectAnswer
            CorrectAnswer.Font = new Font("Segoe print", 12F);
            CorrectAnswer.ForeColor = Color.White;
            CorrectAnswer.Name = "OpenQuestionList";
            CorrectAnswer.Size = new Size(250, 27);
            CorrectAnswer.TabIndex = 1;
            CorrectAnswer.Text = "Juiste antwoord";

            // Properties for StudentAnswer
            StudentAnswer.Font = new Font("Segoe print", 12F);
            StudentAnswer.ForeColor = Color.White;
            StudentAnswer.Name = "StudentAnswer";
            StudentAnswer.Size = new Size(250, 27);
            StudentAnswer.TabIndex = 2;
            StudentAnswer.Text = "Jouw antwoord";

            // Properties for CorrectOrIncorrect
            CorrectOrIncorrect.Font = new Font("Segoe print", 12F);
            CorrectOrIncorrect.ForeColor = Color.White;
            CorrectOrIncorrect.Name = "CorrectOrIncorrect";
            CorrectOrIncorrect.Size = new Size(125, 27);
            CorrectOrIncorrect.TabIndex = 3;
            CorrectOrIncorrect.Text = "Goed/Fout";

            Table.ResumeLayout(true);
            Table.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            mainPanel.Controls.Add(Table);

            FillTable();
        }
コード例 #12
0
        public QuestionlistsStatisticsView(BaseController baseController, int id)
        {
            bc = baseController;
            q = bc.stc.getQuestionlists(1);
            x = bc.sqlc.get(id);
            QuestionlistsStatisticsView_Panel = new Panel();
            QuestionlistsStatisticsView_Panel.BackColor = Color.Transparent;
            QuestionlistsStatisticsView_Panel.Height = Screen.PrimaryScreen.Bounds.Height;
            QuestionlistsStatisticsView_Panel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            QuestionlistsStatisticsView_Panel.Location = new Point(225, 0);

            // Makes new Labels and the Table Panel
            Table = new TableLayoutPanel();
            Question = new Label();
            QuestionExpanded = new Label();
            CorrectAnswer = new Label();
            MultiPerChoice = new Label();
            Score = new Label();
            Type = new Label();

            //Header Label with all styling.
            Header = new Label();
            Header.Font = new Font("Segoe print", 20F);
            Header.Location = new Point(100, 25);
            Header.Name = "Statistics";
            Header.Text = "Statistieken van: " + x.title;
            Header.Size = new Size(1000, 60);
            QuestionlistsStatisticsView_Panel.Controls.Add(Header);

            //Back to overview button.
            Stop = new Button();
            Stop.Name = "Stop";
            Stop.Text = char.ConvertFromUtf32(8592) + "Terug naar overzicht";
            Stop.Size = new Size(300, 50);
            Stop.Location = new Point(Screen.PrimaryScreen.Bounds.Width - 535,Screen.PrimaryScreen.Bounds.Height - 125);
            Stop.Font = new Font("Segoe Print", 17f);
            Stop.ForeColor = Color.White;
            Stop.FlatStyle = FlatStyle.Flat;
            Stop.FlatAppearance.BorderColor = Color.White;
            Stop.FlatAppearance.BorderSize = 2;
            Stop.MouseClick += new MouseEventHandler(Stop_Click);
            Stop.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            QuestionlistsStatisticsView_Panel.Controls.Add(Stop);

            //More details button.
            MoreDetails = new Button();
            MoreDetails.Name = "More Details";
            MoreDetails.Text = "Meer Details";
            MoreDetails.Size = new Size(300, 50);
            MoreDetails.Location = new Point(650, Screen.PrimaryScreen.Bounds.Height - 125);
            MoreDetails.Font = new Font("Segoe Print", 17f);
            MoreDetails.ForeColor = Color.White;
            MoreDetails.FlatStyle = FlatStyle.Flat;
            MoreDetails.FlatAppearance.BorderColor = Color.White;
            MoreDetails.FlatAppearance.BorderSize = 2;
            MoreDetails.MouseClick += new MouseEventHandler(MoreDetails_Click);
            MoreDetails.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            QuestionlistsStatisticsView_Panel.Controls.Add(MoreDetails);

            // Table Layout
            Table.BackgroundImageLayout = ImageLayout.None;
            Table.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            Table.ColumnCount = 5;
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 400F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 350F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110F));
            Table.Controls.Add(Question, 0, 0);
            Table.Controls.Add(QuestionExpanded, 1, 0);
            Table.Controls.Add(CorrectAnswer, 2, 0);
            Table.Controls.Add(MultiPerChoice, 3, 0);
            Table.Controls.Add(Score, 4, 0);
            Table.Location = new Point(100, 100);
            Table.Name = "Table";
            Table.RowCount = 5;
            Table.RowStyles.Add(new RowStyle(SizeType.Absolute, 27F));
            Table.Size = new Size(1000, y);
            Table.TabIndex = 1;

            // Properties for Question
            Question.Font = new Font("Segoe print", 12F);
            Question.ForeColor = Color.White;
            Question.Name = "Question";
            Question.AutoSize = false;
            Question.Size = new Size(50, 27);
            Question.TabIndex = 0;
            Question.Text = "Nr";

            // Properties for vraag
            QuestionExpanded.Font = new Font("Segoe print", 12F);
            QuestionExpanded.ForeColor = Color.White;
            QuestionExpanded.Name = "OpenQuestionList";
            QuestionExpanded.Size = new Size(400, 27);
            QuestionExpanded.TabIndex = 1;
            QuestionExpanded.Text = "Vraag";

            // Properties for correct antwoord
            CorrectAnswer.Font = new Font("Segoe print", 12F);
            CorrectAnswer.ForeColor = Color.White;
            CorrectAnswer.Name = "StudentAnswer";
            CorrectAnswer.Size = new Size(350, 27);
            CorrectAnswer.TabIndex = 3;
            CorrectAnswer.Text = "Correct Antwoord";

            // Properties for Multiperchoice
            MultiPerChoice.Font = new Font("Segoe print", 12F);
            MultiPerChoice.ForeColor = Color.White;
            MultiPerChoice.Name = "MultiPerChoice";
            MultiPerChoice.Size = new Size(100, 27);
            MultiPerChoice.TabIndex = 4;
            MultiPerChoice.Text = "A   B   C   D";

            // Properties for Multiperchoice
            Score.Font = new Font("Segoe print", 12F);
            Score.ForeColor = Color.White;
            Score.Name = "Score";
            Score.Size = new Size(110, 27);
            Score.TabIndex = 5;
            Score.Text = "Goed/Fout";

            Table.ResumeLayout(true);
            Table.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            QuestionlistsStatisticsView_Panel.Controls.Add(Table);

            FillTable();
        }
コード例 #13
0
        public EditQuestionlistView(BaseController baseControlle, int index)
        {
            this.index = index;
            index2 = index;

            bc = baseControlle;
            EditQuestionlistView_Panel = new Panel();
            EditQuestionlistView_Panel.BackColor = Color.Transparent;
            EditQuestionlistView_Panel.Height = Screen.PrimaryScreen.Bounds.Height;
            EditQuestionlistView_Panel.Width = Screen.PrimaryScreen.Bounds.Width - 225;
            EditQuestionlistView_Panel.Location = new Point(225, 0);

            Section = new Label();
            Question = new Label();
            Type = new ComboBox();
            Edit = new Label();
            Delete = new Label();
            Table = new TableLayoutPanel();

            questionlist = new Questionlist();

            int Height = (Question.Text.Length + 100);

            // Properties for table
            Table.BackgroundImageLayout = ImageLayout.None;
            Table.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
            Table.ColumnCount = 3;
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 800F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100F));
            Table.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100F));
            Table.Controls.Add(Question, 0, 0);
            Table.Controls.Add(Edit, 1, 0);
            Table.Controls.Add(Delete, 2, 0);
            Table.Location = new Point(100, 250);
            Table.Name = "Table";
            Table.RowCount = 2;
            Table.RowStyles.Add(new RowStyle(SizeType.Absolute, 27F));
            Table.Size = new Size(1000, y);
            Table.TabIndex = 1;

            // Properties for Section
            Section.Font = new Font("Segoe print", 26F);
            Section.Name = "Section";
            Section.Size = new Size(810, 60);
            Section.Location = new Point(90, 20);
            Section.Text = bc.qlc.get(index).title;
            Section.MouseClick += new MouseEventHandler(EditNameByLabel);

            //Select_College.SelectedValue = bc.qlc.get(index).college;
            // Type Questionlist
            Label TypeLabel = new Label();
            TypeLabel.Name = "Type";
            TypeLabel.Text = "Type";
            TypeLabel.Location = new Point(100, 140);
            TypeLabel.Size = new Size(100, 50);
            TypeLabel.Font = new Font("Segoe Print", 13f);

            // Type Select
            Type = new ComboBox();
            Type.Name = "Selecteer_Status";
            Type.Items.Add("Synchroon");
            Type.Items.Add("Niet Synchroon");
            Type.Items.Add("Timer");
            Type.SelectedIndex = bc.cc.get(bc.qlc.get(index).type).id;
            Type.SelectedIndexChanged += new EventHandler(Add_Timer);
            Type.DropDownStyle = ComboBoxStyle.DropDownList;
            Type.Location = new Point(200, 150);
            Type.Size = new Size(150, 100);

            // Label timer
            Timer = new Label();
            Timer.Name = "Timer";
            Timer.Text = "Timer";
            Timer.Location = new Point(100, 190);
            Timer.Size = new Size(100, 50);
            Timer.Font = new Font("Segoe Print", 13f);
            Timer.Visible = false;

            //dropdown timer
            Timer_Input = new NumericUpDown();
            Timer_Input.Name = "College";
            Timer_Input.Text = "0";
            Timer_Input.Location = new Point(200, 200);
            Timer_Input.Size = new Size(150, 10);
            Timer_Input.BorderStyle = BorderStyle.Fixed3D;
            Timer_Input.Visible = false;

            // TextBox for changing name
            TextBox1 = new TextBox();
            TextBox1.Font = new Font("Segoe print", 26F);
            TextBox1.Name = "TextBox";
            TextBox1.Size = new Size(600, 100);
            TextBox1.Location = new Point(100, 20);
            TextBox1.Text = bc.qlc.get(index).title;
            TextBox1.Visible = false;

            // Button for "EditName"
            EditName = new Button();
            EditName.Font = new Font("Segoe print", 10F);
            EditName.Name = "Bewerk Naam Vragenlijst";
            EditName.Text = "Bewerk vragenlijst naam";
            EditName.Size = new Size(200, 50);
            EditName.Margin = new Padding(0);
            EditName.Location = new Point(900, 30);
            EditName.ForeColor = Color.White;
            EditName.FlatStyle = FlatStyle.Flat;
            EditName.FlatAppearance.BorderColor = Color.White;
            EditName.FlatAppearance.BorderSize = 2;
            EditName.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;

            // Properties for save button
            Save = new Button();
            Save.Font = new Font("Segoe print", 10F);
            Save.Name = "Save";
            Save.Text = "Opslaan";
            Save.Size = new Size(100, 50);
            Save.Margin = new Padding(0);
            Save.Location = new Point(785, 30);
            Save.ForeColor = Color.White;
            Save.FlatStyle = FlatStyle.Flat;
            Save.FlatAppearance.BorderColor = Color.White;
            Save.FlatAppearance.BorderSize = 2;
            Save.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            Save.Visible = false;

            // Properties for Question
            Question.Font = new Font("Segoe print", 12F);
            Question.Name = "Question";
            Question.Size = new Size(164, 30);
            Question.ForeColor = Color.White;
            Question.TabIndex = 0;
            Question.Text = "Vraag";

            // Properties for Edit
            Edit.Font = new Font("Segoe print", 12F);
            Edit.Name = "Edit";
            Edit.Size = new Size(126, 30);
            Edit.ForeColor = Color.White;
            Edit.TabIndex = 1;
            Edit.Text = "Bewerk";

            // Properties for Delete
            Delete.Font = new Font("Segoe print", 12F);
            Delete.Name = "Delete";
            Delete.Size = new Size(130, 30);
            Delete.ForeColor = Color.White;
            Delete.TabIndex = 2;
            Delete.Text = "Verwijder";

            // Properties for Stop button
            Stop.Name = "Stop";
            Stop.Text = char.ConvertFromUtf32(8592);
            Stop.Location = new Point(15, 20);
            Stop.Size = new Size(75, 50);
            Stop.Font = new Font("Segoe Print", 17f);
            Stop.ForeColor = Color.White;
            Stop.FlatStyle = FlatStyle.Flat;
            Stop.FlatAppearance.BorderColor = Color.White;
            Stop.FlatAppearance.BorderSize = 2;
            Stop.MouseClick += new MouseEventHandler(Stop_Click);
            Stop.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;

            //add everything to panel
            Table.BackgroundImage = Properties.Resources.grey_wash_wall_tablebanner;
            Table.ResumeLayout(true);
            EditQuestionlistView_Panel.Controls.Add(Table);
            EditQuestionlistView_Panel.Controls.Add(Section);
            EditQuestionlistView_Panel.Controls.Add(TextBox1);
            EditQuestionlistView_Panel.Controls.Add(Save);
            EditQuestionlistView_Panel.Controls.Add(TypeLabel);
            EditQuestionlistView_Panel.Controls.Add(Type);
            EditQuestionlistView_Panel.Controls.Add(Timer);
            EditQuestionlistView_Panel.Controls.Add(Timer_Input);
            EditQuestionlistView_Panel.Controls.Add(EditName);
            EditQuestionlistView_Panel.Controls.Add(Stop);

            EditQuestionlistView_Panel.AutoScroll = true;
            EditQuestionlistView_Panel.AutoScrollMargin = new Size(0, 65);
        }
コード例 #14
0
        //check which button is clicked
        private void Global_Button_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < ListOfQuestions.Count; i++)
            {
                int indexx = ListOfQuestions.IndexOf(ListOfQuestions[i]);
                if (((Button)sender).Name == "Bewerk" + ListOfQuestions[i].id)
                {
                    int index = ListOfQuestions[i].id;
                    EditQuestionView view = new EditQuestionView(bc, index);
                    bc.qc.editQuestionPanel(index);
                    break;
                }
                else if (((Button)sender).Name == "Verwijder" + ListOfQuestions[i].id)
                {
                    // Are you sure? Dialog
                    DialogResult dialogResult = MessageBox.Show("Weet u zeker dat u " + ListOfQuestions[i].title + " wilt verwijderen?", "", MessageBoxButtons.YesNo);

                    if (dialogResult == DialogResult.Yes)
                    {
                        // Delete the questionlist
                        bc.qc.delete(ListOfQuestions[i]);
                        // Repaint panel
                        bc.qc.editListPanel(index2);
                    }
                    break;
                }
            }
            if (((Button)sender).Name == "Bewerk Naam Vragenlijst")
            {
                Section.Visible = false;
                EditName.Enabled = false;
                TextBox1.Visible = true;
                Save.Visible = true;
            } else if (((Button)sender).Name == "Save")
            {
                Section.Text = TextBox1.Text;
                TextBox1.Visible = false;
                Section.Visible = true;
                Save.Visible = false;
                EditName.Enabled = true;

                questionlist = bc.qlc.get(index2);
                questionlist.title = Section.Text;
                bc.qlc.update(questionlist);
            }
        }
コード例 #15
0
        //save everything function
        public void SaveAll_Click(object sender, EventArgs e)
        {
            questionlist = bc.qlc.get(index2);
            if (Type.SelectedIndex == 0)
            {
                questionlist.type = 0;
            }
            else if (Type.SelectedIndex == 1)
            {
                questionlist.type = 1;
            }
            else if (Type.SelectedIndex == 2)
            {
                questionlist.type = 2;
            }
            questionlist.timer = Int32.Parse(Timer_Input.Text);
            bc.qlc.update(questionlist);

            MessageBox.Show("Uw wijzigingen zijn opgeslagen");
        }
コード例 #16
0
 private void MainLoop()
 {
     // This function checks if the teacher went to the next question.
     // If so, the Next button is enabled so that the student can go to the next question
     // Same goes for the back button but then reverted
     int counter = 1;
     while (true)
     {
         Questionlists = bc.sqlc.get(idQuestionlist);
         currentQuestion = Questionlists.counter;
         if (currentQuestion > counter)
         {
             Next.BeginInvoke(new MethodInvoker(() => Next.Enabled = true));
             counter = currentQuestion;
         }
         else if (currentQuestion < counter)
         {
             Back.BeginInvoke(new MethodInvoker(() => Back.Enabled = true));
         }
         Thread.Sleep(2000);
     }
 }
コード例 #17
0
ファイル: JSONReader.cs プロジェクト: AkshaySharmaDEV/Tricola
 // Update is called once per frame
 void Update()
 {
     myQuestionlist = JsonUtility.FromJson <Questionlist>(QuizJSON.text);
 }
コード例 #18
0
 // Method to update questionlist by serializing object and sending it to the API
 public void updateStatus(Questionlist questionlist)
 {
     var result = bc.jsonRequest("/questionlist/updatestatus", bc.serialize.Serialize(questionlist));
 }
コード例 #19
0
 // Method to delete questionlist by serializing object and sending it to the API
 public void delete(Questionlist questionlist)
 {
     var result = bc.jsonRequest("/questionlist/delete", bc.serialize.Serialize(questionlist));
 }