<jupyter_start><jupyter_text>Needed libraries<jupyter_code>import sys
import psycopg2
from os import getenv
from dotenv import load_dotenv
load_dotenv()<jupyter_output><empty_output><jupyter_text>Secret Vars<jupyter_code>ELEPHANTSQL_DATABASE = getenv('ELEPHANTSQL_DATABASE')
ELEPHANTSQL_USERNAME = getenv('ELEPHANTSQL_USERNAME')
ELEPHANTSQL_PASSWORD = getenv('<PASSWORD>')
ELEPHANTSQL_HOST = getenv('ELEPHANTSQL_HOST')<jupyter_output><empty_output><jupyter_text>SQL Database Connect<jupyter_code>def connect(DATABASE, USERNAME, PASSWORD, HOST):
    """ Connect to the PostgreSQL database server """
    elephantsql_client = None
    try:
        # connect to the PostgreSQL server
        print('Connecting to the PostgreSQL database...')

        # Connect to ElephantSQL-hosted PostgreSQL
        elephantsql_client = psycopg2.connect(dbname=DATABASE, user=USERNAME, password=PASSWORD, host=HOST)

    except (Exception, psycopg2.DatabaseError) as error:
        print(error)
        sys.exit(1)
    return elephantsql_client<jupyter_output><empty_output><jupyter_text>Create Database Table<jupyter_code>def create_table(elephantsql_client, command):
    '''Creating table with given input command'''    
    try:
        # A "cursor", a structure to iterate over db records to perform queries
        cur = elephantsql_client.cursor()

        # Execute commands in order
        cur.execute(command)

        # Close communication with the PostgreSQL database server
        cur.close()

        # Commit the changes
        elephantsql_client.commit()

    except (Exception, psycopg2.DatabaseError) as error:
        print(error)<jupyter_output><empty_output><jupyter_text>Execute Command<jupyter_code>def execute_command(elephantsql_client, insert_req):
    """ Execute a single INSERT request """
    try:
        # Create cursor object
        cur = elephantsql_client.cursor()

        # Execute command
        cur.execute(insert_req)

        # Commit changes
        elephantsql_client.commit()
    except (Exception, psycopg2.DatabaseError) as error:

        print("Error: %s" % error)

        # Reset to prev database state
        elephantsql_client.rollback()

        # Close cursor object
        cur.close()
        return 1
        
    cur.close()<jupyter_output><empty_output><jupyter_text>Drop a table<jupyter_code># Database connection
elephantsql_client = connect(ELEPHANTSQL_DATABASE, ELEPHANTSQL_USERNAME, ELEPHANTSQL_PASSWORD, ELEPHANTSQL_HOST)

command = '''DROP TABLE questions_table;'''

execute_command(elephantsql_client, command)

# Close the connection
elephantsql_client.close()
print('Connection is closed.')<jupyter_output>Connecting to the PostgreSQL database...
Error: table "questions_table" does not exist

Connection is closed.<jupyter_text>Creating a table in the database<jupyter_code># Database connection
elephantsql_client = connect(ELEPHANTSQL_DATABASE, ELEPHANTSQL_USERNAME, ELEPHANTSQL_PASSWORD, ELEPHANTSQL_HOST)

# Building Inital user tweet tables
command = '''CREATE TABLE IF NOT EXISTS questions_table (question_id             SERIAL PRIMARY KEY,
                                                         question_title             varchar(100),
                                                         question_lesson            varchar(1000),
                                                         question_desc              varchar(1000),
                                                         question_a                 varchar(100),
                                                         question_b                 varchar(100),
                                                         question_c                 varchar(100),
                                                         question_d                 varchar(100),
                                                         answer                     varchar(100),
                                                         error                      varchar(100))'''
create_table(elephantsql_client, command)

# Close the connection
elephantsql_client.close()
print('Connection is closed.')<jupyter_output>Connecting to the PostgreSQL database...
Connection is closed.<jupyter_text>Add to questions table<jupyter_code>def add_question(question_package):
    # Database connection
    elephantsql_client = connect(ELEPHANTSQL_DATABASE, ELEPHANTSQL_USERNAME, ELEPHANTSQL_PASSWORD, ELEPHANTSQL_HOST)


    command = "INSERT INTO questions_table (question_id, question_title, question_lesson, question_desc, question_a, question_b, question_c, question_d, answer, error) VALUES ('{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}' )".format(question_package['question_id'], 
                                                                                                                                                                                                                            question_package['question_title'], 
                                                                                                                                                                                                                            question_package['question_lesson'],
                                                                                                                                                                                                                            question_package['question_desc'], 
                                                                                                                                                                                                                            question_package['question_a'], 
                                                                                                                                                                                                                            question_package['question_b'], 
                                                                                                                                                                                                                            question_package['question_c'], 
                                                                                                                                                                                                                            question_package['question_d'], 
                                                                                                                                                                                                                            question_package['answer'], 
                                                                                                                                                                                                                            question_package['error'])
    execute_command(elephantsql_client, command)

    # Close the connection
    elephantsql_client.close()
    print('Connection is closed.')
    
# python unit
track_one_question_one = {'question_id':  11,
                        'question_title': 'Question 1: Basic Operations and Printing in Python',

                        'question_lesson': '''You can use jupyter notebook for python as a basic calculator. 
                                              For example, for addition, 2 + 2 = 4. For subtraction, 2 - 2 = 0. 
                                              For multiplication, 2 * 4 = 8. For division, 4 / 2 = 2. For exponents, 
                                              2 ** 3 = 8. We also have the mod operator, where we divide 2 
                                              numbers and receive the remainder as the final answer. For example, if we 
                                              divide 5 by 2 we get 2.5 which is a quotient, but to get a remainder, we use 
                                              the mod operator, 5 % 2 which equals 1.''',

                        'question_desc': 'What is the output of 7 % 4?',
                        'question_a': '3',
                        'question_b': '6',
                        'question_c': '4',
                        'question_d': '5',
                        'answer': 'a',
                        'error': 'None'}

track_one_question_two = {'question_id':  12,
                        'question_title': 'Question 2: Basic Operations and Printing in Python',
                        'question_lesson': '''To print stuff in python we use the print command 
                                              like print(“Hello World”) will give us Hello World Anything 
                                              in “ “ is considered as a string so “12” is a string and 
                                              not an integer Also, Python accepts both symbols “ and ‘ but 
                                              in cases like print(‘I’ve done my work’), running this will 
                                              give us an error as python will consider characters only till 
                                              ve and that can be corrected by doing print(“I’ve done my work”) 
                                              backslash n: newline(This is used to create a new line) backslash 
                                              t: create 3 spaces(This is used to create 3 spaces between terms).''',

                        'question_desc': 'What is the output of the following string?\nprint(“My name is troy")',
                        'question_a': 'Error',
                        'question_b': '("My name is Troy")',
                        'question_c': 'My name is troy',
                        'question_d': '“My name is troy”',
                        'answer': 'c',
                        'error': 'None'}

track_one_question_three = {'question_id':  13,
                        'question_title': 'Question 3: Basic Operations and Printing in Python',
                        'question_lesson': """To print stuff in python we use the print command 
                                            like print(“Hello World”) will give us Hello World 
                                            Anything in “ “ is considered as a string so “12” 
                                            is a string and not an integer Also, Python accepts 
                                            both symbols “ and ‘ but in cases like print(‘I’ve 
                                            done my work’), running this will give us an error as 
                                            python will consider characters only till ve and 
                                            that can be corrected by doing print(“I’ve done my work”) 
                                            backslash n: newline(This is used to create a new line) 
                                            backslash t: create 3 spaces(This is used to create 3 
                                            spaces between terms).""",

                        'question_desc': 'What is the output of (2**3)%3',
                        'question_a': '1',
                        'question_b': '2',
                        'question_c': '3',
                        'question_d': '4',
                        'answer': 'b',
                        'error': 'None'}

track_one_question_four = {'question_id':  14,
                        'question_title': 'Question 4: Basic Operations and Printing in Python',
                        'question_lesson': '''To print stuff in python we use the print command 
                                            like print(“Hello World”) will give us Hello World 
                                            Anything in “ “ is considered as a string so “12” is a string and not an integer 
                                            Also, Python accepts both symbols “ and ‘ but in cases like 
                                            print(‘I’ve done my work’), running this will give us an error 
                                            as python will consider characters only till ve and 
                                            that can be corrected by doing print(“I’ve done my work”) 
                                            backslash n: newline(This is used to create a new line) 
                                            backslash t: create 3 spaces(This is used to create 3 spaces between terms).''',

                        'question_desc': 'What is the output of the following string? print(“DateTime”)',
                        'question_a': 'Error',
                        'question_b': 'DateTime',
                        'question_c': 'Date Time',
                        'question_d': 'Date-Time',
                        'answer': 'd',
                        'error': 'None'}

track_one_question_five = {'question_id':  15,
                        'question_title': 'Question 5: Basic Operations and Printing in Python',
                        'question_lesson': '''To print stuff in python we use the print command 
                                            like print(“Hello World”) will give us Hello World 
                                            Anything in “ “ is considered as a string so “12” is 
                                            a string and not an integer Also, Python accepts both 
                                            symbols “ and ‘ but in cases like print(‘I’ve done my 
                                            work’), running this will give us an error as python 
                                            will consider characters only till ve and that can be 
                                            corrected by doing print(“I’ve done my work”) backslash 
                                            n: newline(This is used to create a new line) backslash 
                                            t: create 3 spaces(This is used to create 3 spaces between terms).''',

                        'question_desc': 'What is the output of the following string? (“SecondstMinutes”)',
                        'question_a': 'Second   Minutes',
                        'question_b': 'SecondMinutes',
                        'question_c': 'Error',
                        'question_d': 'Second-Minutes',
                        'answer': 'a',
                        'error': 'None'}
#Topic 2: Phyton
track_two_question_one = {'question_id':  21,
                        'question_title': 'Question 1: Variables & Strings',
                        'question_lesson': '''Some rules of variables in python are: 1. Variable names cannot 
                                            start with a number 2. There can be no spaces in the name 3. Cannot 
                                            use any of the following symbols 4. It is considered best practice 
                                            that names are lowercase 5. Avoid using words that have special 
                                            meaning in Python, such as list and str''',

                        'question_desc': '''if work='Game': work''',
                        'question_a': '4',
                        'question_b': 'Error',
                        'question_c': 'Game',
                        'question_d': "'Game'",
                        'answer': 'd',
                        'error': 'None'}

track_two_question_two = {'question_id':  22,
                        'question_title': 'Question 2: Variables & Strings',
                        'question_lesson': '''To find the total length of a string we use the "len" operator. For example, 
                                            if f="Grow", then len(f) will be 4. Spaces also have a length, so we need to 
                                            make sure they are accounted for. For example, if g="Gold Button", then len(g) 
                                            will be 11 and not 10, as the space between Gold and Button also has a length.''',

                        'question_desc': 'If strings=“Topper”, The length of strings or len(strings) is:',
                        'question_a': '3',
                        'question_b': '6',
                        'question_c': '7',
                        'question_d': '10',
                        'answer': 'b',
                        'error': 'None'}

track_two_question_three = {'question_id':  23,
                        'question_title': 'Question 3: Variables & Strings',
                        'question_lesson': '''To find the total length of a string we use the "len" operator. For example, 
                                            if f="Grow", then len(f) will be 4. Spaces also have a length, so we need to 
                                            make sure they are accounted for. For example, if g="Gold Button", then len(g) 
                                            will be 11 and not 10, as the space between Gold and Button also has a length.''',

                        'question_desc': 'If dos="Beautiful flower", the length of dos or len(dos) is:',
                        'question_a': '15',
                        'question_b': '17',
                        'question_c': '16',
                        'question_d': '20',
                        'answer': 'c',
                        'error': 'None'}

track_two_question_four = {'question_id':  24,
                        'question_title': 'Question 4: Variables & Strings',
                        'question_lesson': '''To find the data types of a code we use the type operator and these are important 
                                            data types. Integers are used with the type "int", such as: 3, 40, -12. Floating point 
                                            numbers are used with the type "float", such as: 2.5, -8.912, 10.0. Strings are used with the 
                                            type "str", such as: "Hello", "Sammy", "200".''',

                        'question_desc': 'What is the type of c if c = 20.0',
                        'question_a': 'str',
                        'question_b': 'float',
                        'question_c': 'int',
                        'question_d': 'tup',
                        'answer': 'b',
                        'error': 'None'}

track_two_question_five = {'question_id':  25,
                        'question_title': 'Question 5: Variables & Strings',
                        'question_lesson': '''To find the data types of a code we use the type operator and these are 
                                            important data types. Integers are used with the type "int", such as: 3, 
                                            40, -12. Floating point numbers are used with the type "float", such as: 
                                            2.5, -8.912, 10.0. Strings are used with the type "str", such as: "Hello", "Sammy", "200".''',

                        'question_desc': 'What is the type of x if x = "12"',
                        'question_a': 'float',
                        'question_b': 'tup',
                        'question_c': 'str',
                        'question_d': 'int',
                        'answer': 'c',
                        'error': 'None'}
#Topic 3: Phyton
track_three_question_one = {'question_id':  31,
                        'question_title': 'Question 1: String Indexing',
                        'question_lesson': '''We know strings are a sequence, which means Python can use indexes to 
                                            call parts of the sequence. In Python, we use brackets [] after an object 
                                            to call its index. We should also note that indexing starts at 0 for Python. 
                                            To make comments in your code use the symbol #, and whatever your write here 
                                            won't affect your code.''',

                        'question_desc': 'What is the answer of "Hello World"[9]',
                        'question_a': "'l'",
                        'question_b': "'r'",
                        'question_c': "'d'",
                        'question_d': 'Error',
                        'answer': 'a',
                        'error': 'None'}

track_three_question_two = {'question_id':  32,
                        'question_title': 'Question 2: String Indexing',
                        'question_lesson': '''We know strings are a sequence, which means Python can use indexes to call 
                                            parts of the sequence. In Python, we use brackets [] after an object to call 
                                            its index. We should also note that indexing starts at 0 for Python. To make 
                                            comments in your code use the symbol #, and whatever your write here won't affect your code.''',

                        'question_desc': 'If strings = "Active Mind", what is the output of strings[5]?',
                        'question_a': "' '",
                        'question_b': "'m'",
                        'question_c': "'e'",
                        'question_d': 'Error',
                        'answer': 'c',
                        'error': 'None'}

track_three_question_three = {'question_id':  33,
                        'question_title': 'Question 3: String Indexing',
                        'question_lesson': '''We can do slicing with the colon symbol (:). The colon symbol tells python to grab 
                                            everything from that designated spot, such as in x = "abcdefgh", x[1:] or x[-7:], which 
                                            grabs the items from position 1 or (-7) and everything else after. This would give us the 
                                            answer "bcdefgh" for the previous example. ALso, x[:3] or x[:-5] tells python to grab 
                                            everything before position 3 or (-5), not including the term on position 3 or (-5), which 
                                            gives the answer of “abc”.''',

                        'question_desc': 'If strings = "abcdefgh", what is the output of strings[:]?',
                        'question_a': 'abcdefgh',
                        'question_b': 'aceg',
                        'question_c': 'Error',
                        'question_d': 'hgfedcba',
                        'answer': 'a',
                        'error': 'None'}

track_three_question_four = {'question_id':  34,
                        'question_title': 'Question 4: String Indexing',
                        'question_lesson': '''We can do slicing with the colon symbol (:). The colon symbol tells python to grab everything 
                                            from that designated spot, such as in x = "abcdefgh", x[1:] or x[-7:], which grabs the items from 
                                            position 1 or (-7) and everything else after. This would give us the answer "bcdefgh" for the 
                                            previous example. ALso, x[:3] or x[:-5] tells python to grab everything before position 3 or 
                                            (-5), not including the term on position 3 or (-5), which gives the answer of “abc”.''',

                        'question_desc': 'If strings = "abcdefgh", what is the output of strings[0:6]?',
                        'question_a': 'dcefgh',
                        'question_b': 'abcdef',
                        'question_c': 'abcdefg',
                        'question_d': 'None',
                        'answer': 'b',
                        'error': 'None'}

track_three_question_five = {'question_id':  35,
                        'question_title': 'Question 5: String Indexing',
                        'question_lesson': '''We can also use index and slice notation to grab elements of a sequence by a specified 
                                            step size (the default is 1). For instance, we can use two colons in a row and then a number 
                                            specifying the frequency to grab elements. For example, if x=”abcdefgh”, x[::4] will give us “ae”.''',

                        'question_desc': 'If strings = "abcdefgh", what is the output of strings[::3]?',
                        'question_a': 'fgh',
                        'question_b': 'abc',
                        'question_c': 'adg',
                        'question_d': 'cde',
                        'answer': 'c',
                        'error': 'None'}
#Topic 4: C++ Part 1
track_four_question_one = {'question_id':  41,
                        'question_title': 'Question 1: Strings',
                        'question_lesson': '''Strings are objects that represent sequences of characters. Strings allow you to print words, 
                                            sentences, numbers, and special characters. You can even add strings together to combine them into 
                                            whatever you wish for. Strings do have certain caveat, however, with this course, we can teach you all about them.''',

                        'question_desc': 'Which line of code below shows the missing syntax of the following line of code that prints a sentence?     cout  “My name is Troy” ;',
                        'question_a': ' cout << “My name is Troy” <<; ',
                        'question_b': ' cout < “My name is Troy” ',
                        'question_c': ' cout < “My name is Troy” <; ',
                        'question_d': ' cout << “My name is Troy”; ',
                        'answer': 'd',
                        'error': 'None'}

track_four_question_two = {'question_id':  42,
                        'question_title': 'Question 2: Strings',
                        'question_lesson': '''Strings are objects that represent sequences of characters. Strings allow you to print words, sentences, 
                                            numbers, and special characters. You can even add strings together to combine them into whatever you wish for. 
                                            Strings do have certain caveat, however, with this course, we can teach you all about them.''',

                        'question_desc': ' What is the output of the following string?    cout << “My name is troy"; ',
                        'question_a': ' Error ',
                        'question_b': ' My name is Troy ',
                        'question_c': ' (“My name is Troy”) ',
                        'question_d': ' “My name is Troy” ',
                        'answer': 'b',
                        'error': 'None'}

track_four_question_three = {'question_id':  43,
                        'question_title': 'Question 3: Strings',
                        'question_lesson': '''Strings are objects that represent sequences of characters. Strings allow you to print words, 
                                            sentences, numbers, and special characters. You can even add strings together to combine them 
                                            into whatever you wish for. Strings do have certain caveat, however, with this course, we can 
                                            teach you all about them.''',

                        'question_desc': 'If we have two strings, str1 and str2. What is the output of the following code when:    string str1 = "Hack";    string str2 = "Merced";    cout << str1 + str2; ',
                        'question_a': ' HackMerced ',
                        'question_b': ' Merced Hack ',
                        'question_c': ' Hack Merced ',
                        'question_d': ' None ',
                        'answer': 'a',
                        'error': 'None'}

track_four_question_four = {'question_id':  44,
                        'question_title': 'Question 4: Strings',
                        'question_lesson': '''Strings are objects that represent sequences of characters. Strings allow you to print words, 
                                            sentences, numbers, and special characters. You can even add strings together to combine them 
                                            into whatever you wish for. Strings do have certain caveat, however, with this course, we can 
                                            teach you all about them.''',

                        'question_desc': 'If we want to get a string input from the user with a variable named "firstName", what would be the correct correct way to get it?  ',
                        'question_a': ' cin << firstName; ',
                        'question_b': ' Cin >> firstName; ',
                        'question_c': ' cout << firstName; ',
                        'question_d': ' cin >> firstName; ',
                        'answer': 'd',
                        'error': 'None'}

track_four_question_five = {'question_id':  45,
                        'question_title': 'Question 5: Strings',
                        'question_lesson': '''Strings are objects that represent sequences of characters. Strings allow you to print 
                                            words, sentences, numbers, and special characters. You can even add strings together to 
                                            combine them into whatever you wish for. Strings do have certain caveat, however, with 
                                            this course, we can teach you all about them.''',

                        'question_desc': 'What would be the output of the following code if the user input was "Hello World":   string str1;   cin >> str1;   cout << str1; ',
                        'question_a': ' Hello World ',
                        'question_b': ' World ',
                        'question_c': ' World Hello ',
                        'question_d': ' Hello ',
                        'answer': 'd',
                        'error': 'None'}

#Topic 5: C++ Part 2
track_five_question_one = {'question_id':  51,
                        'question_title': 'Question 1: Math/Arithmetic',
                        'question_lesson': '''Operators are used to perform operations on variables and values. The addition operator (+) is 
                                            used to add variables, while also adding values. The subtraction operator (-) is also used to 
                                            subtract variables and values. The multiplication operator (*) is used to multiply variables 
                                            and values. The division operator (/)  is used to divide variables and values. The modulus 
                                            operator (%) is used to return the division remainder of two variables or values.''',

                        'question_desc': 'What would be the correct way to initialize the variable x to integer 10 multiplied by 2?',
                        'question_a': ' 10 * 2;',
                        'question_b': ' int x = 10 * 2',
                        'question_c': ' 10 * 2 = x',
                        'question_d': ' int x = 10 * 2;',
                        'answer': 'd',
                        'error': 'None'}

track_five_question_two = {'question_id':  52,
                        'question_title': 'Question 2: Math/Arithmetic',
                        'question_lesson': '''Operators are used to perform operations on variables and values. The addition 
                                            operator (+) is used to add variables, while also adding values. The subtraction 
                                            operator (-) is also used to subtract variables and values. The multiplication operator (*) is 
                                            used to multiply variables and values. The division operator (/)  is used to divide variables and 
                                            values. The modulus operator (%) is used to return the division remainder of two variables or values.''',

                        'question_desc': 'What would be the correct way to initialize the variable N that holds a decimal number?',
                        'question_a': ' Both B and C',
                        'question_b': ' float = x;',
                        'question_c': ' double = x;',
                        'question_d': ' float x;',
                        'answer': 'a',
                        'error': 'None'}

track_five_question_three = {'question_id':  53,
                        'question_title': 'Question 3: Math/Arithmetic',
                        'question_lesson': '''Operators are used to perform operations on variables and values. The addition 
                                            operator (+) is used to add variables, while also adding values. The subtraction 
                                            operator (-) is also used to subtract variables and values. The multiplication operator (*) 
                                            is used to multiply variables and values. The division operator (/)  is used to divide variables 
                                            and values. The modulus operator (%) is used to return the division remainder of two variables or values.''',

                        'question_desc': 'What would be the output of the following code if "int x = 21.2" and "int y = 21.3":   cout << x + y;',
                        'question_a': ' 42',
                        'question_b': ' 42.5',
                        'question_c': ' Error',
                        'question_d': ' 43',
                        'answer': 'c',
                        'error': 'None'}
                        
track_five_question_four = {'question_id':  54,
                        'question_title': 'Question 4: Math/Arithmetic',
                        'question_lesson': '''Operators are used to perform operations on variables and values. The addition 
                                            operator (+) is used to add variables, while also adding values. The subtraction 
                                            operator (-) is also used to subtract variables and values. The multiplication 
                                            operator (*) is used to multiply variables and values. The division operator (/)  
                                            is used to divide variables and values. The modulus operator (%) is used to return 
                                            the division remainder of two variables or values.''',

                        'question_desc': 'What would be the output of the following code if "float x = 21.2" and "double y = 21.3":   cout << x + y;',
                        'question_a': '42',
                        'question_b': '42.5',
                        'question_c': 'None',
                        'question_d': '43',
                        'answer': 'b',
                        'error': 'None'}

track_five_question_five = {'question_id':  55,
                        'question_title': 'Question 5: Math/Arithmetic',
                        'question_lesson': '''Operators are used to perform operations on variables and values. The 
                                            addition operator (+) is used to add variables, while also adding values. The 
                                            subtraction operator (-) is also used to subtract variables and values. The 
                                            multiplication operator (*) is used to multiply variables and values. The division 
                                            operator (/)  is used to divide variables and values. The modulus operator (%) is used 
                                            to return the division remainder of two variables or values.''',

                        'question_desc': ' We have two initialized variables, "int x = 365" and "int y = 7". What would be the output of the following code:    cout << x / y << " " << x % y; ',
                        'question_a': '5 1',
                        'question_b': '521',
                        'question_c': '52 1',
                        'question_d': '52',
                        'answer': 'c',
                        'error': 'None'}

#Topic 6: c++ Part 3
track_six_question_one = {'question_id':  61,
                        'question_title': 'Question 1: Loops and if-statements',
                        'question_lesson': '''A while-loop repeats a statement or group of statements while a given condition is true. 
                                            It tests the condition before executing the loop body. Psuedo-code for a while-loop is 
                                            as follows: while(condition) { statement(s)} ''',

                        'question_desc': 'If the condition of a while loop is "i > 0", where i is a variable that takes in user input, when would the loop continue? ',
                        'question_a': ' When i = -2 ',
                        'question_b': ' When i = 1 ',
                        'question_c': ' When i = -1 ',
                        'question_d': ' When i = 0 ',
                        'answer': 'b',
                        'error': 'None'}

track_six_question_two = {'question_id':  62,
                        'question_title': 'Question 2: Loops and if-statements',
                        'question_lesson': '''A while-loop repeats a statement or group of statements while a given condition is 
                                            true. It tests the condition before executing the loop body. Psuedo-code for a while-loop 
                                            is as follows: while(condition) { statement(s)}. There is also a boolean conditional 
                                            statement called if-else statements. If the boolean expression in the if-statement evaluates 
                                            to true, then the if block of code will be executed, otherwise, the else block of code will 
                                            be executed. An else statement is not always needed, however. If-else statements can also be used 
                                            within while loops. Psuedo-code for if-statements is as follows: if(boolean_expression){   // 
                                            statement(s) will execute if the boolean expression is true }    else { // statement(s) will 
                                            execute if the boolean expression is false }''',

                        'question_desc': "We have a while-loop who's condition is 1. Which of the following answers shows how to break from the while-loop using an if-statement once the user input is greater than 10 or less than 0? ",
                        'question_a': ' If (i > 0 & i < 10) ',
                        'question_b': ' If (i > 10 and  i > 0) ',
                        'question_c': ' If (i > 10 or i < 10) ',
                        'question_d': ' If (i > 10 || i < 0) ',
                        'answer': 'd',
                        'error': 'None'}

track_six_question_three = {'question_id':  63,
                        'question_title': 'Question 3: Loops and if-statements',
                        'question_lesson': '''There is a boolean conditional statement called if-else statements. If the boolean 
                                            expression in the if-statement evaluates to true, then the if block of code will be 
                                            executed, otherwise, the else block of code will be executed. An else statement is not 
                                            always needed, however. If-else statements can also be used within while loops. Psuedo-code 
                                            for if-statements is as follows: if(boolean_expression){   // statement(s) will execute if 
                                            the boolean expression is true }    else { // statement(s) will execute if the boolean expression is false }''',

                        'question_desc': 'We want to check the grade of student, where a students inputs their grade to "testScore". There are two if-statements. One checks if "testScore" is greater than 60, and outputs "You pass.". The other if-statement checks if "testScore" is greater than 90 and outputs “You did great.”. What would be the output if "testScore = 95". ',
                        'question_a': ' You pass. You did great. ',
                        'question_b': ' You did great. ',
                        'question_c': ' Neither ',
                        'question_d': ' You pass. ',
                        'answer': 'd',
                        'error': 'None'}

track_six_question_four = {'question_id':  64,
                        'question_title': 'Question 4: Loops and if-statements',
                        'question_lesson': '''There is also a widly used type of loop called for-loop. These for-loops execute a sequence of 
                                            statements multiple times and abbreviates the code that manages the loop variable. The psuedo code 
                                            for for-loops is as follows:   for(init; condition; increment){   statement(s); }''',

                        'question_desc': 'There is a variable named max. We want to create a for-loop which increments the variable i, starting from zero, by 1 everytime i is less than max. What would be the initialization, condition, and the update expression of this loop? ',
                        'question_a': ' (int i = 0; i > max; i++) ',
                        'question_b': ' (i = 0; i < max; i++)',
                        'question_c': ' (int i; i > max; i++) ',
                        'question_d': ' (int i = 0; i < max; i++) ',
                        'answer': 'd',
                        'error': 'None'}

track_six_question_five = {'question_id':  65,
                        'question_title': 'Question 5: Loops and if-statements',
                        'question_lesson': '''Unlike for and while loops, which test the loop condition at the top of the loop, the 
                                            do-while loop checks its condition at the bottom of the loop. A do-while loop is similar 
                                            to a while loop, except that a do-while loop is guaranteed to execute at least once. The 
                                            psuedo-code for do-while loops is as follows:   do{ statement(s); }  while(condition);''',
                                            
                        'question_desc': 'Suppose we have the variable a = 10. The condition of the do-while loops is a < 20. Everytime this is true, the statement in the loop outputs the current value of a. Then the value of a is incremented by 1. What is the output of the 4th iteration? ',
                        'question_a': ' 15 ',
                        'question_b': ' 10 ',
                        'question_c': ' 13 ',
                        'question_d': ' 14 ',
                        'answer': 'c',
                        'error': 'None'}




add_question(track_one_question_one)
add_question(track_one_question_two)
add_question(track_one_question_three)
add_question(track_one_question_four)
add_question(track_one_question_five)
add_question(track_two_question_one)
add_question(track_two_question_two)
add_question(track_two_question_three)
add_question(track_two_question_four)
add_question(track_two_question_five)
add_question(track_three_question_one)
add_question(track_three_question_two)
add_question(track_three_question_three)
add_question(track_three_question_four)
add_question(track_three_question_five)
add_question(track_four_question_one)
add_question(track_four_question_two)
add_question(track_four_question_three)
add_question(track_four_question_four)
add_question(track_four_question_five)
add_question(track_five_question_one)
add_question(track_five_question_two)
add_question(track_five_question_three)
add_question(track_five_question_four)
add_question(track_five_question_five)
add_question(track_six_question_one)
add_question(track_six_question_two)
add_question(track_six_question_three)
add_question(track_six_question_four)
add_question(track_six_question_five)<jupyter_output>Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Error: syntax error at or near "list"
LINE 5: ...                      meaning in Python, such as 'list' and ...
                                                             ^

Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Connection is closed.
Connecting to the PostgreSQL database...
Error: syntax error at or near "t"
LINE 5:                                             won't affect you...
                                             [...]
{'fraction_non_alphanumeric': 0.07864380016667398, 'fraction_numerical': 0.008662660643010658, 'mean_word_length': 1.258158767889863, 'pattern_counts': {'":': 3, '<': 66, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 375, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '159961', 'license': 'MIT', 'n_tokens_mistral': 10189, 'n_tokens_neox': 9265, 'n_words': 3802, 'path': 'notebooks/database_questions.ipynb', 'repo_name': 'salvadoravelar/flask-api', 'size': '45608'}