djem38 the GPA is automatically calculated when final grades are inserted / updated or deleted.
This is done using triggers. If, for whatever reason (you may have restored a database backup which does not include the triggers), here are the triggers:
For MySQL:
--
-- Name: srcg_mp_stats_update; Type: TRIGGER;
--
CREATE TRIGGER srcg_mp_stats_update AFTER UPDATE ON student_report_card_grades FOR EACH ROW CALL t_update_mp_stats(NEW.student_id, NEW.marking_period_id);
--
-- Name: srcg_mp_stats_insert; Type: TRIGGER;
--
CREATE TRIGGER srcg_mp_stats_insert AFTER INSERT ON student_report_card_grades FOR EACH ROW CALL t_update_mp_stats(NEW.student_id, NEW.marking_period_id);
--
-- Name: srcg_mp_stats_delete; Type: TRIGGER;
--
CREATE TRIGGER srcg_mp_stats_delete AFTER DELETE ON student_report_card_grades FOR EACH ROW CALL t_update_mp_stats(OLD.student_id, OLD.marking_period_id);
For PostgreSQL:
--
-- Name: srcg_mp_stats_update; Type: TRIGGER; Schema: public; Owner: rosariosis
--
CREATE TRIGGER srcg_mp_stats_update AFTER INSERT OR DELETE OR UPDATE ON student_report_card_grades FOR EACH ROW EXECUTE PROCEDURE t_update_mp_stats();
You can execute those SQL requests against your DB using adminer / phpMyAdmin / phpPgAdmin.