Exemple #1
0
    //activates objects based on QuestionType
    public void SetQuestion(Question question)
    {
        this.question = question;

        switch (this.question.questionType)
        {
        case QuestionType.TEXT:
            questionImage.transform.gameObject.SetActive(false);
            break;

        case QuestionType.IMAGE:
            ImageHolder();
            questionImage.transform.gameObject.SetActive(true);
            questionImage.sprite = question.QuestionImg;
            break;
        }

        questionText.text = question.questionInfo;

        List <string> answerList = RandomizeList.mixTheList <string>(question.options);

        for (int i = 0; i < options.Count; i++)
        {
            options[i].GetComponentInChildren <Text>().text = answerList[i];
            options[i].name        = answerList[i];
            options[i].image.color = neutralColor;
        }

        answered = false;
    }
 public ActionResult Randomize(RandomizeList random)
 {
     Session["totalTurns"] = null;
     Session["list"]       = random.Randomize();
     return(View("Index", Session["list"] as List <Numbers>));
 }