Ejemplo n.º 1
0
        protected void btnValidate_Click(object sender, EventArgs e)
        {
            BEStudent objbestudent = new BEStudent()
            {
                strPassword = txtCode.Text.Trim(), IntTransID = Convert.ToInt64(ViewState["TransID"])
            };
            BStudent objbstudent = new BStudent();

            objbstudent.BValidateAuthenticationCode(objbestudent);
            if (objbestudent.IntResult == 1)
            {
                tbl1.Visible   = false;
                tbl2.Visible   = false;
                tbl3.Visible   = true;
                lblresult.Text = "Code successfully verified.";

                BEStudent objBEStudent = new BEStudent();
                BStudent  objBStudent  = new BStudent();
                objBEStudent.IntTransID = Convert.ToInt64(ViewState["TransID"]);
                objBEStudent.IntType    = 16;
                objBStudent.BUpdatePLTime(objBEStudent);
                Response.Redirect("Agreements.aspx?TransID=" + AppSecurity.Encrypt(ViewState["TransID"].ToString()), false);
            }
            else
            {
                tbl1.Visible   = false;
                tbl2.Visible   = true;
                tbl3.Visible   = true;
                lblresult.Text = "Invalid code, please try again.";
                txtCode.Text   = "";
            }
        }
Ejemplo n.º 2
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            BStudent  objBStudent  = new BStudent();
            BEStudent objBEStudent = new BEStudent();

            objBEStudent.IntUserID    = Convert.ToInt32(Session[BaseClass.EnumPageSessions.USERID].ToString());
            objBEStudent.strAnswer1   = txtAnswer1.Text;
            objBEStudent.strQuestion1 = hfQid.Value;

            if (Request.QueryString["TransID"] != null)
            {
                objBEStudent.IntTransID = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
            }
            else
            {
                Response.Redirect("StartAnExam.aspx");
            }
            // objBEStudent.IntTransID = Convert.ToInt32(HfTransID.Value);

            objBStudent.BAARandomSecurityQuestionsValidation(objBEStudent);

            if (objBEStudent.IntResult == 1)
            {
                objBEStudent.IntType = 8;
                objBStudent.BUpdatePLTime(objBEStudent);

                Response.Redirect("examiKEY.aspx?TransID=" + Request.QueryString["TransID"].ToString(), false);
            }
            else
            {
                var arr = objBEStudent.StrResult.Split('|');
                var x   = arr[0];
                if (x == "nextQuestion")
                {
                    hfQid.Value       = arr[1].ToString();
                    lblQuestion1.Text = arr[2].ToString();
                    lblFailed.Text    = "";
                    txtAnswer1.Text   = "";
                    txtAnswer1.Focus();
                }

                else if (x == "Locked")
                {
                    Response.Redirect("AuthenticationFailed.aspx?TransID=" + Request.QueryString["TransID"].ToString(), false);
                }
                else
                {
                    lblFailed.Text  = x.ToString();
                    txtAnswer1.Text = "";
                    txtAnswer1.Focus();
                }


                // lblFailed.Text = objBEStudent.StrResult.ToString();
            }
        }
Ejemplo n.º 3
0
        protected void btnProceed_Click(object sender, EventArgs e)
        {
            BEStudent objBEStudent = new BEStudent();
            BStudent  objBStudent  = new BStudent();

            objBEStudent.IntTransID = transID;
            objBEStudent.IntType    = 15;
            objBStudent.BUpdatePLTime(objBEStudent);
            //Response.Redirect("Authenticationcode.aspx?TransID=" + AppSecurity.Encrypt(transID.ToString()), false);

            Response.Redirect("ExamiKNOW.aspx?TransID=" + AppSecurity.Encrypt(transID.ToString()), false);
        }
Ejemplo n.º 4
0
        protected void btnProceed_Click(object sender, EventArgs e)
        {
            BEStudent objBEStudent = new BEStudent();
            BStudent  objBStudent  = new BStudent();

            objBEStudent.IntTransID = transID;
            objBEStudent.IntResult  = 1;
            objBEStudent.IntType    = 14;
            objBStudent.BUpdateNonProctorExamStatus(objBEStudent);
            objBStudent.BUpdatePLTime(objBEStudent);


            Response.Redirect("CaptureIDImage.aspx?TransID=" + AppSecurity.Encrypt(transID.ToString()), false);
        }
        protected void btnBegin_Click(object sender, EventArgs e)
        {
            Session["Flowcheck"]      = null;
            Session["NonProctorExam"] = null;
            Session["Isproctorless"]  = null;
            BEStudent objBEStudent = new BEStudent();
            BStudent  objBStudent  = new BStudent();

            objBEStudent.IntTransID = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
            objBEStudent.IntType    = 18;
            objBEStudent.IntResult  = 0;
            objBStudent.BUpdateNonProctorExamStatus(objBEStudent);
            objBStudent.BUpdatePLTime(objBEStudent);


            ScriptManager.RegisterStartupScript(this, Page.GetType(), "newWindow", "window.open('" + GetExamLink() + "','_blank');", true);
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Int64     TransID      = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
            BEStudent objBEStudent = new BEStudent();
            BStudent  objBStudent  = new BStudent();

            objBEStudent.IntTransID = TransID;
            objBEStudent.IntResult  = 2;
            objBEStudent.IntType    = 9;
            objBStudent.BUpdateNonProctorExamStatus(objBEStudent);
            objBStudent.BUpdatePLTime(objBEStudent);

            if (Session["isexamiFACE"] != null && Session["isexamiFACE"].ToString() == "1")
            {
                BECommon objBECommon = new BECommon();
                BCommon  objBCommon  = new BCommon();
                objBECommon.IntTransID = TransID;
                objBCommon.BGetOpenTokAutoProctorStatus(objBECommon);
                if (objBECommon.IntResult == 1)
                {
                    var client  = new RestClient(System.Configuration.ConfigurationManager.AppSettings["ExamityMeetingService_URL"].ToString());
                    var request = new RestRequest(Method.POST);
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    sb.Append("Method=CreateAutoProctorMeeting&");
                    sb.Append("TransID=" + Request.QueryString["TransID"].ToString());
                    sb.Append("&ClientID=" + System.Configuration.ConfigurationManager.AppSettings["ExamityMeeting_ClientID"].ToString());

                    request.AddParameter("application/x-www-form-urlencoded", sb.ToString(), RestSharp.ParameterType.RequestBody);
                    var response = client.Execute(request);
                    Response.Redirect("BeginAutoProctorExam.aspx?TransID=" + Request.QueryString["TransID"].ToString());
                    //Response.Redirect("BeginAutoProctorExam.aspx?TransID=" + Request.QueryString["TransID"].ToString());
                }
                else
                {
                    Response.Redirect("BeginAutoExam.aspx?TransID=" + Request.QueryString["TransID"].ToString());
                }
            }
            else
            {
                Response.Redirect("BeginExam.aspx?TransID=" + Request.QueryString["TransID"].ToString());
            }
        }
Ejemplo n.º 7
0
 protected void btnNext_Click(object sender, EventArgs e)
 {
     if (Request.QueryString["TransID"] != null)
     {
         BEStudent objBEStudent = new BEStudent();
         BStudent  objBStudent  = new BStudent();
         objBEStudent.IntTransID = Convert.ToInt64(AppSecurity.Decrypt(Request.QueryString["TransID"].ToString()));
         objBEStudent.IntType    = 26;
         objBStudent.BUpdatePLTime(objBEStudent);
         objBStudent.BGetAAexamiKEYstatus(objBEStudent);
         if (objBEStudent.IntResult == 0)
         {
             Response.Redirect("Agreements.aspx?TransID=" + Request.QueryString["TransID"].ToString(), false);
         }
         if (objBEStudent.IntResult == 1)
         {
             Response.Redirect("AuthenticationFailed.aspx?TransID=" + Request.QueryString["TransID"].ToString(), false);
         }
     }
 }
        public void PostToKeyStroke()
        {
            string userid            = Session[SecureProctor.BaseClass.EnumPageSessions.USERID].ToString();
            string firstname         = Request["firstname"];
            string firstnamelastname = Request["firstNameLastName"];

            BEUser objBEUser = new BEUser()
            {
                IntTransID = TransID
            };
            BUser objBUser = new BUser();

            objBUser.BGetProfileExamiKeyDetails(objBEUser);
            string FirstName = objBEUser.DtResult.Rows[0]["FName"].ToString();
            string lastName  = objBEUser.DtResult.Rows[0]["LFName"].ToString();

            if (((firstname.Split(','))[0] == FirstName) && ((firstnamelastname.Split(','))[0] == lastName))
            {
                try
                {
                    var jsonObject = new JObject();
                    jsonObject.Add("userId", userid);
                    jsonObject.Add("client", ConfigurationManager.AppSettings["client"]);
                    jsonObject.Add("firstName", firstname);
                    jsonObject.Add("firstNameLastName", firstnamelastname);

                    var request1 = ConfigurationManager.AppSettings["apiurl"].ToString() + "examity/api/user/score";
                    var request  = (HttpWebRequest)HttpWebRequest.Create(request1);
                    request.Method = "POST";
                    request.Headers["Authorization"] = ConfigurationManager.AppSettings["authkey"];

                    UTF8Encoding encoding  = new UTF8Encoding();
                    byte[]       byteArray = encoding.GetBytes(jsonObject.ToString());
                    request.ContentType   = "application/json";
                    request.ContentLength = byteArray.Length;
                    Stream dataStream = request.GetRequestStream();
                    dataStream.Write(byteArray, 0, byteArray.Length);
                    dataStream.Close();

                    HttpWebResponse response = (HttpWebResponse)request.GetResponse();

                    if (response.StatusCode == HttpStatusCode.OK)
                    {
                        dataStream = response.GetResponseStream();
                        StreamReader reader = new StreamReader(dataStream);
                        string       ret    = reader.ReadToEnd();
                        response.Close();
                        dynamic json = JValue.Parse(ret);

                        if (json.statusCode == "1003")
                        {
                            dynamic jobj = json.scoreInfo as JObject;

                            string obj   = jobj.score;
                            int    score = Convert.ToInt32(obj);

                            BEStudent objBEStudent = new BEStudent()
                            {
                                IntTransID       = TransID,
                                intExamiKeyScore = score,
                                IntType          = 26
                            };
                            BStudent objBStudent = new BStudent();
                            objBStudent.BUpdateExamiKEYScore(objBEStudent);
                            objBStudent.BUpdatePLTime(objBEStudent);
                            Response.Write("true" + "|" + objBEStudent.StrResult);
                        }
                        else if (json.statusCode == "1004")
                        {
                            //lblmsg.Text = "Invalid Profile Details Provided / Profile details not found.";
                            Response.Write("false" + "|" + "Error in validating examiKEY");
                        }
                    }
                }
                catch (WebException ex)
                {
                    using (WebResponse response = ex.Response)
                    {
                        HttpWebResponse httpResponse = (HttpWebResponse)response;
                        using (Stream data = response.GetResponseStream())
                        {
                            string  ret  = new StreamReader(data).ReadToEnd();
                            dynamic json = JValue.Parse(ret);
                        }
                    }
                    Response.Write("false" + "|" + "Error in validating examiKEY");
                }
            }
            else
            {
                if (((firstname.Split(','))[0] == FirstName) & ((firstnamelastname.Split(','))[0] != lastName))
                {
                    Response.Write("false" + "|" + "First Name and Last Name do not match with profile data.");
                }
                else if (((firstname.Split(','))[0] != FirstName) & ((firstnamelastname.Split(','))[0] == lastName))
                {
                    Response.Write("false" + "|" + "First Name does not match with profile data.");
                }
                else if (((firstname.Split(','))[0] != FirstName) & ((firstnamelastname.Split(','))[0] != lastName))
                {
                    Response.Write("false" + "|" + "This does not match with your profile. Please try again.");
                }
                else
                {
                    Response.Write("false" + "|" + "This does not match with your profile. Please try again.");
                }
            }
        }