'''
Created on 20-Jan-2022

@author: bthakur
'''

import inspect
import traceback
import random
import numpy as np
from sympy import (latex, Symbol, symbols,
                   Eq, Rational,
                   UnevaluatedExpr as ueval,
                   )

from xv.util import toIntOrFloat, listAttr
from xv.km.storeddata import BaseStoredQuestions
from xv.km import CustomLogarithm as Log
from xv.km.util import latex_log, latex_fraction, latex_exponent

# _grade4_stored_questions
# Grade4StoredQuestions

class Grade4StoredQuestions(BaseStoredQuestions):
    _QUESTION_KEYWORDS = None
    
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        pass
       
    def get_question_inequality(self):
        keywords = [
            'grade4',
            'grade 4',
            'inequality',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Compare.
        $0.2 \quad ? \quad 0.20$
        Choose 1 answer:
        (A) $<$
        (B) $>$
        (C) $=$
        """
        
        soln_s = rf"""
        $<$ means "is less than."
        $>$ means "is greater than."
        $=$ means "is the same as."
        Let's use the place value table to compare our two numbers.
        $\begin{{array}}{{cccc}} 
        \text{{Ones}} & \cdot & \text{{Tenths}} & \text{{Hundredths}} \\
        \hline 0 & \cdot & 2 & 0 \\
        0 & \cdot & 2 & 0
        \end{{array}}$
        All the digits in $0.2$ and $0.20$ are the same so they are equal.
        $0.2=0.20$

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $0.2=0.20$
		"""

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_measurement_unit_litre(self):
        keywords = [
            'grade4',
            'grade 4',
            'measurement_unit_litre',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Complete the table to show equivalent measurements in liters and milliliters.
        $\begin{{array}}{{cc}} 
        \text{{Liters}} & \text{{Milliliters}} \\
        \hline 5 & \\
        14 & \\
        36 & \\
        \end{{array}}$
        """
        
        soln_s = rf"""
        1 liter $=1,000$ milliliters
        5 liters $=5 \times 1,000=5,000$ milliliters
        14 liters $=14 \times 1,000=14,000$ milliliters
        36 liters $=36 \times 1,000=36,000$ milliliters

        $\begin{{array}}{{cc}} 
        \text{{Liters}} & \text{{Milliliters}} \\
        \hline 
        5 & 5000 \\
        14 & 14000 \\
        36 & 36000 \\
        \end{{array}}$
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $0.2=0.20$
		"""

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_division(self):
        keywords = [
            'grade4',
            'grade 4',
            'division',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Divide.
        $2,380 \div 10$
        What will be the place value of the 8 after we divide?
        Choose 1 answer:
        (A) Thousands
        (B) Hundreds
        (C) Ones
        """
        
        soln_s = rf"""
        The 8 in 2,380 is in the tens place.
        Now, let's divide $2,380 \div 10$.
        Dividing by 10 moves every digit one place to the right.
        $\begin{{array}}{{ccccc}} \text {{ Ten thousands }} & \text {{ Thousands }} & \text {{ Hundreds }} & \text {{ Tens }} & \text {{ Ones }} \\ \hline & \rightarrow 2 & 3 & 8 & 0\end{{array}}$
        $2,380 \div 10=238$

        $\begin{{array}}{{ccccc}} \text {{ Ten thousands }} & \text {{ Thousands }} & \text {{ Hundreds }} & \text {{ Tens }} & \text {{ Ones }} \\ \hline & & 2 & 3 & 8\end{{array}}$
        The 8 moves to the ones place.

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        Ones
		"""

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_angle_protractor(self):
        keywords = [
            'grade4',
            'grade 4',
            'angle_protractor',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Which images show a correct way to measure an angle with a protractor?
        Choose 2 answers:
        (A)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/eb07aeb46b01c6c99118db227798af57c692fb40.svg">

        (B)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/ad8f2243d15deffd95e393770c87c14ebaa00f82.svg">

        (C)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/952db9cddfd24a07b67d08797ad6bee387d47351.svg">
        """
        
        soln_s = rf"""
        To measure an angle, the vertex needs to line up with the middle dot of the protractor.
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/30e4fee6e98d861e202db108c20a50c94123d2c1.svg">

        Next, the rays extend from the middle of the protractor to two numbers.
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/f1278211229deba11bafc320abe16a822043da9a.svg">
        
        These images show the correct way to measure an angle with a protractor:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/ad8f2243d15deffd95e393770c87c14ebaa00f82.svg">
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/952db9cddfd24a07b67d08797ad6bee387d47351.svg">
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        These images show the correct way to measure an angle with a protractor:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/ad8f2243d15deffd95e393770c87c14ebaa00f82.svg">
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/952db9cddfd24a07b67d08797ad6bee387d47351.svg">
        
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_decimal_to_fraction(self):
        keywords = [
            'grade4',
            'grade 4',
            'decimal_to_fraction',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Without using a calculator, convert the decimal to a simplified fraction.
        $0.5=$
        """
        
        soln_s = rf"""
        $0.5=5$ tenths $\displaystyle =\frac{{5}}{{10}}$
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/727d0b63d42b1f978492f93780495083ecaecfbd.svg">

        A simplified fraction uses as large of pieces as possible. Can we make an equivalent fraction with larger pieces than tenths?
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/727d0b63d42b1f978492f93780495083ecaecfbd.svg">

        We can make an equivalent fraction using halves.
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/e9448339a4d383a8d5b0bf17cfaf21315a0fae05.svg">
        $0.5=\frac{{1}}{{2}}$
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $0.5=\frac{{1}}{{2}}$
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_height_giraffe(self):
        keywords = [
            'grade4',
            'grade 4',
            'height_giraffe',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Which is the closest to the height of a giraffe?
        Choose 1 answer:
        (A) 5 centimeters
        (B) 5 meters
        (C) 5 kilometers
        <img src="https://cdn.kastatic.org/ka-perseus-images/8c841ffd498ecc1421f418837cbee1243233f177.svg">

        """
        
        soln_s = rf"""
        Is the height of a giraffe closer to 5 centimeters, 5 meters, or 5 kilometers?
        The height of a giraffe is about 5 meters
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        The height of a giraffe is about 5 meters
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_time_addition(self):
        keywords = [
            'grade4',
            'grade 4',
            'time_addition',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Gabriela plays cricket outside with her neighbors for 1 hour and 15 minutes. Gabriela starts playing at 10:15 a.m.
        What time did the clock show when Gabriela stops playing cricket?
        Choose 1 answer:
        (A) 
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/9fca991cb95f76ba89adfc1aaa526707a9e3eaab.svg">

        (B)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/def974496550c48040ee6d5d2ffeb00b48e753b1.svg">
        
        (C)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/d0507250ca7ad8d155c8764bdd41ac5901f6c4eb.svg">

        """
        
        soln_s = rf"""
        We start at $10: 15$ when Gabriela starts playing cricket.
        To determine what time Gabriela stops playing cricket, we add 1 hour and 15 minutes to $10: 15$
        $10: 15+1$ hour $=11: 15$
        $11: 15+15$ minutes $=11: 30$
        Gabriela stopped playing cricket at 11:30.
        Which clock shows 11:30?
        When Gabriela stops playing cricket, the clock showed:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/9fca991cb95f76ba89adfc1aaa526707a9e3eaab.svg">

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/9fca991cb95f76ba89adfc1aaa526707a9e3eaab.svg">
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_yard_to_feet(self):
        keywords = [
            'grade4',
            'grade 4',
            'yard_to_feet',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Jane buys $\frac{{7}}{{3}}$ yard of fabric to make a cat bed. She starts the project by cutting 4 feet of fabric off the end.
        How many feet long is the remaining piece of fabric?
        Choose 1 answer:
        (A) 1 foot
        (B) 3 feet
        (C) 17 feet


        """
        
        soln_s = rf"""
        First, we need to convert $\frac{{7}}{{3}}$ yard to feet.
        1 yard $=3$ feet
        So, $\frac{{7}}{{3}}$ yard $=\frac{{7}}{{3}} \times 3=7$ feet.
        She cuts off a piece of fabric that is 4 feet long.
        We can subtract to find the number of feet of fabric that remains. $7-4=3$ feet
        There are 3 feet of fabric remaining.

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        There are 3 feet of fabric remaining.
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_expansion_of_number(self):
        keywords = [
            'grade4',
            'grade 4',
            'expansion_of_number',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Which of the following place value tables shows 15,690 ?
        Choose 1 answer:
        (A)
        $\begin{{array}}{{|cccccc|}}
        \hline \text{{Ten thousands}} & \text{{Thousands}} & \text{{Hundreds}} & \text{{Tens}} & \text{{Ones}} \\
        \hline 1 & 5 & 9 & 6 & 0 \\
        \hline
        \end{{array}}$
        (B)
        $\begin{{array}}{{|cccccc|}}
        \hline \text{{Hundred thousands}} & \text{{Ten thousands}} & \text{{Thousands}} & \text{{Hundreds}} & \text{{Tens}} & \text{{Ones}} \\
        \hline 0 & 1 & 5 & 6 & 9 & 0 \\
        \hline
        \end{{array}}$
        (C)
        $\begin{{array}}{{|cccccc|}}
        \hline \text{{Ten thousands}} & \text{{Thousands}} & \text{{Hundreds}} & \text{{Tens}} & \text{{Ones}} \\
        \hline 0 & 1 & 5 & 6 & 9 \\
        \hline
        \end{{array}}$

        """
        
        soln_s = rf"""
        $15,690=0$ hundred thousands $+1$ ten thousand $+5$ thousands + 6 hundreds + 9 tens $+0$ ones
        Now, let's fill in $10,000+5,000+600+90$ on the place value chart.
        (B)
        $\begin{{array}}{{|cccccc|}}
        \hline \text{{Hundred thousands}} & \text{{Ten thousands}} & \text{{Thousands}} & \text{{Hundreds}} & \text{{Tens}} & \text{{Ones}} \\
        \hline 0 & 1 & 5 & 6 & 9 & 0 \\
        \hline
        \end{{array}}$
        
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        (B)
        $\begin{{array}}{{|cccccc|}}
        \hline \text{{Hundred thousands}} & \text{{Ten thousands}} & \text{{Thousands}} & \text{{Hundreds}} & \text{{Tens}} & \text{{Ones}} \\
        \hline 0 & 1 & 5 & 6 & 9 & 0 \\
        \hline
        \end{{array}}$
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_angle(self):
        keywords = [
            'grade4',
            'grade 4',
            'angle',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Look at the angle shown below.
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/8577bdaabacf741fa11b40df189ea9efa109503f.svg">
        Estimate the measure of the angle
        Choose 1 answer:
        (A) $145^{{\circ}}$
        (B) $80^{{\circ}}$
        (c) $215^{{\circ}}$
        (D) $305^{{\circ}}$

        """
        
        soln_s = rf"""
        Let's relate the angle shown to benchmark angles.
        What is a reasonable estimate for the measure of the angle?
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/44609febdc207ebef7eab487f3022c0fd134fe3a.svg">
        
        The angle measure is about halfway between $270^{{\circ}}$ and $360^{{\circ}}$.
        $305^{{\circ}}$ is the best estimate for the measure for the angle.
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $305^{{\circ}}$
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_addition(self):
        keywords = [
            'grade4',
            'grade 4',
            'addition',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Add.
        $322,984+86,415$

        """
        
        soln_s = rf"""
        $4+5=9$
        $80+10=90$
        $900+400=1300$
        $1000+2000+6000=9000$
        $20000+80000=100000$
        $100000+300000=400000$
        $322,984+86,415=409,399$
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $322,984+86,415=409,399$
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_complete_the_equations(self):
        keywords = [
            'grade4',
            'grade 4',
            'complete_the_equations',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Complete the equations to solve $4,563 \div 9$.
        $\begin{{aligned}} & 4,563 \div 9 \\ =&(4,500 \div 9)+(63 \div ?)\\ =& 500+7 \\ =& ? \end{{aligned}}$

        """
        
        soln_s = rf"""
        Let's split 4,563 into two numbers that add to make 4,563 . The divisor stays the same for each. $4,563 \div 9=(4,500 \div 9)+(63 \div 9)$
        Now, let's divide $4,500 \div 9$
        $4,563 \div 9=(4,500 \div 9)+(63 \div 9)$
        $=500+(63 \div 9)$
        Next, let's divide $63 \div 9$
        $\begin{{aligned}} 4,563 \div 9 &=(4,500 \div 9)+(63 \div 9) \\ &=500+(63 \div 9) \\ &=500+7 \end{{aligned}}$
        Last, we add the quotients.
        $\begin{{aligned}} 4,563 \div 9 &=(4,500 \div 9)+(63 \div 9) \\ &=500+(63 \div 9) \\ &=500+7 \\ &=507 \end{{aligned}}$
        
        Here are the completed equations:
        $\begin{{aligned}} & 4,563 \div 9 \\ =&(4,500 \div 9)+(63 \div 9) \\ =& 500+7 \\ =& 507 \end{{aligned}}$



        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $\begin{{aligned}} & 4,563 \div 9 \\ =&(4,500 \div 9)+(63 \div 9) \\ =& 500+7 \\ =& 507 \end{{aligned}}$
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_factor_multiple(self):
        keywords = [
            'grade4',
            'grade 4',
            'factor_multiple',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        We know $6 \times 7=42$.
        So, which of the following statements are also true?
        Choose 2 answers:
        (A) 42 is a factor of 7 .
        (B) 6 is a factor of 42 .
        (C) 42 is a multiple of 7 .

        """
        
        soln_s = rf"""
        When both factors are whole numbers, then:
        factor $\times$ factor $=$ multiple $6 \times 7=42$
        - 6 and 7 are factors of 42 .
        - 42 is a multiple of 6 and 7 .
        The true statements are:
        - 6 is a factor of 42 .
        - 42 is a multiple of 7 .


        {hint_s.strip()}
        """
        
        answer_s = rf"""
        - 6 is a factor of 42 .
        - 42 is a multiple of 7 .
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_division_1(self):
        keywords = [
            'grade4',
            'grade 4',
            'division_1',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Divide.
        $413 \div 2= ?$ remainder ?
        """
        
        soln_s = rf"""
        FIX solution

        $413 \div 2=206$ remainder 1
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $413 \div 2=206$ remainder 1
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_fraction_word_problem(self):
        keywords = [
            'grade4',
            'grade 4',
            'fraction_word_problem',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Nicole has $\frac{{2}}{{3}}$ of the butter she needs to make 14 mini pies.
        What is the greatest number of mini pies that Nicole can make with the butter she has?
        Choose 1 answer:
        (A) 7 mini pies
        (B) 8 mini pies
        (C) 9 mini pies
        """
        
        soln_s = rf"""
        FIX solution

        9 mini pies
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        9 mini pies
        
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_identify_shape(self):
        keywords = [
            'grade4',
            'grade 4',
            'identify_shape',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        The following clues will help us identify a shape:
        The shape is a quadrilateral.
        The shape does not have 4 right angles.
        The shape has only 1 pair of parallel sides.
        Which shape matches all three clues?
        Choose 1 answer:
        (A) 
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/cfb1c299763d532dd861ae13e48f1b40390a8dc9.svg">

        (B)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">
        
        (C)
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/f4a87cd6056fac25ffb650cc820a368f7f7d0008.svg">

        """
        
        soln_s = rf"""
        Hint 1: The shape is a quadrilateral.
        A quadrilateral is a polygon with 4 sides.
        These shapes are quadrilaterals:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/f4a87cd6056fac25ffb650cc820a368f7f7d0008.svg">

        Hint 2: The shape does not have 4 right angles.
        These shapes are quadrilateral and do not have 4 right angles:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/f4a87cd6056fac25ffb650cc820a368f7f7d0008.svg">

        Hint 3 : The shape has only 1 pair of parallel sides.
        This shape is a quadrilateral, does not have 4 right angles, and has only 1 pair of parallel sides:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">

        This shape matches all three clues:
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/b787d821b97c96663f4705e1d0a24974086f64b2.svg">
        
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_fraction_word_problem_1(self):
        keywords = [
            'grade4',
            'grade 4',
            'fraction_word_problem_1',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        TODO fraction_word_problem_1

        Amy ran 8 miles. She recorded how long it took her to run each mile, rounded to the nearest $\frac{{1}}{{4}}$ of a minute.
        How long did it take Amy to run her slowest and fastest mile combined?

        """
        
        soln_s = rf"""
        Amy's ran her slowest mile in $8 \frac{{3}}{{4}}$ minutes.
        Amy's ran her fastest mile in $9 \frac{{2}}{{4}}$ minutes.
        To find how long it took Amy to run her fastest and slowest mile combined, we add the two values.
        $9 \frac{{2}}{{4}} \min +8 \frac{{3}}{{4}} \min$

        $\begin{{aligned}} 9 \frac{{2}}{{4}}+8 \frac{{3}}{{4}} &=(8+9)+\left(\frac{{2}}{{4}}+\frac{{3}}{{4}}\right) \\ &=17+\frac{{5}}{{4}} \\ &=17+1 \frac{{1}}{{4}} \\ &=18 \frac{{1}}{{4}} \end{{aligned}}$
        It took Amy $18 \frac{{1}}{{4}}$ minutes to run her fastest and slowest mile combined.

        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $18 \frac{{1}}{{4}}$ minutes
        
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_number_line(self):
        keywords = [
            'grade4',
            'grade 4',
            'number_line',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        TODO number_line

        Which expressions match the following number line?
        Choose 2 answers:
        (A) $\displaystyle \frac{{1}}{{4}}+2$
        (B) $\displaystyle 10 \times \frac{{2}}{{4}}$
        (C) $\displaystyle 2 \times \frac{{5}}{{4}}$
        (D) $\displaystyle \frac{{5}}{{4}}+\frac{{5}}{{4}}$
        """
        
        soln_s = rf"""
        Starting from 0 , the arrow moves a length of $\displaystyle \frac{{5}}{{4}}$ on the number line 2 times to get to the point.
        
        We can express this movement by adding $\displaystyle \frac{{5}}{{4}}+\frac{{5}}{{4}}$.
        We can also express this movement by multiplying $\displaystyle 2 \times \frac{{5}}{{4}}$.
        The following expressions match the number line:
        $\displaystyle \frac{{5}}{{4}}+\frac{{5}}{{4}}$
        $\displaystyle 2 \times \frac{{5}}{{4}}$

        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $18 \frac{{1}}{{4}}$ minutes
        
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_add_fraction(self):
        keywords = [
            'grade4',
            'grade 4',
            'add_fraction',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        $\displaystyle \frac{{37}}{{100}}=\frac{{3}}{{10}}+\frac{{x}}{{100}}$
        $x=$        
        """
        
        soln_s = rf"""
        
        $\displaystyle \frac{{37}}{{100}}=\frac{{3}}{{10}}+\frac{{7}}{{100}}$
        $x=7$        
        
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $x = 7$
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_similar_fraction(self):
        keywords = [
            'grade4',
            'grade 4',
            'similar_fraction',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Move the dot to a fraction equivalent to $\displaystyle \frac{{9}}{{12}}$ on each number line.

        Complete the equation.
        $\displaystyle \frac{{9}}{{12}}=\frac{{f}}{{4}}$
        $f=$
        """
        
        soln_s = rf"""
        
        First, let's graph $\frac{{9}}{{12}}$.

        Numbers are equivalent when they are located at the same point on the number line. $\frac{{3}}{{4}}$ is the at the same location as $\frac{{9}}{{12}}$ on the number line.
        $\frac{{3}}{{4}}=\frac{{9}}{{12}}$
        The number lines should be graphed as follows:
        $\frac{{9}}{{12}}=\frac{{3}}{{4}}$
        $f = 3$
        
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $f = 3$
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_fraction_to_decimal(self):
        keywords = [
            'grade4',
            'grade 4',
            'fraction_to_decimal',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        Express $\displaystyle \frac{{9}}{{10}}$ as a decimal.
        """
        
        soln_s = rf"""
        
        $\displaystyle \frac{{9}}{{10}}=0.9=9$ tenths
        
        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $\displaystyle \frac{{9}}{{10}}=0.9$
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_fraction_word_problem_2(self):
        keywords = [
            'grade4',
            'grade 4',
            'fraction_word_problem_2',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        The table shows the amount of apples three friends collected.
        $\begin{{array}}{{ll}} 
        & \text{{Amount (bucket)}} \\
        \hline 
        \text{{Fred}} & \frac{{5}}{{6}} \\
        \text{{Taylor}} & \frac{{4}}{{6}} \\
        \text{{Amir}} & \frac{{1}}{{6}}
        \end{{array}}$
        How many buckets of apples did Fred and Taylor pick combined?
        buckets
        """
        
        soln_s = rf"""
        To find the amount of apples Fred and Taylor picked combined, we can add.
        $\begin{{aligned}} &\frac{{5}}{{6}}+\frac{{4}}{{6}}\\ =&\frac{{5+4}}{{6}} \\ =&\frac{{9}}{{6}} \end{{aligned}}$
        The amount of apples Fred and Taylor picked combined is $\frac{{9}}{{6}}$ of a bucket, or $1 \frac{{1}}{{2}}$ buckets.

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $\frac{{9}}{{6}}$, or $1 \frac{{1}}{{2}}$ buckets
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_fraction_area(self):
        keywords = [
            'grade4',
            'grade 4',
            'fraction_area',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        How can we calculate the shaded area?
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/9eba602fe4dc715eaf34a575070a8c0ae4494591.svg">
        Choose all answers that apply:
        (A) $6 \times \frac{{3}}{{4}}$
        (B) $18 \times \frac{{1}}{{5}}$
        (C) $18 \times \frac{{1}}{{4}}$
        
        """
        
        soln_s = rf"""
        There are 6 rectangles. $\frac{{3}}{{4}}$ of each rectangle is shaded.
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/9eba602fe4dc715eaf34a575070a8c0ae4494591.svg">
        
        We can find the shaded area by multiplying $6 \times \frac{{3}}{{4}}$.
        We can also find the shaded area by multiplying $18 \times \frac{{1}}{{4}}$.
        We can calculate the shaded area using the following expressions:
        $6 \times \frac{{3}}{{4}}$
        $18 \times \frac{{1}}{{4}}$

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $6 \times \frac{{3}}{{4}}$
        $18 \times \frac{{1}}{{4}}$
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_angle_1(self):
        keywords = [
            'grade4',
            'grade 4',
            'angle_1',
            ]
        
        
        hint_s = rf"""
        <b>See the following managers for more detailed explanation:</b>
        
        
        """
        
        prob_s = rf"""
        TODO angle_1

        What is the measure of $\angle z$ ?
        <img src="https://cdn.kastatic.org/ka-perseus-graphie/dfa48725836d98d804b22c5f9e72593e508d4c26.svg">

        """
        
        soln_s = rf"""
        
        We can add the measures of the parts to find the measure of the whole.
        $80^{{\circ}}+z=140^{{\circ}}$
        We can subtract to find the measure of $\angle z$.
        $140^{{\circ}}-80^{{\circ}}=z$
        The measure of $\angle z$ is $60^{{\circ}}$.

        {hint_s.strip()}
        """
        
        answer_s = rf"""
        $\angle z$ is $60^{{\circ}}$.
        
        """


        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass

    def get_question_SAMPLE(self):
        keywords = [
            'grade4',
            'grade 4',
            ]
        
        hint_s = rf"""
        <b>:</b>
        
        """
        
        prob_s = rf"""

        """
        
        soln_s = rf"""

        
        {hint_s.strip()}

        """
        
        answer_s = rf"""
        
        
        """

        result = {
            'keywords': keywords,
            'prob_s': prob_s.strip(),
            'soln_s': soln_s.strip(),
            'answer_s': answer_s.strip(),
            }
        return result
        pass
    pass
#class Grade4StoredQuestions:
