// AI DISABLED VERSION (SAFE)

import { UserProgress, VivaQuestion, VivaEvaluation, VivaSession } from "../types";

// ------------------ DOCUMENT ANALYSIS ------------------
export async function analyzeDocumentation(submission: any, language: string): Promise<any> {
  return {
    marks: {
      documentation: {
        objective: 4,
        concepts: 4,
        explanation: 4,
        learningOutcome: 4,
        total: 16
      },
      code: {
        logic: 4,
        output: 4,
        concepts: 4,
        total: 12
      }
    },
    aiFeedback: "Good effort. AI disabled mode."
  };
}

// ------------------ VIVA QUESTIONS ------------------
export async function generateVivaQuestions(
  progress: UserProgress,
  level: number,
  count: number = 5
): Promise<VivaQuestion[]> {
  return [
    {
      id: "q1",
      text: "Explain your project.",
      type: "Conceptual"
    },
    {
      id: "q2",
      text: "What concepts did you use?",
      type: "Conceptual"
    },
    {
      id: "q3",
      text: "What is the output of your program?",
      type: "Output Prediction"
    }
  ];
}

// ------------------ ANSWER EVALUATION ------------------
export async function evaluateVivaAnswer(
  question: VivaQuestion,
  answer: string,
  language: string
): Promise<VivaEvaluation> {
  return {
    isCorrect: true,
    feedback: {
      correct: "Good explanation",
      missing: "Could improve clarity",
      improvement: "Practice more"
    },
    qualitativeScore: "Good understanding"
  };
}

// ------------------ SUMMARY ------------------
export async function generateVivaSummary(
  session: Partial<VivaSession>
): Promise<VivaSession['summary']> {
  return {
    overall: "Good performance",
    strengths: ["Basic understanding", "Effort"],
    improvements: ["More clarity needed"],
    finalQualitative: "Good"
  };
}