Class: SakaiInfo::QuizMetadata

Inherits:
SakaiObject show all
Defined in:
lib/sakai-info/quiz.rb

Overview

metadata

Direct Known Subclasses

PendingQuizMetadata, PublishedQuizMetadata

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from SakaiObject

all_serializations, #dbrow_only_serialization, #dbrow_serialization, descendants, #object_type_serialization, #serialize, #shell_serialization, #summary_serialization, #to_csv, #to_json, #to_yaml

Constructor Details

#initialize(dbrow) ⇒ QuizMetadata

Returns a new instance of QuizMetadata.



1357
1358
1359
1360
1361
1362
1363
# File 'lib/sakai-info/quiz.rb', line 1357

def initialize(dbrow)
  @dbrow = dbrow
  @id = dbrow[:assessmentmetadataid]
  @quiz_id = dbrow[:assessmentid]
  @key = dbrow[:label]
  @value = dbrow[:entry]
end

Instance Attribute Details

#dbrowObject (readonly)

Returns the value of attribute dbrow.



1355
1356
1357
# File 'lib/sakai-info/quiz.rb', line 1355

def dbrow
  @dbrow
end

#idObject (readonly)

Returns the value of attribute id.



1355
1356
1357
# File 'lib/sakai-info/quiz.rb', line 1355

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



1355
1356
1357
# File 'lib/sakai-info/quiz.rb', line 1355

def key
  @key
end

#valueObject (readonly)

Returns the value of attribute value.



1355
1356
1357
# File 'lib/sakai-info/quiz.rb', line 1355

def value
  @value
end

Instance Method Details

#default_serializationObject



1365
1366
1367
1368
1369
1370
1371
1372
# File 'lib/sakai-info/quiz.rb', line 1365

def default_serialization
  {
    "id" => self.id,
    "quiz" => self.quiz.serialize(:summary),
    "key" => self.key,
    "value" => self.value,
  }
end