Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST: Add module assert_helper #17

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
FIX: Correct issues with task stats inc withdrawn students
Existing stats incorrectly included counts of task stats
that included withdrawn students as not started tasks.
  • Loading branch information
macite authored and Reuben Wilson committed May 7, 2016
commit 23a19a4637049893e2fe526aec440e86c34338af
2 changes: 1 addition & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def role_for(user)

def self.for_user(user, include_inactive)
if include_inactive
projects.where('projects.user_id = :user_id', user_id: user.id)
where('projects.user_id = :user_id', user_id: user.id)
else
active_projects.where('projects.user_id = :user_id', user_id: user.id)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/unit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1106,7 +1106,7 @@ def task_status_stats
count = data.select{|r| r[:task_definition_id] == td.id && r[:tutorial_id] == t.id }.map{|r| r[:num]}.inject(:+)
count = 0 unless count

num = t.projects.where("projects.target_grade >= :grade", grade: td.target_grade).count
num = t.projects.where("projects.enrolled = TRUE AND projects.target_grade >= :grade", grade: td.target_grade).count
num = 0 unless num

if num - count > 0
Expand Down