original_docstring: Edits the question using a temporary file
docstring: Edits the question using a temporary file
docstring_tokens: Edits the question using a temporary file
code: def editquestion(self, event=None):
          '''Edits the question using a temporary file'''
          global questionList
  
          category = self.dropdown.get()
          question = self.scrolledtext.get(0.0,'end-1c')
          answer = self.ansentry.get()
          colour = main.colour
          itemindex = 0
  
          if category == main.category and question == main.question and answer == main.answer: #no changes made
              messagebox.showinfo(message='You have made no changes!')
              return
  
          if answer == '' or question == '' or category == '' or answer == 'Answer... Egypt' or question == 'Question... Where do cats originate from?' or category == 'Category Name':
              messagebox.showinfo(message='Make sure all entries aren\'t empty or have the default text inside them')
              return
  
          elif category in main.categories: #valid category
              c.execute('UPDATE questions SET question = (?), answer = (?) WHERE rowid = (?)', (question, answer, main.rowid))
              conn.commit()
  
          main.refreshlist()
          main.randomquestion()
          self.window.destroy()
code_tokens: def editquestion ( self , event = None ) : global questionList category = self . dropdown . get ( ) question = self . scrolledtext . get ( 0.0 , 'end-1c' ) answer = self . ansentry . get ( ) colour = main . colour itemindex = 0 if category == main . category and question == main . question and answer == main . answer : messagebox . showinfo ( message = 'You have made no changes!' ) return if answer == '' or question == '' or category == '' or answer == 'Answer... Egypt' or question == 'Question... Where do cats originate from?' or category == 'Category Name' : messagebox . showinfo ( message = 'Make sure all entries aren\'t empty or have the default text inside them' ) return elif category in main . categories : c . execute ( 'UPDATE questions SET question = (?), answer = (?) WHERE rowid = (?)' , ( question , answer , main . rowid ) ) conn . commit ( ) main . refreshlist ( ) main . randomquestion ( ) self . window . destroy ( )
short_docstring: Edits the question using a temporary file
short_docstring_tokens: Edits the question using a temporary file
comment: '''Edits the question using a temporary file'''$SEP$#no changes made
  $SEP$#valid category
  