@utilities.arguments_not_none<EOL><INDENT>def create_assessment_taken(self, assessment_taken_form):<DEDENT>
<EOL>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>if not isinstance(assessment_taken_form, ABCAssessmentTakenForm):<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>if assessment_taken_form.is_for_update():<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>if self._forms[assessment_taken_form.get_id().get_identifier()] == CREATED:<EOL><INDENT>raise errors.IllegalState('<STR_LIT>')<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>raise errors.Unsupported('<STR_LIT>')<EOL><DEDENT>if not assessment_taken_form.is_valid():<EOL><INDENT>raise errors.InvalidArgument('<STR_LIT>')<EOL><DEDENT>assessment_offered_id = Id(assessment_taken_form._my_map['<STR_LIT>'])<EOL>aols = AssessmentOfferedLookupSession(<EOL>catalog_id=None, runtime=self._runtime)<EOL>aols.use_federated_bank_view()<EOL>assessment_offered = aols.get_assessment_offered(assessment_offered_id)<EOL>try:<EOL><INDENT>if assessment_offered.has_max_attempts():<EOL><INDENT>max_attempts = assessment_offered.get_max_attempts()<EOL>num_takens = collection.find({'<STR_LIT>': [{'<STR_LIT>': str(assessment_offered.get_id())},<EOL>{'<STR_LIT>': str(self.get_effective_agent_id())},<EOL>{'<STR_LIT>' + self._catalog_name + '<STR_LIT>': {'<STR_LIT>': [str(self._catalog_id)]}}]}).count()<EOL>if num_takens >= max_attempts:<EOL><INDENT>raise errors.PermissionDenied('<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>assessment_taken_form._my_map['<STR_LIT>'] = str(self.get_effective_agent_id())<EOL>insert_result = collection.insert_one(assessment_taken_form._my_map)<EOL>self._forms[assessment_taken_form.get_id().get_identifier()] = CREATED<EOL>return objects.AssessmentTaken(<EOL>osid_object_map=collection.find_one({'<STR_LIT>': insert_result.inserted_id}),<EOL>runtime=self._runtime,<EOL>proxy=self._proxy)<EOL>
Creates a new ``AssessmentTaken``.

        arg:    assessment_taken_form
                (osid.assessment.AssessmentTakenForm): the form for this
                ``AssessmentTaken``
        return: (osid.assessment.AssessmentTaken) - the new
                ``AssessmentTaken``
        raise:  IllegalState - ``assessment_taken_form`` already used in
                a create transaction
        raise:  InvalidArgument - one or more of the form elements is
                invalid
        raise:  NullArgument - ``assessment_taken_form`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure occurred
        raise:  Unsupported - ``assessment_offered_form`` did not
                originate from
                ``get_assessment_taken_form_for_create()``
        *compliance: mandatory -- This method must be implemented.*