Results 1 to 7 of 7

Thread: [RESOLVED] Finding Rank

  1. #1

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Resolved [RESOLVED] Finding Rank

    Hi guys

    First of all my maths is a bit rusty. I can't think of a solution to this simple problem.

    I have the following things:
    • total score of each student (summed up value of scores in each exam)
    • total number of exams


    I have to findout the rank of each student based on the above two values.

    First I thought about using the average of total score, sorted in descending order as the rankings. But I think, it's not a correct approach to find the ranks.

    Any clues on how to find it ?

    Thanks in advance

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  2. #2
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Finding Rank

    Could you give an example of your difficulty?

    For instance, if A has a total score of 720 and B has a total score of 630, both having taking the same number of exams, A outranks B. One doesn't even need to take the average, though it doesn't affect the ranking. I don't see why sorting the scores is insufficient.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Finding Rank

    You do find the average of each one and then go descending. Make sure that a score of 0 still has a "count up" in the number of exams so the kid takes a hit for that 0

    Issue I have to deal with in real world ranks is that if two scores are tied they get the same number but then the next one is ranked as if the duplicate never happened.

    Rank 1 - score 100
    Rank 2 - score 99
    Rank 3 - score 97 - both rank 3
    Rank 3 - score 97
    Rank 5 - score 95 - back to rank 5

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  4. #4

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Finding Rank

    Quote Originally Posted by jemidiah View Post
    Could you give an example of your difficulty?

    For instance, if A has a total score of 720 and B has a total score of 630, both having taking the same number of exams, A outranks B. One doesn't even need to take the average, though it doesn't affect the ranking. I don't see why sorting the scores is insufficient.
    Because a student can participate in the same exam more than once. It's kind of mock tests.
    Eg:

    Code:
    Student_A -- Exam_E -- Score(50)
    Student_A -- Exam_D -- Score(20)
    Student_B -- Exam_D -- Score(11)
    So, this will become like this:

    Code:
    Student_A -- Score(70) -- NumberOfExams(2) -- Avg(35)
    Student_B -- Score(11) -- NumberOfExams(1) -- Avg(11)
    Do you think it would be a bad idea to allow students to appear again and again in the same exam ? Now I am getting a feeling like so !

    Thanks

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Finding Rank

    Quote Originally Posted by szlamany View Post
    You do find the average of each one and then go descending. Make sure that a score of 0 still has a "count up" in the number of exams so the kid takes a hit for that 0

    Issue I have to deal with in real world ranks is that if two scores are tied they get the same number but then the next one is ranked as if the duplicate never happened.

    Rank 1 - score 100
    Rank 2 - score 99
    Rank 3 - score 97 - both rank 3
    Rank 3 - score 97
    Rank 5 - score 95 - back to rank 5
    Thanks

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  6. #6
    Only Slightly Obsessive jemidiah's Avatar
    Join Date
    Apr 2002
    Posts
    2,431

    Re: Finding Rank

    Quote Originally Posted by akhileshbc View Post
    Because a student can participate in the same exam more than once. It's kind of mock tests.
    I would probably take the highest grade the student achieved in the mock tests and ignore the rest, then sort as usual. You could also take the average of the student's mock test scores as you initially suggested; there's no universally best way to do it.
    The time you enjoy wasting is not wasted time.
    Bertrand Russell

    <- Remember to rate posts you find helpful.

  7. #7

    Thread Starter
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Finding Rank

    Quote Originally Posted by jemidiah View Post
    I would probably take the highest grade the student achieved in the mock tests and ignore the rest, then sort as usual. You could also take the average of the student's mock test scores as you initially suggested; there's no universally best way to do it.
    Thanks

    Then I will go with my present approach.

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width