provide this method to return only wrong answers
        :return:
188838
def get_wrong_answers(self):
        
        all_answers = self.my_osid_object._my_map['answers']
        wrong_answers = [a for a in all_answers
                         if a['genusTypeId'] == str(WRONG_ANSWER_GENUS_TYPE)]
        return AnswerList(wrong_answers,
                          runtime=self.my_osid_object._runtime,
                          proxy=self.my_osid_object._proxy)
553353
def handle_ans(self, ans_):
        
        ans = ans_.strip(' ')
        def chack_if_answer_was(valid_keys):
            return any([ans == key or ans.startswith(key + ' ')
                        for key in valid_keys])
        # Custom interactions
        for func, tup in self.actions.items():
            valid_keys = tup[0]
            if chack_if_answer_was(valid_keys):
                func()
165700
def addAnswers(self, answers, callback=None, errback=None, **kwargs):
        
        if not self.data:
            raise RecordException('record not loaded')
        orig_answers = self.data['answers']
        new_answers = self._rest._getAnswersForBody(answers)
        orig_answers.extend(new_answers)
        return self.update(answers=orig_answers, callback=callback,
                           errback=errback, **kwargs)
496319
def answer(self) -> str:
        
        answers = self._data['answers']
        return self.random.choice(answers)
503296
def generate_answers
      the_answers = {}
      dashboard = only_host_with_role(@hosts, 'dashboard')
      master = only_host_with_role(@hosts, 'master')
      @hosts.each do |h|
        the_answers[h.name] = host_answers(h, master, dashboard, @options)
        if the_answers[h.name] && h[:custom_answers]
          the_answers[h.name] = the_answers[h.name].merge(h[:custom_answers])
        end
        h[:answers] = the_answers[h.name]
      end
      return the_answers
    end
115501
def get_answers(self):
        
        # Implemented from template for osid.repository.Asset.get_asset_contents_template
        return AnswerList(
            self._my_map['answers'],
            runtime=self._runtime,
            proxy=self._proxy)
817042
def to_bool(answer, default):
    
    answer = str(answer).lower()
    default = str(default).lower()

    if answer and answer in "yes":
        return True

    return False
978227
def choice(*es):
    
    msg = 'Expected one of: {}'.format(', '.join(map(repr, es)))
    def match_choice(s, grm=None, pos=0):
        errs = []
        for e in es:
            try:
                return e(s, grm, pos)
            except PegreError as ex:
                errs.append((ex.message, ex.position))
        if errs:
            raise PegreChoiceError(errs, pos)
    return match_choice
1131967
def get_answer_ids(self):
        
        id_list = []
        for answer in self.get_answers():
            id_list.append(answer.get_id())
        return IdList(id_list)
1240101
def _choose(self):
        
        answer = "all"

        if not self.force:
            for i, value in enumerate(self.current_values):
                self.out("{:>2d}. {}".format(i + 1, value))

            answer = self.prompt(
                'Which value to remove? Enter number or "all": ')

        if answer != "all":
            try:
                answer = int(answer) - 1

                if answer < 0 or answer >= len(self.current_values):
                    answer = None
            except ValueError:
                answer = None

        return answer
1328801
def _is_match(self, response, answer):
        """"""
        # TODO: this varies depending on question type
        if self._only_generic_right_feedback():
            return str(answer.genus_type) == str(RIGHT_ANSWER_GENUS)
        elif self._is_multiple_choice():
            return MultiChoiceItemRecord._is_match(self, response, answer)
        elif self._is_image_sequence() or self._is_mw_sentence():
            return OrderedChoiceItemRecord._is_match(self, response, answer)
        elif self._is_numeric_response():
            return CalculationInteractionItemRecord._is_match(self, response, answer)
        elif self._is_fitb():
            return MagicRandomizedInlineChoiceItemRecord._is_match(self, response, answer)
        return False
1145665
def answered_by(self, rec):
        """"""
        return self.clazz == rec.clazz and \
                (self.type == rec.type or self.type == _TYPE_ANY) and \
                self.name == rec.name
768190
def get_correctness_for_response(self, response):
        """"""
        for answer in self.my_osid_object.get_answers():
            if self._is_match(response, answer):
                try:
                    return answer.get_score()
                except AttributeError:
                    return 100
        for answer in self.my_osid_object.get_wrong_answers():
            if self._is_match(response, answer):
                try:
                    return answer.get_score()
                except AttributeError:
                    return 0
        return 0
778600
def validate(self, answer):
        
        if answer is None:
            return False
        else:
            if isinstance(self.validator, list):
                for v in self.validator:
                    if not v.validate(answer):
                        return False
                return True
            else:
                return self.validator.validate(answer)
1220984
def ask_questions(self):
        
        out_config = {}

        for key in c.CONFIG_QUESTIONS:
            section = key[1]
            print
            for question in section:
                answer = utils.ask(question[1], question[2])
                out_config["{0}_{1}".format(key[0], question[0])] = answer

        for key in c.CONFIG_MULTIPLE_CHOICE_QUESTIONS:
            section = key[1]
            print
            # keep going until we get what we want
            while True:
                input = utils.ask(section[1], "")
                if (input.isdigit() and
                        int(input) > 0 and
                        int(input) <= section[0]):
                    answer = input

                    break
                print

            # store the answer as 1 less than it is, we're dealing with
            # a list to select the number which is 0 indexed
            answer = int(input) - 1

            if key[0] == "license":
                out_config["license_type"] = c.LICENSE_TYPES[answer][0]
                out_config["license_url"] = c.LICENSE_TYPES[answer][1]

        # merge in defaults without asking questions
        merged_config = dict(c.CONFIG_DEFAULTS.items() + out_config.items())

        return merged_config
1165745
def answers(self, other):
        """"""
        if other.__class__ == self.__class__:
            return (other.service + 0x40) == self.service or \
                   (self.service == 0x7f and
                    (self.requestServiceId == other.service))
        return 0
1234322
def get(self):
        
        if not self.filling:
            self.fill()

        answer = tornado.gen.Future()

        def _on_result(future):
            if future.exception():
                return answer.set_exc_info(future.exc_info())
            answer.set_result(future.result())

        def _on_item(future):
            if future.exception():
                return answer.set_exc_info(future.exc_info())
            future.result().add_done_callback(_on_result)

        self.queue.get().add_done_callback(_on_item)
        return answer