예제 #1
0
        public frmQuestions(QuizParameters quizParameters)
        {
            //Initialise the needed structures
            InitializeComponent();
            this.quizParameters = quizParameters;
            quizQuestions = new List<IQuizQuestion>();
            renderedQuestions = new List<Panel>();
            hintsUsed = 0;
            currQuestionID = 0;

            //Generate the shuffled question IDs array
            randGen = new Random();
            shuffledIDs = new int[quizParameters.questions.Count];
            for (int i = 0; i < quizParameters.questions.Count; i++)
            {
                shuffledIDs[i] = i;
            }
            for (int i = quizParameters.questions.Count-1; i >= 0; i--)
            {
                int tmp;
                int pos = randGen.Next(i);
                tmp = shuffledIDs[i];
                shuffledIDs[i] = shuffledIDs[pos];
                shuffledIDs[pos] = tmp;
            }
        }
예제 #2
0
 public QuestionsFetchedEventArgs(QuizParameters quizParameters)
 {
     this.quizParameters = quizParameters;
 }