def setUp(self):
        super(ComPAIRLearningRecordTestCase, self).setUp()
        self.data = BasicTestData()
        self.user = self.data.authorized_student
        self.setup_session_data(self.user)


        self.expected_caliper_object = {
            "id": 'https://localhost:8888',
            "type": "SoftwareApplication",
            "name": "ComPAIR",
            "description": "The ComPAIR learning application pairs student answers for deeper learning through comparison of peer work.",
            "version": self.app.config.get("COMPAIR_VERSION")
        }
        self.expected_xapi_object = {
            'id': 'https://localhost:8888',
            'objectType': 'Activity',
            'definition': {
                'type': 'http://activitystrea.ms/schema/1.0/service',
                'name': {'en-US': 'ComPAIR'},
                'extensions': {
                    'http://id.tincanapi.com/extension/version': self.app.config.get("COMPAIR_VERSION")
                }
            }
        }
示例#2
0
    def setUp(self):
        super(ComPAIRLearningRecordTestCase, self).setUp()
        self.data = BasicTestData()
        self.lti_data = LTITestData()
        self.user = self.data.authorized_student
        self.setup_session_data(self.user)
        self.course = self.data.main_course
        self.lti_context = self.lti_data.create_context(
            self.lti_data.lti_consumer,
            compair_course_id=self.course.id,
            lis_course_offering_sourcedid="sis_course_id",
            lis_course_section_sourcedid="sis_section_id",
        )

        self.expected_caliper_course = {
            'academicSession': self.course.term,
            'dateCreated': self.course.created.replace(tzinfo=pytz.utc).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
            'dateModified': self.course.modified.replace(tzinfo=pytz.utc).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
            'id': "https://localhost:8888/app/course/"+self.course.uuid,
            'name': self.course.name,
            'type': 'CourseOffering',
            'otherIdentifiers': [{
                'identifier': self.lti_context.context_id,
                'identifierType': 'LtiContextId',
                'type': 'SystemIdentifier',
                'extensions': {
                    'lis_course_offering_sourcedid': 'sis_course_id',
                    'lis_course_section_sourcedid': 'sis_section_id',
                    'oauth_consumer_key': self.lti_data.lti_consumer.oauth_consumer_key,
                },
            }]
        }

        self.expected_xapi_course = {
            'id': "https://localhost:8888/app/course/"+self.course.uuid,
            'definition': {
                'type': 'http://adlnet.gov/expapi/activities/course',
                'name': {'en-US': self.course.name}
            },
            'objectType': 'Activity'
        }
示例#3
0
    def setUp(self):
        super(ComPAIRLearningRecordTestCase, self).setUp()
        self.data = BasicTestData()
        self.user = self.data.authorized_student
        self.setup_session_data(self.user)
        self.criterion = self.data.create_criterion(self.user)

        self.expected_caliper_criterion = {
            'dateCreated':
            self.criterion.created.replace(
                tzinfo=pytz.utc).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
            'dateModified':
            self.criterion.modified.replace(
                tzinfo=pytz.utc).strftime('%Y-%m-%dT%H:%M:%S.%f')[:-3] + 'Z',
            'id':
            "https://localhost:8888/app/criterion/" + self.criterion.uuid,
            'name':
            self.criterion.name,
            'description':
            self.criterion.description,
            'type':
            'DigitalResource'
        }

        self.expected_xapi_criterion = {
            'id':
            "https://localhost:8888/app/criterion/" + self.criterion.uuid,
            'definition': {
                'type': 'http://adlnet.gov/expapi/activities/question',
                'name': {
                    'en-US': self.criterion.name
                },
                'description': {
                    'en-US': self.criterion.description
                }
            },
            'objectType': 'Activity'
        }
示例#4
0
 def setUp(self):
     super(CoursesAPITests, self).setUp()
     self.data = BasicTestData()
示例#5
0
 def setUp(self):
     super(ComPAIRLearningRecordTestCase, self).setUp()
     self.data = BasicTestData()
     self.user = self.data.authorized_student
     self.setup_session_data(self.user)
示例#6
0
 def setUp(self):
     super(ComPAIRXAPITestCase, self).setUp()
     self.data = BasicTestData()
     self.user = self.data.authorized_student
     self.course = self.data.main_course
示例#7
0
 def setUp(self):
     super(ComPAIRXAPITestCase, self).setUp()
     self.data = BasicTestData()
     self.user = self.data.authorized_student
     self.criterion = self.data.create_criterion(self.user)
示例#8
0
 def setUp(self):
     super(LTIConsumersAPITests, self).setUp()
     self.data = BasicTestData()
     self.lti_data = LTITestData()
示例#9
0
    def setUp(self):
        super(ComPAIRLearningRecordTestCase, self).setUp()
        self.data = BasicTestData()
        self.lti_data = LTITestData()
        self.user = self.data.authorized_student
        self.setup_session_data(self.user)
        self.course = self.data.main_course
        self.lti_context = self.lti_data.create_context(
            self.lti_data.lti_consumer,
            compair_course_id=self.course.id,
            lis_course_offering_sourcedid="sis_course_id",
            lis_course_section_sourcedid="sis_section_id",
        )

        self.expected_caliper_course = {
            'academicSession':
            self.course.term,
            'dateCreated':
            self.course.created.replace(tzinfo=pytz.utc).isoformat(),
            'dateModified':
            self.course.modified.replace(tzinfo=pytz.utc).isoformat(),
            'id':
            "https://localhost:8888/app/course/" + self.course.uuid,
            'name':
            self.course.name,
            'type':
            'CourseOffering',
            'extensions': {
                'ltiContexts': [{
                    'context_id':
                    self.lti_context.context_id,
                    'oauth_consumer_key':
                    self.lti_data.lti_consumer.oauth_consumer_key,
                    'lis_course_offering_sourcedid':
                    "sis_course_id",
                    'lis_course_section_sourcedid':
                    "sis_section_id",
                }]
            }
        }

        self.expected_xapi_course = {
            'id': "https://localhost:8888/app/course/" + self.course.uuid,
            'definition': {
                'type': 'http://adlnet.gov/expapi/activities/course',
                'name': {
                    'en-US': self.course.name
                }
            },
            'objectType': 'Activity'
        }

        self.expected_xapi_sis_course = {
            'id': 'https://localhost:8888/course/' +
            self.lti_context.lis_course_offering_sourcedid,
            'objectType': 'Activity'
        }

        self.expected_xapi_sis_section = {
            'id':
            'https://localhost:8888/course/' +
            self.lti_context.lis_course_offering_sourcedid + '/section/' +
            self.lti_context.lis_course_section_sourcedid,
            'objectType':
            'Activity'
        }
示例#10
0
 def setUp(self):
     super(UsersAPITests, self).setUp()
     self.data = BasicTestData()
示例#11
0
 def setUp(self):
     super(ClassListAPITest, self).setUp()
     self.data = BasicTestData()
     self.url = "/api/courses/" + self.data.get_course().uuid + "/users"