Sha256: a4ff9b6d96b6ea6a5d71654575d8f0731f74bdc51b43fa2b3814fe7ec4c0adbc

Contents?: true

Size: 1.08 KB

Versions: 22

Compression:

Stored size: 1.08 KB

Contents

xml.instruct! :xml, :version=>"1.0" , :encoding => 'UTF-8'
xml.CRD('version' => "1.0"){
  @questions.each do |question|
    xml.REFERENCE{
      xml.QUESTION question.body
      xml.tag! 'ACC-LEVEL', '1'
      xml.tag! 'REG-ID', "#{LibraryGroup.site_config.name}_#{question.id}"
      xml.ANSWER question.answers.first.try(:body)
      xml.tag! 'CRT-DATE', question.created_at.strftime('%Y%m%d')
      if question.solved?
        xml.SOLUTION 1
      else
        xml.SOLUTION 0
      end
      # xml.KEYWORD question.tags.collect(&:name).join(' ')
      xml.KEYWORD question.tags.join(' ')
      xml.CLASS :type => 'NDC'
      xml.tag! 'RES-TYPE'
      xml.tag! 'CON-TYPE'
      question.answers.each do
        xml.BIBL{
          xml.tag! 'BIBL-DESC'
          xml.tag! 'BIBL-NOTE'
        }
      end
      xml.tag! 'ANS-PROC', question.answers.first.try(:body)
      xml.REFERRAL
      xml.tag! 'PRE-RES'
      xml.NOTE question.note
      xml.tag! 'PTN-TYPE'
      if question.answers.exists?
        xml.CONTRI question.answers.collect(&:user).collect(&:username).uniq.join(' ')
      end
    }
  end
}

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
enju_question-0.3.2 app/views/questions/index_crd.xml.builder
enju_question-0.3.1 app/views/questions/index_crd.xml.builder
enju_question-0.3.0 app/views/questions/index_crd.xml.builder
enju_question-0.3.0.beta.1 app/views/questions/index_crd.xml.builder
enju_question-0.2.0 app/views/questions/index_crd.xml.builder
enju_question-0.2.0.beta.4 app/views/questions/index_crd.xml.builder
enju_question-0.2.0.beta.3 app/views/questions/index_crd.xml.builder
enju_question-0.2.0.beta.2 app/views/questions/index_crd.xml.builder
enju_question-0.2.0.beta.1 app/views/questions/index_crd.xml.builder
enju_question-0.1.1 app/views/questions/index_crd.xml.builder
enju_question-0.1.0 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre15 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre14 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre13 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre12 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre11 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre10 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre9 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre8 app/views/questions/index_crd.xml.builder
enju_question-0.1.0.pre7 app/views/questions/index_crd.xml.builder