If you look at the properties of grade_grades and grade_items (either the class definitions, or the database tables) then it is not clear that the data we have is quite right for what we really need.
Fortunately, it is not bad. As I said before, the gradebook works for most people most of the time. But still, solving some of the other problems will only be possible with a change to the model, and it is not clear how the model should be changed to solve all the problems. Working that out will require some serious, deep requirements analysis.
Some examples of some specific problems with the model:
1. Let's start with the good news, one that was solved in the past. It used to be impossible to have 'extra credit' activities, beloved of the Americans. Now you can.
2. However, I think it is still not possible to have grades above 100% or below 0%, and perhaps it should?
3. The thing we have been arguing about in the other thread: Should the visibility of the grade item be a separate concept from the visibility of the corresponding activity, or one and the same?
4. At the moment whether a grade item is visible can have three states: Hidden, Visible, or Hidden until a given date. It is not clear that third option should really be build into the data model. The alternative is to have grade items be either hidden or visible at any one time, and if you want that to change automatically at a set time, should have a separate plugin that makes that change at the right time.
5. I am about to explain another issue as Problem C.
Note that it is not just enough to have a model that is logically self-consistent and lets us write bug-free code. We also need to have a model that makes sense to teacher. Of course most teachers should not need to understand the full model. As I say, simple scenarios work for most people with the current faulty model. But there will always be power-users, and we should be able to explain the full model to them if they are interested.