def _update_partitions(self, reload_items=True):
        """Update user partitions in the course descriptor, then reload the content. """
        update_verification_partitions(self.course.id)  # pylint: disable=no-member

        # Reload each component so we can see the changes
        if reload_items:
            self.course = self.store.get_course(self.course.id)  # pylint: disable=no-member
            self.sections = [self._reload_item(section.location) for section in self.sections]
            self.subsections = [self._reload_item(subsection.location) for subsection in self.subsections]
            self.verticals = [self._reload_item(vertical.location) for vertical in self.verticals]
            self.icrv = self._reload_item(self.icrv.location)
            self.sibling_problem = self._reload_item(self.sibling_problem.location)
    def _update_partitions(self, reload_items=True):
        """Update user partitions in the course descriptor, then reload the content. """
        update_verification_partitions(self.course.id)  # pylint: disable=no-member

        # Reload each component so we can see the changes
        if reload_items:
            self.course = self.store.get_course(self.course.id)  # pylint: disable=no-member
            self.sections = [self._reload_item(section.location) for section in self.sections]
            self.subsections = [self._reload_item(subsection.location) for subsection in self.subsections]
            self.verticals = [self._reload_item(vertical.location) for vertical in self.verticals]
            self.icrv = self._reload_item(self.icrv.location)
            self.sibling_problem = self._reload_item(self.sibling_problem.location)
Esempio n. 3
0
def on_pre_publish(sender, course_key, **kwargs):  # pylint: disable=unused-argument
    """
    Create user partitions for verification checkpoints.

    This is a pre-publish step since we need to write to the course descriptor.
    """
    from openedx.core.djangoapps.credit import api
    if api.is_credit_course(course_key):
        # For now, we are tagging content with in-course-reverification access groups
        # only in credit courses on publish.  In the long run, this is not where we want to put this.
        # This really should be a transformation on the course structure performed as a pre-processing
        # step by the LMS, and the transformation should be owned by the verify_student app.
        # Since none of that infrastructure currently exists, we're doing it this way instead.
        log.info(u"Starting to update in-course reverification access rules")
        update_verification_partitions(course_key)
        log.info(u"Finished updating in-course reverification access rules")
Esempio n. 4
0
def on_pre_publish(sender, course_key, **kwargs):  # pylint: disable=unused-argument
    """
    Create user partitions for verification checkpoints.

    This is a pre-publish step since we need to write to the course descriptor.
    """
    from openedx.core.djangoapps.credit import api
    if api.is_credit_course(course_key):
        # For now, we are tagging content with in-course-reverification access groups
        # only in credit courses on publish.  In the long run, this is not where we want to put this.
        # This really should be a transformation on the course structure performed as a pre-processing
        # step by the LMS, and the transformation should be owned by the verify_student app.
        # Since none of that infrastructure currently exists, we're doing it this way instead.
        log.info(u"Starting to update in-course reverification access rules")
        update_verification_partitions(course_key)
        log.info(u"Finished updating in-course reverification access rules")