Sha256: 41b766d0f2f7c2b3103cbd711c6cc27b9ba2fe7c9c678e2ecc168bafaf046087

Contents?: true

Size: 999 Bytes

Versions: 8

Compression:

Stored size: 999 Bytes

Contents

module ContextualizationResultHelper
  def humanized_expectation_result_item(expectation_result)
    %Q{<li>#{status_icon(expectation_result[:result])} #{expectation_result[:explanation]}</li>}.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.choices?
      contextualization.passed? ? :correct_answer : :wrong_answer
    else
      contextualization.submission_status
    end
  end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mumuki-laboratory-5.8.3 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.8.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.8.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.7.0 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.6.3 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.6.2 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.6.1 app/helpers/contextualization_result_helper.rb
mumuki-laboratory-5.6.0 app/helpers/contextualization_result_helper.rb