@utilities.arguments_not_none<EOL><INDENT>def add_item(self, item_id, assessment_part_id):<DEDENT>
<EOL>from dlkit.abstract_osid.id.primitives import Id as ABCId<EOL>if not isinstance(item_id, ABCId):<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>if (not isinstance(assessment_part_id, ABCId) and<EOL>assessment_part_id.get_identifier_namespace() != '<STR_LIT>'):<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>if item_id.get_identifier_namespace() != '<STR_LIT>':<EOL><INDENT>if item_id.get_authority() != self._authority:<EOL><INDENT>raise errors.InvalidArgument()<EOL><DEDENT>else:<EOL><INDENT>mgr = self._get_provider_manager('<STR_LIT>')<EOL>admin_session = mgr.get_item_admin_session_for_bank(self._catalog_id, proxy=self._proxy)<EOL>item_id = admin_session._get_item_id_with_enclosure(item_id)<EOL><DEDENT><DEDENT>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>item = collection.find_one({'<STR_LIT>': ObjectId(item_id.get_identifier())})<EOL>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>assessment_part = collection.find_one({'<STR_LIT>': ObjectId(assessment_part_id.get_identifier())})<EOL>if '<STR_LIT>' in assessment_part:<EOL><INDENT>if str(item_id) not in assessment_part['<STR_LIT>']:<EOL><INDENT>assessment_part['<STR_LIT>'].append(str(item_id))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>assessment_part['<STR_LIT>'] = [str(item_id)]<EOL><DEDENT>collection.save(assessment_part)<EOL>
Appends an item to an assessment part.

        arg:    item_id (osid.id.Id): ``Id`` of the ``Item``
        arg:    assessment_part_id (osid.id.Id): ``Id`` of the
                ``AssessmentPart``
        raise:  AlreadyExists - ``item_id`` already part of
                ``assessment_part_id``
        raise:  NotFound - ``item_id`` or ``assessment_part_id`` not
                found
        raise:  NullArgument - ``item_id`` or ``assessment_part_id`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization fauilure
        *compliance: mandatory -- This method must be implemented.*