/// <summary>
    /// Retrieved the questions and answer from the database
    /// </summary>
    /// <returns> the list of questions is returned </returns>
    public QuestionsNAnswers LoadQuestion()
    {
        QuestionsNAnswersDAO     dao       = new QuestionsNAnswersDAO();
        List <QuestionsNAnswers> questions = dao.RetrieveQuestions(DifficultyStore.Difficulty);

        question = questions[Random.Range(0, questions.Count)];

        return(question);
    }
Exemplo n.º 2
0
    private void Start()
    {
        title.text = Difficulty.difficulty;
        Debug.Log(Difficulty.difficulty);
        this.QnADAO = new QuestionsNAnswersDAO();
        this.qna    = QnADAO.RetrieveQuestionsNAnswers();

        /*string[] answer1 = { "e", "f", "g", "h" };
         * QuestionsNAnswers q2 = new QuestionsNAnswers(2, "intermediate question", answer1, 3, (float)0.50, "Intermediate");
         * QnADAO.addData(q2);
         * string[] answer2 = { "M", "L", "K", "J" };
         * QuestionsNAnswers q3 = new QuestionsNAnswers(3, "very hard question", answer2, 4, (float)0.50, "Expert");
         * QnADAO.addData(q3);*/

        generateQuestion(Difficulty.difficulty);
        Vector3 pos = quitButton.transform.position;

        pos.x += 500f;
        quitButton.transform.position = pos;
    }