|
|
|
@ -8,14 +8,14 @@ module Mobile
|
|
|
|
|
def self.whomework_expose(f)
|
|
|
|
|
expose f do |wh, opt|
|
|
|
|
|
if wh.is_a?(Hash) && wh.key?(f)
|
|
|
|
|
if f == :created_at
|
|
|
|
|
format_time(wh[f])
|
|
|
|
|
else
|
|
|
|
|
wh[f]
|
|
|
|
|
end
|
|
|
|
|
wh[f]
|
|
|
|
|
elsif wh.is_a?(::HomeworkCommon)
|
|
|
|
|
if wh.respond_to?(f)
|
|
|
|
|
wh.send(f)
|
|
|
|
|
if f == :created_at
|
|
|
|
|
format_time(wh.send(f))
|
|
|
|
|
else
|
|
|
|
|
wh.send(f)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
case f
|
|
|
|
|
when :absence_penalty
|
|
|
|
@ -28,6 +28,8 @@ module Mobile
|
|
|
|
|
get_activity_praise_num(wh)
|
|
|
|
|
when :whomework_journal_count
|
|
|
|
|
wh.journals_for_messages.count
|
|
|
|
|
when :course_name
|
|
|
|
|
wh.course.name
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
@ -49,6 +51,7 @@ module Mobile
|
|
|
|
|
expose :anonymous_comment
|
|
|
|
|
expose :quotes
|
|
|
|
|
expose :is_open
|
|
|
|
|
whomework_expose :course_name
|
|
|
|
|
whomework_expose :created_at
|
|
|
|
|
whomework_expose :absence_penalty
|
|
|
|
|
whomework_expose :evaluation_start
|
|
|
|
|