3 Replies - 2727 Views - Last Post: 13 February 2013 - 07:27 PM

#1 EmptyBucket  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-February 13

Displaying questions task for quiz game

Posted 10 February 2013 - 12:30 PM

For my quiz application, Im confused as to whether I should stick to this format for the question
was going to try xml, but I don't have much of a starting point for that

I've looked at examples for like rpg conversations but they have a lot of things I don't need
I just want to display all of this on the screen then be able to switch to next question,
If anyone has any examples or ideas to offer me It would be much appreciated


List<CQuestion> listOfQuestions = new List<CQuestion>();

            CQuestion question1 = new CQuestion();
            listOfQuestions.Add(question1);
            question1.QuestionText = "What is a variable?";
            question1.Answers[0] = "Stores a value";
            question1.Answers[1] = "Stores a Bitmap";
            question1.Answers[2] = "Stores the game code";
            question1.Answers[3] = "all of the above";
            question1.CorrectAnswer = 1;



  public CQuestion()
        {
            
            Answers = new string[4];
        }
        public string[] Answers { get; set; }
        public string QuestionText { get; set; }
        public int CorrectAnswer { get; set; }


Is This A Good Question/Topic? 0
  • +

Replies To: Displaying questions task for quiz game

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5674
  • View blog
  • Posts: 12,186
  • Joined: 02-June 10

Re: Displaying questions task for quiz game

Posted 10 February 2013 - 12:36 PM

Multiple choice quiz - tutorial

Using XML is a good choice. Its as easy as serializing your CQuestion objects.
Separating data from GUI - PLUS - serializing the data to XML
Was This Post Helpful? 0
  • +
  • -

#3 EmptyBucket  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-February 13

Re: Displaying questions task for quiz game

Posted 13 February 2013 - 06:36 PM

thanks for the links, I don't completely understand xml, I know it holds data but can it read it and DISPLAY the text on my xna screen when I compile, or would my best go be to go with spritefonts?

Thanks
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5674
  • View blog
  • Posts: 12,186
  • Joined: 02-June 10

Re: Displaying questions task for quiz game

Posted 13 February 2013 - 07:27 PM

*it* (meaning XML) doesn't display anything. Its just the format of the file holding your information.

How you store your information (XML, text file, database) doesn't have anything to do with how you draw it on screen.

You get your strings from someplace.
You draw them on screen however you like: SpriteFonts... Textbox... grab .jpg's of each character and put them in the right order... Whatever...

If you don't understand how to put text on the screen you probably aren't ready to be designing a program yet. Stick with following the lessons of the text book for now.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1