Moodle
  1. Moodle
  2. MDL-14274

Make it possible to add conditions (IF) to grade calculations in 1.9 gradebook - please

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.9
    • Fix Version/s: 2.0.10
    • Component/s: Gradebook
    • Labels:
      None
    • Environment:
      na
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE
    • Rank:
      341

      Description

      I understand that when calculating the grade for a category or total grade in moodle 1.9, it is possible to use various formulas:

      http://moodle.org/help.php?module=grade&file=calculation.html

      However, it does not appear to be possible to use an IF formula (condition) as can be done in Excel.

      It would be very useful to be able to calculate the total of x number of graded activities, but not include the scores of those activities that are less than a certain %.

      So for example, if there are three graded activities for which students must get 50% or more, the formula in Excel would be as follows:

      =SUM((IF(A1>=50,A1,0))+IF(B1>=50,B1,0)+IF(C1>=50,C1,0))

      where A1, B1, & C1 are the three graded activities. Here, A1, A2 & A3 are added together, but if the score of any one activity falls below 50%, it is treated as 0%.

      For example:

      student1
      activityA1: 30
      activityA2: 80
      activityA3: 70
      Total: 150 (Not 180)

      the total for student1 is only 150 (not 180) because his score for quizA1 is less than 50, and so is treated as zero, so 0+80+70=150

      I know it's possible to indicate a "Grade to pass" for any item or category, but this seems to only change the background colour of a score: green for pass, red for fail. It does not effect the category score to which that item belongs.

      So, I can see three possible ways of achieving this goal:
      1) make it possible to use the 'IF' function in the gradebook as in Excel
      2) make it possible to remove from the total calculation any grade that falls below the designated 'Grade to pass": this should be an option, not automatic
      3) make it possible for each activity module to return 0% to the gradebook if the score falls below a specified amount - probably the least practical solution

      Why would this feature be useful?
      Short answer = motivation
      In activities that students can do (i.e. submit) more than once, they would be 'encouraged' to achieve more than a bare minimum. For example, in a course in which there were many quizzes, it would be possible for a student to pass by doing very well in just a few quizzes, and then doing lots of other quizzes badly. Yes, their average would be pulled down, but because they had done a few very well, their average may still be high enough to pass. Allowing the teacher to specify a grade below which certain activities must not fall will assist teachers to motivate their students.

        Issue Links

          Activity

          Hide
          Nicolas Connault added a comment -

          I prefer solution 2, adding a "gradefail counts as 0" option for each grade item, because it's far easier to use than using calculations. However, we could also implement IF, but we won't look at this until 2.0.

          Show
          Nicolas Connault added a comment - I prefer solution 2, adding a "gradefail counts as 0" option for each grade item, because it's far easier to use than using calculations. However, we could also implement IF, but we won't look at this until 2.0.
          Hide
          Peter Ruthven-Stuart added a comment -

          Nicolas,

          Thanks for your comment on this issue.

          Yes, I agree that solution 2 makes most sense. It allows teachers to convert low scoring assignments to 0%, so that students are penalized for performing badly. Also, it doesn't require teachers to learn the various IF equations associated with the Excel IF formulas.

          That said, including IF calculations in version 2 would be welcome, since this would make the Gradebook even more useful, i.e. a teacher could use the conditional formula to do many more things, not just convert less that x% scores to 0%.

          Note to other people coming to this "New Feature" suggestion: In the Moodle Gradebook it is already possible to remove low scoring activities from total scores so that students are NOT penalized for x number of lowest scores.

          The original suggestion here is to make it possible to make conditional calculations (using IF formulas). Just one of the advantages of this is that it would be possible to penalize students that had underperformed. Or, put more positively, 'incentivize' students to perform well, by encouraging them to get at lest x%.

          Show
          Peter Ruthven-Stuart added a comment - Nicolas, Thanks for your comment on this issue. Yes, I agree that solution 2 makes most sense. It allows teachers to convert low scoring assignments to 0%, so that students are penalized for performing badly. Also, it doesn't require teachers to learn the various IF equations associated with the Excel IF formulas. That said, including IF calculations in version 2 would be welcome, since this would make the Gradebook even more useful, i.e. a teacher could use the conditional formula to do many more things, not just convert less that x% scores to 0%. Note to other people coming to this "New Feature" suggestion: In the Moodle Gradebook it is already possible to remove low scoring activities from total scores so that students are NOT penalized for x number of lowest scores. The original suggestion here is to make it possible to make conditional calculations (using IF formulas). Just one of the advantages of this is that it would be possible to penalize students that had underperformed. Or, put more positively, 'incentivize' students to perform well, by encouraging them to get at lest x%.
          Hide
          Otakar Šprdlík added a comment -

          Most of IF formulas can be substituded by other formulas using ROUND, but that are not so straightforward to read.

          For example, at one of our courses homeworks have two parts graded separately, but if the student performs well in both, he/she gets a bonus (grade is 0-1 for each part and the bonus is 1 if both grades are >=0.7 (In fact, I would prefer some smooth nonlinear function in that case but the teachers wanted this threshold :

          =[[part1]]+[[part2]]+round([[part1]]/0,7/2)*round([[part2]]/0,7/2)

          Similar approach can be used to the problem above:
          =A1*ROUND(A1/100)+B1*ROUND(B1/100)+C1*ROUND(C1/100)

          The formula will come more complicated if the threshold is less than 50%.

          We use such "rounding" formulas in several cases. Some of them are very unreadable. Possibility to use IF would improve the situation much.

          Show
          Otakar Šprdlík added a comment - Most of IF formulas can be substituded by other formulas using ROUND, but that are not so straightforward to read. For example, at one of our courses homeworks have two parts graded separately, but if the student performs well in both, he/she gets a bonus (grade is 0-1 for each part and the bonus is 1 if both grades are >=0.7 (In fact, I would prefer some smooth nonlinear function in that case but the teachers wanted this threshold : =[ [part1] ]+[ [part2] ]+round([ [part1] ]/0,7/2)*round([ [part2] ]/0,7/2) Similar approach can be used to the problem above: =A1*ROUND(A1/100)+B1*ROUND(B1/100)+C1*ROUND(C1/100) The formula will come more complicated if the threshold is less than 50%. We use such "rounding" formulas in several cases. Some of them are very unreadable. Possibility to use IF would improve the situation much.
          Hide
          Otakar Šprdlík added a comment -

          Fix of my previous comment:

          The formula will come more complicated if the threshold is equall or less than 1/3 of the maximum
          (33%, not 50%) due to need of some nonlinear transformation before rounding to ensure the result of rounding is 0 or 1, no more.

          Show
          Otakar Šprdlík added a comment - Fix of my previous comment: The formula will come more complicated if the threshold is equall or less than 1/3 of the maximum (33%, not 50%) due to need of some nonlinear transformation before rounding to ensure the result of rounding is 0 or 1, no more.
          Hide
          Ivan Periz added a comment -

          I think an IF sentence is necessary anyway since it lets you solve things you cannot solve otherwise.

          Specially when some students must take specific exams which other students in the same group must not.

          For instance, let's say students who failed TEST1 must take TEST2, which will be the only score to take in account.

          I would say =IF( TEST2>0; TEST2; TEST1).

          That means that students who took TEST2 can forget about TEST1.

          Maybe there is another "cleaner" to solve those exceptions. I would be grateful to know about them.

          Show
          Ivan Periz added a comment - I think an IF sentence is necessary anyway since it lets you solve things you cannot solve otherwise. Specially when some students must take specific exams which other students in the same group must not. For instance, let's say students who failed TEST1 must take TEST2, which will be the only score to take in account. I would say =IF( TEST2>0; TEST2; TEST1). That means that students who took TEST2 can forget about TEST1. Maybe there is another "cleaner" to solve those exceptions. I would be grateful to know about them.
          Hide
          Dariusz Borkowski added a comment -

          We use moodle at large university.
          The lack of conditional calculation is one of biggest obstacles in serious usage of moodle.
          The request for this feature was reported in 2008 and it is frequently voted.
          Now we have 2012 ant it is still unresolved.

          Show
          Dariusz Borkowski added a comment - We use moodle at large university. The lack of conditional calculation is one of biggest obstacles in serious usage of moodle. The request for this feature was reported in 2008 and it is frequently voted. Now we have 2012 ant it is still unresolved.
          Hide
          joe broeker added a comment -

          I agree with Periz. We are in a smiliar situation. Students recieve a course work total. If their course work grade is above 70% they are then allowed to take an exit test. Those students not above 70% would not be eligible to sit for the final exam and would receive a "no grade" for their total course grade.

          =IF([[course work]]>=69.5,IF([[exit test]]>69.5,([[coursework]]*0.7+[[exit test]]*0.3),"FALSE"))

          Show
          joe broeker added a comment - I agree with Periz. We are in a smiliar situation. Students recieve a course work total. If their course work grade is above 70% they are then allowed to take an exit test. Those students not above 70% would not be eligible to sit for the final exam and would receive a "no grade" for their total course grade. =IF([ [course work] ]>=69.5,IF([ [exit test] ]>69.5,([ [coursework] ]*0.7+[ [exit test] ]*0.3),"FALSE"))
          Hide
          Naomi Quirke added a comment -

          A workaround for Ivan Periz is to say max([[test1]], [[test2]]). Then if a student has passed test 1 well, they get the grade for that, but if they haven't passed then they get the re-sit grade (if it is higher.)

          A workaround for the issue Otakar Prdlik raised is:
          if a = grade in percent form
          then let x = min(1,round(a,33)) => if a<33 then x= min(1,0)=0. if 32>a<66 then x=min(1,1)=1. if a>65 then x=min(1,2)=1.

          My issue that brought me here, which was to see if there was an IF statement that I could use as for Prdlik but taking into account that I have groups in my course as well... well that was unresolved... but I have a work around for that too for anyone else who needs it:

          Issue: groups with different grading calculations in the same class (worked around by having assignments with different codes for each group then adding all the grades) combined with need to have overall course grade of fail if one important assignment is failed.

          Workaround:
          let g1a = grade of group 1 for ith assignment, g2a = grade of group 2 for ith assignment
          g1x=round( g1a,50 ); g2x=round( g2a,50 )
          Then final score = (sum over all i( g1a*weighting + g2a*weighting) ) * (product over all i( max(g1x,g2x) )

          Show
          Naomi Quirke added a comment - A workaround for Ivan Periz is to say max([ [test1] ], [ [test2] ]). Then if a student has passed test 1 well, they get the grade for that, but if they haven't passed then they get the re-sit grade (if it is higher.) A workaround for the issue Otakar Prdlik raised is: if a = grade in percent form then let x = min(1,round(a,33)) => if a<33 then x= min(1,0)=0. if 32>a<66 then x=min(1,1)=1. if a>65 then x=min(1,2)=1. My issue that brought me here, which was to see if there was an IF statement that I could use as for Prdlik but taking into account that I have groups in my course as well... well that was unresolved... but I have a work around for that too for anyone else who needs it: Issue: groups with different grading calculations in the same class (worked around by having assignments with different codes for each group then adding all the grades) combined with need to have overall course grade of fail if one important assignment is failed. Workaround: let g1a = grade of group 1 for ith assignment, g2a = grade of group 2 for ith assignment g1x =round( g1a ,50 ); g2x =round( g2a ,50 ) Then final score = (sum over all i( g1a *weighting + g2a *weighting ) ) * (product over all i( max(g1x ,g2x ) )
          Hide
          Naomi Quirke added a comment -

          Sorry about my terminology above... when I said round(a, 33) I meant to say round(a/33,0), so the calculation above for Prdlik should read min(1, round(a/33,0)).
          The bottom workaround needs to be altered to have the same details in it:
          g1x = min(1, round(g1a/50,0)) etc.

          Show
          Naomi Quirke added a comment - Sorry about my terminology above... when I said round(a, 33) I meant to say round(a/33,0), so the calculation above for Prdlik should read min(1, round(a/33,0)). The bottom workaround needs to be altered to have the same details in it: g1x = min(1, round(g1a /50,0)) etc.
          Hide
          Naomi Quirke added a comment -

          Here is a real example from our course:
          Group 1
          • Character sketch (15%): [[302016]]
          • Essay (25%): [[302026]]
          • Short answer test (10%): [[302036]]
          • Exam (50%): [[302046]]
          Group 2
          • Character sketch (15%): [[302017]]
          • Essay (35%): [[302027]]
          • Short answer test (10%): [[302037]]
          • Exam (40%): [[302047]]

          Grade Calculation
          =( ([[302016]].1)([[302026]].25)([[302036]].15)([[302046]].5)([[302017]].1)([[302027]].35)([[302037]].15)+([[302047]].4) ) * max(min(1,round([[302016]]/50-0.5,0)), min(1,round([[302017]]/50-0.5,0))) * max(min(1,round([[302026]]/50-0.5,0)), min(1,round([[302027]]/50-0.5,0))) * max(min(1,round([[302046]]/50-0.5,0)), min(1,round([[302047]]/50-0.5,0))) * max(min(1,round([[302036]]/30-0.5,0)), min(1,round([[302037]]/30-0.5,0)))

          Note that for the short answer test, it was unnecessary for them to pass, but they need to have seriously attempted it. So instead of dividing the grade by 50, I put in that they needed to get 30%.

          Show
          Naomi Quirke added a comment - Here is a real example from our course: Group 1 • Character sketch (15%): [ [302016] ] • Essay (25%): [ [302026] ] • Short answer test (10%): [ [302036] ] • Exam (50%): [ [302046] ] Group 2 • Character sketch (15%): [ [302017] ] • Essay (35%): [ [302027] ] • Short answer test (10%): [ [302037] ] • Exam (40%): [ [302047] ] Grade Calculation =( ([ [302016] ] .1) ([ [302026] ] .25) ([ [302036] ] .15) ([ [302046] ] .5) ([ [302017] ] .1) ([ [302027] ] .35) ([ [302037] ] .15)+([ [302047] ] .4) ) * max(min(1,round([ [302016] ]/50-0.5,0)), min(1,round([ [302017] ]/50-0.5,0))) * max(min(1,round([ [302026] ]/50-0.5,0)), min(1,round([ [302027] ]/50-0.5,0))) * max(min(1,round([ [302046] ]/50-0.5,0)), min(1,round([ [302047] ]/50-0.5,0))) * max(min(1,round([ [302036] ]/30-0.5,0)), min(1,round([ [302037] ]/30-0.5,0))) Note that for the short answer test, it was unnecessary for them to pass, but they need to have seriously attempted it. So instead of dividing the grade by 50, I put in that they needed to get 30%.

            People

            • Votes:
              21 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: