Exemplo n.º 1
0
        /*
         * Get the questions set from Blockscore
         */
        private void HandleQuestionSet(BlockScoreResponse verifyUsResult, BlockscoreAPI blockscore)
        {
            if (!string.IsNullOrEmpty(verifyUsResult.id))
            {
                lblquestionrequest.Text = "verification_id = " + verifyUsResult.id.ToString();

                BlockScoreQuestionsResponse questionSet = GetQuestionSet(blockscore);

                lblquestionresponse.Text = GetblockscoreQuestionsResponseoutput(questionSet);

                CheckAnswers(blockscore, questionSet);
            }
        }
Exemplo n.º 2
0
        /*
         * Ouput Blockscore Questions Response object to a string
         */
        private string GetblockscoreQuestionsResponseoutput(BlockScoreQuestionsResponse blockscoreresponse)
        {
            string strreturn = "";

            foreach (Question tempquestion in blockscoreresponse.questions)
            {
                strreturn += "<br/><br/>Question id: " + tempquestion.id.ToString();;
                strreturn += "<br/>question:  " + tempquestion.question.ToString();
                strreturn += "<br/>Answers:  ";

                strreturn += "<div class='Tab1'>";
                foreach (Answer tempanswer in tempquestion.answers)
                {
                    strreturn += "<br/>id  " + tempanswer.answer_id.ToString();
                    strreturn += "<br/>answer  " + tempanswer.answer.ToString();
                }
                strreturn += "</div>";
            }

            return(strreturn);
        }