////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor de la clase.\n
        ///             Constructor. </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 13/05/2020. </remarks>
        ///
        /// <param name="typeOfExamParam">  Tipo de examen.\n
        ///                                 Type of the exam parameter. </param>
        /// <param name="subjectParam">     Tema seleccionado.\n
        ///                                 The subject parameter. </param>
        /// <param name="dataPanelParam">   Panel donde el programa muestra los datos.\n
        ///                                 Panel where program show all data. </param>
        /// <param name="rightPanelParam">  Panel derecho.\n
        ///                                 Right panel. </param>
        /// <param name="beforeFormParam">  Panel anterior.\n
        ///                                 Before panel. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public SelectNormalModel(string typeOfExamParam, string subjectParam, Panel dataPanelParam, Panel rightPanelParam, Form beforeFormParam)
        {
            InitializeComponent();
            dataPanel  = dataPanelParam;
            rightPanel = rightPanelParam;
            subject    = subjectParam;
            typeOfExam = typeOfExamParam;
            beforeForm = beforeFormParam;
            ConnectionWithServer.setNewSelectNormalModel(this);
            showHideElements(false);

            if (typeOfExam == "normal")
            {
                string jsonMessageAddNewNormalModification = Utilities.generateSingleDataRequest("getAllNormalModels", subject);
                byte[] jSonObjectBytes = System.Text.Encoding.ASCII.GetBytes(Utilities.Encrypt(jsonMessageAddNewNormalModification, ConnectionWithServer.EncryptKey, ConnectionWithServer.IvString));
                ConnectionWithServer.ServerStream.Write(jSonObjectBytes, 0, jSonObjectBytes.Length);
                // Envio de datos mediante flush
                ConnectionWithServer.ServerStream.Flush();
            }
            else
            {
                string jsonMessageAddNewNormalModification = Utilities.generateSingleDataRequest("getAllTestModels", subject);
                byte[] jSonObjectBytes = System.Text.Encoding.ASCII.GetBytes(Utilities.Encrypt(jsonMessageAddNewNormalModification, ConnectionWithServer.EncryptKey, ConnectionWithServer.IvString));
                ConnectionWithServer.ServerStream.Write(jSonObjectBytes, 0, jSonObjectBytes.Length);
                // Envio de datos mediante flush
                ConnectionWithServer.ServerStream.Flush();
            }


            typeOfDataPanel.Focus();
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor de la clase.\n
        ///             Constructor. </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 12/05/2020. </remarks>
        ///
        /// <param name="typeOfExamParam">      Tipo de examen.\n
        ///                                     Type of exam. </param>
        /// <param name="subjectSelectedParam"> Tema seleccionado.\n
        ///                                     Selected theme. </param>
        /// <param name="allQuestionDataParam"> Listado de preguntas asociadas al modelo.\n
        ///                                     List of all questions of the model. </param>
        /// <param name="dataPanelParam">       Panel donde el programa muestra los datos.\n
        ///                                     Panel where program show all data. </param>
        /// <param name="rightPanelParam">      Panel de la izquierda.\n
        ///                                     Right panel. </param>
        /// <param name="beforeFormParam">      Panel anterior.\n
        ///                                     before panel. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public AllDataTestModel(string typeOfExamParam, string subjectSelectedParam, ArrayList allQuestionDataParam, Panel dataPanelParam, Panel rightPanelParam, Form beforeFormParam)
        {
            InitializeComponent();
            dataPanel         = dataPanelParam;
            rightPanel        = rightPanelParam;
            subject           = subjectSelectedParam;
            typeOfModel.Text += typeOfExamParam;
            beforeForm        = beforeFormParam;
            allQuestionData   = allQuestionDataParam;
            ConnectionWithServer.setAllDataTestModel(this);
            typeOfDataPanel.Focus();
        }
示例#3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor de la clase.\n
        ///             Constructor of the class.
        ///               </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 26/04/2020. </remarks>
        ///
        /// <param name="typeOfExamParam">  Tipo de examen.\n
        ///                                 Type of exam. </param>
        /// <param name="subjectSelectedParam"> Tema seleccionado.\n
        ///                                     Theme selected. </param>
        /// <param name="dataPanelParam">   Panel donde se muestran los datos.\n
        ///                                 Panel when program show all data. </param>
        /// <param name="rightPanelParam">  Panel de la derecha con las opciones de minimizar, cerrar...\n
        ///                                 Right panel with minize, close.... options</param>
        /// <param name="beforeFormParam">  Panel anterior, usado en caso de que el usuario haga click en el botón volver.\n
        ///                                 Before panel, this is used when user click on 'back' button. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public AddNewQuestion(string typeOfExamParam, string subjectSelectedParam, Panel dataPanelParam, Panel rightPanelParam, Form beforeFormParam)
        {
            InitializeComponent();
            dataPanel            = dataPanelParam;
            rightPanel           = rightPanelParam;
            subjectSelectedParam = subjectSelectedParam.Replace("Asignatura: ", "");
            subject = subjectSelectedParam;
            subjectSelected.Text            += subjectSelectedParam;
            labelRequestTypeOfQuestion.Text += typeOfExamParam;
            beforeForm = beforeFormParam;
            comboBoxOfThemes.Items.Add(bannerComboBox);
            comboBoxOfThemes.Visible = false;
            ConnectionWithServer.setNewQuestionFrom(this);
            typeOfDataPanel.Focus();
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor de la clase.\n
        ///             Constructor. </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 05/05/2020. </remarks>
        ///
        /// <param name="typeOfExamParam">      Tipo de examen.\n
        ///                                     Type of the exam parameter. </param>
        /// <param name="themeSelectedParam">   Tema seleccionado para hacer el examen.\n
        ///                                     The theme selected parameter. </param>
        /// <param name="dataPanelParam">       Panel donde el programa muestra los datos.\n
        ///                                     The data panel parameter that the program show all data. </param>
        /// <param name="rightPanelParam">      Panel derecho del programa.\n
        ///                                     The right panel parameter. </param>
        /// <param name="beforeFormParam">      Panel anterior.\n
        ///                                     The before form parameter. </param>
        /// <param name="saveAsModelParam">     True si se va a guardar el modelo de examen, false en caso contrario.\n
        ///                                     True if the program will save the model of the exam, false in the opposite case.</param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public CreateNormalExam(string typeOfExamParam, string themeSelectedParam, Panel dataPanelParam, Panel rightPanelParam, Form beforeFormParam, bool saveAsModelParam)
        {
            InitializeComponent();
            dataPanel     = dataPanelParam;
            rightPanel    = rightPanelParam;
            themeSelected = themeSelectedParam;
            typeOfExam    = typeOfExamParam;
            beforeForm    = beforeFormParam;
            ConnectionWithServer.setCreateNormalExam(this);
            showHideElements(false);
            showHideBackButton(false);
            showHideLabelWait(true);
            showHideErrorMessage(false);
            saveAsModel = saveAsModelParam;
            getAllNormalQuestionsSpecificTheme();
            typeOfDataPanel.Focus();
        }
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Evento de click sobre el botón enviar, cuando es pulsado se realiza una petición de actualización sobre la pregunta indicada.\n
        ///             Click event about send button, when this button is pressed, the program does a request to update the specific question with the data of the modification. </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 24/05/2020. </remarks>
        ///
        /// <param name="sender">   Código del evento.\n
        ///                         Source of the event. </param>
        /// <param name="e">        Información del evento.\n
        ///                         Event information. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        private void buttonSend_Click(object sender, EventArgs e)
        {
            bool userOption = Utilities.createWarningForm("Los cambios que va a realizar son irreversibles ");

            if (userOption)
            {
                // Envio de actualización de la pregunta y borrado de esta modificación
                string jsonMessageAddNewNormalModification = Utilities.generateSingleDataRequest("updateTestModification", id);
                byte[] jSonObjectBytes = System.Text.Encoding.ASCII.GetBytes(Utilities.Encrypt(jsonMessageAddNewNormalModification, ConnectionWithServer.EncryptKey, ConnectionWithServer.IvString));
                ConnectionWithServer.ServerStream.Write(jSonObjectBytes, 0, jSonObjectBytes.Length);
                // Envio de datos mediante flush
                ConnectionWithServer.ServerStream.Flush();
                Dispose();
                Utilities.createWarningForm("Espere, por favor", "Se está procesando su solicitud,\n espere...");
                ConnectionWithServer.closeAllPopUps();
                ConnectionWithServer.LoginForm.AskTypeDataChangesObject1.nextButton.PerformClick();
            }
        }
示例#6
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Constructor de la clase.\n
        ///             Constructor. </summary>
        ///
        /// <remarks>   Javier Fernández Fernández, 13/05/2020. </remarks>
        ///
        /// <param name="typeOfExamParam">  Tipo de examen.\n
        ///                                 Type of the exam. </param>
        /// <param name="subjectParam">     Tema seleccionado.\n
        ///                                 Theme selected. </param>
        /// <param name="dataPanelParam">   Panel dondel el programa muestra todos los datos.\n
        ///                                 Panel where program show all data. </param>
        /// <param name="rightPanelParam">  Panel de la derecha.\n
        ///                                 Right panel. </param>
        /// <param name="beforeFormParam">  formulario anterior.\n
        ///                                 The before form. </param>
        ////////////////////////////////////////////////////////////////////////////////////////////////////

        public SelectSubjectFormModels(string typeOfExamParam, string subjectParam, Panel dataPanelParam, Panel rightPanelParam, Form beforeFormParam)
        {
            InitializeComponent();
            dataPanel                    = dataPanelParam;
            rightPanel                   = rightPanelParam;
            subject                      = subjectParam;
            subjectSelected.Text        += subjectParam;
            labelRequestTypeOfExam.Text += typeOfExamParam;
            typeOfExam                   = typeOfExamParam;
            beforeForm                   = beforeFormParam;
            comboBoxOfThemes.Items.Add(bannerComboBox);
            ConnectionWithServer.setNewSelectSubjectFormModels(this);
            showHideElements(false);

            string jsonMessageAddNewNormalModification = Utilities.generateSingleDataRequest("getAllModelsThemesFromSignature", subject);

            byte[] jSonObjectBytes = System.Text.Encoding.ASCII.GetBytes(Utilities.Encrypt(jsonMessageAddNewNormalModification, ConnectionWithServer.EncryptKey, ConnectionWithServer.IvString));
            ConnectionWithServer.ServerStream.Write(jSonObjectBytes, 0, jSonObjectBytes.Length);
            // Envio de datos mediante flush
            ConnectionWithServer.ServerStream.Flush();

            typeOfDataPanel.Focus();
        }