I have a database table that holds the following grade information for a student:
student_id subject_id gpa letter_grade (which is calculated based on gpa, & inserted when record is saved) semester 6 518 95 A+ 1 6 534 100 A+ 1
I then calculate an end-of-semester report based on the grades. I use the gpa to calculate the credits applied and the overall GPA. Based on this overall GPA, I want to calculate rank for the student for his class and his form (grade level) overall. How do I do this without saving into the database this rank prior? Also, can this be done from a view in CodeIgniter? If so, what;s the best way to do it?
Can this be done in Code Igniter? Yes you should be able to.
Should this be done in the view? No you should not be doing your calculations in a view. Make a class and bring that in when you’re creating a model to handle the grades. Your view should only be used to render your user interface.