export const toggleExamSelection = (
  selectedIds: number[],
  examId: number,
  checked: boolean,
): number[] => {
  if (checked) {
    return selectedIds.includes(examId) ? selectedIds : [...selectedIds, examId];
  }
  return selectedIds.filter((id) => id !== examId);
};

export const selectAllExamIds = (examIds: number[], checked: boolean): number[] =>
  checked ? [...new Set(examIds)] : [];
