Locking the Markbook
I'd like to have the ability to lock out edits to a particular term in the Markbook once a condition is met; that condition doesn't matter so much because I would want it to be multiple things. Manually, when a report is run, and so on.
How could we go about locking down edits to a particular term in the markbook? I think it would be a good thing for a school administrator to have the ability to lock and unlock the ability for edits to be made to the markbook. A simple check box that says "Enable Term's Markbook" or something to that effect would be stellar.
How could we go about locking down edits to a particular term in the markbook? I think it would be a good thing for a school administrator to have the ability to lock and unlock the ability for edits to be made to the markbook. A simple check box that says "Enable Term's Markbook" or something to that effect would be stellar.
Comments
For this reason, the core will likely never support locking markbook columns or restricting access. For your approach, if you are trying to create an automated system, it may be helpful to work on recording your values as Report grades rather than in the markbook. This will then give you many more options for creating report cards and PDFs from that data.
So, is it a simple database entry in to a reports table then? The reports module is huge, and wrapping my head around all the moving parts has been difficult given my time constraints. Is there a direction you could point me in to get started?
I really like this idea, because I feel like it really is the best of both worlds, combining the current system's functionality with just a redirect from markbook to report.
Once you have the criteria, you're writing to the gibbonReportingValue table. Have a look at the schema of the table. It looks like a lot of fields at first, but a lot of them are relational, which your script should be able to pick up on based on the student you're working with (what class/year/etc they're in). Then, you're recording either a value or a comment, plus some timestamps. Once you're able to start writing consistently to the gibbonReportingValue table from your script, the values would then be available in the interface to preview, proof, generate reports, etc.
Hope this helps!
I do have one last quick question. Right now my module works as a template that gets triggered when a report with that particular template item is added to the report. How can I trigger my module by a button click? Something that just allows me to run the script and store the data with a click of a button?
The documentation isn't perfect, but this page might help you get started creating and submitting a form: https://docs.gibbonedu.org/code/gibbon/forms/form/ and use the process page example in the starter module.
Here's an idea. Could I create a new table or table entry for classes, that marks whether or not a class has been locked? Then, when loading markbook, have the system check for that value and make fields uneditable if true?
It is, technically, safe to add new columns to an existing table and base your code off of that, as long as those columns never conflict with future column names (perhaps prefix them). So you could add a column to the gibbonMarkbookColumn table to indicate if it is locked, and then check that status at the beginning of the markbook edit/enter data pages. There are already different levels of permissions for the markbook, so you could check for the "Edit Markbook_everything" permission, which could allow users to lock and unlock columns, and then show a message to users if they do not have permission.
To make bulk changes to locked columns, I recommend the new Commands feature in the Query Builder module, which would let you write an SQL UPDATE command to change the locked status of columns based on something such as the date or column type.
Hope this helps get you up and running with your changes.