Skip to content

Commit

Permalink
Merge pull request #40600 from code-dot-org/remove-course-progress-block
Browse files Browse the repository at this point in the history
Remove unused course progress block and Policies::ScriptActivity helpers
  • Loading branch information
davidsbailey committed May 26, 2021
2 parents 049d5bb + 9b0a13d commit 545cf40
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
22 changes: 0 additions & 22 deletions dashboard/app/views/shared/_course_progress_block.html.haml

This file was deleted.

16 changes: 0 additions & 16 deletions dashboard/lib/policies/script_activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,4 @@ def self.completed?(user, script)
return false unless user_script
!!user_script.completed_at || user.completed_progression_levels?(script)
end

def self.passed_any_level?(user, script)
user_levels = UserLevels.
where(user: user, script: script).
index_by(&:level_id)

script.script_levels.detect do |script_level|
user_level = user_levels[script_level.level_id]
is_passed = (user_level && user_level.passing?)
script_level.valid_progression_level? && is_passed
end
end

def self.not_started?(user, script)
!completed?(user, script) && !passed_any_level?(user, script)
end
end

0 comments on commit 545cf40

Please sign in to comment.