コード例 #1
0
        public void AnswerAdd()
        {
            QuestionAnswers.Add(new Answer());

            AnswerButtonDeleteIsEnabled = true;
            NotifyOfPropertyChange(() => CanSaveQuestion);
        }
コード例 #2
0
        public static string SoruCevapla(QuestionAnswers q)
        {
            try
            {
                DB_A151C9_beritankEntities db = new DB_A151C9_beritankEntities();

                tblQuestionAnswers x = new tblQuestionAnswers()
                {
                    QuestionID = q.QuestionID, AnswerUserID = q.AnswerUserID, AnswerText = q.AnswerText
                };

                db.tblQuestionAnswers.Add(x);

                //var cevap = (from c in db.tblQuestionAnswers//gelen verinin içinde sorunun id sini kullanarak o soruya cevap ekledim
                //             where c.QuestionID == q.QuestionID
                //             select c
                //               ).SingleOrDefault();

                //cevap.AnswerText = q.AnswerText;//Yorum kaydettim
                //cevap.AnswerUserID = q.AnswerUserID;//yorum yazan kişiyi kaydettim
                //cevap.Accuracy = q.Accuracy;



                db.SaveChanges();
                return("İşlem Başarılı");
            }
            catch (Exception)
            {
                return("İşlem Başarılı");
            }
        }
コード例 #3
0
ファイル: AdminBL.cs プロジェクト: hamedahmed100/VoteSystem
        public void addQuestion(QuestionAnswers quesionAnswers)
        {
            Question question = new Question
            {
                Content = quesionAnswers.Question
            };

            //Add Question
            dbContext.Questions.Add(question);


            Answer answer;

            foreach (var ans in quesionAnswers.Answers)
            {
                answer = new Answer
                {
                    Question  = question,
                    TheAnswer = ans
                };
                //Add Answers
                dbContext.Answers.Add(answer);
            }


            //save Changes
            dbContext.SaveChanges();
        }
コード例 #4
0
 public virtual void AddClassified(Answers newAnswer)
 {
     if (QuestionAnswers.All(x => x.Id == newAnswer.Id))
     {
         ((IList <Answers>)QuestionAnswers).Add(newAnswer);
     }
 }
コード例 #5
0
        public ActionResult Create(QuestionAnswers questionAnswers, HttpPostedFileBase file)
        {
            if (file != null && Path.GetExtension(file.FileName) != ".md")
            {
                ModelState.AddModelError("MarkdownReference", "Only .md file extensions supported");
            }

            if (questionAnswers.Answers.Where(x => x.Correct).Count() != 1)
            {
                ModelState.AddModelError("Text", "One correct answer required");
            }

            if (ModelState.IsValid)
            {
                questionAnswers.Question.Answers = questionAnswers.Answers;
                if (file != null)
                {
                    questionAnswers.Question.MarkdownReference = Guid.NewGuid();
                    markdownService.Upload(file, questionAnswers.Question.MarkdownReference.Value);
                }

                db.Questions.Add(questionAnswers.Question);
                db.SaveChanges();
                return(RedirectToAction("Index", new { quizId = questionAnswers.Question.QuizId }));
            }

            return(View(questionAnswers));
        }
コード例 #6
0
        public MySqlContext(DbContextOptions options) : base(options)
        {
            //Database.EnsureDeleted();
            Database.EnsureCreated();

            if (Articles.Count() == 0)
            {
                PutData data = new PutData();

                Articles.AddRange(data.articles);
                Comments.AddRange(data.comments);

                SuperUsers.Add(data.super);
                TeacherUsers.AddRange(data.teacher);
                StudentUsers.AddRange(data.studentUser);
                TestStudents.AddRange(data.testStudents);
                QuestionAnswers.AddRange(data.questionAnswers);
                Tests.AddRange(data.tests);

                Themes.AddRange(data.themes);
                TestThemes.AddRange(data.TestThemas);
                Questions.AddRange(data.questions1);
                Questions.AddRange(data.questions2);
                Questions.AddRange(data.questions3);
                Marks.AddRange(data.Marks1);
                Marks.AddRange(data.Marks2);

                EventProfileUsers.AddRange(data.EventProfileUsers);
                Meetups.AddRange(data.Meetups);
                Speakers.AddRange(data.Speakers);

                SaveChanges();
            }
        }
コード例 #7
0
        public List <QuestionAnswers> GetQuestionsFromPage(int page)
        {
            var questions = new List <QuestionAnswers>();

            GlobalLogger.Instance.Debug("Обработка страницы " + page.ToString() + " из " + TotalPages.ToString());
            try
            {
                var url   = ConfigurationManager.AppSettings["questionsUrl"] + (page * 10).ToString();
                var web   = new HtmlWeb();
                var doc   = web.Load(url);
                var xpath = ConfigurationManager.AppSettings["questionsXpath"];
                var table = doc.DocumentNode.SelectSingleNode(xpath);
                var rows  = table.ChildNodes.Where(node => node.Name == "tr").Skip(1);
                for (int i = 0; i < rows.Count(); i++)
                {
                    var row = rows.ElementAt(i);
                    try
                    {
                        var columns  = row.ChildNodes.Where(node => node.Name == "td").ToList();
                        var question = new QuestionAnswers(GetQuestionText(columns), GetAnswers(columns));
                        questions.Add(question);
                    }
                    catch (Exception e)
                    {
                        GlobalLogger.Instance.Debug("Произошла ошибка " + e.Message + " при обработке " + i.ToString() + " строки");
                    }
                }
            }
            catch (Exception e)
            {
                GlobalLogger.Instance.Debug("Произошла ошибка " + e.Message + " при обработке страницы");
            }
            return(questions);
        }
コード例 #8
0
        public async Task <int> AddQuestion(QuestionAnswers qna)
        {
            qna.Id = qna.question.GetDeterministicHashCode();
            await db.QuestionAnswers.AddAsync(qna);

            db.SaveChanges();
            return(qna.Id);
        }
コード例 #9
0
        public IEnumerable <QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer> > Get()
        {
            int UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

            QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>[] _Answers = new QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>().GetUserAnswersForRankOrder(UserID);
            var _Result = _Answers.OrderBy(x => x.RankOrder);

            return(_Result);
        }
コード例 #10
0
 public void AnswerDelete(object obj)
 {
     QuestionAnswers.Remove(obj as Answer);
     if (QuestionAnswers.Count == 2)
     {
         AnswerButtonDeleteIsEnabled = false;
     }
     NotifyOfPropertyChange(() => CanSaveQuestion);
 }
コード例 #11
0
        public virtual void ArchiveClassified(long answerId)
        {
            var answerToBeArchived = QuestionAnswers.FirstOrDefault(pred => pred.Id == answerId);

            if (answerToBeArchived != null)
            {
                answerToBeArchived.Archive();
            }
        }
コード例 #12
0
ファイル: WorkFlowHandler.cs プロジェクト: SaBPNHS/MCATool
 private void RemoveQuestionAnswers(QuestionAnswers questionAnswers)
 {
     foreach (var answer in questionAnswers.Items)
     {
         _questionAnswerHelper.RemoveQuestionAnswer(new QuestionAnswer()
         {
             QuestionAnswerId = answer.QuestionAnswerId
         });
     }
 }
コード例 #13
0
        public ActionResult Admin(QuestionAnswers questionAnswers)
        {
            TempData["check"] = false;
            if (ModelState.IsValid)
            {
                TempData["check"] = true;
                new AdminBL().addQuestion(questionAnswers);
            }

            return(RedirectToAction("Admin"));
        }
コード例 #14
0
ファイル: GradeOperation.cs プロジェクト: sakpung/webstudy
        private void Generate()
        {
            Dictionary <string, QuestionAnswers> localQa = omrAnalysisEngine.QuestionsAnswers;

            List <string> detectedKeys = new List <string>();

            foreach (KeyValuePair <string, QuestionAnswers> kvp in localQa)
            {
                detectedKeys.AddRange(kvp.Value.AnswersCount.Keys);
            }

            detectedKeys = detectedKeys.Distinct().ToList();

            int length = detectedKeys.Count + 1;
            int width  = localQa.Count + 1;

            statsArray = new string[length, width];

            // build header
            int ticker = 1;

            foreach (KeyValuePair <string, QuestionAnswers> kvp in localQa)
            {
                statsArray[0, ticker] = kvp.Key;
                ticker++;
            }

            for (int i = 0; i < detectedKeys.Count; i++)
            {
                string masterKey = detectedKeys[i];
                statsArray[i + 1, 0] = masterKey;

                for (int j = 0; j < width; j++)
                {
                    string currentKey = statsArray[0, j];
                    if (currentKey == null || localQa.ContainsKey(currentKey) == false)
                    {
                        continue;
                    }
                    QuestionAnswers qa = localQa[currentKey];

                    if (qa.AnswersCount == null || qa.AnswersCount.ContainsKey(masterKey) == false)
                    {
                        continue;
                    }
                    statsArray[i + 1, j] = qa.AnswersCount[detectedKeys[i]].ToString();
                }
            }
        }
コード例 #15
0
        public ActionResult Index(FormCollection c)
        {
            int i = 0;

            if (ModelState.IsValid)
            {
                var checkboxlistselections = c.GetValues("choices");
                var dropdownselections     = c.GetValues("item.QuestionChoices");

                List <QuestionAnswers> todelete = (
                    from qq in db.QuestionAnswers
                    where qq.memberID == config.LoggedInMember.ID
                    select qq).ToList <QuestionAnswers>();

                //remove current answers for member
                db.QuestionAnswers.RemoveRange(todelete);

                //add dropdown selections to answers table
                for (i = 0; i < dropdownselections.Count(); i++)
                {
                    QuestionAnswers qa = new QuestionAnswers();
                    qa.questionChoiceID = Convert.ToInt16(dropdownselections[i]);
                    qa.memberID         = config.LoggedInMember.ID;
                    db.QuestionAnswers.Add(qa);
                }

                //add checkbox selections to answers table
                for (i = 0; i < checkboxlistselections.Count(); i++)
                {
                    QuestionAnswers qa = new QuestionAnswers();
                    qa.questionChoiceID = Convert.ToInt16(checkboxlistselections[i]);
                    qa.memberID         = config.LoggedInMember.ID;
                    db.QuestionAnswers.Add(qa);
                }

                db.SaveChanges();
            }

            //get member's choices
            List <QuestionAnswers> choices = db.QuestionAnswers.Where(q => q.memberID == config.LoggedInMember.ID).ToList <QuestionAnswers>();

            ViewBag.choiceIdSelected = choices;

            //get all enabled questions
            var Questions = db.Questions.Include(t => t.QuestionCategory).Where(q => q.enabled == true);
            var questions = Questions.ToList();

            return(View(questions));
        }
コード例 #16
0
    private void LoadNextQuestion()
    {
        if (_nextQuestion >= _questions.Length)
        {
            _questionText.text = _finishText;
            _castText.text     = _questionText.text;
            foreach (var button in _answerButtons)
            {
                button.gameObject.SetActive(false);
            }
            return;
        }

        _question = _questions[_nextQuestion];

        if (_question.Randomize)
        {
            var random = NewShuffled(4, i => i);

            // The position of the correct answer has been probably changed.
            var correctAnswer = 0;
            for (var i = 0; i < random.Length; ++i)
            {
                if (_question.CorrectAnswer == (QuestionAnswers.Answer)random[i])
                {
                    correctAnswer = i;
                    break;
                }
            }

            _question = new QuestionAnswers(_question.Question, _question.Answers[random[0]],
                                            _question.Answers[random[1]], _question.Answers[random[2]], _question.Answers[random[3]],
                                            (QuestionAnswers.Answer)correctAnswer, _question.Randomize);
        }

        _questionText.text = _question.Question;
        _castText.text     = _question.Question;

        for (var i = 0; i < 4; ++i)
        {
            _answerButtons[i].GetComponentInChildren <Text>().text = _question.Answers[i];
            _answerButtons[i].GetComponent <Image>().color         = Color.white;
            _answerButtons[i].interactable = true;
        }

        ++_nextQuestion;
    }
コード例 #17
0
        public ActionResult <List <QuestionAnswers> > GetQuizQuestions()
        {
            List <QuestionAnswers> quizQuestionsAnswers = new List <QuestionAnswers>();
            QuestionAnswers        questionsAnswers;
            List <Question>        randomQuestions = GetFiveRandomQuestions();

            for (int i = 0; i < randomQuestions.Count; i++)
            {
                questionsAnswers = new QuestionAnswers
                {
                    question = randomQuestions[i],
                    answers  = GetAnswersByQuestion(randomQuestions[i].id)
                };
                quizQuestionsAnswers.Add(questionsAnswers);
            }

            return(quizQuestionsAnswers);
        }
コード例 #18
0
        public byte[] HintStatistics(QuestionAnswers question)
        {
            var  statistic = new byte[] { 0, 0, 0, 0 };
            var  random    = new Random();
            byte number    = 97;

            for (var i = 0; i != 3; i++)
            {
                statistic[i] = (byte)random.Next(1, number + 1);
                number       = (byte)(number - statistic[i] + 1);
            }
            statistic[3] = (byte)(100 - statistic[0] - statistic[1] - statistic[2]);
            var maxValue = statistic.Max();
            var maxIndex = Array.IndexOf(statistic, maxValue);

            for (var i = 0; i != 4; i++)
            {
                if (question.Answers[i].IsCorrect)
                {
                    byte randomValue = (byte)random.Next(0, 101);
                    if (randomValue < 95)
                    {
                        var temp = statistic[i];
                        statistic[i]        = statistic[maxIndex];
                        statistic[maxIndex] = temp;
                    }
                    else
                    {
                        var incorrect = statistic.Select((item, index) => index).Where(index => statistic[index] != maxIndex) as int[];
                        if (incorrect != null)
                        {
                            var randomStatistic = (byte)incorrect.OrderBy(index => random.Next()).First();
                            var randomIndex     = incorrect.OrderBy(item => randomStatistic).First();
                            var temp            = statistic[i];
                            statistic[i]           = randomStatistic;
                            statistic[randomIndex] = temp;
                        }
                    }
                }
            }
            GlobalLogger.Instance.Info("Подсказка Статистика вернула cледующие значения: " + statistic[0].ToString() + "%  " + statistic[1].ToString() + "%  " + statistic[2].ToString() + "%  " + statistic[3].ToString() + "%");
            return(statistic);
        }
コード例 #19
0
        public void EditComment(QuestionsAnswers answers)
        {
            var book = QuestionAnswers.Where(b => b.AnswerID == answers.AnswerID).FirstOrDefault();

            if (book == null)
            {
                QuestionAnswers.Add(answers);
                QuestionsDetails.CommentDisplay = (questions.AnswerCount = questions.AnswerCount + 1).ToString();
            }
            else
            {
                var index = QuestionAnswers.IndexOf(book);
                QuestionAnswers[index] = answers;
            }
            if (LoadStatus == LoadMoreStatus.StausNodata)
            {
                LoadStatus = LoadMoreStatus.StausEnd;
            }
        }
コード例 #20
0
        public IResult <IEnumerable <QuestionAnswers> > GetNumberOfQuestionsByChapter(string chapterName, int numberOfQuestions)
        {
            var list   = new Dictionary <int, QuestionAnswers>();
            var result = new Result <IEnumerable <QuestionAnswers> >();

            try
            {
                using (SqlConnection connection = new SqlConnection())
                {
                    connection.ConnectionString = _connectionString;
                    using (SqlCommand command = new SqlCommand())
                    {
                        command.Connection  = connection;
                        command.CommandType = System.Data.CommandType.StoredProcedure;
                        command.CommandText = "GetNumberOfQuestionsByChapter";
                        command.Parameters.AddWithValue("@ChapterName", chapterName);
                        command.Parameters.AddWithValue("@numberOfQuestions", numberOfQuestions);
                        connection.Open();
                        var reader = command.ExecuteReader();
                        while (reader.Read())
                        {
                            QuestionAnswers questionAnswers = new QuestionAnswers();
                            questionAnswers.SetQuestion(reader["Question"].ToString());
                            int questionId = (int)reader["QuizId"];
                            list[questionId] = questionAnswers;
                        }
                    }
                }
                foreach (var keyValuePair in list)
                {
                    keyValuePair.Value.SetAnswers(GetAnswersForQuestion(keyValuePair.Key));
                }
                result.IsSucess = true;
                result.Data     = list.Values;
            }
            catch (Exception ex)
            {
                result.IsSucess     = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
コード例 #21
0
        public bool[] HintTwoAnswers(QuestionAnswers question)
        {
            var answers   = question.Answers.Select(x => x.IsCorrect).ToArray();
            var random    = new Random();
            var incorrect = answers.Select((item, index) => index).Where(index => answers[index] == false);
            var hintIndex = incorrect.OrderBy(index => random.Next()).First();

            answers[hintIndex] = true;
            var logText = "Подсказка Убрать Два Неверных ответа убрала ответы под номерами: ";

            for (var i = 0; i < 4; i++)
            {
                if (!answers[i])
                {
                    logText += i.ToString() + " ";
                }
            }
            GlobalLogger.Instance.Info(logText);
            return(answers);
        }
コード例 #22
0
        async Task ExecuteCommentCommandAsync()
        {
            var result = await StoreManager.QuestionsDetailsService.GetAnswersAsync(questions.Qid, pageIndex, pageSize);

            if (result.Success)
            {
                var answers = JsonConvert.DeserializeObject <List <QuestionsAnswers> >(result.Message.ToString());
                if (answers.Count > 0)
                {
                    if (pageIndex == 1 && QuestionAnswers.Count > 0)
                    {
                        QuestionAnswers.Clear();
                    }
                    QuestionAnswers.AddRange(answers);
                    pageIndex++;
                    if (QuestionAnswers.Count >= pageSize)
                    {
                        LoadStatus  = LoadMoreStatus.StausDefault;
                        CanLoadMore = true;
                    }
                    else
                    {
                        LoadStatus  = LoadMoreStatus.StausEnd;
                        CanLoadMore = false;
                    }
                }
                else
                {
                    LoadStatus = LoadMoreStatus.StausNodata;
                }
                CanLoadMore = false;
            }
            else
            {
                Log.SaveLog("QuestionsDetailsViewModel.GetAnswersAsync", new Exception()
                {
                    Source = result.Message
                });
                LoadStatus = LoadMoreStatus.StausError;
            }
        }
コード例 #23
0
        public IResult <IEnumerable <QuestionAnswers> > GetQuestionsByChapter(string chapterName)
        {
            IResult <IEnumerable <QuestionAnswers> > result = new Result <IEnumerable <QuestionAnswers> >();

            if (_fileData == null)
            {
                throw new ArgumentNullException();
            }
            try
            {
                TextReader textReader          = new StringReader(_fileData);
                var        doc                 = XDocument.Load(textReader);
                var        questionAnswersList = doc.Descendants("Chapter")
                                                 .Where(x => x.Attribute("ChapterName").Value == chapterName)
                                                 .Elements("Quiz").OrderBy(x => Guid.NewGuid()).ToList();
                var list = new List <QuestionAnswers>();
                foreach (var questionAnswers in questionAnswersList)
                {
                    QuestionAnswers questionAnswer = new QuestionAnswers();
                    questionAnswer.SetQuestion(questionAnswers.Attribute("Question").Value);
                    List <Answer> answers = new List <Answer>();
                    var           ansList = questionAnswers.Elements("Answer")
                                            .Select(a => new Answer()
                    {
                        AnswerValue = a.Attribute("Answer").Value,
                        IsCorrect   = int.Parse(a.Attribute("IsCorrectAnswer").Value) == 1 ? true : false
                    }).ToList();
                    questionAnswer.SetAnswers(ansList.OrderBy(x => Guid.NewGuid()).Take(ansList.Count).ToList());

                    list.Add(questionAnswer);
                }
                result.Data     = list.ToList();
                result.IsSucess = true;
            }
            catch (Exception ex)
            {
                result.IsSucess     = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
コード例 #24
0
        public void UpdateAnswers()
        {
            var existingParent = Context.Questions
                                 .Where(p => p.QuestionId == Question.QuestionId)
                                 .SingleOrDefault();

            foreach (var existingChild in existingParent.Answers.ToList())
            {
                if (!QuestionAnswers.Any(c => c.AnswerId == existingChild.AnswerId))
                {
                    Context.Answers.Remove(existingChild);
                }
            }

            foreach (var childModel in QuestionAnswers)
            {
                var existingChild = existingParent.Answers
                                    .Where(c => c.AnswerId == childModel.AnswerId)
                                    .SingleOrDefault();

                if (existingChild != null && existingChild?.AnswerId != 0)
                {
                    Context.Entry(existingChild).CurrentValues.SetValues(childModel);
                }
                else
                {
                    var newChild = new Answer
                    {
                        Text       = childModel.Text,
                        IsCorrect  = childModel.IsCorrect,
                        Question   = existingParent,
                        QuestionId = existingParent.QuestionId
                    };
                    existingParent.Answers.Add(newChild);
                }
            }
        }
コード例 #25
0
        public QuestionAnswerListViewModel BuildQuestionAnswerListViewModel(QuestionAnswers questionAnswers)
        {
            if (questionAnswers == null)
            {
                throw new ArgumentNullException("questionAnswers");
            }
            var questionAnswerViewModels = new List <QuestionAnswerViewModel>();

            foreach (var questionAnswer in questionAnswers.Items)
            {
                var questionAnswerViewModel = Mapper.DynamicMap <QuestionAnswer, QuestionAnswerViewModel>(questionAnswer);
                questionAnswerViewModel.Question           = questionAnswer.WorkflowQuestion.Question.Description;
                questionAnswerViewModel.StageDescription   = questionAnswer.WorkflowQuestion.WorkflowStage.Description;
                questionAnswerViewModel.Answer             = questionAnswer.QuestionOption.Option.Description.Contains("Single option") ? string.Empty : questionAnswer.QuestionOption.Option.Description;
                questionAnswerViewModel.FurtherInformation = questionAnswer.FurtherInformation ?? string.Empty;
                questionAnswerViewModels.Add(questionAnswerViewModel);
            }
            var viewModel = new QuestionAnswerListViewModel
            {
                Items = questionAnswerViewModels
            };

            return(viewModel);
        }
コード例 #26
0
        private void LoadQuestionsMatchNormalOrderByRankOrder(int OtherUserID)
        {
            try
            {
                int UserID = Convert.ToInt32(HttpContext.Current.User.Identity.Name);

                QuestionsMatch[] m_QuestionsMatch = new QuestionsMatch().GetQuestionsMatch(UserID, OtherUserID);

                m_QuestionsMatch = m_QuestionsMatch.Where(x => x.UserValue != "" && x.OtherUserValue != "" && x.IsAnsweredPrivately == false && x.QuestionCategory == 0).ToArray();

                QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>[] _Answers = new QuestionAnswers <OptionsSingleSelectAnswer, OptionsMultiSelectAnswer>().GetUserAnswers(OtherUserID);



                List <QuestionsMatch> lstQmatch = new List <QuestionsMatch>();;

                foreach (var _Answer in _Answers)
                {
                    QuestionsMatch _Match = new QuestionsMatch();
                    _Match = m_QuestionsMatch.Where(x => x.Question_id == _Answer.Question_id).SingleOrDefault();
                    //here QuestionType is rank order;
                    if (_Match != null)
                    {
                        if (!_Answer.AnsweredPrivately)
                        {
                            _Match.QuestionType = _Answer.RankOrder;
                            lstQmatch.Add(_Match);
                        }
                    }
                }

                var _OrderByRankOrder = lstQmatch.OrderBy(x => x.QuestionType);

                rptPhilosophyMatch.DataSource = _OrderByRankOrder;
                rptPhilosophyMatch.DataBind();
            }
            catch (Exception)
            {
            }
        }
コード例 #27
0
 public Question()
 {
     Answers = new QuestionAnswers();
 }
コード例 #28
0
 public void AddUsedQuestion(QuestionAnswers question)
 {
     _usedQuestions.Add(question);
 }
コード例 #29
0
 bool IsExistIsCorrectTrueAnswers()
 {
     return(QuestionAnswers.Any(q => q.IsCorrect == true));
 }
コード例 #30
0
 bool IsEmptyTextAnswers()
 {
     return(QuestionAnswers.Any(q => string.IsNullOrEmpty(q.Text)));
 }
コード例 #31
0
ファイル: ExamManager.cs プロジェクト: mudassary/OnlineExam
        //public static ExamManager Instance
        //{
        //    get 
        //    {
        //        if (_examManager == null)
        //            _examManager = new ExamManager();

        //        return _examManager;
        //    }
        //}

        void Initialize()
        {
            _questionBank = new List<QuestionOptions>();
            _questionAnswers = new List<QuestionAnswers>();

            Question question = new Question();

            question.ID = 1;
            question.Text = "Where are routes registered in ASP.NET MVC Application?";

            List<Option> options = new List<Option>();
            options.Add(new Option(){ID = 1, Text = "Controller" });
            options.Add(new Option(){ID = 2, Text = "Web.Config" });
            options.Add(new Option(){ID = 3, Text = "Global.asax" });
            options.Add(new Option(){ID = 4, Text = "All of the Above" });
            
            QuestionOptions questionOptions = new QuestionOptions();
            questionOptions.Question = question;
            questionOptions.Options = options;

            List<Option> answers = new List<Option>();
            answers.Add(new Option() { ID = 3, Text = "Global.asax" });

            QuestionAnswers questionAnswers = new QuestionAnswers();
            questionAnswers.Question = question;
            questionAnswers.Answers = answers;

            _questionBank.Add(questionOptions);
            _questionAnswers.Add(questionAnswers);


            question = new Question();

            question.ID = 2;
            question.Text = "What are digital signatures used for? (Choose all that apply.)";

            options = new List<Option>();
            options.Add(new Option() { ID = 1, Text = "Encryption" });
            options.Add(new Option() { ID = 2, Text = "Authorization" });
            options.Add(new Option() { ID = 3, Text = "Nonrepudiation" });
            options.Add(new Option() { ID = 4, Text = "Authentication" });

            questionOptions = new QuestionOptions();
            questionOptions.Question = question;
            questionOptions.Options = options;
            questionOptions.IsMultiChoice = true;

            answers = new List<Option>();
            answers.Add(new Option() { ID = 1, Text = "Encryption" });
            answers.Add(new Option() { ID = 2, Text = "Authorization" });
            answers.Add(new Option() { ID = 3, Text = "Nonrepudiation" });
            answers.Add(new Option() { ID = 4, Text = "Authentication" });

            questionAnswers = new QuestionAnswers();
            questionAnswers.Question = question;
            questionAnswers.Answers = answers;
            
            _questionBank.Add(questionOptions);
            _questionAnswers.Add(questionAnswers);


            question = new Question();

            question.ID = 3;
            question.Text = "You are creating an ASP.NET MVC 4 web application that will be accessed by a large number of traditional consumers. If you need to be able to access state information on the client side in JavaScript/jQuery, where can you store it? (Choose all that apply.)";

            options = new List<Option>();
            options.Add(new Option() { ID = 1, Text = "LocalStorage" });
            options.Add(new Option() { ID = 2, Text = "QueryString" });
            options.Add(new Option() { ID = 3, Text = "ViewState" });
            options.Add(new Option() { ID = 4, Text = "Cookies" });
            options.Add(new Option() { ID = 5, Text = "All of the Above" });

            questionOptions = new QuestionOptions();
            questionOptions.Question = question;
            questionOptions.Options = options;

            questionOptions.IsMultiChoice = true;

            answers = new List<Option>();
            answers.Add(new Option() { ID = 1, Text = "LocalStorage" });
            answers.Add(new Option() { ID = 4, Text = "Cookies" });

            questionAnswers = new QuestionAnswers();
            questionAnswers.Question = question;
            questionAnswers.Answers = answers;

            _questionBank.Add(questionOptions);
            _questionAnswers.Add(questionAnswers);

            question = new Question();

            question.ID = 4;
            question.Text = "Which of the following feature is a part of HTML 5?";

            options = new List<Option>();
            options.Add(new Option() { ID = 1, Text = "Canvas" });
            options.Add(new Option() { ID = 2, Text = "Audio And Video" });
            options.Add(new Option() { ID = 3, Text = "GeoLocation" });
            options.Add(new Option() { ID = 4, Text = "All of the Above" });

            questionOptions = new QuestionOptions();
            questionOptions.Question = question;
            questionOptions.Options = options;

            answers = new List<Option>();
            answers.Add(new Option() { ID = 4, Text = "All of the Above" });

            questionAnswers = new QuestionAnswers();
            questionAnswers.Question = question;
            questionAnswers.Answers = answers;

            _questionBank.Add(questionOptions);
            _questionAnswers.Add(questionAnswers);
            
            question = new Question();

            question.ID = 5;
            question.Text = "Which of the following browser supports HTML5 in its latest version?";

            options = new List<Option>();
            options.Add(new Option() { ID = 1, Text = "Mozilla Firefox" });
            options.Add(new Option() { ID = 2, Text = "Opera" });
            options.Add(new Option() { ID = 3, Text = "Both Of the Above" });
            options.Add(new Option() { ID = 4, Text = "None of the Above" });

            questionOptions = new QuestionOptions();
            questionOptions.Question = question;
            questionOptions.Options = options;

            answers = new List<Option>();
            answers.Add(new Option() { ID = 4, Text = "None of the Above" });

            questionAnswers = new QuestionAnswers();
            questionAnswers.Question = question;
            questionAnswers.Answers = answers;

            _questionBank.Add(questionOptions);
            _questionAnswers.Add(questionAnswers);
        }