class_docstr: Managing class for the acute evaluator process.
  
  Relevant args are parsed in the `setup_args` function above.
class_docstr_tok: ["Managing","class","for","the","acute","evaluator","process",".","Relevant","args","are","parsed","in","the","`","setup_args","`","function","above","."]
docstr: Soft block workers who fail onboarding tasks, keep track of their status.
  
  :param agent:
      Agent that the worker completed the task with.
docstr_tok: ["Soft","block","workers","who","fail","onboarding","tasks",",","keep","track","of","their","status",".",":","param","agent",":","Agent","that","the","worker","completed","the","task","with","."]
code: def check_and_update_worker_approval(self, agent: "Agent"):
      """
      Soft block workers who fail onboarding tasks, keep track of their status.
  
      :param agent:
          Agent that the worker completed the task with.
      """
      worker = agent.get_worker()
      worker_id = worker.db_id
      save_data = agent.state.get_data()
      all_task_data = save_data["inputs"]
      response_data = save_data["outputs"]["final_data"]
      num_onboarding_tasks = 0
      num_correct = 0
  
      for i in range(len(all_task_data)):
          is_onboarding = all_task_data[i]["pairing_dict"].get(
              "is_onboarding", False
          )
          if not is_onboarding:
              # not an onboarding task, no need to check correctness
              continue
          worker_response = response_data[i]["speakerChoice"]
          expected_response = all_task_data[i]["pairing_dict"][
              "correct_answer"
          ]
          num_onboarding_tasks += 1
          if worker_response == expected_response:
              # count correct answers
              num_correct += 1
      if num_onboarding_tasks == 0:
          # no onboarding tasks found
          if worker_id in self.failed_onboard:
              # worker already failed onboarding, add pairings back to queue
              self.requeue_task_data(worker_id, all_task_data)
          return
      if (
          num_correct / num_onboarding_tasks
      ) >= self.args.blueprint.onboarding_threshold:
          # worker passed onboarding
          return
      # worker failed onboarding, soft block and record
      assert (
          self.block_qualification is not None
      ), "Should not be blocking without a block qualification set"
      worker.grant_qualification(self.block_qualification, 1)
      self.failed_onboard.add(worker_id)
  
imports: import json
  import queue
  import random
  from typing import List, Any, Dict, Tuple, Set, TYPE_CHECKING
  from mephisto.utils.logger_core import get_logger
  from mephisto.abstractions.blueprint import SharedTaskState, TaskRunner
  from omegaconf import DictConfig
label_desc: Use image node_id 12 for calling the AcuteEvalRunner obj's underlying member method code with example usage: obj.check_and_update_worker_approval(agent) without return types