def load_item_for_objective(self):
mgr = self.my_osid_object._get_provider_manager('<STR_LIT>', local=True)<EOL>if self.my_osid_object._my_map['<STR_LIT>']:<EOL><INDENT>item_query_session = mgr.get_item_query_session_for_bank(Id(self.my_osid_object._my_map['<STR_LIT>']),<EOL>proxy=self.my_osid_object._proxy)<EOL><DEDENT>else:<EOL><INDENT>item_query_session = mgr.get_item_query_session(proxy=self.my_osid_object._proxy)<EOL><DEDENT>item_query_session.use_federated_bank_view()<EOL>item_query = item_query_session.get_item_query()<EOL>for objective_id_str in self.my_osid_object._my_map['<STR_LIT>']:<EOL><INDENT>item_query.match_learning_objective_id(Id(objective_id_str), True)<EOL><DEDENT>item_list = list(item_query_session.get_items_by_query(item_query))<EOL>taking_agent_id = self._assessment_section._assessment_taken.taking_agent_id<EOL>atqs = mgr.get_assessment_taken_query_session(proxy=self.my_osid_object._proxy)<EOL>atqs.use_federated_bank_view()<EOL>querier = atqs.get_assessment_taken_query()<EOL>querier.match_taking_agent_id(taking_agent_id, match=True)<EOL>seen_items = [item_id for item_id in self._assessment_section._item_id_list]<EOL>taken_ids = [str(t.ident)<EOL>for t in atqs.get_assessments_taken_by_query(querier)]<EOL>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self.my_osid_object._runtime)<EOL>results = collection.find({"<STR_LIT>": {"<STR_LIT>": taken_ids}})<EOL>for section in results:<EOL><INDENT>if '<STR_LIT>' in section:<EOL><INDENT>seen_items += [question['<STR_LIT>'] for question in section['<STR_LIT>']]<EOL><DEDENT><DEDENT>unseen_item_id = None<EOL>shuffle(item_list)<EOL>for item in item_list:<EOL><INDENT>if str(item.ident) not in seen_items:<EOL><INDENT>unseen_item_id = item.get_id()<EOL>break<EOL><DEDENT><DEDENT>if unseen_item_id is not None:<EOL><INDENT>self.my_osid_object._my_map['<STR_LIT>'] = [str(unseen_item_id)]<EOL><DEDENT>elif self.my_osid_object._my_map['<STR_LIT>']:<EOL><INDENT>if len(item_list) > <NUM_LIT:0>:<EOL><INDENT>self.my_osid_object._my_map['<STR_LIT>'] = [str(item_list[<NUM_LIT:0>].ident)]<EOL><DEDENT>else:<EOL><INDENT>self.my_osid_object._my_map['<STR_LIT>'] = []  <EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.my_osid_object._my_map['<STR_LIT>'] = []<EOL><DEDENT>
if this is the first time for this magic part, find an LO linked item