Skip to content

Commit

Permalink
Remove "Grade Essay Questions" -#549
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsong8 committed May 5, 2015
1 parent 6f440e0 commit 95f53d4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 28 deletions.
54 changes: 27 additions & 27 deletions app/controllers/student_quizzes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,33 +122,33 @@ def record_response

end

def submit_essay_grades
params.inspect
response_id = params[:response_id]
question_id = params[:question_id]
score = params[question_id][:score]
if score.eql? ' '
flash[:error] = "Question was not graded. You must choose a score before submitting for grading."
else
updated_score = Score.where(question_id: question_id, response_id: response_id).first
updated_score.update_attributes(:score => score)
end
redirect_to :action => :grade_essays
end

def grade_essays
scores = Score.where(score: -1)
@questions = Array.new
@answers = Hash.new
@questionnaires = Array.new
scores.each do |score|
question = Question.find(score.question_id)
@questions << question
@questionnaires << QuizQuestionnaire.find(question.questionnaire_id)
@answers.merge!({question: score})
end
@questionnaires.uniq!
end
# def submit_essay_grades
# params.inspect
# response_id = params[:response_id]
# question_id = params[:question_id]
# score = params[question_id][:score]
# if score.eql? ' '
# flash[:error] = "Question was not graded. You must choose a score before submitting for grading."
# else
# updated_score = Score.where(question_id: question_id, response_id: response_id).first
# updated_score.update_attributes(:score => score)
# end
# redirect_to :action => :grade_essays
# end
#
# def grade_essays
# scores = Score.where(score: -1)
# @questions = Array.new
# @answers = Hash.new
# @questionnaires = Array.new
# scores.each do |score|
# question = Question.find(score.question_id)
# @questions << question
# @questionnaires << QuizQuestionnaire.find(question.questionnaire_id)
# @answers.merge!({question: score})
# end
# @questionnaires.uniq!
# end

def graded?(response, question)
return (Score.where(question_id: question.id, response_id: response.id).first)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
<%= link_to image_tag('/assets/tree_view/assign-reviewers-24.png', :title => 'Assign reviewers'), {:controller => 'review_mapping', :action => 'list_mappings', :id => node.node_object_id}, {:title => 'Assign reviewers'} %>
<%= link_to image_tag('/assets/tree_view/assign-survey-24.png', :title => 'Assign surveys'), {:controller => 'survey', :action => 'assign', :id => node.node_object_id}, {:title => 'Assign surveys'} %>
<%= link_to image_tag('/assets/tree_view/view-survey-24.png', :title => 'View quiz questions'), {:controller => 'questions', :action => 'review_questions', :id => node.node_object_id}, {:title => 'View quiz questions'} %>
<%= link_to image_tag('/assets/tree_view/grade-essay-icon-24.png', :title => 'Grade Essay Questions'), {:controller => 'student_quizzes', :action => 'grade_essays'} %>
</div>
<div>
<%= link_to image_tag('/assets/tree_view/view-scores-24.png', :title => 'View scores'), {:controller => 'grades', :action => 'view', :id => node.node_object_id}, {:title => 'View scores'} %>
Expand Down

0 comments on commit 95f53d4

Please sign in to comment.