eClass Support
Grade Calculations
Last modified on 05 September 2024 03:10 PM

In the eClass gradebook, as an alternative to using the built-in mechanisms to calculate a course total, instructors can use formulas to compute grades, using  other grade items as variables if desired. Note that this feature is usually never required and is not recommended for most course total or category calculations. The entry of grade calculations uses a similar syntax and functions as what is available in common spreadsheet applications so in some scenarios this can be very useful to have in a course (see the example calculations below). 

Important note: when rolling courses forward, calculated columns will show an error until new grade item IDs are added. These issues MUST be repaired to avoid poor course and site performance. Please see the notes section below for more information and instructions for repairing this.

Enable Calculations:

Before adding any grade calculations, in 'Gradebook Setup', under Preferences: Grader report, Show calculations to 'Yes'. This step is required -- if it is not enabled, you will not see 'Edit calculation' as an option for any grade items. This action only needs to be done once per user and will remain in place across courses.

To set up grade calculations:

  1. Go to the Gradebook setup
  2. Find a manual grade item or grade category in the list and click Edit and then Edit calculation. (Calculations cannot be applied to grades derived from course activities like quizzes or assignments.)




  3. The most common use of a custom calculation is to manipulate an existing grade in some way. Existing grades can be used in calculations by assigning them ID numbers on the bottom half of the page. Existing IDs will appear to the right of each grades category or item. To add IDs, enter a unique identifier into the box shown next to the grade item or category then click Add ID numbers at the bottom of the page. The page will save and refresh showing the newly assigned ID numbers that can now be use in a grade calculation.




  4. Enter a formula, beginning with an equal sign (=), including any functions and ID numbers if required. ID numbers must be enclosed by double square brackets. e.g. for a grade item with XYZ as an ID number, use [[XYZ]] in the formula. See below for more details about constructing calculations.



  5. Click the Save Changes.

 

Constructing Calculations:

The following standard operations are available: 

  • Addition - using the plus + sign
  • Subtraction - using the minus - sign
  • Multiplication - using the asterisk * character
  • Division - using the slash / character
  • Exponentiation - using the caret ^ character
  • Round brackets for multiplication and order of operations - using ( and )

The following functions are available:

  • average([[item1]], [[item2]]...): Returns the average of the values in a list of arguments
  • ceil(number): Maps a real number to the smallest following integer
  • floor(number): Maps a real number to the largest previous integer
  • if([[item1]], [[item2]], [[item3]]): Evaluates the first argument (condition) and returns the second argument if the condition is not zero (true condition) and returns the third argument if the condition is zero (false condition).
  • max([[item1]], [[item2]]...): Returns the maximum value in a list of arguments
  • min([[item1]], [[item2]]...): Returns the minimum value in a list of arguments
  • mod(dividend, divisor): Calculates the remainder of a division
  • pi(): Returns the value of the number Pi (3.14159265...)
  • power(base, exponent): Raises a number to the exponent power (this is the same as base^exponent)
  • round(number, count): Rounds number to count decimal digits
  • sum([[item1]], [[item2]]...): Returns the sum of all arguments (this is the same as [[item1]]+[[item2]]+...

Other supported functions: 

  • sin()
  • sinh()
  • arcsin()
  • asin()
  • arcsinh()
  • asinh()
  • cos()
  • cosh()
  • arccos()
  • acos()
  • arccosh()
  • acosh()
  • tan()
  • tanh()
  • arctan()
  • atan()
  • arctanh()
  • atanh()
  • sqrt()
  • abs()
  • ln()
  • log()
  • exp()

 

Example Calculations:

  • Return the maximum value of the grades referred by Quiz.1, Quiz.4 and Assignment.1
    • =max([[Quiz.1]], [[Quiz.4]], [[Assignment.1]])
  • Returns the average of the maximum and the minimum values among Quiz.1, Quiz.4 and Assignment.1 (functions can be nested)
    • =average(max([[Quiz.1]], [[Quiz.4]], [[Assignment.1]]), min([[Quiz.1]], [[Quiz.4]], [[Assignment.1]]))
  • Return a weighted grade sum where item1 is weighted 30%, item2 is weighted at 60% and item3 is weighted at 200%
    • =sum([[item1]]*0.3, [[item2]]*0.6, [[item3]]*2)
  • Return the sum of midtermexam and lab items if the midtermexam grade is 5 of more, and 0 otherwise. This is a way of handling conditional evaluation in a course.
    • =if([[midtermexam]]>=5, [[midtermexam]]+[[lab]], 0)
  • Returns the average of item1 and item2 if both have 5 of more, and 0 otherwise. This is a way to handle sine qua non activities.
    • =if(AND([[item1]]>=5, [[item2]]>=5), ([[item1]]+[[item2]])/2, 0)
  • Return a threshold score across a series of similar items, ie. students can receive a maximum of 10 points across all their forum submissions
    • =min([[ID-of-forum-category-total]],10)

 

Additional notes:

  • When courses with complex calculations are rolled forward, these grade columns will show up as 'Error' in the grader report:



    This will persist until new grade item IDs are manually added (as in step #3. above). In the broken state, the calculations will show a hash syntax to indicate that they were pointing to grade item IDs in the previous course:



  • For Campus St. Jean instructors or any others using the French language pack, he examples shown here in this guide use a comma (,) as a separator. If your course in displayed using the French language, you may be required to use a semicolon instead (;) as a separator.
  • The Moodle community has also developed the following video tutorials:
(0 vote(s))
Helpful
Not helpful

Comments (0)
-->