Make "Date" Optional When "Term" Exists in Markbook Columns

Hi @sandra @Ali

In Gibbon versions prior to v25, the term for a Markbook column was inferred from the date when the column was created.

Later, the explicit “Term” field was introduced, which has been very useful. I typically enable “Group Columns by Term” so columns and totals are grouped correctly by term.

It is very convenient to import columns using DataStructure-markbookColumns.xlsx. In many cases, I fill in the “Term Added” field but leave “Date Added” blank, since it is not required during import.

However, if I later edit one of those imported columns, I cannot save my changes unless I provide a value for “Date”. It is set to the current date by default and can be changed.

Would it make sense to make “Date” non-required whenever “Term” is already filled in?

At that point, the date is no longer needed to infer the term, since the term has already been explicitly defined.

One issue this currently creates is that if a user enters a Date value that conflicts with the selected term, the column can appear under both:
• the explicitly selected term, and
• the term inferred from the date.

Just wondering if this logic could be simplified now that explicit term support exists.

Thanks

Hi @sandra

I’ve opened a PR for this: Markbook: use explicit Term over Date when filtering columns, and make Date optional when a Term is set by tiekubd · Pull Request #2194 · GibbonEdu/core · GitHub

With Group Columns by Term on, the explicit Term now takes priority:

  • Date is optional when a Term is set. Imported columns that have Term Added but no Date Added can now be edited and saved without entering a date. If a Term is set, a blank date stays empty. If neither is set, it still defaults to today.
  • No more showing up in two terms. A column now only appears under its selected term in the teacher Markbook view, even if its date falls in another term.
  • Older columns are unchanged. Columns with no Term are still placed by their date, as before.

It’s tested on v31.0.00 and needs no database changes.

One related thing I noticed: the student, parent and Student Profile Markbook views group columns by Go Live date rather than Term. A column can therefore show under a different term there than in the teacher view. I’ve left that out of this PR, but I’m happy to send a follow-up if you’d like those views to use Term in the same way.

Thanks!