original_docstring: Deletes the question that is currently selected
docstring: Deletes the question that is currently selected
docstring_tokens: Deletes the question that is currently selected
code: def deletequestion(self, event=None):
          '''Deletes the question that is currently selected'''
          message = messagebox.askyesno(message='Are you sure you want to delete this question?')
          if not message:
              return
  
          c.execute('DELETE FROM questions WHERE rowid = (?)', (self.rowid,))
          conn.commit()
  
          messagebox.showinfo(message='Question deleted successfully!')
  
          self.refreshlist()
  
          if self.category not in category:
              messagebox.showinfo(message='There are no questions in this current category')
  
              c.execute('DELETE FROM subjects WHERE subject = (?)', (self.category,))
              conn.commit()
  
              self.window.destroy()
              self.changecategory()
              return
          else:
              self.randomquestion(bruteforce=True)
code_tokens: def deletequestion ( self , event = None ) : message = messagebox . askyesno ( message = 'Are you sure you want to delete this question?' ) if not message : return c . execute ( 'DELETE FROM questions WHERE rowid = (?)' , ( self . rowid , ) ) conn . commit ( ) messagebox . showinfo ( message = 'Question deleted successfully!' ) self . refreshlist ( ) if self . category not in category : messagebox . showinfo ( message = 'There are no questions in this current category' ) c . execute ( 'DELETE FROM subjects WHERE subject = (?)' , ( self . category , ) ) conn . commit ( ) self . window . destroy ( ) self . changecategory ( ) return else : self . randomquestion ( bruteforce = True )
short_docstring: Deletes the question that is currently selected
short_docstring_tokens: Deletes the question that is currently selected
comment: '''Deletes the question that is currently selected'''