The Prophet ﷺ used to combine two men from those killed at Uhud in a single grave, then he would ask, "Which of them had memorized more of the Quran?" When one of them was indicated, he would place him first in the grave.
أن النبي ﷺ كان يجمع بين الرجلين من قتلى أحد- يعني في القبر- ثم يقول: أيهما أكثر أخذا للقرآن؟ فإذا أشير إلى أحدهما قدمه في اللحد.
Bukhari narrated it in the Book of Funerals (1343) from Abdullah bin Yusuf, who said, Layth narrated to us, who said, Ibn Shihab narrated to me, from Abdul-Rahman bin Kaab bin Malik, from Jabir bin Abdullah, and he mentioned it.