app/models/rubric_criterion.rb
# Returns a hash containing the information of a single rubric criterion.
Returns a hash containing the information of a single rubric criterion.
Returns a hash containing the information of a single rubric criterion .
def to_yml
    levels_to_yml = { self.name => { 'type' => 'rubric',
                                     'max_mark' => self.max_mark.to_f,
                                     'levels' => {},
                                     'ta_visible' => self.ta_visible,
                                     'peer_visible' => self.peer_visible,
                                     'bonus' => self.bonus } }
    self.levels.each do |level|
      levels_to_yml[self.name]['levels'][level.name] = { 'description' => level.description,
                                                         'mark' => level.mark }
    end
    levels_to_yml
  end
def to_yml levels_to_yml = { self . name => { 'type' => 'rubric' , 'max_mark' => self . max_mark . to_f , 'levels' => { } , 'ta_visible' => self . ta_visible , 'peer_visible' => self . peer_visible , 'bonus' => self . bonus } } self . levels . each do | level | levels_to_yml [ self . name ] [ 'levels' ] [ level . name ] = { 'description' => level . description , 'mark' => level . mark } end levels_to_yml end
Returns a hash containing the information of a single rubric criterion.
Returns a hash containing the information of a single rubric criterion .