Report template

Hi, I pinned myself to an old post from 2021 Reports and Markbooks - #8 by Dechen 10 days ago, but received no reply and it seems no one has viewed it, so copying my message here.
Please could you let me know if there have been any changes since 2021 regarding displaying multiple sets of grades in the report? We have to publish a report in a format that would collect data from all students and combine them into one table, as seen in the picture below:


Currently only Markbooks allow for such displays, as far as I my knowledge of the system goes…I would really appreciate your guidance and any suggestions as to how to tweak HTML if that’s necessary.
Many thanks

Hi @Dechen

How is the Improvement column being calculated?

Are you looking for a report that can exported to excel?

Cheers.

Hi, The improvement column is calculated based on the total figure from last semester (LS), where this semester’s figure(TS) is in column L on the picture above:
=(TS-LS)/LS
By the way, would it be possible to generate the Total figure in the report? the formula looks like this, based on the above example:
=ROUND(((I410.25)+(J410.35)+(K41*0.4)),1)
ROUND defines a number of decimals

Thank you very much for looking into this

Hi @Dechen,

If your goal is to generate reports based on calculations performed on grades in the Markbook—enabling you to visualize them instantly and export the results to Excel—one approach is to use the Query Builder module. Below is an example query you can build upon, followed by its output.

WITH RankedResults AS (
    SELECT 
        gibbonSchoolYearTerm.name AS Term,
        gibbonCourse.nameShort AS Course,
        gibbonPerson.Surname AS Surname,
        gibbonPerson.PreferredName AS PreferredName,
        CONCAT(
            ROUND(MAX(IF(gibbonMarkbookColumn.name = 'Language skill 25%', 
                         CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                         NULL)), 1), '%'
        ) AS Language_Skill,
        CONCAT(
            ROUND(MAX(IF(gibbonMarkbookColumn.name = 'Effort 35%', 
                         CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                         NULL)), 1), '%'
        ) AS Effort,
        CONCAT(
            ROUND(MAX(IF(gibbonMarkbookColumn.name = 'Behaviour 40%', 
                         CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                         NULL)), 1), '%'
        ) AS Behaviour,
        CONCAT(
            ROUND((
                MAX(IF(gibbonMarkbookColumn.name = 'Language skill 25%', 
                       CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                       NULL)) * 0.25 +
                MAX(IF(gibbonMarkbookColumn.name = 'Effort 35%', 
                       CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                       NULL)) * 0.35 +
                MAX(IF(gibbonMarkbookColumn.name = 'Behaviour 40%', 
                       CAST(REPLACE(gibbonMarkbookEntry.attainmentValue, '%', '') AS DECIMAL), 
                       NULL)) * 0.4
            ), 1), '%'
        ) AS Total,
        ROW_NUMBER() OVER (
            PARTITION BY gibbonCourse.nameShort, gibbonPerson.Surname, gibbonPerson.PreferredName
            ORDER BY gibbonSchoolYearTerm.name ASC
        ) AS rankOrder
    FROM 
        gibbonMarkbookColumn 
    LEFT JOIN gibbonSchoolYearTerm 
        ON gibbonMarkbookColumn.gibbonSchoolYearTermID = gibbonSchoolYearTerm.gibbonSchoolYearTermID
    JOIN gibbonCourseClass 
        ON gibbonMarkbookColumn.gibbonCourseClassID = gibbonCourseClass.gibbonCourseClassID 
    JOIN gibbonCourse 
        ON gibbonCourseClass.gibbonCourseID = gibbonCourse.gibbonCourseID
    JOIN gibbonMarkbookEntry 
        ON gibbonMarkbookEntry.gibbonMarkbookColumnID = gibbonMarkbookColumn.gibbonMarkbookColumnID
    JOIN gibbonPerson 
        ON gibbonMarkbookEntry.gibbonPersonIDStudent = gibbonPerson.gibbonPersonID 

    GROUP BY 
        gibbonSchoolYearTerm.name,
        gibbonCourse.nameShort,
        gibbonPerson.Surname,
        gibbonPerson.PreferredName
)
SELECT 
    r1.Course,
    r1.Surname,
    r1.PreferredName,
    r1.Term,
    r1.Language_Skill,
    r1.Effort,
    r1.Behaviour,
    r1.Total,
    CASE 
        WHEN r1.rankOrder > 1 THEN 
            ROUND((CAST(REPLACE(r1.Total, '%', '') AS DECIMAL) - CAST(REPLACE(r2.Total, '%', '') AS DECIMAL)) / CAST(REPLACE(r2.Total, '%', '') AS DECIMAL) * 100, 1)
        ELSE NULL
    END AS Improvement
FROM 
    RankedResults r1
LEFT JOIN 
    RankedResults r2
    ON r1.Course = r2.Course
    AND r1.Surname = r2.Surname
    AND r1.PreferredName = r2.PreferredName
    AND r1.rankOrder = r2.rankOrder + 1
ORDER BY 
    r1.Course,
    r1.Surname,
    r1.PreferredName,
    r1.Term;



+++++++++++++++++++++++++++++++++++
These are the only columns you need in the gradebook for each term/semester:

+++++++++++++++++++++++++++++++++++

In the Query Builder module, we calculate the [Total 100%] and [Improvement] values for consecutive terms, using the formulae provided.

I hope this helps,

Tieku

Thank you so much for this! looks like you’ve given it a lot of time! I have saved the above query in the Query Builder and then run it but it returned 0 results. Is there anything else that I need to know/do?
FYI so far I have entered records in a markbook for 1 one english class and for 1st term only.

The query likely returned no results because the School Year and Year Group values were hardcoded. I’ve updated the query; please test it again and let me know the outcome. Additionally, ensure the column names match exactly: “Language skill 25%”, “Effort 35%”, and “Behaviour 40%”.

Thank you very much! It worked :slight_smile: I don’t know how difficult would it be to do something similar that would pull information from the reports’ data? I am not sure which interface the teachers will prefer and what will work best long term…
Thanks a million for your kind support

I was not very specific. These are the report criteria:


CHN criteria also apply to ENG, FR, NPL, SH courses.

In any case, would it be possible to list the Total scores in a descending order for each course separately? now it looks like this

I wish I knew how to do it myself :slightly_frowning_face: