本文整理匯總了Python中openassessment.assessment.models.Assessment.get_median_score方法的典型用法代碼示例。如果您正苦於以下問題:Python Assessment.get_median_score方法的具體用法?Python Assessment.get_median_score怎麽用?Python Assessment.get_median_score使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類openassessment.assessment.models.Assessment
的用法示例。
在下文中一共展示了Assessment.get_median_score方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_choose_score
# 需要導入模塊: from openassessment.assessment.models import Assessment [as 別名]
# 或者: from openassessment.assessment.models.Assessment import get_median_score [as 別名]
def test_choose_score(self):
self.assertEqual(0, Assessment.get_median_score([]))
self.assertEqual(5, Assessment.get_median_score([5]))
# average of 5, 6, rounded down.
self.assertEqual(6, Assessment.get_median_score([5, 6]))
self.assertEqual(14, Assessment.get_median_score([5, 6, 12, 16, 22, 53]))
self.assertEqual(14, Assessment.get_median_score([6, 5, 12, 53, 16, 22]))
self.assertEqual(16, Assessment.get_median_score([5, 6, 12, 16, 22, 53, 102]))
self.assertEqual(16, Assessment.get_median_score([16, 6, 12, 102, 22, 53, 5]))