All problems
Item Difficulty Index
Problem
Return the item difficulty index correct/n, the proportion of examinees answering correctly. Return 0.0 when n <= 0.
Hint
This p-value is the classical item facility index.
Test cases
case 1
in: [15,20]
expected: 0.75
case 2
in: [0,10]
expected: 0
case 3
in: [20,20]
expected: 1
case 4
in: [5,0]
expected: 0
case 5
in: [1,3]
expected: 0.3333333333333333
Starter codePython
def item_difficulty_index(correct, n):
# Your code here
pass5 test cases · run your code against them in the editor