Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public static bool GetTestSessions(List <TestSession> testSessionList, ref string error)
 {
     return(TestSessionDB.GetTestSessions(testSessionList, ref error));
 }