private void GetAllQuestionBanks() { var AllQuestions = new Question_Bank(); AllQuestions.ExamID = ExamID; gvQuestionBank.DataSource = AllQuestions.SelectQuestionBankByExam(); gvQuestionBank.DataBind(); }
private void DeleteQuestionBank(int QuestionBankID) { var DeleteQuestionBank = new Question_Bank(); DeleteQuestionBank.QuestionBankID = QuestionBankID; DeleteQuestionBank.DeleteQuestionBank(); GetAllQuestionBanks(); }
private void InsertQuestionBank(int QuestionID) { var NewQuestionBank = new Question_Bank(); NewQuestionBank.ExamID = ExamID; NewQuestionBank.QuestionID = QuestionID; NewQuestionBank.InsertQuestionBank(); GetAllQuestionBanks(); }
public DataTable GetListOfQuestions(string strToken, int intExamID) { DataTable Result = new DataTable(); if (ValidAuth(strToken) == true) { var AllQuestions = new Question_Bank(); AllQuestions.ExamID = intExamID; Result = AllQuestions.SelectQuestionBankByExam(); } return(Result); }
public List <int> GetListOfQuestion(string strToken, int intExamID) { var AllQuestion = new Question_Bank(); List <int> QuestionIDs = new List <int>(); if (ValidAuth(strToken) == true) { AllQuestion.ExamID = intExamID; DataTable dtAllQuestions = new DataTable(); dtAllQuestions = AllQuestion.SelectQuestionBankByExam(); foreach (DataRow x in dtAllQuestions.Rows) { QuestionIDs.Add(Convert.ToInt32(x["fkQuestion_ID"])); } Exam CheckRandom = new Exam(); CheckRandom.ExamID = intExamID; CheckRandom.SelectExamByID(); if (CheckRandom.ExamQuestionsOrdered == true) { // Need to add way to order question bank //List<KeyValuePair<int,int>> QuestionsOrdered = new List<KeyValuePair<int,int>>(); //foreach (int l in QuestionIDs) //{ // Question CheckQuestion = new Question(); // CheckQuestion.QuestionID = l; // CheckQuestion.SelectQuestionByID(); // if(CheckQuestion.ord) //} } else { } } return(QuestionIDs); }