Beispiel #1
0
        public static int getCurrentSessionId(int testSessionID)
        {
            string             error        = "Could not return list of test sessions";
            List <TestSession> testSessions = new List <TestSession>();

            // Get sessionID recently written
            TestSessionDB.GetTestSessions(testSessions, ref error);
            testSessionID = testSessions[testSessions.Count - 1].intSessionID;
            return(testSessionID);
        }
Beispiel #2
0
        // Check to see if the user
        public static bool userTookTest(UserClass currentUser, ItemPair itemPair)
        {
            List <TestSession> currentTestSessions = new List <TestSession>();
            List <Test>        testList            = new List <Test>();
            bool   alreadyTookTest = false;
            int    itemID          = 0;
            string errorStuff      = "Error getting test sessions";

            // Get Test ID but needs item id first
            itemID = itemPair.Item1.ItemID;
            // Grab Existing Test Sessions
            TestSessionDB.GetTestSessions(currentTestSessions, ref errorStuff);
            // Get list of tests
            int testID = 1;

            foreach (var currentTestSession in currentTestSessions)
            {
                if (currentTestSession.intTestID == testID && currentTestSession.intUserID == currentUser.intUserID)
                {
                    alreadyTookTest = true;
                }
            }
            return(alreadyTookTest);
        }
Beispiel #3
0
 public static bool GetTestDate(List <TestSession> dateList, ref string error, int UserID, int TestID)
 {
     return(TestSessionDB.GetTestDate(dateList, ref error, UserID, TestID));
 }
Beispiel #4
0
 public static bool CreateSession(TestSession testsession)
 {
     return(TestSessionDB.CreateSession(testsession));
 }
Beispiel #5
0
 public static bool GetUserTests(List <Test> testList, ref string error, int TestID)
 {
     return(TestSessionDB.GetUserTests(testList, ref error, TestID));
 }
Beispiel #6
0
 public static bool GetTestSessions(List <TestSession> testSessionList, ref string error)
 {
     return(TestSessionDB.GetTestSessions(testSessionList, ref error));
 }