Prefer high-performing distractors
This commit is contained in:
@@ -21,6 +21,16 @@ func _initialize() -> void:
|
||||
observed_sets[",".join(ids)] = true
|
||||
_assert(observed_sets.size() > 1, "future sessions should be able to present different distractors")
|
||||
|
||||
seed(12345)
|
||||
var weighted_distractors: Array = question.get("choices", []).slice(1)
|
||||
var weighted_counts := {"B": 0, "C": 0, "D": 0, "E": 0, "F": 0, "G": 0, "H": 0, "I": 0}
|
||||
for _iteration in range(2000):
|
||||
var selected: Array = service._select_weighted_distractors(weighted_distractors, {"B": 100}, 1)
|
||||
var selected_id := str(selected[0].get("id", ""))
|
||||
weighted_counts[selected_id] = int(weighted_counts.get(selected_id, 0)) + 1
|
||||
for low_rate_id in ["C", "D", "E", "F", "G", "H", "I"]:
|
||||
_assert(weighted_counts["B"] > weighted_counts[low_rate_id], "higher-rate distractors should be preferred")
|
||||
|
||||
var legacy: Dictionary = service._prepare_question_choices(_question(5))
|
||||
_check_presented(legacy)
|
||||
_assert(_ids(legacy.get("presented_choices", [])).size() == 5, "legacy five-choice questions must show all choices")
|
||||
|
||||
Reference in New Issue
Block a user