How do I add a non-Moodle-generated grade (such as attendance or homework) to the gradebook?
Use the Offline Assignment Activity for this. Note that such grades can be bulk-uploaded from a comma-separated ASCII file, if available. See the circled question-mark help icon in the View submitted assignments page of the Assignments activity (this page is also where you can manually supply grades and comments). You can obtain a list of your course Participants in a format suitable for preparing a bulk-upload file, by clicking on Display a Participants roster in the Participants page.