Class: SakaiInfo::QuizAuthorization

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

Overview

authorization

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ModProps

included

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) ⇒ QuizAuthorization

Returns a new instance of QuizAuthorization.



1459
1460
1461
1462
1463
1464
1465
1466
1467
# File 'lib/sakai-info/quiz.rb', line 1459

def initialize(dbrow)
  @dbrow = dbrow
  @id = dbrow[:id]
  @agent_id = dbrow[:agentid]
  @name = dbrow[:functionid]
  @quiz_id = dbrow[:qualifierid]
  @starts_at = dbrow[:effectivedate]
  @ends_at = dbrow[:expirationdate]
end

Instance Attribute Details

#dbrowObject (readonly)

Returns the value of attribute dbrow.



1451
1452
1453
# File 'lib/sakai-info/quiz.rb', line 1451

def dbrow
  @dbrow
end

#ends_atObject (readonly)

Returns the value of attribute ends_at.



1451
1452
1453
# File 'lib/sakai-info/quiz.rb', line 1451

def ends_at
  @ends_at
end

#idObject (readonly)

Returns the value of attribute id.



1451
1452
1453
# File 'lib/sakai-info/quiz.rb', line 1451

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



1451
1452
1453
# File 'lib/sakai-info/quiz.rb', line 1451

def name
  @name
end

#starts_atObject (readonly)

Returns the value of attribute starts_at.



1451
1452
1453
# File 'lib/sakai-info/quiz.rb', line 1451

def starts_at
  @starts_at
end

Instance Method Details

#default_serializationObject



1469
1470
1471
1472
1473
1474
1475
1476
# File 'lib/sakai-info/quiz.rb', line 1469

def default_serialization
  {
    "id" => self.id,
    "quiz" => self.quiz.serialize(:summary),
    "name" => self.name,
    "agent" => @agent_id,
  }
end

#quiz_summary_serializationObject



1478
1479
1480
1481
1482
1483
# File 'lib/sakai-info/quiz.rb', line 1478

def quiz_summary_serialization
  {
    "name" => self.name,
    "agent" => @agent_id,
  }
end