Sha256: 6f386fc72683fa48b387c45e1d3a7050b685721bc46470d4989615b38271ea56

Contents?: true

Size: 1.09 KB

Versions: 9

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require_relative 'concept_ai_gift_exporter'
require_relative 'code_gift_exporter'
require_relative '../version'
require_relative '../application'

# Export Data (ConceptIA and Code) to gift to outputfile
module DataGiftExporter
  ##
  # Export an array of Data (ConceptAI and Code objects) into GIFT outpufile
  # @param data (Hash)
  # @param project (Project)
  def self.export_all(data, project)
    file = File.open(project.get(:outputpath), 'w')
    file.write('// ' + ('=' * 50) + "\n")
    file.write("// Created by : #{Asker::NAME}")
    file.write(" (version #{Asker::VERSION})\n")
    file.write("// File       : #{project.get(:outputname)}\n")
    file.write("// Time       : #{Time.new}\n")
    file.write("// Author     : David Vargas Ruiz\n")
    file.write('// ' + ('=' * 50) + "\n\n")
    category = Application.instance.config['questions']['category']
    file.write("$CATEGORY: $course$/#{category}\n") unless category.nil?

    ConceptAIGiftExporter.export_all(data[:concepts_ai], file)
    CodeGiftExporter.export_all(data[:codes_ai], file)

    file.close
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
asker-tool-2.5.4 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.5.3 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.5.2 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.5.1 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.5.0 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.4.5 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.4.4 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.4.3 lib/asker/exporter/data_gift_exporter.rb
asker-tool-2.4.2 lib/asker/exporter/data_gift_exporter.rb