app/helpers/review_mapping_helper.rb
#This function makes a call to the function which makes a call to the API, with all the comments provided by a student for one round of review.
# It returns the number of suggestions provided by a reviewer.
This function makes a call to the function which makes a call to the API, with all the comments provided by a student for one round of review.
It returns the number of suggestions provided by a reviewer.
This function makes a call to the function which makes a call to the API with all the comments provided by a student for one round of review . It returns the number of suggestions provided by a reviewer .
def num_suggestions_for_responses_by_a_reviewer(comments)
    suggestion_score = 0
    if !comments.empty?
      0.upto(comments.length-1) do |i|
        suggestion_score+=rand(10).to_i
      end
      return (suggestion_score/comments.length).ceil()
    else
      return suggestion_score
    end
  end
def num_suggestions_for_responses_by_a_reviewer ( comments ) suggestion_score = 0 if ! comments . empty? 0 . upto ( comments . length - 1 ) do | i | suggestion_score += rand ( 10 ) . to_i end return ( suggestion_score / comments . length ) . ceil ( ) else return suggestion_score end end
This function makes a call to the function which makes a call to the API, with all the comments provided by a student for one round of review.
This function makes a call to the function which makes a call to the API with all the comments provided by a student for one round of review .
#send user review to API for analysis #api_response = retrieve_review_suggestion_metrics(comments) #uncomment this call when the API starts working #compute average for all response fields in ONE response #uncomment the code below when the API starts working # if api_response #   number_of_responses = api_response["results"].size #   0.upto(number_of_responses- 1) do |i| #     suggestion_chance += api_response["results"][i]["metrics"]["suggestion"]["suggestions_chances"] #   end # end #response received from the call to the API is simulated using a random number generator
comments