Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Previous and Next button Problem

Previous and Next button Problem

Scheduled Pinned Locked Moved Visual Basic
csharphelpwpfquestion
14 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11753052
    wrote on last edited by
    #1

    I am currently working on a cbt software and i want the questions to be coming randomly ( one per page) which is working. Please how can i program Previous and Next button with WPF of VB.NET so user can skip and later go back before the exam finishes. Please help me. Have been on it for like 3 weeks now. thank you

    R 1 Reply Last reply
    0
    • U User 11753052

      I am currently working on a cbt software and i want the questions to be coming randomly ( one per page) which is working. Please how can i program Previous and Next button with WPF of VB.NET so user can skip and later go back before the exam finishes. Please help me. Have been on it for like 3 weeks now. thank you

      R Offline
      R Offline
      Ralf Meier
      wrote on last edited by
      #2

      At which point do you stuck ? I think, at first you have to build up a kind of collection in which all Page-Contents are memorized, the selected answers and also the order of appearance. After that you build up a Page, which has the 2 Buttons which increase or decrease the Collection-Pointer and which displays the Collection-Content at pointer-position.

      U 1 Reply Last reply
      0
      • R Ralf Meier

        At which point do you stuck ? I think, at first you have to build up a kind of collection in which all Page-Contents are memorized, the selected answers and also the order of appearance. After that you build up a Page, which has the 2 Buttons which increase or decrease the Collection-Pointer and which displays the Collection-Content at pointer-position.

        U Offline
        U Offline
        User 11753052
        wrote on last edited by
        #3

        I used a loop with total number of question a user can answer.. so when it clicks next. it gets incremented by one.. example Is a user can answer 10 questions and he is on number 7, he now moved back to question two, how do I program it to fetch what's on question two and when he is done , he won't see different questions from 4-7 he already did and also move on to complete the questions.. I am really struck there, please help me

        R 1 Reply Last reply
        0
        • U User 11753052

          I used a loop with total number of question a user can answer.. so when it clicks next. it gets incremented by one.. example Is a user can answer 10 questions and he is on number 7, he now moved back to question two, how do I program it to fetch what's on question two and when he is done , he won't see different questions from 4-7 he already did and also move on to complete the questions.. I am really struck there, please help me

          R Offline
          R Offline
          Ralf Meier
          wrote on last edited by
          #4

          As I have written before : I would create a class which could memorize all the necessary information - for example the question-text, the given answer and so on (all what you think that you need). Now you initialize your question-catalogue - each question is stored in this class-variable and the class is stored in the collection. How much experience do you have with classes, collections, dynamic creation of classes ? Could you imagine, what I tried to explain you ?

          U 1 Reply Last reply
          0
          • R Ralf Meier

            As I have written before : I would create a class which could memorize all the necessary information - for example the question-text, the given answer and so on (all what you think that you need). Now you initialize your question-catalogue - each question is stored in this class-variable and the class is stored in the collection. How much experience do you have with classes, collections, dynamic creation of classes ? Could you imagine, what I tried to explain you ?

            U Offline
            U Offline
            User 11753052
            wrote on last edited by
            #5

            six month now...

            R 1 Reply Last reply
            0
            • U User 11753052

              six month now...

              R Offline
              R Offline
              Ralf Meier
              wrote on last edited by
              #6

              OK ... you understood what I have decribed ? How should we go further ?

              U 1 Reply Last reply
              0
              • R Ralf Meier

                OK ... you understood what I have decribed ? How should we go further ?

                U Offline
                U Offline
                User 11753052
                wrote on last edited by
                #7

                yes i do. we can go further with practical examples ( probably a simple sample code) or what do you think?

                R 1 Reply Last reply
                0
                • U User 11753052

                  yes i do. we can go further with practical examples ( probably a simple sample code) or what do you think?

                  R Offline
                  R Offline
                  Ralf Meier
                  wrote on last edited by
                  #8

                  OK ... of course ... I suggest that you create a class with the (from your point) necessary properties. After that I need to know which Information out of your database should be stored for questioning. Then we could fill the from me suggested collection with the new class-items which could be used (later) for your visualisation on the form. It's your turn ... ;)

                  U 1 Reply Last reply
                  0
                  • R Ralf Meier

                    OK ... of course ... I suggest that you create a class with the (from your point) necessary properties. After that I need to know which Information out of your database should be stored for questioning. Then we could fill the from me suggested collection with the new class-items which could be used (later) for your visualisation on the form. It's your turn ... ;)

                    U Offline
                    U Offline
                    User 11753052
                    wrote on last edited by
                    #9

                    yes i have created a class called "Bank"for the questions, it has the questions, options and correct answer, and its selecting per group (i.e. for a particular subject example English) i have the properties as follows public property questionNo as String public property question as String public property optionA as String public property optionB as String public property optionC as String public property CorrectAnswer as String

                    R 1 Reply Last reply
                    0
                    • U User 11753052

                      yes i have created a class called "Bank"for the questions, it has the questions, options and correct answer, and its selecting per group (i.e. for a particular subject example English) i have the properties as follows public property questionNo as String public property question as String public property optionA as String public property optionB as String public property optionC as String public property CorrectAnswer as String

                      R Offline
                      R Offline
                      Ralf Meier
                      wrote on last edited by
                      #10

                      OK ... Now you should create the Collection for the Animation/Visualisation. This could work like this :

                      dim QuestionCollection as new collection

                      Sub Initialize_Collection
                      QuestionCollection.clear

                      for i as integer = 1 to 10
                         dim myBank as new Bank
                         myBank.QuestionNo = ""    ' assign the Question-No. here
                         myBank.Question = ""      ' assign the Question-Text here
                         myBank.OptionA = ""       ' assign the Option-Value A here
                         myBank.OptionB = ""       ' assign the Option-Value B here
                         myBank.OptionC = ""       ' assign the Option-Value C here
                         myBank.CorrectAnswer = "" ' assign the correct Answer-Text here
                         myBank.Result = false     ' you should add a boolean as result for the question to 
                      

                      your class
                      QuestionCollection.add (myBank)
                      next
                      End Sub

                      now you could work with this Collection on your Form. With your Buttons you should select the index from the Collection-Entry and put the data of it to your Form-Labels/TextBoxes/OptionButtons etc. Do you understand what I mean ?

                      U 1 Reply Last reply
                      0
                      • R Ralf Meier

                        OK ... Now you should create the Collection for the Animation/Visualisation. This could work like this :

                        dim QuestionCollection as new collection

                        Sub Initialize_Collection
                        QuestionCollection.clear

                        for i as integer = 1 to 10
                           dim myBank as new Bank
                           myBank.QuestionNo = ""    ' assign the Question-No. here
                           myBank.Question = ""      ' assign the Question-Text here
                           myBank.OptionA = ""       ' assign the Option-Value A here
                           myBank.OptionB = ""       ' assign the Option-Value B here
                           myBank.OptionC = ""       ' assign the Option-Value C here
                           myBank.CorrectAnswer = "" ' assign the correct Answer-Text here
                           myBank.Result = false     ' you should add a boolean as result for the question to 
                        

                        your class
                        QuestionCollection.add (myBank)
                        next
                        End Sub

                        now you could work with this Collection on your Form. With your Buttons you should select the index from the Collection-Entry and put the data of it to your Form-Labels/TextBoxes/OptionButtons etc. Do you understand what I mean ?

                        U Offline
                        U Offline
                        User 11753052
                        wrote on last edited by
                        #11

                        Yes, i understood it a bit. like am creating a new List(of Collection) . and the loop means the user has 10 questions to answer, can you explain further please.. sorry for bothering you this much

                        R 1 Reply Last reply
                        0
                        • U User 11753052

                          Yes, i understood it a bit. like am creating a new List(of Collection) . and the loop means the user has 10 questions to answer, can you explain further please.. sorry for bothering you this much

                          R Offline
                          R Offline
                          Ralf Meier
                          wrote on last edited by
                          #12

                          NO ... if you want to do it with a List then you have to use a List (of Bank) - not of collection. Either a collection or a generic List. When you generate the List (or collection) you create severall instances of Bank (your class-definition). Each Instance should be filled with the needed data - for example the question-text and so on. Please think a bit - some of the work should be done by you ... :cool:

                          U 1 Reply Last reply
                          0
                          • R Ralf Meier

                            NO ... if you want to do it with a List then you have to use a List (of Bank) - not of collection. Either a collection or a generic List. When you generate the List (or collection) you create severall instances of Bank (your class-definition). Each Instance should be filled with the needed data - for example the question-text and so on. Please think a bit - some of the work should be done by you ... :cool:

                            U Offline
                            U Offline
                            User 11753052
                            wrote on last edited by
                            #13

                            i know right.. let me work more on myself, i would get back to you. thanks alot, i really appreciate. God bless you

                            R 1 Reply Last reply
                            0
                            • U User 11753052

                              i know right.. let me work more on myself, i would get back to you. thanks alot, i really appreciate. God bless you

                              R Offline
                              R Offline
                              Ralf Meier
                              wrote on last edited by
                              #14

                              No ... we could work together. That is no problem ... But my wish was : TOGETHER ... and not me alone ... So ... please show me your results and we could speak further ...

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups