code stringlengths 1 18.2k |
|---|
def has_parent_gradebooks(self, gradebook_id): """Tests if the ``Gradebook`` has any parents. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if the gradebook has parents, ``false`` otherwise raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` is... |
def is_parent_of_gradebook(self, id_, gradebook_id): """Tests if an ``Id`` is a direct parent of a gradebook. arg: id (osid.id.Id): an ``Id`` arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if this ``id`` is a parent of ``gradebook_id,`` ``false`` otherwise raise: NotFound - ``gra... |
def get_parent_gradebook_ids(self, gradebook_id): """Gets the parent ``Ids`` of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (osid.id.IdList) - the parent ``Ids`` of the gradebook raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` is ``null``... |
def get_parent_gradebooks(self, gradebook_id): """Gets the parents of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (osid.grading.GradebookList) - the parents of the gradebook raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` is ``null`` rais... |
def is_ancestor_of_gradebook(self, id_, gradebook_id): """Tests if an ``Id`` is an ancestor of a gradebook. arg: id (osid.id.Id): an ``Id`` arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if this ``id`` is an ancestor of ``gradebook_id,`` ``false`` otherwise raise: NotFound - ``gr... |
def has_child_gradebooks(self, gradebook_id): """Tests if a gradebook has any children. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if the ``gradebook_id`` has children, ``false`` otherwise raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` ... |
def is_child_of_gradebook(self, id_, gradebook_id): """Tests if a gradebook is a direct child of another. arg: id (osid.id.Id): an ``Id`` arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if the ``id`` is a child of ``gradebook_id,`` ``false`` otherwise raise: NotFound - ``gradebook... |
def get_child_gradebook_ids(self, gradebook_id): """Gets the child ``Ids`` of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` to query return: (osid.id.IdList) - the children of the gradebook raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` is ``null`` raise: Operat... |
def get_child_gradebooks(self, gradebook_id): """Gets the children of the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` to query return: (osid.grading.GradebookList) - the children of the gradebook raise: NotFound - ``gradebook_id`` is not found raise: NullArgument - ``gradebook_id`` is ``null`` raise: Op... |
def is_descendant_of_gradebook(self, id_, gradebook_id): """Tests if an ``Id`` is a descendant of a gradebook. arg: id (osid.id.Id): an ``Id`` arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook return: (boolean) - ``true`` if the ``id`` is a descendant of the ``gradebook_id,`` ``false`` otherwise raise: NotFound... |
def get_gradebook_nodes(self, gradebook_id, ancestor_levels, descendant_levels, include_siblings): """Gets a portion of the hierarchy for the given gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include. A value of 0 returns no pa... |
osid.resource.BinHierarchySession.get_bin_nodes return objects.GradebookNode(self.get_gradebook_node_ids( gradebook_id=gradebook_id, ancestor_levels=ancestor_levels, descendant_levels=descendant_levels, include_siblings=include_siblings)._my_map, runtime=self._runtime, proxy=self._proxy) |
def add_root_gradebook(self, gradebook_id): """Adds a root gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook raise: AlreadyExists - ``gradebook_id`` is already in hierarchy raise: NotFound - ``gradebook_id`` not found raise: NullArgument - ``gradebook_id`` is ``null`` raise: OperationFailed - unable ... |
def remove_root_gradebook(self, gradebook_id): """Removes a root gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook raise: NotFound - ``gradebook_id`` is not a root raise: NullArgument - ``gradebook_id`` is ``null`` raise: OperationFailed - unable to complete request raise: PermissionDenied - authoriz... |
def add_child_gradebook(self, gradebook_id, child_id): """Adds a child to a gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook arg: child_id (osid.id.Id): the ``Id`` of the new child raise: AlreadyExists - ``gradebook_id`` is already a parent of ``child_id`` raise: NotFound - ``gradebook_id`` or ``chi... |
def remove_child_gradebook(self, gradebook_id, child_id): """Removes a child from a gradebook. arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook arg: child_id (osid.id.Id): the ``Id`` of the new child raise: NotFound - ``gradebook_id`` not a parent of ``child_id`` raise: NullArgument - ``gradebook_id`` or ``chi... |
def get_id(self): """override get_id to generate our "magic" id that encodes scaffolding information""" waypoint_index = 0 if 'waypointIndex' in self.my_osid_object._my_map: waypoint_index = self.my_osid_object._my_map['waypointIndex'] # NOTE that the order of the dict **must** match the order in generate_children() # ... |
def initialize(self, magic_identifier, assessment_section): """This method is to be called by a magic AssessmentPart lookup session. magic_identifier_part includes: parent_id = id string of the parent part that created this part level = how many levels deep objective_id = the Objective Id to for which to select an item... |
(perhaps it # was only set with a learningObjectiveId) self.my_osid_object._my_map['itemIds'] = [] |
def get_parts(self, parts=None, reference_level=0): """Recursively returns a depth-first list of all known magic parts""" if parts is None: parts = list() new_reference_level = reference_level else: self._level_in_section = self._level + reference_level new_reference_level = self._level_in_section parts.append(self.my_... |
def load_item_for_objective(self): """if this is the first time for this magic part, find an LO linked item""" mgr = self.my_osid_object._get_provider_manager('ASSESSMENT', local=True) if self.my_osid_object._my_map['itemBankId']: item_query_session = mgr.get_item_query_session_for_bank(Id(self.my_osid_object._my_map['... |
is wasteful collection = JSONClientValidated('assessment', collection='AssessmentSection', runtime=self.my_osid_object._runtime) results = collection.find({"assessmentTakenId": {"$in": taken_ids}}) for section in results: if 'questions' in section: seen_items += [question['itemId'] for question in section['questions']]... |
def has_magic_children(self): """checks if child parts are currently available for this part""" if self._child_parts is not None: # generate_children has already been called return bool(self._child_parts) if self._assessment_section is not None: if (self.my_osid_object._my_map['maxLevels'] is None or self.my_osid_objec... |
def get_child_ids(self): """gets the ids for the child parts""" if self.has_magic_children(): if self._child_parts is None: self.generate_children() child_ids = list() for part in self._child_parts: child_ids.append(part.get_id()) return IdList(child_ids, runtime=self.my_osid_object._runtime, proxy=self.my_osid_object.... |
def get_children(self): """return the current child parts of this assessment part""" if self.has_magic_children(): if self._child_parts is None: self.generate_children() return self._child_parts raise IllegalState() |
def get_item_ids(self): """get item ids associated with this assessment part""" if self.has_item_ids(): return IdList(self.my_osid_object._my_map['itemIds'], runtime=self.my_osid_object._runtime, proxy=self.my_osid_object._proxy) raise IllegalState() |
def get_scaffold_objective_ids(self): """Assumes that a scaffold objective id is available""" section = self._assessment_section item_id = self.get_my_item_id_from_section(section) return section.get_confused_learning_objective_ids(item_id) |
def get_my_item_id_from_section(self, section): """returns the first item associated with this magic Part Id in the Section""" for question_map in section._my_map['questions']: if question_map['assessmentPartId'] == str(self.get_id()): return section.get_question(question_map=question_map).get_id() raise IllegalState('... |
def delete(self): """need this because the JSONClientValidated cannot deal with the magic identifier""" magic_identifier = unquote(self.get_id().identifier) orig_identifier = magic_identifier.split('?')[0] collection = JSONClientValidated('assessment_authoring', collection='AssessmentPart', runtime=self.my_osid_object.... |
def get_assessment_part(self): """If there's an AssessmentSection ask it first for the part. This will take advantage of the fact that the AssessmentSection may have already cached the Part in question. """ if self._magic_parent_id is None: assessment_part_id = Id(self.my_osid_object._my_map['assessmentPartId']) else: ... |
def _init_map(self): """stub""" # super(ScaffoldDownAssessmentPartFormRecord, self)._init_map() self.my_osid_object_form._my_map['itemIds'] = \ [str(self._item_ids_metadata['default_id_values'][0])] self.my_osid_object_form._my_map['learningObjectiveIds'] = \ [str(self._learning_objective_ids_metadata['default_id_value... |
def get_item_ids_metadata(self): """get the metadata for item""" metadata = dict(self._item_ids_metadata) metadata.update({'existing_id_values': self.my_osid_object_form._my_map['itemIds']}) return Metadata(**metadata) |
def set_item_ids(self, item_ids): '''the target Item This can only be set if there is no learning objective set ''' if self.get_item_ids_metadata().is_read_only(): raise NoAccess() for item_id in item_ids: if not self.my_osid_object_form._is_valid_id(item_id): raise InvalidArgument() if self.my_osid_object_form._my_map... |
def get_learning_objective_ids_metadata(self): """get the metadata for learning objective""" metadata = dict(self._learning_objective_ids_metadata) metadata.update({'existing_id_values': self.my_osid_object_form._my_map['learningObjectiveIds'][0]}) return Metadata(**metadata) |
def set_learning_objective_ids(self, learning_objective_ids): """the learning objective to find related items for This can only be set if there are no items specifically set """ if self.get_learning_objective_ids_metadata().is_read_only(): raise NoAccess() for learning_objective_id in learning_objective_ids: if not sel... |
def get_max_levels_metadata(self): """get the metadata for max levels""" metadata = dict(self._max_levels_metadata) metadata.update({'existing_cardinal_values': self.my_osid_object_form._my_map['maxLevels']}) return Metadata(**metadata) |
def get_max_waypoint_items_metadata(self): """get the metadata for max waypoint items""" metadata = dict(self._max_waypoint_items_metadata) metadata.update({'existing_cardinal_values': self.my_osid_object_form._my_map['maxWaypointItems']}) return Metadata(**metadata) |
def set_max_waypoint_items(self, max_waypoint_items): """This determines how many waypoint items will be seen for a scaffolded wrong answer""" if self.get_max_waypoint_items_metadata().is_read_only(): raise NoAccess() if not self.my_osid_object_form._is_valid_cardinal(max_waypoint_items, self.get_max_waypoint_items_met... |
def get_waypoint_quota_metadata(self): """get the metadata for waypoint quota""" metadata = dict(self._waypoint_quota_metadata) metadata.update({'existing_cardinal_values': self.my_osid_object_form._my_map['waypointQuota']}) return Metadata(**metadata) |
def set_waypoint_quota(self, waypoint_quota): """how many waypoint questions need to be answered correctly""" if self.get_waypoint_quota_metadata().is_read_only(): raise NoAccess() if not self.my_osid_object_form._is_valid_cardinal(waypoint_quota, self.get_waypoint_quota_metadata()): raise InvalidArgument() self.my_osi... |
def get_item_bank_id_metadata(self): """get the metadata for item bank""" metadata = dict(self._item_bank_id_metadata) metadata.update({'existing_id_values': self.my_osid_object_form._my_map['itemBankId']}) return Metadata(**metadata) |
def set_item_bank_id(self, bank_id): """the assessment bank in which to search for items, such as related to an objective""" if self.get_item_bank_id_metadata().is_read_only(): raise NoAccess() if not self.my_osid_object_form._is_valid_id(bank_id): raise InvalidArgument() self.my_osid_object_form._my_map['itemBankId'] ... |
def get_allow_repeat_items_metadata(self): """get the metadata for allow repeat items""" metadata = dict(self._allow_repeat_items_metadata) metadata.update({'existing_id_values': self.my_osid_object_form._my_map['allowRepeatItems']}) return Metadata(**metadata) |
def set_allow_repeat_items(self, allow_repeat_items): """determines if repeat items will be shown, or if the scaffold iteration will simply stop""" if self.get_allow_repeat_items_metadata().is_read_only(): raise NoAccess() if not self.my_osid_object_form._is_valid_boolean(allow_repeat_items): raise InvalidArgument() se... |
def clear_allow_repeat_items(self): """reset allow repeat itmes to default value""" if (self.get_allow_repeat_items_metadata().is_read_only() or self.get_allow_repeat_items_metadata().is_required()): raise NoAccess() self.my_osid_object_form._my_map['allowRepeatItems'] = \ bool(self._allow_repeat_items_metadata['defaul... |
def get_objective_bank(self): """Gets the ObjectiveBank associated with this session. return: (osid.learning.ObjectiveBank) - the ObjectiveBank associated with this session raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure compliance: mandatory - This method must be imp... |
def can_lookup_objectives(self): """Tests if this user can perform Objective lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to... |
def get_objective(self, objective_id=None): """Gets the Objective specified by its Id. In plenary mode, the exact Id is found or a NotFound results. Otherwise, the returned Objective may have a different Id than requested, such as the case where a duplicate Id was assigned to an Objective and retained for compatibility... |
def get_objectives_by_ids(self, objective_ids=None): """Gets an ObjectiveList corresponding to the given IdList. In plenary mode, the returned list contains all of the objectives 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 not found or i... |
raise NullArgument() url_path = construct_url('objectives_by_ids', obj_ids=objective_ids) objectives = self._get_request(url_path) # for i in objective_ids: # objective = None # url_path = construct_url('objectives', # obj_id=i) # try: # objective = self._get_request(url_path) # except (NotFound, OperationFailed): # if... |
def get_objectives_by_genus_type(self, objective_genus_type=None): """Gets an ObjectiveList corresponding to the given objective genus Type which does not include objectives of genus types derived from the specified Type. In plenary mode, the returned list contains all known objectives or an error results. Otherwise, t... |
def get_objectives_by_query(self, objective_query=None): """Gets a list of Objectives matching the given objective query. arg: objectiveQuery (osid.learning.ObjectiveQuery): the objective query return: (osid.learning.ObjectiveList) - the returned ObjectiveList raise: NullArgument - objectiveQuery is null raise: Operati... |
def _record_extension(self, objective_id, key, value): """ To structure a record extension property bean """ record_bean = { 'value': value, 'displayName': self._text_bean(key), 'description': self._text_bean(key), 'displayLabel': self._text_bean(key), 'associatedId': str(objective_id) } return record_bean |
def can_create_objectives(self): """Tests if this user can create Objectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Objective will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer create ... |
def get_objective_form_for_create(self, objective_record_types=None): """Gets the objective form for creating new objectives. A new form should be requested for each create transaction. arg: objectiveRecordTypes (osid.type.Type): array of objective record types return: (osid.learning.ObjectiveForm) - the objective form... |
def create_objective(self, objective_form=None): """Creates a new Objective. arg: objectiveForm (osid.learning.ObjectiveForm): the form for this Objective return: (osid.learning.Objective) - the new Objective raise: IllegalState - objectiveForm already used in a create transaction raise: InvalidArgument - one or more o... |
session') if not objective_form.is_valid(): raise InvalidArgument('one or more of the form elements is invalid') url_path = construct_url('objectives', bank_id=self._catalog_idstr) try: result = self._post_request(url_path, objective_form._my_map) except Exception: raise # OperationFailed self._forms[objective_form.get... |
def get_objective_form_for_update(self, objective_id=None): """Gets the objective form for updating an existing objective. A new objective form should be requested for each update transaction. arg: objectiveId (osid.id.Id): the Id of the Objective return: (osid.learning.ObjectiveForm) - the objective form raise: NotFou... |
def can_delete_objectives(self): """Tests if this user can delete Objectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Objective will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer delete ... |
def delete_objective(self, objective_id=None): """Deletes the Objective identified by the given Id. arg: objectiveId (osid.id.Id): the Id of the Objective to delete raise: NotFound - an Objective was not found identified by the given Id raise: NullArgument - objectiveId is null raise: OperationFailed - unable to comple... |
def can_access_objective_hierarchy(self): """Tests if this user can perform hierarchy queries. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an an application that ma... |
def get_root_objective_ids(self): """Gets the root objective Ids in this hierarchy. return: (osid.id.IdList) - the root objective Ids raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure compliance: mandatory - This method must be implemented. """ url_path = construct_url(... |
def get_root_objectives(self): """Gets the root objective in this objective hierarchy. return: (osid.learning.ObjectiveList) - the root objective raise: OperationFailed - unable to complete request raise: PermissionDenied - authorization failure compliance: mandatory - This method is must be implemented. """ url_path =... |
def is_parent_of_objective(self, id_=None, objective_id=None): """Tests if an Id is a direct parent of an objective. arg: id (osid.id.Id): an Id arg: objective_id (osid.id.Id): the Id of an objective return: (boolean) - true if this id is a parent of objective_id, false otherwise raise: NotFound - objective_id is not f... |
def is_child_of_objective(self, id_=None, objective_id=None): """Tests if an objective is a direct child of another. arg: id (osid.id.Id): an Id arg: objective_id (osid.id.Id): the Id of an objective return: (boolean) - true if the id is a child of objective_id, false otherwise raise: NotFound - objective_id is not fou... |
def get_child_objective_ids(self, objective_id=None): """Gets the child Ids of the given objective. arg: objective_id (osid.id.Id): the Id to query return: (osid.id.IdList) - the children of the objective raise: NotFound - objective_id is not found raise: NullArgument - objective_id is null raise: OperationFailed - una... |
def get_child_objectives(self, objective_id=None): """Gets the children of the given objective. arg: objective_id (osid.id.Id): the Id to query return: (osid.learning.ObjectiveList) - the children of the objective raise: NotFound - objective_id is not found raise: NullArgument - objective_id is null raise: OperationFai... |
def get_objective_nodes(self, objective_id=None, ancestor_levels=None, descendant_levels=None, include_siblings=None): """Gets a portion of the hierarchy for the given objective. arg: objective_id (osid.id.Id): the Id to query arg: ancestor_levels (cardinal): the maximum number of ancestor levels to include. A value of... |
bank_id=self._catalog_idstr, descendents=descendant_levels) return self._get_request(url_path) else: raise Unimplemented() |
def can_modify_objective_hierarchy(self): """Tests if this user can change the hierarchy. A return of true does not guarantee successful authorization. A return of false indicates that it is known performing any update will result in a PermissionDenied. This is intended as a hint to an application that may opt not to o... |
def add_child_objective(self, objective_id=None, child_id=None): """Adds a child to an objective. arg: objective_id (osid.id.Id): the Id of an objective arg: child_id (osid.id.Id): the Id of the new child raise: AlreadyExists - objective_id is already a parent of child_id raise: NotFound - objective_id or child_id not ... |
def remove_child_objectives(self, objective_id=None): """Removes all children from an objective. arg: objective_id (osid.id.Id): the Id of an objective raise: NotFound - objective_id not found raise: NullArgument - objective_id is null raise: OperationFailed - unable to complete request raise: PermissionDenied - author... |
def can_sequence_objectives(self): """Tests if this user can sequence objectives. A return of true does not guarantee successful authorization. A return of false indicates that it is known performing any update will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer the... |
def move_objective_behind(self, parent_objective_id=None, reference_objective_id=None, objective_id=None): """Moves an objective behind a refrence objective under the given parent. arg: parent_objective_id (osid.id.Id): the Id of the parent objective arg: reference_objective_id (osid.id.Id): the Id of the objective arg... |
identified is not the parent of one or both of the other objectives') ids_arg = {'ids': []} for ident in ohs.get_child_objective_ids(parent_objective_id): ids_arg['ids'].append(str(ident)) if objective_id != reference_objective_id: ids_arg['ids'].remove(str(objective_id)) index = ids_arg['ids'].index(str(reference_obje... |
def can_lookup_objective_prerequisites(self): """Tests if this user can perform Objective lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that m... |
def get_all_requisite_objectives(self, objective_id=None): """Gets a list of Objectives that are the requisites for the given Objective including the requistes of the requisites, and so on. In plenary mode, the returned list contains all of the immediate requisites, or an error results if an Objective is not found or i... |
# getting all requisites directly requisites = list() requisite_ids = list() all_requisites = self._get_requisites_recursively(objective_id, requisites, requisite_ids) return objects.ObjectiveList(all_requisites) |
def is_objective_required(self, objective_id=None, required_objective_id=None): """Tests if an objective is required before proceeding with an objective. arg: objective_id (osid.id.Id): Id of the dependent Objective arg: required_objective_id (osid.id.Id): Id of the required Objective return: (boolean) - true if object... |
def can_assign_requisites(self): """Tests if this user can manage objective requisites. A return of true does not guarantee successful authorization. A return of false indicates that it is known mapping methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt ... |
def assign_objective_requisite(self, objective_id=None, requisite_objective_id=None): """Creates a requirement dependency between two Objectives. arg: objective_id (osid.id.Id): the Id of the dependent Objective arg: requisite_objective_id (osid.id.Id): the Id of the required Objective raise: AlreadyExists - objective_... |
def assign_objective_requisites(self, objective_id=None, requisite_objective_ids=None): """Creates a requirement dependency between Objective + a list of objectives. NON-standard method impl by cjshaw arg: objective_id (osid.id.Id): the Id of the dependent Objective arg: requisite_objective_id (osid.id.Id): the Id of t... |
def can_lookup_activities(self): """Tests if this user can perform Activity lookups. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in a PermissionDenied. This is intended as a hint to an application that may opt not to ... |
def get_activity(self, activity_id=None): """Gets the Activity specified by its Id. In plenary mode, the exact Id is found or a NotFound results. Otherwise, the returned Activity may have a different Id than requested, such as the case where a duplicate Id was assigned to a Activity and retained for compatibility. arg:... |
def get_activities_by_ids(self, activity_ids=None): """Gets an ActivityList corresponding to the given IdList. In plenary mode, the returned list contains all of the activities 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 not found or ina... |
raise NullArgument() activities = [] for i in activity_ids: activity = None url_path = construct_url('activities', bank_id=self._catalog_idstr, act_id=i) try: activity = self._get_request(url_path) except (NotFound, OperationFailed): if self._activity_view == PLENARY: raise else: pass if activity: if not (self._activit... |
def get_activities_by_genus_type(self, activity_genus_type=None): """Gets an ActivityList corresponding to the given activity genus Type which does not include activities of genus types derived from the specified Type. In plenary mode, the returned list contains all known activities or an error results. Otherwise, the ... |
def get_activities_for_objective(self, objective_id=None): """Gets the activities for the given objective. In plenary mode, the returned list contains all of the activities mapped to the objective Id or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible Activities may b... |
obj_id=objective_id) return objects.ActivityList(self._get_request(url_path)) |
def get_activities_for_objectives(self, objective_ids=None): """Gets the activities for the given objectives. In plenary mode, the returned list contains all of the activities specified in the objective Id list, in the order of the list, including duplicates, or an error results if a course offering Id in the supplied ... |
NullArgument() # Should also check if objective_id exists? activities = [] for i in objective_ids: acts = None url_path = construct_url('activities', bank_id=self._catalog_idstr, obj_id=i) try: acts = json.loads(self._get_request(url_path)) except (NotFound, OperationFailed): if self._activity_view == PLENARY: raise el... |
def get_activities(self): """Gets all Activities. In plenary mode, the returned list contains all known activites or an error results. Otherwise, the returned list may contain only those activities that are accessible through this session. return: (osid.learning.ActivityList) - a ActivityList raise: OperationFailed - u... |
def get_activities_by_query(self, activity_query=None): """Gets a list of Activities matching the given activity query. arg: activityQuery (osid.learning.ActivityQuery): the activity query return: (osid.learning.ActivityList) - the returned ActivityList raise: NullArgument - activityQuery is null raise: OperationFailed... |
def can_create_activities(self): """Tests if this user can create Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating an Activity will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer create o... |
def get_activity_form_for_create(self, objective_id=None, activity_record_types=None): """Gets the activity form for creating new activities. A new form should be requested for each create transaction. arg: activityRecordTypes (osid.type.Type): array of activity record types return: (osid.learning.ActivityForm) - the a... |
def can_update_activities(self): """Tests if this user can update Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating an Activity will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer update o... |
def get_activity_form_for_update(self, activity_id=None): """Gets the activity form for updating an existing activity. A new activity form should be requested for each update transaction. arg: activityId (osid.id.Id): the Id of the Activity return: (osid.learning.ActivityForm) - the activity form raise: NotFound - acti... |
def update_activity(self, activity_form=None): """Updates an existing activity,. arg: activityForm (osid.learning.ActivityForm): the form containing the elements to be updated raise: IllegalState - activityForm already used in an update transaction raise: InvalidArgument - the form contains an invalid value raise: Null... |
InvalidArgument('one or more of the form elements is invalid') url_path = construct_url('activities', bank_id=self._catalog_idstr) try: result = self._put_request(url_path, activity_form._my_map) except Exception: raise # OperationFailed self._forms[activity_form.get_id().get_identifier()] = UPDATED return objects.Acti... |
def can_delete_activities(self): """Tests if this user can delete Activities. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting an Activity will result in a PermissionDenied. This is intended as a hint to an application that may opt not to offer delete o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.