Grade Scale and Overall Meanscore

Hello Good people,

as we await the big day: V21! :slight_smile:

During creating of reports using internal assessments or courses and criteria types, we mostly setup and use grade scale —>

  1. is there a way to have a grade scale such that once a teacher enters marks a grade letter or point equivalent to that mark displays so that there’s a | mark | grade —side by side.

  2. How do we calculate an overall mean score of a student from let’s say an internal assessment and display it on the generated reports(mean score from all the subjects)

PS: coming from excel where you type a score and let the if function do its work :expressionless:

Hi Kelvin,

Each of these are possible through custom templates. Report templates are generally HTML with added Twig templating code. You can find more info about Twig here: It has a lot of functions that can loop and calculate things, but its closer to PHP syntax than Spreadsheet functions. To get started editing templates, I recommend using the duplicate tool in Template Builder > Manage Assets, then making changes and seeing how they work.

  1. This could be achieved by using the value & descriptors in the Manage Grade Scales to set the value to the mark and the descriptor to it’s letter grade. Then, in your template you’d edit it to display both the value and descriptor for each grade.
  2. This could be done by looping over a set of grades in the template and calculating the mean. Check out the Twig loop and set syntax.

Hope this helps get you started.

okay @ross I will try that out:

  1. edit template to display value | descriptor.
  2. loop through values and obtain the mean.

Thank you so much for the response. I will post a feedback once I manage.


Hi @ross and all members

I have managed task1: to automatically display a grade/points from a value entered in internal assessment, works like a charm :wink:

Currently I need to do a for loop to get the mean grade but I am confused with which array to use as limit for my loop and I have realized I need two mean:

  1. for the Course (as there will be 3 internal assessments)
  2. for the overall courses as the final overall grade.

Attached find the inspect array file probably you can guide me on how I will go about this or something that can help me out.

Kind Regards,

Kelvin M W

Hi Kelvin,

The following syntax may help. It can be added near the top of your template so that you can output it later in the template text. For the course mean, replace the key “COURSE” with the short name of the course (which can be done inside your main assessments loop). It turns out Twig’s associative array indexing syntax is a bit odd, hence the merge in there.

`{% set total = 0 %}
{% set totalArray = [] %}

{% for assessment in internalAssessment %}

    {% set total = total + assessment.attainmentValue|number_format %}

    {% set courseTotal = totalArray[assessment.courseNameShort] %}
    {% set totalArray = totalArray|merge({ (assessment.courseNameShort) : courseTotal + assessment.attainmentValue|number_format}) %}

{% endfor %}

Mean: {{ total / internalAssessment|length }}
Course Mean: {{ totalArray["COURSE"] / 3 }}
` ```

Hi Sandra,

Thank You sooooooo much! I really appreciate the effort, and to be honest this would have been a bit tough to come up with since I was trying several different ways.

Let me try that and put everything together.

Thank you.