一, 写一个方法 get_stu_data_by_id
接收一个参数(学生id)
返回这个学生的全部数据
二,写一个方法 get_best_data_by_id
接收两个参数(学生id,显示数量)
函数内部会对该学生的得分情况进行排序分析
并且返回指定数量的结果
》
测试用学生id
tg60
res = get_stu_data_by_id(“tg60”)
可以得到该生的全部题目情况
res2 = get_best_data_by_id(“tg60”,6)
可以得到该生 score 最高的前六个数据
数据源数据是每一个学生的考试情况
score_list = [{"stu_id": "mc00", "test_id": "zw10150092", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "mc00", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "di75323755", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "wx92327500", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "pm12", "test_id": "zw10150092", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "zw10150092", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "di75323755", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "zv08827537", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "wx92327500", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "rm19", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "di75323755", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "zw10150092", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "lb71", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "di75323755", "score": -2, "level": 0, "grade_list": [0], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "lf40483404", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "ev47338581", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "nh08784469", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "cy75027628", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "wx92327500", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "zv08827537", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "in29250258", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tt05", "test_id": "zw10150092", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "zw10150092", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "ya14", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "di75323755", "score": -2, "level": 0, "grade_list": [0], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "lf40483404", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "zw10150092", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "dd19990626", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "xy29055443", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "nh08784469", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "wx92327500", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "zv08827537", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "in29250258", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "oq29", "test_id": "cy75027628", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "nh08784469", "score": -2, "level": 0, "grade_list": [0], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "di75323755", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "dd19990626", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "zw10150092", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "in29250258", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "lf40483404", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "wx92327500", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "wh42", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "zw10150092", "score": -2, "level": 0, "grade_list": [0], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "lf40483404", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "in29250258", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wc14", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "zv08827537", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "nh08784469", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "di75323755", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "zw10150092", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "dd19990626", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "wx92327500", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "lf40483404", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "sm59", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "cy75027628", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "zw10150092", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "tg60", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "zw10150092", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "wx92327500", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "yj70", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "zv08827537", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "wx92327500", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "zw10150092", "score": 10, "level": 4, "grade_list": [4], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "in29250258", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "wm85", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "di75323755", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "wx92327500", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "nh08784469", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "zw10150092", "score": 6, "level": 3, "grade_list": [3], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "ev47338581", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "cy75027628", "score": 4, "level": 2, "grade_list": [2], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "if84", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "ev47338581", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "di75323755", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "zv08827537", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "nh08784469", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "xy29055443", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "lf40483404", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "cy75027628", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "wx92327500", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "in29250258", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "dd19990626", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}, {"stu_id": "hd67", "test_id": "zw10150092", "score": 2, "level": 1, "grade_list": [1], "last_time": 1566646708}]