code stringlengths 1 18.2k |
|---|
def update_question(self, question_form): """Updates an existing question. arg: question_form (osid.assessment.QuestionForm): the form containing the elements to be updated raise: IllegalState - ``question_form`` already used in an update transaction raise: InvalidArgument - the form contains an invalid value raise: Nu... |
raise errors.InvalidArgument('one or more of the form elements is invalid') item_id = Id(question_form._my_map['itemId']).get_identifier() item = collection.find_one({'$and': [{'_id': ObjectId(item_id)}, {'assigned' + self._catalog_name + 'Ids': {'$in': [str(self._catalog_id)]}}]}) item['question'] = question_form._my_... |
def delete_question(self, question_id): """Deletes the ``Question`` identified by the given ``Id``. arg: question_id (osid.id.Id): the ``Id`` of the ``Question`` to delete raise: NotFound - a ``Question`` was not found identified by the given ``Id`` raise: NullArgument - ``question_id`` is ``null`` raise: OperationFail... |
def create_answer(self, answer_form): """Creates a new ``Answer``. arg: answer_form (osid.assessment.AnswerForm): the form for this ``Answer`` return: (osid.assessment.Answer) - the new ``Answer`` raise: IllegalState - ``answer_form`` already used in a create transaction raise: InvalidArgument - one or more of the form... |
used in a create transaction') except KeyError: raise errors.Unsupported('answer_form did not originate from this session') if not answer_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') answer_form._my_map['_id'] = ObjectId() item_id = Id(answer_form._my_map['itemId']).get_i... |
def update_answer(self, answer_form): """Updates an existing answer. arg: answer_form (osid.assessment.AnswerForm): the form containing the elements to be updated raise: IllegalState - ``answer_form`` already used in an update transaction raise: InvalidArgument - the form contains an invalid value raise: NullArgument -... |
except KeyError: raise errors.Unsupported('answer_form did not originate from this session') if not answer_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') item_id = Id(answer_form._my_map['itemId']).get_identifier() item = collection.find_one( {'$and': [{'_id': ObjectId(item... |
def delete_answer(self, answer_id): """Deletes the ``Answer`` identified by the given ``Id``. arg: answer_id (osid.id.Id): the ``Id`` of the ``Answer`` to delete raise: NotFound - an ``Answer`` was not found identified by the given ``Id`` raise: NullArgument - ``answer_id`` is ``null`` raise: OperationFailed - unable t... |
errors.OperationFailed() Answer( osid_object_map=answer_map, runtime=self._runtime, proxy=self._proxy)._delete() collection.save(item) |
def register_for_deleted_item(self, item_id): """Registers for notification of a deleted assessment item. ``ItemReceiver.deletedItems()`` is invoked when the specified assessment item is removed from the assessment bank. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` to monitor raise: NotFound - an ``Item`` was ... |
def get_item_ids_by_bank(self, bank_id): """Gets the list of ``Item`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related item ``Ids`` raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``bank_id`` is ``null`` raise: OperationFai... |
def get_items_by_bank(self, bank_id): """Gets the list of ``Items`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.ItemList) - list of related items raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``bank_id`` is ``null`` raise: OperationFailed - u... |
def get_item_ids_by_banks(self, bank_ids): """Gets the list of ``Item Ids`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable to complete request raise:... |
def get_items_by_banks(self, bank_ids): """Gets the list of ``Items`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.ItemList) - list of items raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable to complete request raise: Pe... |
def get_bank_ids_by_item(self, item_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``Item``. arg: item_id (osid.id.Id): ``Id`` of an ``Item`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``item_id`` is not found raise: NullArgument - ``item_id`` is ``null`` raise: OperationFailed - unable t... |
def get_banks_by_item(self, item_id): """Gets the list of ``Banks`` mapped to an ``Item``. arg: item_id (osid.id.Id): ``Id`` of an ``Item`` return: (osid.assessment.BankList) - list of banks raise: NotFound - ``item_id`` is not found raise: NullArgument - ``item_id`` is ``null`` raise: OperationFailed - unable to compl... |
def assign_item_to_bank(self, item_id, bank_id): """Adds an existing ``Item`` to a ``Bank``. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: AlreadyExists - ``item_id`` is already assigned to ``bank_id`` raise: NotFound - ``item_id`` or ``bank_id`` not ... |
def unassign_item_from_bank(self, item_id, bank_id): """Removes an ``Item`` from a ``Bank``. arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: NotFound - ``item_id`` or ``bank_id`` not found or ``item_id`` not assigned to ``bank_id`` raise: NullArgument -... |
def get_assessment(self, assessment_id): """Gets the ``Assessment`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``Assessment`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was assigned to a ``Assessment``... |
def get_assessments_by_ids(self, assessment_ids): """Gets an ``AssessmentList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assessments specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in the supplied list is... |
for # osid.resource.ResourceLookupSession.get_resources_by_ids # NOTE: This implementation currently ignores plenary view collection = JSONClientValidated('assessment', collection='Assessment', runtime=self._runtime) object_id_list = [] for i in assessment_ids: object_id_list.append(ObjectId(self._get_id(i, 'assessment... |
def get_assessments_by_genus_type(self, assessment_genus_type): """Gets an ``AssessmentList`` corresponding to the given assessment genus ``Type`` which does not include assessments of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assessments or an error results. Other... |
def get_assessments(self): """Gets all ``Assessments``. In plenary mode, the returned list contains all known assessments or an error results. Otherwise, the returned list may contain only those assessments that are accessible through this session. return: (osid.assessment.AssessmentList) - a list of ``Assessments`` ra... |
def get_assessments_by_query(self, assessment_query): """Gets a list of ``Assessments`` matching the given assessment query. arg: assessment_query (osid.assessment.AssessmentQuery): the assessment query return: (osid.assessment.AssessmentList) - the returned ``AssessmentList`` raise: NullArgument - ``assessment_query``... |
collection='AssessmentOffered', runtime=self._runtime) match = '$in' in assessment_query._query_terms['assessmentOfferedId'].keys() if match: match_identifiers = [ObjectId(Id(i).identifier) for i in assessment_query._query_terms['assessmentOfferedId']['$in']] query = {'$in': match_identifiers} else: match_identifiers =... |
[] # return objects.AssessmentList(result, runtime=self._runtime, proxy=self._proxy) and_list = list() or_list = list() for term in assessment_query._query_terms: if '$in' in assessment_query._query_terms[term] and '$nin' in assessment_query._query_terms[term]: and_list.append( {'$or': [{term: {'$in': assessment_query.... |
def get_assessment_form_for_create(self, assessment_record_types): """Gets the assessment form for creating new assessments. A new form should be requested for each create transaction. arg: assessment_record_types (osid.type.Type[]): array of assessment record types to be included in the create operation or an empty li... |
= objects.AssessmentForm( bank_id=self._catalog_id, record_types=assessment_record_types, runtime=self._runtime, effective_agent_id=self.get_effective_agent_id(), proxy=self._proxy) self._forms[obj_form.get_id().get_identifier()] = not CREATED return obj_form |
def create_assessment(self, assessment_form): """Creates a new ``Assessment``. arg: assessment_form (osid.assessment.AssessmentForm): the form for this ``Assessment`` return: (osid.assessment.Assessment) - the new ``Assessment`` raise: IllegalState - ``assessment_form`` already used in a create transaction raise: Inval... |
KeyError: raise errors.Unsupported('assessment_form did not originate from this session') if not assessment_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') insert_result = collection.insert_one(assessment_form._my_map) self._forms[assessment_form.get_id().get_identifier()] =... |
def update_assessment(self, assessment_form): """Updates an existing assessment. arg: assessment_form (osid.assessment.AssessmentForm): the form containing the elements to be updated raise: IllegalState - ``assessment_form`` already used in an update transaction raise: InvalidArgument - the form contains an invalid val... |
originate from this session') if not assessment_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') collection.save(assessment_form._my_map) self._forms[assessment_form.get_id().get_identifier()] = UPDATED # Note: this is out of spec. The OSIDs don't require an object to be retu... |
def delete_assessment(self, assessment_id): """Deletes an ``Assessment``. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` to remove raise: NotFound - ``assessment_id`` not found raise: NullArgument - ``assessment_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDen... |
if collection.find({'assessmentId': str(assessment_id)}).count() != 0: raise errors.IllegalState('there are still AssessmentsOffered associated with this Assessment') collection = JSONClientValidated('assessment', collection='Assessment', runtime=self._runtime) collection.delete_one({'_id': ObjectId(assessment_id.get_i... |
def alias_assessment(self, assessment_id, alias_id): """Adds an ``Id`` to an ``Assessment`` for the purpose of creating compatibility. The primary ``Id`` of the ``Assessment`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer to another assessment, it is reassign... |
def get_assessment_ids_by_bank(self, bank_id): """Gets the list of ``Assessment`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related assessment ``Ids`` raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``bank_id`` is ``null`` r... |
def get_assessments_by_bank(self, bank_id): """Gets the list of ``Assessments`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.AssessmentList) - list of related assessments raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``bank_id`` is ``null`` ra... |
def get_assessment_ids_by_banks(self, bank_ids): """Gets the list of ``Assessment Ids`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable to complete re... |
def get_assessments_by_banks(self, bank_ids): """Gets the list of ``Assessments`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.AssessmentList) - list of assessments raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable to co... |
def get_bank_ids_by_assessment(self, assessment_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``Assessment``. arg: assessment_id (osid.id.Id): ``Id`` of an ``Assessment`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``assessment_id`` is not found raise: NullArgument - ``assessment_id`` is ... |
def get_banks_by_assessment(self, assessment_id): """Gets the list of ``Banks`` mapped to an ``Assessment``. arg: assessment_id (osid.id.Id): ``Id`` of an ``Assessment`` return: (osid.assessment.BankList) - list of banks raise: NotFound - ``assessment_id`` is not found raise: NullArgument - ``assessment_id`` is ``null`... |
def assign_assessment_to_bank(self, assessment_id, bank_id): """Adds an existing ``Assessment`` to a ``Bank``. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: AlreadyExists - ``assessment_id`` is already assigned to ``bank_id`` raise: NotFou... |
def unassign_assessment_from_bank(self, assessment_id, bank_id): """Removes an ``Assessment`` from a ``Bank``. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: NotFound - ``assessment_id`` or ``bank_id`` not found or ``assessment_id`` not ass... |
def _get_first_part_id(self, assessment_id): """This session implemenation assumes all items are assigned to the first assessment part""" if assessment_id not in self._first_part_index: self._first_part_index[assessment_id] = get_first_part_id_for_assessment( assessment_id, runtime=self._runtime, proxy=self._proxy, cre... |
def get_items(self, assessment_id): """Gets the items in sequence from an assessment. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` return: (osid.assessment.ItemList) - list of items raise: NotFound - ``assessmentid`` not found raise: NullArgument - ``assessment_id`` is ``null`` raise: OperationFail... |
def add_item(self, assessment_id, item_id): """Adds an existing ``Item`` to an assessment. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` arg: item_id (osid.id.Id): the ``Id`` of the ``Item`` raise: NotFound - ``assessment_id`` or ``item_id`` not found raise: NullArgument - ``assessment_id`` or ``ite... |
def move_item(self, assessment_id, item_id, preceeding_item_id): """Moves an existing item to follow another item in an assessment. arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` arg: item_id (osid.id.Id): the ``Id`` of an ``Item`` arg: preceeding_item_id (osid.id.Id): the ``Id`` of a preceeding ``It... |
def order_items(self, item_ids, assessment_id): """Sequences existing items in an assessment. arg: item_ids (osid.id.Id[]): the ``Id`` of the ``Items`` arg: assessment_id (osid.id.Id): the ``Id`` of the ``Assessment`` raise: NotFound - ``assessment_id`` is not found or an ``item_id`` is not on ``assessment_id`` raise: ... |
def get_assessment_offered(self, assessment_offered_id): """Gets the ``AssessmentOffered`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``AssessmentOffered`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` wa... |
proxy=self._proxy) |
def get_assessments_offered_by_ids(self, assessment_offered_ids): """Gets an ``AssessmentOfferedList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assessments specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` ... |
template for # osid.resource.ResourceLookupSession.get_resources_by_ids # NOTE: This implementation currently ignores plenary view collection = JSONClientValidated('assessment', collection='AssessmentOffered', runtime=self._runtime) object_id_list = [] for i in assessment_offered_ids: object_id_list.append(ObjectId(sel... |
def get_assessments_offered_by_genus_type(self, assessment_offered_genus_type): """Gets an ``AssessmentOfferedList`` corresponding to the given assessment offered genus ``Type`` which does not include assessments of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assessm... |
objects.AssessmentOfferedList(result, runtime=self._runtime, proxy=self._proxy) |
def get_assessments_offered_for_assessment(self, assessment_id): """Gets an ``AssessmentOfferedList`` by the given assessment. In plenary mode, the returned list contains all known assessments offered or an error results. Otherwise, the returned list may contain only those assessments offered that are accessible throug... |
def get_assessments_offered(self): """Gets all ``AssessmentOffered`` elements. In plenary mode, the returned list contains all known assessments offered or an error results. Otherwise, the returned list may contain only those assessments offered that are accessible through this session. return: (osid.assessment.Assessm... |
def get_assessments_offered_by_query(self, assessment_offered_query): """Gets a list of ``AssessmentOffered`` elements matching the given assessment offered query. arg: assessment_offered_query (osid.assessment.AssessmentOfferedQuery): the assessment offered query return: (osid.assessment.AssessmentOfferedList) - the r... |
result = collection.find(query_terms).sort('_id', DESCENDING) else: result = [] return objects.AssessmentOfferedList(result, runtime=self._runtime, proxy=self._proxy) |
def create_assessment_offered(self, assessment_offered_form): """Creates a new ``AssessmentOffered``. arg: assessment_offered_form (osid.assessment.AssessmentOfferedForm): the form for this ``AssessmentOffered`` return: (osid.assessment.AssessmentOffered) - the new ``AssessmentOffered`` raise: IllegalState - ``assessme... |
KeyError: raise errors.Unsupported('assessment_offered_form did not originate from this session') if not assessment_offered_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') insert_result = collection.insert_one(assessment_offered_form._my_map) self._forms[assessment_offered_f... |
def update_assessment_offered(self, assessment_offered_form): """Updates an existing assessment offered. arg: assessment_offered_form (osid.assessment.AssessmentOfferedForm): the form containing the elements to be updated raise: IllegalState - ``assessment_offrered_form`` already used in an update transaction raise: In... |
not originate from this session') if not assessment_offered_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') collection.save(assessment_offered_form._my_map) self._forms[assessment_offered_form.get_id().get_identifier()] = UPDATED # Note: this is out of spec. The OSIDs don't ... |
def alias_assessment_offered(self, assessment_offered_id, alias_id): """Adds an ``Id`` to an ``AssessmentOffered`` for the purpose of creating compatibility. The primary ``Id`` of the ``AssessmentOffered`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer to anot... |
def get_assessment_offered_ids_by_bank(self, bank_id): """Gets the list of ``AssessmentOffered`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related assessment offered ``Ids`` raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``... |
def get_assessments_offered_by_bank(self, bank_id): """Gets the list of ``AssessmentOffereds`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.AssessmentOfferedList) - list of related assessments offered raise: NotFound - ``bank_id`` is not found raise: NullArgumen... |
def get_assessment_offered_ids_by_banks(self, bank_ids): """Gets the list of ``AssessmentOffered Ids`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable... |
def get_assessments_offered_by_banks(self, bank_ids): """Gets the list of ``AssessmentOffered`` objects corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.AssessmentOfferedList) - list of assessments offered raise: NullArgument - ``bank_ids`` is ``null`` ... |
def get_bank_ids_by_assessment_offered(self, assessment_offered_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentOffered``. arg: assessment_offered_id (osid.id.Id): ``Id`` of an ``AssessmentOffered`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``assessment_offered_id`` is not fou... |
def get_banks_by_assessment_offered(self, assessment_offered_id): """Gets the list of ``Banks`` mapped to an ``AssessmentOffered``. arg: assessment_offered_id (osid.id.Id): ``Id`` of an ``AssessmentOffered`` return: (osid.assessment.BankList) - list of banks raise: NotFound - ``assessment_offered_id`` is not found rais... |
def assign_assessment_offered_to_bank(self, assessment_offered_id, bank_id): """Adds an existing ``AssessmentOffered`` to a ``Bank``. arg: assessment_offered_id (osid.id.Id): the ``Id`` of the ``AssessmentOffered`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: AlreadyExists - ``assessment_offered_id`` is... |
def unassign_assessment_offered_from_bank(self, assessment_offered_id, bank_id): """Removes an ``AssessmentOffered`` from a ``Bank``. arg: assessment_offered_id (osid.id.Id): the ``Id`` of the ``AssessmentOffered`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: NotFound - ``assessment_offered_id`` or ``ba... |
def get_assessment_taken(self, assessment_taken_id): """Gets the ``AssessmentTaken`` specified by its ``Id``. In plenary mode, the exact ``Id`` is found or a ``NotFound`` results. Otherwise, the returned ``AssessmentTaken`` may have a different ``Id`` than requested, such as the case where a duplicate ``Id`` was assign... |
proxy=self._proxy) |
def get_assessments_taken_by_ids(self, assessment_taken_ids): """Gets an ``AssessmentTakenList`` corresponding to the given ``IdList``. In plenary mode, the returned list contains all of the assessments specified in the ``Id`` list, in the order of the list, including duplicates, or an error results if an ``Id`` in the... |
template for # osid.resource.ResourceLookupSession.get_resources_by_ids # NOTE: This implementation currently ignores plenary view collection = JSONClientValidated('assessment', collection='AssessmentTaken', runtime=self._runtime) object_id_list = [] for i in assessment_taken_ids: object_id_list.append(ObjectId(self._g... |
def get_assessments_taken_by_genus_type(self, assessment_taken_genus_type): """Gets an ``AssessmentTakenList`` corresponding to the given assessment taken genus ``Type`` which does not include assessments of types derived from the specified ``Type``. In plenary mode, the returned list contains all known assessments tak... |
objects.AssessmentTakenList(result, runtime=self._runtime, proxy=self._proxy) |
def get_assessments_taken_for_assessment(self, assessment_id): """Gets an ``AssessmentTakenList`` for the given assessment. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain only those assessments taken that are accessible through this ... |
def get_assessments_taken_for_assessment_offered(self, assessment_offered_id): """Gets an ``AssessmentTakenList`` by the given assessment offered. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain only those assessments taken that are a... |
def get_assessments_taken_for_taker_and_assessment_offered(self, resource_id, assessment_offered_id): """Gets an ``AssessmentTakenList`` for the given resource and assessment offered. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain on... |
> deadline: raise errors.PermissionDenied('you are passed the deadline for the offered') except errors.IllegalState: # no deadline set pass result = collection.find( dict({'assessmentOfferedId': str(assessment_offered_id), 'takingAgentId': str(resource_id)}, **self._view_filter())).sort('_id', DESCENDING) return object... |
def get_assessments_taken(self): """Gets all ``AssessmentTaken`` elements. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain only those assessments taken that are accessible through this session. return: (osid.assessment.AssessmentTaken... |
def get_assessments_taken_by_query(self, assessment_taken_query): """Gets a list of ``AssessmentTaken`` elements matching the given assessment taken query. arg: assessment_taken_query (osid.assessment.AssessmentTakenQuery): the assessment taken query return: (osid.assessment.AssessmentTakenList) - the returned ``Assess... |
result = collection.find(query_terms).sort('_id', DESCENDING) else: result = [] return objects.AssessmentTakenList(result, runtime=self._runtime, proxy=self._proxy) |
def get_assessment_taken_form_for_create(self, assessment_offered_id, assessment_taken_record_types): """Gets the assessment taken form for creating new assessments taken. A new form should be requested for each create transaction. arg: assessment_offered_id (osid.id.Id): the ``Id`` of the related ``AssessmentOffered``... |
isinstance(arg, ABCType): raise errors.InvalidArgument('one or more argument array elements is not a valid OSID Type') am = self._get_provider_manager('ASSESSMENT') aols = am.get_assessment_offered_lookup_session(proxy=self._proxy) aols.use_federated_bank_view() offered = aols.get_assessment_offered(assessment_offered_... |
def create_assessment_taken(self, assessment_taken_form): """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`` ... |
AssessmentTakenForm') if assessment_taken_form.is_for_update(): raise errors.InvalidArgument('the AssessmentForm is for update only, not create') try: if self._forms[assessment_taken_form.get_id().get_identifier()] == CREATED: raise errors.IllegalState('assessment_taken_form already used in a create transaction') excep... |
def update_assessment_taken(self, assessment_taken_form): """Updates an existing assessment taken. arg: assessment_taken_form (osid.assessment.AssessmentTakenForm): the form containing the elements to be updated raise: IllegalState - ``assessment_taken_form`` already used in an update transaction raise: InvalidArgument... |
not originate from this session') if not assessment_taken_form.is_valid(): raise errors.InvalidArgument('one or more of the form elements is invalid') collection.save(assessment_taken_form._my_map) self._forms[assessment_taken_form.get_id().get_identifier()] = UPDATED # Note: this is out of spec. The OSIDs don't requir... |
def delete_assessment_taken(self, assessment_taken_id): """Deletes an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` to remove raise: NotFound - ``assessment_taken_id`` not found raise: NullArgument - ``assessment_taken_id`` is ``null`` raise: OperationFailed - unable ... |
def alias_assessment_taken(self, assessment_taken_id, alias_id): """Adds an ``Id`` to an ``AssessmentTaken`` for the purpose of creating compatibility. The primary ``Id`` of the ``AssessmentTaken`` is determined by the provider. The new ``Id`` is an alias to the primary ``Id``. If the alias is a pointer to another asse... |
def get_assessment_taken_ids_by_bank(self, bank_id): """Gets the list of ``AssessmentTaken`` ``Ids`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.id.IdList) - list of related assessment taken ``Ids`` raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``bank_i... |
def get_assessments_taken_by_bank(self, bank_id): """Gets the list of ``AssessmentTakens`` associated with a ``Bank``. arg: bank_id (osid.id.Id): ``Id`` of the ``Bank`` return: (osid.assessment.AssessmentTakenList) - list of related assessments taken raise: NotFound - ``bank_id`` is not found raise: NullArgument - ``ba... |
def get_assessment_taken_ids_by_banks(self, bank_ids): """Gets the list of ``AssessmentTaken Ids`` corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NullArgument - ``bank_ids`` is ``null`` raise: OperationFailed - unable to ... |
def get_assessments_taken_by_banks(self, bank_ids): """Gets the list of ``AssessmentTaken`` objects corresponding to a list of ``Banks``. arg: bank_ids (osid.id.IdList): list of bank ``Ids`` return: (osid.assessment.AssessmentTakenList) - list of assessments taken raise: NullArgument - ``bank_ids`` is ``null`` raise: O... |
def get_bank_ids_by_assessment_taken(self, assessment_taken_id): """Gets the list of ``Bank`` ``Ids`` mapped to an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): ``Id`` of an ``AssessmentTaken`` return: (osid.id.IdList) - list of bank ``Ids`` raise: NotFound - ``assessment_taken_id`` is not found raise: Nu... |
def get_banks_by_assessment_taken(self, assessment_taken_id): """Gets the list of ``Banks`` mapped to an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): ``Id`` of an ``AssessmentTaken`` return: (osid.assessment.BankList) - list of banks raise: NotFound - ``assessment_taken_id`` is not found raise: NullArgum... |
def assign_assessment_taken_to_bank(self, assessment_taken_id, bank_id): """Adds an existing ``AssessmentTaken`` to a ``Bank``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: AlreadyExists - ``assessment_taken_id`` is already ass... |
def unassign_assessment_taken_from_bank(self, assessment_taken_id, bank_id): """Removes an ``AssessmentTaken`` from a ``Bank``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` arg: bank_id (osid.id.Id): the ``Id`` of the ``Bank`` raise: NotFound - ``assessment_taken_id`` or ``bank_id`` not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.