def test_average_partial_round_before_letter(self):
     """ Example:
         ave(75.49, 77.50) = 76.495 = 76.50 = C+
         See /docs/specs/grade_scales.md
     """
     score1 = 75.49
     score2 = 77.50
     s1_ids = [self.data.mp1.id ,self.data.mp2.id]
     student = self.data.student
     course = Course.objects.create(
         fullname="Some", shortname="some", credits=1, graded=True)
     section = CourseSection.objects.create(
         name=course.shortname, course=course)
     ce = CourseEnrollment.objects.create(
         user=student,
         course_section=section)
     build_grade_cache()
     grade1 = Grade.objects.get_or_create(
         student=student,
         course_section=section,
         marking_period=self.data.mp1)[0]
     grade2 = Grade.objects.get_or_create(
         student=student,
         course_section=section,
         marking_period=self.data.mp2)[0]
     grade1.set_grade(score1)
     grade1.save()
     grade2.set_grade(score2)
     grade2.save()
     self.assertEqual(ce.get_average_for_marking_periods(s1_ids, letter=True), 'C+')
 def handle(self, *args, **options):
     try:
         if Student.objects.first():
             raise CommandError('You cannot run this on a already populated database')
     except OperationalError: # New database
         import django
         if django.get_version()[:3] != '1.7':
             call_command('syncdb', all=True, interactive=False)
         else:
             call_command('migrate', interactive=False)
     self.data = SampleTCData()
     self.data.create_sample_tc_data()
     build_grade_cache()
     self.stdout.write('Success. Good Job!')
 def setUp(self):
     self.data = SampleTCData()
     self.data.create_sample_tc_data()
     build_grade_cache()
 def setUp(self):
     self.data = SampleTCData()
     self.data.create_sample_tc_data()
     build_grade_cache()
Esempio n. 5
0
 def build_grade_cache(self):
     from ecwsp.grades.tasks import build_grade_cache
     build_grade_cache()
Esempio n. 6
0
 def setUp(self):
     self.data = SampleTCData()
     self.data.create_sample_tc_data()
     self.data.create_sample_tc_benchmark_data()
     self.fetch_useful_data_and_bind_to_self()
     build_grade_cache()
Esempio n. 7
0
 def setUp(self):
     self.data = SampleTCData()
     self.data.create_sample_tc_data()
     self.data.create_sample_tc_benchmark_data()
     self.fetch_useful_data_and_bind_to_self()
     build_grade_cache()
Esempio n. 8
0
 def build_grade_cache(self):
     from ecwsp.grades.tasks import build_grade_cache
     build_grade_cache()