original_docstring: Changes self.string into a different question from the category passed
docstring: Changes self.string into a different question from the category passed
docstring_tokens: Changes self . string into a different question from the category passed
code: def randomquestion(self, event=None, bruteforce=False):
          '''Changes self.string into a different question from the category passed'''
  
          #forcing any question in the category to be set
          if bruteforce:
              for item in questionList:
                  if item != self.questionrow and item[0] == self.category:
                      self.question = item[2]
                      self.answer = item[1]
                      self.questionrow = item
                      self.rowid = item[3]
                      self.string.set(self.question)
                      return
  
          #counter measure making sure not infinitely looping
          count = 0
          for question in questionList:
              if question[0] == self.category:
                  count += 1
          if count <= 1 and self.question != '':
              return
  
          while True:
              choice = random.choice(questionList)
              if choice[0] == self.category and choice[2] != self.question: #makes sure not repeated after eachother
                  self.question = choice[2]
                  self.answer = choice[1]
                  self.questionrow = choice
                  self.rowid = choice[3]
                  self.string.set(self.question)
                  break
code_tokens: def randomquestion ( self , event = None , bruteforce = False ) : if bruteforce : for item in questionList : if item != self . questionrow and item [ 0 ] == self . category : self . question = item [ 2 ] self . answer = item [ 1 ] self . questionrow = item self . rowid = item [ 3 ] self . string . set ( self . question ) return count = 0 for question in questionList : if question [ 0 ] == self . category : count += 1 if count <= 1 and self . question != '' : return while True : choice = random . choice ( questionList ) if choice [ 0 ] == self . category and choice [ 2 ] != self . question : self . question = choice [ 2 ] self . answer = choice [ 1 ] self . questionrow = choice self . rowid = choice [ 3 ] self . string . set ( self . question ) break
short_docstring: Changes self.string into a different question from the category passed
short_docstring_tokens: Changes self . string into a different question from the category passed
comment: '''Changes self.string into a different question from the category passed'''$SEP$#forcing any question in the category to be set
  $SEP$#counter measure making sure not infinitely looping
  $SEP$#makes sure not repeated after eachother
  