예제 #1
0
 def setUp(self):
   random.seed(2)
   # Django settings
   from django.conf import settings
   settings._target = None
   os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
       
   body = 'This is a {{quantity1}} and a {{amount1}} and a {{quantity2}} and {{amount2}}'
   self.varDomains = {}
   for sym in symbols('quantity1 amount1 quantity2 amount2'):
     self.varDomains[sym] = ANY_DOMAIN
               
   self.dpTemplate = pt.ProblemTemplate(problemName="DirectProportionAmountProblem", body=body, author=None, varDomains=self.varDomains)
   init.initProblems()
예제 #2
0
 def setUp(self):
   from django.conf import settings
   settings._target = None
   os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
   random.seed(2)
   self.defaultVarDomain = Domain(type=Domain.WHOLE_NUMBER, low=2, high=100)
   varDomains = {LcmProblem.num1: self.defaultVarDomain,
                     LcmProblem.num2: self.defaultVarDomain,
                     LcmProblem.lcm: self.defaultVarDomain}
   self.lcmProblem = LcmProblem(varDomains)
   bodyLcm = "Ram can run a lap in {{num1}} seconds and " + \
             "Shyam can run a lap in {{num2}} seconds. They both start together." + \
             " After how many seconds will they both meet again at the starting point?"
   self.lcmTemplate = ProblemTemplate('LcmProblem', body=bodyLcm, author=None)
   init.initProblems()
예제 #3
0
def initialize():
  init.initProblems()
  init.initTemplatesInDb(force = False)
  init.initSyllabusInDb()