original_docstring: Creates a question for a new category
docstring: Creates a question for a new category
docstring_tokens: Creates a question for a new category
code: def newcategory(self, event=None):
          '''Creates a question for a new category'''
  
          funccategory = self.categoryentry.get()
          question = self.scrolledtext.get(0.0,'end-1c')
          answer = self.ansentry.get()
          colour = self.colour
  
          if answer == '' or question == '' or funccategory == '' or answer == 'Answer... Egypt' or question == 'Question... Where do cats originate from?' or funccategory == 'Category Name':
              messagebox.showinfo(message='Make sure all entries aren\'t empty or have the default text inside them')
              return
  
          if colour == 'red':
              messagebox.showinfo(message='Please select a category colour')
              return
  
          if funccategory in category or funccategory.lower() in category or funccategory.title() in category or funccategory.upper() in category:
              messagebox.showwarning(message='Category name already in use!')
              return
  
          c.execute('INSERT INTO subjects VALUES (?, ?)', (funccategory, colour))
          c.execute('INSERT INTO questions VALUES (?, ?, ?)', (funccategory, answer, question))
          conn.commit()
  
          messagebox.showinfo(message='New category made!')
          main.refreshlist()
          self.window.destroy()
code_tokens: def newcategory ( self , event = None ) : funccategory = self . categoryentry . get ( ) question = self . scrolledtext . get ( 0.0 , 'end-1c' ) answer = self . ansentry . get ( ) colour = self . colour if answer == '' or question == '' or funccategory == '' or answer == 'Answer... Egypt' or question == 'Question... Where do cats originate from?' or funccategory == 'Category Name' : messagebox . showinfo ( message = 'Make sure all entries aren\'t empty or have the default text inside them' ) return if colour == 'red' : messagebox . showinfo ( message = 'Please select a category colour' ) return if funccategory in category or funccategory . lower ( ) in category or funccategory . title ( ) in category or funccategory . upper ( ) in category : messagebox . showwarning ( message = 'Category name already in use!' ) return c . execute ( 'INSERT INTO subjects VALUES (?, ?)' , ( funccategory , colour ) ) c . execute ( 'INSERT INTO questions VALUES (?, ?, ?)' , ( funccategory , answer , question ) ) conn . commit ( ) messagebox . showinfo ( message = 'New category made!' ) main . refreshlist ( ) self . window . destroy ( )
short_docstring: Creates a question for a new category
short_docstring_tokens: Creates a question for a new category
comment: '''Creates a question for a new category'''