zwischenstand

This commit is contained in:
Thomas Hille
2017-02-22 14:38:40 +01:00
parent d5b2ea4269
commit 04c54549c5
2 changed files with 64 additions and 6 deletions

View File

@ -92,7 +92,7 @@ class Exercise < ActiveRecord::Base
(created_at - lag(created_at) OVER (PARTITION BY user_id
ORDER BY created_at)) AS working_time
FROM submissions
WHERE exercise_id=69) AS foo) AS bar
WHERE exercise_id=#{self.id}) AS foo) AS bar
GROUP BY user_id
) AS foo
""")
@ -200,7 +200,8 @@ class Exercise < ActiveRecord::Base
if user
submissions.where(user: user, cause: "assess").where("score IS NOT NULL").order("score DESC").first.score || 0 rescue 0
else
files.teacher_defined_tests.sum(:weight)
5
#files.teacher_defined_tests.sum(:weight)
end
end