示例#1
0
 def __init__(self):
     self.type = Types.Equation_First_order_one_unknown
     self.complexity = Complexity.Moderate
     self.arg1,self.arg2,self.arg3 = get_n_distinct(args,3)
     self.num1,self.num2,self.num3 = get_n_distinct([12,13,14,15,16,17,18,19,20],3)
     self.num1 = self.num2 + self.num3
     self.body = "Given {arg1} = {arg2}+{arg3}. If {arg1}={num1} and {arg2}={num2}, What is {arg3}?"\
         .format(arg1=self.arg1, arg2=self.arg2, arg3=self.arg3, num1=self.num1, num2=self.num2)
示例#2
0
 def __init__(self):
     self.type = [Types.Chart, Types.sat_reasoning]
     self.complexity = Complexity.Moderate
     scores = [20, 40, 60, 80, 100, 120]
     self.scores_boys = get_n_distinct(scores, 4)
     self.scores_girls = get_n_distinct(scores, 4)
     wording = random.sample(['mean', 'average'], 1)[0]
     self.body = "Looking at the given chart of scores per courses, what is the " + wording + " of girls scores in all courses?"
     self.res = sum(self.scores_girls) / 4.0
示例#3
0
 def __init__(self):
     self.type = Types.Equation_First_order_one_unknown
     self.complexity = Complexity.Advanced
     self.arg1, self.arg2, self.arg3 = get_n_distinct(args, 3)
     self.num1, self.num2, self.num3 = get_n_distinct(range(20, 50), 3)
     self.const = random.choice(range(10, 20))
     self.num1 = self.num2 + self.num3 - self.const
     self.body = "Given {arg1} = {arg2} + {arg3} - {const}. If {arg1}={num1} and {arg2}={num2}, What is {arg3}?"\
         .format(arg1=self.arg1, arg2=self.arg2, arg3=self.arg3, num1=self.num1, num2=self.num2, const=self.const)
示例#4
0
 def __init__(self):
     self.type = Types.Chart
     self.complexity = Complexity.Moderate
     scores = [20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100]
     self.scores_boys = get_n_distinct(scores, 4)
     self.scores_girls = get_n_distinct(scores, 4)
     self.courses = ('Maths', 'Science', 'Reading', 'Writing')
     self.body = "Looking at the given chart of scores per courses, what is the ratio of total scores of girls over boys?"
     self.res = Fraction(sum(self.scores_girls), sum(self.scores_boys))
示例#5
0
    def __init__(self):
        self.type = Types.Fraction_add
        self.complexity = Complexity.Advanced
        self.ratio3, self.ratio2, self.ratio1 = get_n_distinct(
            simple_fractions, 3)

        self.res = self.ratio1 + self.ratio2 - self.ratio3
示例#6
0
 def __init__(self):
     self.type = Types.Percentage
     self.complexity = Complexity.Advanced
     self.male,self.female = get_n_distinct([30,40,50,60,70,80,90],2)
     self.body = "In a school, there are {0} female and {1} male students. What percentage of school pupils are male and female.".format(self.female,self.male)
     total = self.male + self.female
     self.resm,self.resf = (self.male*100.0)/total, (self.female*100.0)/total
示例#7
0
    def __init__(self):
        self.type = Types.fraction_add
        self.complexity = Complexity.Basic
        self.ratio3, self.ratio2, self.ratio1 = get_n_distinct(
            random_fractions, 3)

        self.res = self.ratio1 + self.ratio2 - self.ratio3
示例#8
0
 def __init__(self):
     self.type = Types.Geometry_angle
     self.complexity = Complexity.Basic
     pool = [1, 10, 20, 25, 30, 35, 40, 45, 50, 55, 60, 70, 80, 90, 100, 110, 115, 120, 125, 130, 145, 175, 179, 180,
             200, 250, 270, 300, 330, 360]
     angles = get_n_distinct(pool, 4)
     self.body = "Identify the angle types {0} (acute, right, obtuse, straight, reflex, full)?".format(angles)
     self.res = [angle_identifier(a) for a in angles]
示例#9
0
 def __init__(self):
     self.type = Types.Percentage
     self.complexity = Complexity.Moderate
     self.percentages = get_n_distinct([1, 2, 5, 7, 8, 9, 10, 20, 50], 4)
     self.languages = get_n_distinct([
         "German", "Turkish", "Mandarin", "Spanish", "Arabic", "Urdu",
         "Hindu"
     ], 4)
     self.population = random.choice([1000, 2000, 3000])
     self.spoken = [(self.population / 100) * per
                    for per in self.percentages]
     self.body = "In a school with {pop} students".format(
         pop=self.population)
     c = 0
     for p in self.spoken:
         self.body += ", {many} speaks {lang}".format(
             many=p, lang=self.languages[c])
         c += 1
     self.body += ". What are the percentages of these students speaking these languages?"
示例#10
0
 def __init__(self):
     self.type = Types.Money
     self.complexity = Complexity.Moderate
     self.subject = random.choice(boys)
     self.count = random.choice([4, 5])
     self.coins = get_n_distinct([1, 2, 5, 10, 20, 50], self.count)
     self.total = 0
     for coin in self.coins:
         self.total += coin
     self.body = "{subj} has {count} unique coins (in pences) in his hand. He knows its a total of {total}, can you identify which coins are these?"\
         .format(subj=self.subject, count=self.count, total=self.total)
示例#11
0
 def __init__(self):
     self.type = Types.Power
     self.complexity = Complexity.Moderate
     self.first, self.second, self.third, self.fourth = get_n_distinct(
         range(0, 11), 4)
     self.res = [
         cube(self.first),
         cube(self.second),
         cube(self.third),
         cube(self.fourth)
     ]
示例#12
0
    def __init__(self):
        self.type = Types.hcf
        self.complexity = Complexity.Basic
        pairs = []
        for i in range(2):
            pairs.append(get_n_distinct(Question4.q, 2))

        self.q = f"Find the Highest Common Factor(HCF) (also known as Greatest Common Divisor(GCD)) of {' and '.join([str(i) for i in pairs])}"
        res = []
        for pair in pairs:
            res.append(hcf(pair[0], pair[1]))
        self.r = ' , '.join([str(i) for i in res])
示例#13
0
    def __init__(self):
        self.type = Types.lcm
        self.complexity = Complexity.Basic
        pairs=[]
        for i in range(2):
            pairs.append(get_n_distinct(Question5.q, 2))

        self.q = f"Find the Lowest Common Multiple(LCM) of {' and '.join([str(i) for i in pairs])}"
        res = []
        for pair in pairs:
            res.append(lcm(pair[0], pair[1]))
        self.r = ' , '.join([str(i) for i in res])
示例#14
0
 def __init__(self):
     self.type = [Types.Time_add]
     self.complexity = Complexity.Basic
     self.place = random.choice(places)
     self.subj1, self.subj2 = get_n_distinct(subjects, 2)
     self.start = datetime.now()
     self.start_str = "{0}:{1}".format(self.start.hour, self.start.minute)
     hrs = random.choice([1, 2, 3, 4])
     delta = timedelta(hours=hrs)
     seconds = delta.total_seconds()
     hours = seconds // 3600
     minutes = (seconds % 3600) // 60
     self.spent = ""
     if hours != 0:
         self.spent = "{0} hours ".format(int(hours))
     if minutes != 0:
         self.spent = self.spent + "{0} minutes ".format(int(minutes))
     self.body = "{0} and {1} met at the {2} at {3}. If they spent {4} visiting the place, when do they leave. ".format(
         self.subj1, self.subj2, self.place, self.start_str, self.spent)
     result = (self.start + delta)
     self.res = "They leave at {0}:{1}".format(result.hour, result.minute)
示例#15
0
 def __init__(self):
     self.type = Types.Power
     self.complexity = Complexity.Basic
     self.first, self.second, self.third, self.fourth = get_n_distinct(range(0,21),4)
     self.res = [sq(self.first),sq(self.second),sq(self.third),sq(self.fourth)]