Exemplo n.º 1
0
    def objectives_for_assessment(self, user, student_id, subject_id = None):
        """The set of 'Objectives' that are visible to the 'User' for the purpose of assessing a given student.

        :param user: is the 'User' for whom the objectives are being collected.
        :param student_id: is the id of the 'User' who is being assessed.
        :param subject_id: is the id of the `Subject` that will be used to filter the set of `Objectives` returned.
        """
        q = Objective.assigned_objectives_q(user.id, student_id)
        q = self._filter_on_subject(q, subject_id)
        return q
Exemplo n.º 2
0
    def objectives_for_selection(self, user, subject_id = None):
        """The set of 'Objectives' that are visible to the 'User' is the set of system objectives and the objectives the
        user has some self assessment for.

        :param user: is the 'User' for whom the objectives are being collected.
        :param subject_id: is the id of the `Subject` that will be used to filter the set of `Objectives` returned.
        """

        q = Objective.query.union(
                    Objective.system_objectives_q(subject_id),
                    Objective.assigned_objectives_q(user.id, user.id)
        )
        q = self._filter_on_subject(q, subject_id)
        return q