Module: AssignmentResultHelper

Defined in:
app/helpers/assignment_result_helper.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
# File 'app/helpers/assignment_result_helper.rb', line 8

def community_link
  Organization.current.community_link
end

#community_link?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/helpers/assignment_result_helper.rb', line 12

def community_link?
  community_link.present?
end

#manual_evaluation_comment(assignment) ⇒ Object



33
34
35
36
37
# File 'app/helpers/assignment_result_helper.rb', line 33

def manual_evaluation_comment(assignment)
  if assignment.manual_evaluation_comment?
    Mumukit::ContentType::Markdown.to_html assignment.manual_evaluation_comment
  end
end


16
17
18
19
20
21
# File 'app/helpers/assignment_result_helper.rb', line 16

def render_community_link
  if community_link?
    link_to fa_icon('facebook-f', type: :brand, text: I18n.t(:ask_community), class: 'fa-fw'),
            community_link, target: '_blank', class: 'dropdown-item'
  end
end


23
24
25
26
27
28
29
30
31
# File 'app/helpers/assignment_result_helper.rb', line 23

def report_bug_link(assignment, organization=Organization.current)
  if organization.report_issue_enabled?
    mail_to organization.contact_email,
      fa_icon(:bug, text: t(:notify_problem_with_exercise), class: 'fa-fw'),
      subject: t(:problem_with_exercise, title: @exercise.name),
      body: assignment_help_email_body(assignment),
      class: 'dropdown-item'
  end
end


2
3
4
5
6
# File 'app/helpers/assignment_result_helper.rb', line 2

def solution_download_link(assignment)
  link_to fa_icon(:download, text: t(:download)),
          solution_octet_data(assignment),
          download: solution_filename(assignment) if assignment.exercise.upload?
end