Class ChallengeRunService

java.lang.Object
me.nickhanson.codeforge.service.ChallengeRunService

public class ChallengeRunService extends Object
Service class responsible for running and evaluating code submissions against coding challenges using predefined heuristics.
Author:
Nick Hanson
  • Constructor Details

    • ChallengeRunService

      public ChallengeRunService()
  • Method Details

    • run

      public RunResult run(Long challengeId, String language, String code)
      Evaluates submitted code for a given challenge using a default mode.

      Delegates to runWithMode(String, Long, String, String) with "unknown" as the mode.

      Parameters:
      challengeId - The ID of the challenge being evaluated.
      language - The programming language of the submitted code.
      code - The submitted code as a string.
      Returns:
      A RunResult object representing the outcome of the evaluation.
    • runWithMode

      public RunResult runWithMode(String mode, Long challengeId, String language, String code)
      Internal method to evaluate code with a specified mode for telemetry.
      Parameters:
      mode - The mode of the run (e.g., "test", "submit").
      challengeId - The ID of the challenge being evaluated.
      language - The programming language of the submitted code.
      code - The submitted code as a string.
      Returns:
      A RunResult object representing the outcome of the evaluation.