Sha256: c1f0d182dab2caea882e882924e0a111a2e03635adf8aebac89c952df5e89439

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

# ~*~ encoding: utf-8 ~*~
module Aladdin

  module Render

    # Renders short questions marked up in JSON as HTML.
    # @example
    #     {
    #       "format": "short",
    #       "question": "What is the most commonly used word in English?",
    #       "answer": "the"
    #     }
    class Short < Problem

      # Name of template file for rendering short answer questions.
      TEMPLATE = 'short.haml'

      # Checks if the given json contains a valid MCQ.
      # @return [Boolean] true iff the json contains a valid MCQ.
      def valid?
        super and
          not @json[ANSWER].nil?
      end

    end

  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
aladdin-0.0.8 lib/aladdin/render/templates/short.rb
aladdin-0.0.7 lib/aladdin/render/templates/short.rb
aladdin-0.0.6 lib/aladdin/render/templates/short.rb
aladdin-0.0.5 lib/aladdin/render/templates/short.rb
aladdin-0.0.4 lib/aladdin/render/short.rb
aladdin-0.0.3 lib/aladdin/render/short.rb