/**
   * returns whether the worker already has submitted the wrong calibrations
   *
   * @param experimentID the current experiment
   * @param platformID the platform the worker is working on
   * @param worker the worker to check for
   * @return true if the worker is already belonging to the wrong population, false if not
   */
  public boolean hasSubmittedWrongCalibrations(int experimentID, String platformID, int worker) {
    SelectConditionStep<Record1<Integer>> getCalibrationForExperiment =
        DSL.select(CALIBRATION_ANSWER_OPTION.CALIBRATION)
            .from(CALIBRATION_ANSWER_OPTION)
            .where(
                CALIBRATION_ANSWER_OPTION.ID_CALIBRATION_ANSWER_OPTION.eq(
                    EXPERIMENTS_CALIBRATION.ANSWER));

    SelectConditionStep<Record1<Integer>> getExperimentPlatformIds =
        DSL.select(EXPERIMENTS_PLATFORM.IDEXPERIMENTS_PLATFORMS)
            .from(EXPERIMENTS_PLATFORM)
            .where(EXPERIMENTS_PLATFORM.EXPERIMENT.eq(experimentID))
            .and(EXPERIMENTS_PLATFORM.PLATFORM.eq(platformID));

    return create.fetchExists(
        DSL.select()
            .from(CALIBRATION_ANSWER_OPTION)
            .innerJoin(CALIBRATION_RESULT)
            .onKey()
            .innerJoin(EXPERIMENTS_CALIBRATION)
            .on(
                EXPERIMENTS_CALIBRATION
                    .EXPERIMENTS_PLATFORM
                    .in(getExperimentPlatformIds)
                    .and(CALIBRATION_ANSWER_OPTION.CALIBRATION.eq(getCalibrationForExperiment))
                    .and(
                        EXPERIMENTS_CALIBRATION
                            .NOT
                            .eq(true)
                            .and(
                                EXPERIMENTS_CALIBRATION.ANSWER.eq(
                                    CALIBRATION_ANSWER_OPTION.ID_CALIBRATION_ANSWER_OPTION))
                            .or(
                                EXPERIMENTS_CALIBRATION
                                    .NOT
                                    .eq(false)
                                    .and(
                                        EXPERIMENTS_CALIBRATION.ANSWER.notEqual(
                                            CALIBRATION_ANSWER_OPTION
                                                .ID_CALIBRATION_ANSWER_OPTION)))))
            .where(CALIBRATION_RESULT.WORKER.eq(worker)));
  }