Reporting Term total from Markbook

Hello good people,
I was trying to create a "mark book by course" report replicating the idea from V22 which used to report internal assessment by course.

I have managed to fetch the value from the markbook as shown in the attached file. My target is to calculate the value of each markbook columns course wise and display the total mark as per the associated Term.
Where Term 1 will have course 1 and total mark ...and Term 2 will have the same

Please Help.


  • Hi anteneh, looks like you're off to a great start. If you check out the MarkbookView class in the moudles/Markbook/src directory, this may help you with the term calculations you're looking for. You can see the MarkbookView in action on the Markbook page, however the code for that page is massive, so here's a snippet of how it's being used. In your script, you'd likely want to fetch your data, then loop over and process it using this class, and return the resulting array of data:
    // Build the markbook object for this class
    $markbook = new MarkbookView($gibbon, $pdo, $gibbonCourseClassID);
    // You don't necessarily need to use the below query, which is for a whole class. Just ensure your data has the same columns and names, and create a new DataSet() before passing it into the loadColumnsFromDataSet() method.
    $columns = $markbookGateway->queryMarkbookColumnsByClass($criteria, $gibbonCourseClassID);
    // Load the columns for the current page
    // Cache all weighting data for efficient use below
    if ($markbook->getSetting('enableColumnWeighting') == 'Y') {
        $markbook->cacheWeightings( );
    // Once the data is loaded into the $markbook object, you can get the calculated term and overall averages with methods like:
    $markbook->getTermAverage($rowStudents['gibbonPersonID'], $term['gibbonSchoolYearTermID']);
Sign In or Register to comment.