def select(self, task_ids, student_id, practice_context): score_computer = CombinedScoreComputer( criteria=self.CRITERIA_WEIGHTS, combinator=product, practice_context=practice_context, student=student_id) scored_tasks = score_computer.combined_scores(task_ids) best_task_id = max(scored_tasks)[1] return best_task_id
def select(self, task_ids, student_id, practice_context): score_computer = CombinedScoreComputer( criteria=self.CRITERIA_WEIGHTS, combinator=product, practice_context=practice_context, student=student_id) scored_tasks = score_computer.combined_scores(task_ids) #print('Random choice from:', sorted(scored_tasks)) selected_task_id = weighted_choice(scored_tasks) return selected_task_id