'''
Created on 02-Mar-2021

@author: bthakur
'''
'''
Created on 07-Feb-2021

@author: bthakur
'''
import numpy as np
import random
import inspect
import traceback


from sympy import (simplify, sympify, log, latex, Symbol, symbols, 
                   UnevaluatedExpr as ueval)

from xv.km.util import latex_fraction
from xv.km.kelements import KPrintElement
        
from ..helper import BaseHelper
from xv.km.managers import BaseManager
from xv.km.kelements import KProblemTemplate

# _grade8_manager
# Grade8Manager
        
class Grade8Manager(BaseManager):
    '''
    Grade 8 (class 8) math
    Example:
        ke = Grade8Manager()
        ke.getRandomProblem()
        ke.getRandomProblem(problem_type = 0)
        ke.getRandomProblem(problem_type = 1)
        ...
        ke.printProblem()
        ke.printAnswer()
        ke.printSolution()

        ke.printProblemTypes()
    '''    
    def __new__(cls, *args, **kwargs):
        instance = super(Grade8Manager, cls).__new__(cls, *args, **kwargs)
        for base_class in Grade8Manager.__bases__:
            base_class.__init__(instance, *args, **kwargs)
        return instance
    
    def __init__(self, *args, **kwargs):
        self.base_helper = BaseHelper(**kwargs)
        pass

    def _TEMPLATE_CUSTOM_QUESTIONS(self, keywords, **kwargs):
        
        from ..storeddata import Grade8StoredQuestions
        
        stored_questions = Grade8StoredQuestions(verbose = self.verbose)
        result = stored_questions.get_random_question(keywords)

        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        if result is None:
            prob_s = f"""
            Failed to get questions
            keywords = {keywords}
            """
            problemTemplate.add_problem(prob_s.strip(), 'text/html')
            return problemTemplate
            
        
        prob_s = f"""
        {result['prob_s']}
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        {result['soln_s']}
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        {result['answer_s']}
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass


    def _init_problem_types(self, *args, **kwargs):
        self._append_problem_types([
            '_problem_custom_questions_power_to_power',
            '_problem_custom_questions_linear_equations',
            '_problem_custom_questions_parallel_lines',
            '_problem_custom_questions_algebric_expressions',
            '_problem_custom_questions_statistical_interpretation',
            '_problem_custom_questions_equilateral_triangle',
            '_problem_custom_questions_volume',
            '_problem_custom_questions_scatter_plot',
            '_problem_custom_questions_transform_a_polygon',
            
            
            '_problem_order_of_magnitude',
            '_problem_scientific_notation',
            '_problem_angle_preserving',
            '_problem_basic_rigid_motion',
            '_problem_between',
            '_problem_congruence',
            '_problem_congruent',
            '_problem_directed_line_segment',
            '_problem_distance_preserving',
            '_problem_exterior_angle',
            '_problem_reflection',
            '_problem_rotation',
            '_problem_sequence_composition_of_transformations',
            '_problem_transformation',
            '_problem_translation',
            '_problem_transversal',
            '_problem_vector',
            '_problem_dilation',
            '_problem_scale_drawing',
            '_problem_similar',
            '_problem_similarity_transformation',
            '_problem_average_speed',
            '_problem_constant_speed',
            '_problem_horizontal_line',
            '_problem_linear_equation',
            '_problem_point_slope_equation_of_a_line',
            '_problem_slope_of_a_line_in_a_cartesian_plane',
            '_problem_slope_intercept_equation_of_a_line',
            '_problem_solution_to_a_system_of_linear_equations',
            '_problem_standard_form_of_a_linear_equation',
            '_problem_system_of_linear_equations',
            '_problem_vertical_line',
            '_problem_x_intercept',
            '_problem_y_intercept',
            '_problem_cone',
            '_problem_cylinder',
            '_problem_equation_form_of_a_linear_function',
            '_problem_function',
            '_problem_graph_of_a_linear_function',
            '_problem_lateral_edge_and_face_of_a_prism',
            '_problem_lateral_edge_and_face_of_a_pyramid',
            '_problem_linear_function',
            '_problem_solid_sphere_or_ball',
            '_problem_sphere',
            '_problem_association',
            '_problem_bivariate_data_set',
            '_problem_column_relative_frequency',
            '_problem_row_relative_frequency',
            '_problem_scatter_plot',
            '_problem_two_way_frequency_table',
            '_problem_variable',
            '_problem_a_square_root_of_a_number',
            '_problem_cube_root',
            '_problem_decimal_expansion',
            '_problem_decimal_expansion_of_a_negative_number',
            '_problem_decimal_expansion_of_a_positive_real_number',
            '_problem_decimal_system',
            '_problem_irrational_number',
            '_problem_th',
            '_problem_perfect_square',
            '_problem_rational_approximation',
            '_problem_real_number',
            '_problem_the_square_root_of_a_number',
            '_problem_truncated_cone',

         ])
        pass

    def _problem_custom_questions_power_to_power(self, *args, **kwargs):
        keywords = kwargs.get('keywords', 'power_to_power')
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_linear_equations(self, *args, **kwargs):
        from ..algebra import LinearEquationManager
        le_manager = LinearEquationManager(verbose = self.verbose)
        problem_type = random.randint(0, 4)
        problemTemplate = le_manager.initProblemTemplate(problem_type = problem_type, 
                                                         dim = 2) 
        return problemTemplate


    def _problem_custom_questions_parallel_lines(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['parallel', 'lines'])
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_algebric_expressions(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['algebric', 'expressions'])
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_statistical_interpretation(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['statistical', 'interpretation'])
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_equilateral_triangle(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['equilateral', 'triangle'] )
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_volume(self, *args, **kwargs):
        keywords = kwargs.get('keywords', 'volume')
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_scatter_plot(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['scatter', 'plot'])
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)

    def _problem_custom_questions_transform_a_polygon(self, *args, **kwargs):
        keywords = kwargs.get('keywords', ['transform', 'polygon'])
        return self._TEMPLATE_CUSTOM_QUESTIONS(keywords, **kwargs)




    def _problem_order_of_magnitude(self, *args, **kwargs):
        """
        The order of magnitude of a finite decimal is the exponent in the power of 10 when that decimal is expressed in scientific notation. For example, the order of magnitude of 192.7 is 2, because when 192.7 is expressed in scientific notation as , 2 is the exponent of 102.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_scientific_notation(self, *args, **kwargs):
        """
        The scientific notation for a finite decimal is the representation of that decimal as the product of a decimal s and a power of 10, where s satisfies the property that its absolute value is at least 1 but less than 10, or in symbolic notation, . For example, the scientific notation for 192.7 is .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_angle_preserving(self, *args, **kwargs):
        """
        transformation is angle preserving if (1) the image of any angle is again an angle, and (2) for any given angle, the angle measure of the image of that angle is equal to the measure of the angle.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_basic_rigid_motion(self, *args, **kwargs):
        """
        A basic rigid motion is a rotation, reflection, or translation of the plane. Basic rigid motions are the basic examples of transformations that preserve distances and angle measures.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_between(self, *args, **kwargs):
        """
         A point B is between A and C if (1) A, B, and C are different points on the same line, and (2) .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_congruence(self, *args, **kwargs):
        """
         A congruence is a finite composition of basic rigid motions (rotation, reflections, translations) of the plane.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_congruent(self, *args, **kwargs):
        """
         Two figures in a plane are congruent if there exists a congruence that maps one figure onto the other figure.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_directed_line_segment(self, *args, **kwargs):
        """
        A directed line segment is the line segment AB together with a direction given by connecting an initial point A to a terminal point B.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_distance_preserving(self, *args, **kwargs):
        """
        A transformation is distance preserving if the distance between the images of two points is always equal to the distance between the original two points. Because the length of a segment is (by definition) equal to the distance between its endpoints, such a transformation is also said to be length preserving or said to preserve lengths of segments.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_exterior_angle(self, *args, **kwargs):
        """
        Let be an angle of a triangle, ??ABC, and let D be a point on such that B is between A and D. is an exterior angle of ??ABC.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_reflection(self, *args, **kwargs):
        """
         (description) Given a line ? in the plane, a reflection across ? is the transformation of the plane that maps each point on the line ? to itself, and maps each remaining point P of the plane to its image P? such that ? is the perpendicular bisector of the segment .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_rotation(self, *args, **kwargs):
        """
         (description) For a number d between 0 and 180, the rotation of d degrees around center O is the transformation of the plane that maps the point O to itself, and maps each remaining point P of the plane to its image P? in the counterclockwise half-plane of ray so that P and P? are the same distance away from O and the measurement of is d degrees. The counterclockwise half-plane should be described as the half-plane that lies to the left of as you move along in the direction from O to P.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_sequence_composition_of_transformations(self, *args, **kwargs):
        """
        A composition of transformations is a transformation that is a sequence of two or more transformations given by applying the first transformation followed by applying the next transformation in the sequence to the image of the first transformation, and so on. Given transformations G and F, G ? F is called the composition of F and G, and represents first applying the transformation F and then applying G to the image of F.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_transformation(self, *args, **kwargs):
        """
         A transformation F of the plane is a function that assigns to each point P of the plane a point F(P) in the plane. Given a transformation F, the image of a point A is the point F(A) that the transformation maps the point A to in the plane, and is often denoted simply by A?. Similarly, the image of triangle T is often denoted by T?.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_translation(self, *args, **kwargs):
        """
         (description) For vector , a translation along is the transformation of the plane that maps each point P of the plane to its image P? so that the line is parallel to the vector (or contains it), and the directed line segment points in the same direction and is the same length as the vector.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_transversal(self, *args, **kwargs):
        """
         Given a pair of lines L and M in a plane, a third line T is a transversal if it intersects L at a single point and intersects M at a single but different point.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_vector(self, *args, **kwargs):
        """
         A (bound) vector is a directed line segment, i.e., an "arrow." A vector's initial point is often called its tail, and the terminal point is often called its tip. The length of a directed line segment (vector) is the length of the segment, i.e., AB.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_dilation(self, *args, **kwargs):
        """
         For a positive number r, a dilation with center O and scale factor r is the transformation of the plane that maps the point O to itself, and maps each remaining point P of the plane to its image P? on the ray so that .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_scale_drawing(self, *args, **kwargs):
        """
        For two figures S and S? in the plane, S? is said to be the scale drawing of S with scale factor r if there exists a similarity transformation from S to S? with r the scale factor of the similarity.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_similar(self, *args, **kwargs):
        """
         Two figures in a plane are similar if there exists a similarity transformation taking one figure onto the other figure. A congruence is a similarity with scale factor 1. It can be shown that a similarity with scale factor 1 is a congruence.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_similarity_transformation(self, *args, **kwargs):
        """
        A similarity transformation (or a similarity) is a composition of a finite number of dilations or basic rigid motions. The scale factor of a similarity transformation is the product of the scale factors of the dilations in the composition; if there are no dilations in the composition, the scale factor is defined to be 1.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_average_speed(self, *args, **kwargs):
        """
        Let a time interval of t hours be given. Suppose that an object travels a total distance of d miles during this time interval. The average speed of the object in the given time interval is miles per hour.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_constant_speed(self, *args, **kwargs):
        """
        For any positive real number v, an object travels at a constant speed of v mph over a fixed time interval if the average speed is always equal to v mph for any smaller time interval of the given time interval.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_horizontal_line(self, *args, **kwargs):
        """
        In a Cartesian plane, a horizontal line is either the x-axis or any other line parallel to the x-axis. For example, the graph of the equation is a horizontal line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_linear_equation(self, *args, **kwargs):
        """
        (description) A linear equation is an equation in which both expressions are linear expressions.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_point_slope_equation_of_a_line(self, *args, **kwargs):
        """
        The point-slope equation of a non-vertical line in the Cartesian plane that passes through point (x1,?y1) and has slope m is . It can be shown that every non-vertical line is the graph of its point-slope equation, and that every graph of a point-slope equation is a line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_slope_of_a_line_in_a_cartesian_plane(self, *args, **kwargs):
        """
        The slope of a non-vertical line in a Cartesian plane that passes through two different points is the number given by the change in y-coordinates divided by the corresponding change in the x-coordinates. For two points (x1,?y1) and (x2,?y2) on the line where , the slope of the line m can be computed by the formula The slope of a vertical line is not defined. The definition of slope is well-defined after one uses similar triangles to show that the expression is always the same number for any two distinct points (x1,?y1) and (x2,?y2) on the line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_slope_intercept_equation_of_a_line(self, *args, **kwargs):
        """
        The slope-intercept equation of a non-vertical line in the Cartesian plane with slope m and y-intercept b is It can be shown that every non-vertical line is the graph of its slope-intercept equation, and that every graph of a slope-intercept equation is a line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_solution_to_a_system_of_linear_equations(self, *args, **kwargs):
        """
        (description) A solution to a system of two linear equations in two variables is an ordered pair of numbers that is a solution to both equations. For example, the solution to the system of linear equations is the ordered pair (5, 1) because substituting 5 in for x and 1 in for y results in two true equations: and .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_standard_form_of_a_linear_equation(self, *args, **kwargs):
        """
        A linear equation in two variables x and y is in standard form if it is of the form for real numbers a, b, and c, where a and b are both not zero. The numbers a, b, and c are called constants.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_system_of_linear_equations(self, *args, **kwargs):
        """
        A system of linear equations is a set of two or more linear equations. For example, is a system of linear equations.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_vertical_line(self, *args, **kwargs):
        """
        In a Cartesian plane, a vertical line is either the y-axis or any other line parallel to the y-axis. For example, the graph of the equation is a vertical line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_x_intercept(self, *args, **kwargs):
        """
         An x-intercept of a graph is the x-coordinate of a point where the graph intersects the x-axis. An x-intercept point is the coordinate point where the graph intersects the x-axis. The x-intercept of a graph of a linear equation can be found by setting in the equation. Many times the term x-intercept point is shortened to just x-intercept if it is clear from the context that the term is referring to a point and not a number.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_y_intercept(self, *args, **kwargs):
        """
         A y-intercept of a graph is the y-coordinate of a point where the graph intersects the y-axis. A y-intercept point is the coordinate point where the graph intersects the y-axis. The y-intercept of a graph of a linear equation can be found by setting in the equation. Many times the term y-intercept point is shortened to just y-intercept if it is clear from the context that the term is referring to a point and not a number.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_cone(self, *args, **kwargs):
        """
         Let B be a polygonal region or a disk in a plane E, and V be a point not in E. The cone with base B and vertex V is the union of all segments for all points P in B. A cone is named by its base. If the base is a polygonal region, then the cone is usually called a pyramid. For example, a cone with a triangular region for its base is called a triangular pyramid. A cone with a circular region for its base whose vertex lies on the perpendicular line to the base that passes through the center of the circle is called a right circular cone. This cone is the one usually shown in elementary and middle school textbooks. The name of it is often shortened to just cone.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_cylinder(self, *args, **kwargs):
        """
         Let E and E' be two parallel planes, let B be a polygonal region or a disk in the plane E, and let L be a line that intersects E and E' but not B. At each point P of B, consider the segment parallel to line L, joining P to a point P? of the plane E?. The union of all these segments is called a cylinder with base B. The regions B and B? are called the base faces (or just bases) of the prism. A cylinder is named by its base. If the base is a polygonal region, then the cylinder is usually called a prism. For example, a cylinder with a triangular region for its base is called a triangular prism. A cylinder with a circular region for its base that is defined by a line that is perpendicular to the base is called a right circular cylinder. This cylinder is the one usually shown in elementary and middle school textbooks, where the name is often shortened to just cylinder.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_equation_form_of_a_linear_function(self, *args, **kwargs):
        """
        (description) The equation form of a linear function is an equation of the form , where the number m is called the rate of change of the linear function and the number b is called the initial value of the linear function. To calculate the output named by the dependent variable y, an input is substituted into the independent variable x and evaluated.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_function(self, *args, **kwargs):
        """
         (description) A function is a correspondence between a set (whose elements are called inputs) and another set (whose elements are called outputs) such that each input corresponds to one and only one output. The correspondence is often given as a rule: The output is a number found by substituting an input number into the variable of a one-variable expression and evaluating. For example, a proportional relationship is a special type of function whose output is always given by multiplying the input number by another number (the constant of proportionality).
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_graph_of_a_linear_function(self, *args, **kwargs):
        """
        The graph of a linear function represented by the equation is the set of ordered pairs (x,?y) for inputs x and outputs y that make the equation true. When the graph of a linear function is a line (i.e., the set of inputs is all real numbers), then m is the slope of the line, and b is the y-intercept of the line.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_lateral_edge_and_face_of_a_prism(self, *args, **kwargs):
        """
        Suppose the base B of a prism is a polygonal region and Pi is a vertex of B. Let be the corresponding point in B? such that is parallel to the line L defining the prism. The segment is called a lateral edge of the prism. If is a base edge of the base B (a side of B), and F is the union of all segments parallel to line L for which points P are in segment and points P? are in B?, then F is a lateral face of the prism. It can be shown that a lateral face of a prism is always a region enclosed by a parallelogram.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_lateral_edge_and_face_of_a_pyramid(self, *args, **kwargs):
        """
        Suppose the base B of a pyramid with vertex V is a polygonal region and Pi is a vertex of B. The segment is called a lateral edge of the pyramid. If is a base edge of the base B (a side of B), and F is the union of all segments for all points P in the segment , then F is called a lateral face of the pyramid. It can be shown that the face of a pyramid is always a triangular region.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_linear_function(self, *args, **kwargs):
        """
        (description) A linear function is a function whose inputs and outputs are real numbers such that each output is given by substituting an input into a linear expression and evaluating.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_solid_sphere_or_ball(self, *args, **kwargs):
        """
        Given a point C in the 3-dimensional space and a number , the solid sphere (or ball) with center C and radius r is the set of all points in space whose distance from the point C is less than or equal to r.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_sphere(self, *args, **kwargs):
        """
         Given a point C in the 3-dimensional space and a number , the sphere with center C and radius r is the set of all points in space that are distance r from the point C.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_association(self, *args, **kwargs):
        """
         (description) An association is a relationship between the two variables of a bivariate data set. The relationship is often expressed in terms of relative frequencies (described using two-way tables of the two domains of variables of the data set) or numerical relationships that can be modeled by functions (most often as linear relationships between the two domains of the two variables for the data set).
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_bivariate_data_set(self, *args, **kwargs):
        """
        (description) A bivariate data set is an ordered list of ordered pairs of data values (called data points). Data sets and bivariate data sets are both called data sets. Data values can be either numerical or categorical. If both are numerical, then the data set is called a numerical bivariate data set.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_column_relative_frequency(self, *args, **kwargs):
        """
        In a two-way table, a column relative frequency is a cell frequency divided by the column total for that cell.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_row_relative_frequency(self, *args, **kwargs):
        """
        In a two-way table, a row relative frequency is the number given by dividing the cell frequency by the row total for that cell.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_scatter_plot(self, *args, **kwargs):
        """
        A scatter plot is a graph of a numerical bivariate data set.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_two_way_frequency_table(self, *args, **kwargs):
        """
        (description) A two-way frequency table is a rectangular table used to summarize data on two categorical variables of a bivariate data set. The rows of the table correspond to the possible categories for one of the variables, and the columns correspond to the possible categories for the other variable. Entries in the cells of the table indicate the number of times that a particular category combination occurs in the data set; the value is the frequency for that combination.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_variable(self, *args, **kwargs):
        """
         (description) A variable is a symbol (such as a letter) that is a placeholder for a data value from a specified set of data values. The specified set of data values is called the domain of the variable.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_a_square_root_of_a_number(self, *args, **kwargs):
        """
        square root of a number b is a number whose square is b. In symbols, a square root of b is a number a such that . Negative numbers do not have any square roots, zero has exactly one square root, and positive numbers have two square roots.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_cube_root(self, *args, **kwargs):
        """
        The cube root of a number b is a number whose cube is b. It is denoted by .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_decimal_expansion(self, *args, **kwargs):
        """
        (description) A whole number (e.g., 3) and an infinite sequence of single-digit numbers (e.g., 1, 4, 1, 5, 9, 2, .?.?. ) is called a decimal expansion and is written as a finite decimal together with ellipses to indicate the infinite sequence (i.e., 3.141592.?.?. ).
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_decimal_expansion_of_a_negative_number(self, *args, **kwargs):
        """
        A decimal expansion of a negative number is a decimal expansion of the absolute value of the number together with a negative sign in front of the expansion.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_decimal_expansion_of_a_positive_real_number(self, *args, **kwargs):
        """
        (description) A decimal expansion of a positive real number x is a decimal expansion with the property that for any and all whole numbers n, if a is the nth finite decimal of that decimal expansion, then .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_decimal_system(self, *args, **kwargs):
        """
        The decimal system is a positional numeral system for representing real numbers by their decimal expansions. The decimal system extends the whole number place value system and the place value systems to decimal representations with an infinite number of digits.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_irrational_number(self, *args, **kwargs):
        """
        An irrational number is a real number that cannot be expressed as for integers p and q with . An irrational number has a decimal expansion that is neither terminating nor repeating.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_th(self, *args, **kwargs):
        """
        The nth Finite Decimal of a Decimal Expansion The nth finite decimal of a decimal expansion is the number represented by the finite decimal obtained by discarding all the digits in the decimal expansion after the nth decimal digit. For example, the 2nd finite decimal of 3.141592.?.?. is 3.14.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_perfect_square(self, *args, **kwargs):
        """
        A perfect square is the square of an integer.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_rational_approximation(self, *args, **kwargs):
        """
        (description) A rational approximation of a real number r is a rational number a with absolute error less than some specified number. Rational approximations are usually found by taking the nth finite decimal a of a decimal expansion of r, which approximates r with absolute error less than or equal to .
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_real_number(self, *args, **kwargs):
        """
        (description) A real number is a number that can be represented by a point on the number line. Any point on the number line corresponds to a real number. (Recall that a number line is a line equipped with a coordinate system.)
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_the_square_root_of_a_number(self, *args, **kwargs):
        """
        Every positive real number x has a unique positive square root called the square root of a number or principle square root of x; it is denoted . The square root of zero is zero.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass




    def _problem_truncated_cone(self, *args, **kwargs):
        """
        (description) Given a cone, a truncated cone is a solid obtained by taking all points of the cone that lie between two planes that are both parallel to its base together with the points of the cone that lie in both planes.
        
        """
        
        problemTemplate = KProblemTemplate()
        problemTemplate.problem_type = kwargs.get('problem_type')
        
        prob_s = f"""
        TODO
        """
        problemTemplate.add_problem(prob_s.strip(), 'text/html')

        soln_s = f"""
        """
        problemTemplate.add_solution(soln_s.strip(), 'text/html')

        answer_s = f"""
        """
        problemTemplate.add_answer(answer_s.strip(), 'text/html')
        
        return problemTemplate
        pass


