Viktorani API - v0.0.8
    Preparing search index...

    Function importQuestions

    • Import questions from a JSON array file into the question bank.

      Parameters

      • file: File

        A .json file containing an array of partial Question objects.

      Returns Promise<ImportResult>

      A summary with counts of imported, skipped, and error rows.

      Each element must have at least title, type, and answer. Rows missing required fields are skipped and reported in errors. Uses db.questions.put so existing records with matching id are updated.

      If the file is not valid JSON or is not a JSON array.

      const result = await importQuestions(file)
      console.log(`Imported ${result.imported}, skipped ${result.skipped}`)