diff --git a/app/helpers/exercise_helper.rb b/app/helpers/exercise_helper.rb index 2c92ffad7..4cafa8e62 100644 --- a/app/helpers/exercise_helper.rb +++ b/app/helpers/exercise_helper.rb @@ -43,4 +43,15 @@ module ExerciseHelper return result end + def get_current_score exercise + score = 0 + unless exercise.nil? + exercise.exercise_questions.each do |exercise_question| + score += exercise_question.question_score + end + return score + end + return score + end + end \ No newline at end of file diff --git a/app/views/exercise/_exercise_form.html.erb b/app/views/exercise/_exercise_form.html.erb index 8567c6641..61e288079 100644 --- a/app/views/exercise/_exercise_form.html.erb +++ b/app/views/exercise/_exercise_form.html.erb @@ -76,21 +76,21 @@ '