code: def show_input(self, template_helper, language, seed):
          
          choices = []
          limit = self._limit
          if limit == 0:
              limit = len(self._choices)  # no limit
  
          rand = Random("{}#{}#{}".format(self.get_task().get_id(), self.get_id(), seed))
  
          # Ensure that the choices are random
          # we *do* need to copy the choices here
          random_order_choices = list(self._choices)
          rand.shuffle(random_order_choices)
  
          if self._multiple:
              # take only the valid choices in the first pass
              for entry in random_order_choices:
                  if entry['valid']:
                      choices.append(entry)
                      limit = limit - 1
              # take everything else in a second pass
              for entry in random_order_choices:
                  if limit == 0:
                      break
                  if not entry['valid']:
                      choices.append(entry)
                      limit = limit - 1
          else:
              # need to have ONE valid entry
              for entry in random_order_choices:
                  if not entry['valid'] and limit > 1:
                      choices.append(entry)
                      limit = limit - 1
              for entry in random_order_choices:
                  if entry['valid'] and limit > 0:
                      choices.append(entry)
                      limit = limit - 1
  
          rand.shuffle(choices)
  
          header = ParsableText(self.gettext(language, self._header), "rst",
                                translation=self._translations.get(language, gettext.NullTranslations()))
  
          return str(DisplayableMultipleChoiceProblem.get_renderer(template_helper).tasks.multiple_choice(
              self.get_id(), header, self._multiple, choices,
              lambda text: ParsableText(self.gettext(language, text) if text else "", "rst",
                                        translation=self._translations.get(language, gettext.NullTranslations()))))
docs: Show multiple choice problems