Sha256: a43aa34521cc0a978e47c0201b09bea4ab4484c81873db4b6a32d1963af4404f
Contents?: true
Size: 1.06 KB
Versions: 13
Compression:
Stored size: 1.06 KB
Contents
module Mumuki::Laboratory::Controllers::ResultsRendering extend ActiveSupport::Concern included do include ProgressBarHelper before_action :set_guide_previously_done! end def render_results_json(assignment, results = {}) render json: results.merge( guide_finished_by_solution: guide_finished_by_solution?, class_for_progress_list_item: class_for_progress_list_item(@exercise, true), html: render_results_html(assignment), title_html: render_results_title_html(assignment)) end def render_results_html(assignment) render_to_string partial: 'exercise_solutions/results', locals: {assignment: assignment} end def render_results_title_html(assignment) render_to_string partial: 'exercise_solutions/results_title', locals: {assignment: assignment} end def guide_finished_by_solution? !@guide_previously_done && @exercise.guide_done_for?(current_user) end def set_guide_previously_done! @guide_previously_done = @exercise.guide_done_for?(current_user) end end
Version data entries
13 entries across 13 versions & 1 rubygems