Sha256: 30ba8556894cfd0aeedf66f9d3ef4b4fcd665f3dae2f10cf58f21a9eea6c16cc

Contents?: true

Size: 1.21 KB

Versions: 26

Compression:

Stored size: 1.21 KB

Contents

module ContextualizationResultHelper
  def render_affable_expectation_result(affable_expectation_result)
    %Q{#{status_icon(affable_expectation_result[:result])} #{affable_expectation_result[:explanation]}}.html_safe
  end

  def render_feedback?(contextualization)
    contextualization.feedback.present?
  end

  def t_contextualization_status(contextualization)
    t contextualization_status contextualization
  end

  def contextualization_status(contextualization)
    if contextualization.exercise.hidden?
      :hidden_done
    elsif contextualization.exercise.choice?
      contextualization.solved? ? :correct_answer : :wrong_answer
    else
      contextualization.submission_status
    end
  end

  def render_test_result_header(test_result)
    [test_result[:title].presence, test_result[:summary]].compact.join(': ').html_safe
  end

  def render_test_results(contextualization)
    if contextualization.test_results.present?
      template = contextualization.result.present? ? 'layouts/mixed_results' : 'layouts/test_results'
      render partial: template, locals: { contextualization: contextualization }
    else
      render partial: 'layouts/result', locals: { contextualization: contextualization }
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mumuki-laboratory-7.12.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.11.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.11.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.5 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.4 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.3 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.2 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.10.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.9.2 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.9.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.9.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.6 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.5 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.4 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.8.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.3 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.2 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-7.7.0 app/helpers/contextualization_result_helper.rb