This file is indexed.

/usr/lib/python2.7/dist-packages/schooltool/requirement/grades.txt is in python-schooltool.gradebook 2.6.3-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
=========================
Grading Integration Tests
=========================

The overarching requirement in this scenario is the school curriculum.  That is,
this requirement represents the work that has to be done to graduate.

First we need to set up the school itself:

  >>> from schooltool.testing import setup
  >>> school = setup.setUpSchoolToolSite()

Next we are creating the base requirement for graduation:

  >>> from schooltool.requirement import interfaces, requirement
  >>> graduation = requirement.Requirement(u'Graduation Requirements')

We want to create a course to provide some context:

  >>> from schooltool.course.course import Course
  >>> from schooltool.course.course import CourseContainer

  >>> courses = CourseContainer()
  >>> econ = courses[u'econ'] = Course()
  >>> econ.title = u'Economics'
  >>> econ.title
  u'Economics'

The course can be adapted to be a ``IRequirement``:

  >>> econ_req = interfaces.IRequirement(econ)
  >>> econ_req
  Requirement(u'Economics')

We want to indicate that Economics is part of the Graduation Requirements:

  >>> graduation[u'econ'] = econ_req
  >>> sorted(graduation.keys())
  [u'econ']

Now we'll create a section of the economics course.  It also implements
``IRequirement``:

  >>> from schooltool.course.section import Section
  >>> from schooltool.course.section import SectionContainer

  >>> sections = SectionContainer()
  >>> econ_section = Section(u"3rd Period Econ.")
  >>> sections[u'3rd-econ'] = econ_section

  >>> sec_req = interfaces.IRequirement(econ_section)
  >>> sec_req
  Requirement(u'3rd Period Econ.')

Create some people.

  >>> from schooltool.person.person import Person

  >>> student = school[u'persons'][u'jane'] = Person(u"Jane Student")
  >>> teacher = school[u'persons'][u'joe'] = Person(u"Joe Teacher")

Grab the student's ``IEvaluations`` adapter:

  >>> evals = interfaces.IEvaluations(student)
  >>> evals
  <Evaluations for <schooltool.person.person.Person object at ...>
  >>> sorted(evals.keys())
  []

The next step is to decide on a scoresystem to use for the requirements. For
simplicity's sake, let use the standard Pass/Fail system:

  >>> from schooltool.requirement.scoresystem import PassFail
  >>> pf = PassFail

We should be able to make an evaluation now:

  >>> from schooltool.requirement import evaluation
  >>> ev = evaluation.Evaluation(sec_req, pf, 'Pass', teacher)
  >>> ev.requirement
  Requirement(u'3rd Period Econ.')
  >>> ev.scoreSystem
  <GlobalDiscreteValuesScoreSystem u'Pass/Fail'>
  >>> ev.value
  'Pass'
  >>> ev.evaluator
  <schooltool.person.person.Person object at ...>

And we then attach the section evaluation to the student being evaluated:

  >>> sorted(evals.keys())
  []
  >>> ev
  <Evaluation for Requirement(u'3rd Period Econ.'), value='Pass'>

We need to do some kind of setup to get this working.

  >>> name = evals.addEvaluation(ev)
  >>> sorted(evals.values())
  [<Evaluation for Requirement(u'3rd Period Econ.'), value='Pass'>]