Esempio n. 1
0
    def test_team_multiple_registration1(self):

        self.get_test_client({"id": "student1", "api_key": "student1"})

        course = self.FIXTURE["courses"]["cmsc40100"]
        assignment1 = course["assignments"]["pa1"]
        assignment2 = course["assignments"]["pa2"]

        a1 = Assignment.from_id(course["id"], assignment1["id"])
        self.assertEquals(a1.name, assignment1["name"])

        a2 = Assignment.from_id(course["id"], assignment2["id"])
        self.assertEquals(a2.name, assignment2["name"])

        r1 = a1.register(partners=["student2"])
        r2 = a2.register(partners=["student2"])
Esempio n. 2
0
    def test_create_assignment(self):

        self.get_test_client({"id": "admin", "api_key": "admin"})

        assignment = Assignment(id="pa1",
                                name="Programming Assignment 1",
                                deadline="2042-01-21T20:00",
                                course_id="cmsc40100")
Esempio n. 3
0
def instructor_assignment_add(ctx, course, assignment_id, name, deadline):
    deadline = convert_datetime_to_utc(deadline)
    
    assignment = Assignment(id = assignment_id,
                            name = name,
                            deadline = deadline,
                            course_id = course.id)
    
    return CHISUBMIT_SUCCESS
Esempio n. 4
0
    def test_single_registration1(self):

        self.get_test_client({"id": "student1", "api_key": "student1"})

        course = self.FIXTURE["courses"]["cmsc40100"]
        assignment = course["assignments"]["pa1"]

        a = Assignment.from_id(course["id"], assignment["id"])
        self.assertEquals(a.name, assignment["name"])

        r = a.register(partners=["student2", "student3"])
Esempio n. 5
0
    def test_get_assignment(self):

        self.get_test_client({"id": "student1", "api_key": "student1"})

        assignment = Assignment.from_id("cmsc40100", "pa1")
Esempio n. 6
0
    def test_get_assignments(self):

        self.get_test_client({"id": "student1", "api_key": "student1"})

        assignments = Assignment.all("cmsc40100")
Esempio n. 7
0
 def get_assignment(self, assignment_id):
     return Assignment.from_id(self.id, assignment_id)
Esempio n. 8
0
 def get_assignment(self, assignment_id):
     return Assignment.from_id(self.id, assignment_id)