For the past few hours I’ve been diving deep into the Notes system to find out exactly what needs to be changed in order to be able to add notes to all of Groupings (status quo), Assignments, and individual Students.
From the previous post on the subject:
We have completed the first three steps, including unit and functional tests. Thanks to the polymorphic, “noteable” idea that we used for the relationship between a note and a grouping, the only work necessary to have notes on a different object type is to:
- add a “display_for_note” method to the model, like we did for groupings – this allows us to display these notes
- modify the create a note form in the Notes tab to allow for other types of noteable objects than just groupings
- add a link to the modal dialog in an appropriate location for the object type
For now, I can’t see the best place to place a link to a modal dialog to create a note associated to an assignment or to a student, so I would recommend just adding that functionality to the Notes tab.
This leads me to believe that most of the work is cut out for me. Which as near as I can tell, it is!
I’ll endeavour to break up my changes as mentioned above, described below:
- Low Hanging Fruit – a simple isolated change to add the display_for_note functionality, and associated tests, to the models of Assignments, and Groupings. Also, the notes main page will need to be updated to not have the add_new when there are no ‘noteable’ objects in the DB at all, rather than simply groupings, as it is now.
- Refactor Note Creation page – Once the other objects are able to be “noted” the next place to change is the main notes creation page. Currently it’s designed to look solely for Groupings that we can apply notes to. It will need to be updated with a drop down of the types, and then dynamically update a subsequent drop box with those types. This will be much clearer than simply putting all notable objects into a single drop box, even though it adds another pair of clicks to creating a note from scratch.
- Adding Modal Dialog links to Assignments and Student pages – These will be put in sensible locations, probably adjacent to the edit link in the student table, and on both the Assignment main table page, and the assignment configuration page. We don’t want to confuse people by having ambiguous Notes links without being clear what the noteable object is.
For 3 I’ll need to consult with Victoria for best placement of the links, as this is a usability issue, first and foremost.
Change 2 is also a usability issue somewhat, but I can’t think of a simpler solution interface wise than two drop downs in the create note page.
One issue that should be interesting to deal with is the case of Single student groups. Do we apply the note to the grouping as we do now? Or would it be better to apply it to the student in that group? The obvious solution is to do nothing, and use locality to decide. Whenever a note is being created in marking an assignment of a single student, the most likely intention of the user is to make a note on the grouping, as it’s related to the assignment. Otherwise, they would seek to make a note on the student specifically either in the table of students, or in the Note creation form in the Notes tab.
Input on this plan would be much appreciated, though I won’t be able to answer detailed technical questions until I’m arm deep into the code.