当前位置: 首页>>代码示例>>Python>>正文


Python PersistentCourseGrade.read方法代码示例

本文整理汇总了Python中lms.djangoapps.grades.models.PersistentCourseGrade.read方法的典型用法代码示例。如果您正苦于以下问题:Python PersistentCourseGrade.read方法的具体用法?Python PersistentCourseGrade.read怎么用?Python PersistentCourseGrade.read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在lms.djangoapps.grades.models.PersistentCourseGrade的用法示例。


在下文中一共展示了PersistentCourseGrade.read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_persistent_grades_not_enabled_on_course

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
 def test_persistent_grades_not_enabled_on_course(self, default_store, num_mongo_queries, num_sql_queries):
     with self.store.default_store(default_store):
         self.set_up_course(enable_persistent_grades=False)
         with check_mongo_calls(num_mongo_queries):
             with self.assertNumQueries(num_sql_queries):
                 self._apply_recalculate_subsection_grade()
         with self.assertRaises(PersistentCourseGrade.DoesNotExist):
             PersistentCourseGrade.read(self.user.id, self.course.id)
         self.assertEqual(len(PersistentSubsectionGrade.bulk_read_grades(self.user.id, self.course.id)), 0)
开发者ID:dehamzah,项目名称:edx-platform,代码行数:11,代码来源:test_tasks.py

示例2: _assert_grades_absent_for_courses

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
    def _assert_grades_absent_for_courses(self, course_keys, db_table=None):
        """
        Assert grades for given courses do not exist.
        """
        for course_key in course_keys:
            if db_table == "course" or db_table is None:
                with self.assertRaises(PersistentCourseGrade.DoesNotExist):
                    PersistentCourseGrade.read(self.user_ids[0], course_key)

            if db_table == "subsection" or db_table is None:
                for subsection_key in self.subsection_keys_by_course[course_key]:
                    with self.assertRaises(PersistentSubsectionGrade.DoesNotExist):
                        PersistentSubsectionGrade.read_grade(self.user_ids[0], subsection_key)
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:15,代码来源:test_reset_grades.py

示例3: test_persistent_grades_enabled_on_course

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
 def test_persistent_grades_enabled_on_course(self, default_store, num_mongo_queries, num_sql_queries):
     with self.store.default_store(default_store):
         self.set_up_course(enable_persistent_grades=True)
         with check_mongo_calls(num_mongo_queries):
             with self.assertNumQueries(num_sql_queries):
                 self._apply_recalculate_subsection_grade()
         self.assertIsNotNone(PersistentCourseGrade.read(self.user.id, self.course.id))
         self.assertGreater(len(PersistentSubsectionGrade.bulk_read_grades(self.user.id, self.course.id)), 0)
开发者ID:dehamzah,项目名称:edx-platform,代码行数:10,代码来源:test_tasks.py

示例4: test_create_and_read_grade

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
 def test_create_and_read_grade(self):
     created_grade = PersistentCourseGrade.update_or_create(**self.params)
     read_grade = PersistentCourseGrade.read(self.params["user_id"], self.params["course_id"])
     for param in self.params:
         if param == u'passed':
             continue  # passed/passed_timestamp takes special handling, and is tested separately
         self.assertEqual(self.params[param], getattr(created_grade, param))
     self.assertIsInstance(created_grade.passed_timestamp, datetime)
     self.assertEqual(created_grade, read_grade)
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:11,代码来源:test_models.py

示例5: _assert_grades_exist_for_courses

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
 def _assert_grades_exist_for_courses(self, course_keys, db_table=None):
     """
     Assert grades for given courses exist.
     """
     for course_key in course_keys:
         if db_table == "course" or db_table is None:
             self.assertIsNotNone(PersistentCourseGrade.read(self.user_ids[0], course_key))
         if db_table == "subsection" or db_table is None:
             for subsection_key in self.subsection_keys_by_course[course_key]:
                 self.assertIsNotNone(PersistentSubsectionGrade.read_grade(self.user_ids[0], subsection_key))
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:12,代码来源:test_reset_grades.py

示例6: test_grade_does_not_exist

# 需要导入模块: from lms.djangoapps.grades.models import PersistentCourseGrade [as 别名]
# 或者: from lms.djangoapps.grades.models.PersistentCourseGrade import read [as 别名]
 def test_grade_does_not_exist(self):
     with self.assertRaises(PersistentCourseGrade.DoesNotExist):
         PersistentCourseGrade.read(self.params["user_id"], self.params["course_id"])
开发者ID:Lektorium-LLC,项目名称:edx-platform,代码行数:5,代码来源:test_models.py


注:本文中的lms.djangoapps.grades.models.PersistentCourseGrade.read方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。