Course Total Grade Calculation

Course Total Grade Calculation

by Leah Lever -
Number of replies: 7

I want to calculate the Course Total Grade according to this function

function getfinalgrade($quiz)
{
    switch($quiz)
    {
    case 0: $iq =  74; break;
    case 1: $iq =  74; break;
    case 2: $iq =  74; break;
    case 3: $iq =  77; break;
    case 4: $iq =  80; break;
    case 5: $iq =  83; break;
    case 6: $iq =  86; break;
    case 7: $iq =  89; break;
    case 8: $iq =  92; break;
    case 9: $iq =  95; break;
    case 10: $iq = 98; break;
    case 11: $iq = 102; break;
    case 12: $iq = 105; break;
    case 13: $iq = 109; break;
    case 14: $iq = 113; break;
    case 15: $iq = 116; break;
    case 16: $iq = 120; break;
    case 17: $iq = 123; break;
    case 18: $iq = 127; break;
    case 19: $iq = 130; break;
    case 20: $iq = 134; break;
    case 21: $iq = 138; break;
    case 22: $iq = 141; break;
    case 23: $iq = 145; break;
            case 24: $iq = 148; break;
            case 25: $iq = 152; break;
            case 26: $iq = 156; break;
            case 27: $iq = 159; break;
            case 28: $iq = 163; break;
            case 29: $iq = 166; break;
            case 30: $iq = 169; break;
            case 31: $iq = 172; break;
            case 32: $iq = 175; break;
            case 33: $iq = 177; break;
      
    }
return($iq);
}

Does anybody know how to implement this ???

Thank you

In reply to Leah Lever

Re: Course Total Grade Calculation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Could you maybe tell us what you are trying to achieve - sorry, your function means nothing to me!!  

In reply to Emma Richardson

Re: Course Total Grade Calculation

by Leah Lever -

Sure I will explain, what I mean is that I want to calculate Course Total as follows:

if Quiz grade=1 then Course Total should be 74

if Quiz grade=2 then Course Total should be 74

if Quiz grade=3 then Course Total should be 74

if Quiz grade=4 then Course Total should be 80

and so on .... until

if Quiz grade=34 then Course Total should be 177

The Course Total Grades are arbitrary, its an IQ Test actually

Is there any way to achieve that ???

In reply to Leah Lever

Re: Course Total Grade Calculation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thanks - forgive my function ignorance!!  I think you could actually set up your grade letters to achieve that.

The quiz scores, presuming it is the only grade item in the course, can translate to letter grades.  But trickily enough, you can put numbers in as letters!  So in your grade letters settings, just create the outcome as you described...and then set your gradebook display to show the "letter grades"

In reply to Emma Richardson

Re: Course Total Grade Calculation

by Leah Lever -

Thanks for the reply Emma

I have tried that already, but it doesnt seem to allow me to add more items than 14

I need 34

Do you have any idea ???

In reply to Leah Lever

Re: Course Total Grade Calculation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Well, dang it.  Do you need the score in the gradebook or does the student just need it?

In reply to Emma Richardson

Re: Course Total Grade Calculation

by Leah Lever -
Problem solved Emma
I just found out that every time I save the grade letters list, and reopen for editing, it gives me the option to add 3 more items
So my problem is solved without php code involved
Thank you so much !!!!!!!!!!!!!!!!!!!
In reply to Leah Lever

Re: Course Total Grade Calculation

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Excellent - glad we figured it out!  Thanks for reporting back in case anyone else is looking for something like this.