From 1047e52269eca9f2c929fb003c348f2f166ee785 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 20 Oct 2024 22:31:10 -0400 Subject: [PATCH 01/18] Update most fullname to name --- app/controllers/account_request_controller.rb | 6 ++--- app/controllers/import_file_controller.rb | 8 +++--- app/controllers/participants_controller.rb | 2 +- app/controllers/profile_controller.rb | 2 +- app/controllers/users_controller.rb | 6 ++--- app/helpers/conference_helper.rb | 2 +- app/helpers/import_file_helper.rb | 2 +- app/helpers/participants_helper.rb | 4 +-- app/helpers/review_mapping_helper.rb | 4 +-- app/models/assignment.rb | 2 +- app/models/feedback_response_map.rb | 2 +- app/models/mentor_management.rb | 4 +-- app/models/metareview_response_map.rb | 2 +- app/models/participant.rb | 4 +-- app/models/response.rb | 6 ++--- app/models/response_map.rb | 2 +- app/models/review_questionnaire.rb | 2 +- app/models/review_response_map.rb | 6 ++--- app/models/student_task.rb | 2 +- app/models/survey_response_map.rb | 2 +- app/models/team.rb | 2 +- app/models/teammate_review_response_map.rb | 2 +- app/models/user.rb | 14 +++++----- .../list_pending_requested.html.erb | 2 +- .../list_pending_requested_finalized.html.erb | 2 +- app/views/admin/_show.html.erb | 2 +- app/views/admin/list_administrators.html.erb | 2 +- app/views/admin/list_instructors.html.erb | 2 +- .../admin/list_super_administrators.html.erb | 2 +- app/views/advertise_for_partner/show.html.erb | 2 +- .../all_students_all_reviews.html.erb | 2 +- .../assignments/edit/_calibration.html.erb | 2 +- .../assignments/list_submissions.html.erb | 2 +- app/views/grades/_heat_grid_tab.html.erb | 2 +- app/views/grades/_review_table.html.erb | 6 ++--- app/views/grades/_team.html.erb | 2 +- app/views/grades/_view_heatgrid.html.erb | 4 +-- app/views/grades/view_team.html.erb | 2 +- app/views/import_file/_user.html.erb | 6 ++--- app/views/participants/_participant.html.erb | 2 +- .../view_copyright_grants.html.erb | 2 +- .../popup/author_feedback_popup.html.erb | 4 +-- app/views/popup/participants_popup.html.erb | 4 +-- .../popup/reviewer_details_popup.html.erb | 2 +- app/views/popup/team_users_popup.html.haml | 4 +-- .../reports/_answer_tagging_report.html.erb | 4 +-- .../reports/_bookmark_rating_report.html.erb | 2 +- app/views/reports/_feedback_report.html.erb | 14 +++++----- app/views/reports/_review_report.html.erb | 2 +- .../reports/_self_review_report.html.erb | 2 +- .../reports/_teammate_review_report.html.erb | 2 +- .../_list_review_mappings.html.erb | 4 +-- .../student_quizzes/review_questions.html.erb | 2 +- .../student_teams/_send_invitations.html.erb | 2 +- .../student_teams/_team_display.html.erb | 2 +- app/views/student_teams/mentor.html.erb | 2 +- app/views/student_teams/view.html.erb | 6 ++--- app/views/users/_name.html.erb | 4 +-- app/views/users/keys.html.erb | 2 +- app/views/users/list.html.erb | 2 +- app/views/users/show.html.erb | 2 +- db/data_migrations/scrub_database.rb | 2 +- ...42307_rename_name_and_fullname_in_users.rb | 1 - .../account_request_controller_spec.rb | 2 +- .../controllers/conference_controller_spec.rb | 10 +++---- .../invitations_controller_spec.rb | 2 +- .../participants_controller_spec.rb | 4 +-- .../password_retrieval_controller_spec.rb | 6 ++--- spec/controllers/popup_controller_spec.rb | 4 +-- .../review_bids_controller_spec.rb | 2 +- .../sample_reviews_controller_spec.rb | 4 +-- .../submission_records_controller_spec.rb | 2 +- spec/controllers/users_controller_spec.rb | 8 +++--- spec/factories/factories.rb | 8 +++--- spec/features/quiz_spec.rb | 2 +- spec/helpers/answer_helper_spec.rb | 2 +- spec/helpers/participants_helper_spec.rb | 4 +-- spec/helpers/review_mapping_helper_spec.rb | 10 +++---- spec/lib/scoring_spec.rb | 2 +- spec/models/administrator_spec.rb | 2 +- spec/models/answer_tag_spec.rb | 2 +- spec/models/assignment_participant_spec.rb | 14 +++++----- .../assignment_survey_response_map_spec.rb | 4 +-- spec/models/cake_spec.rb | 2 +- spec/models/course_analytic_spec.rb | 6 ++--- spec/models/course_node_spec.rb | 2 +- spec/models/course_spec.rb | 8 +++--- .../models/course_survey_response_map_spec.rb | 4 +-- spec/models/duty_spec.rb | 6 ++--- spec/models/feedback_response_map_spec.rb | 2 +- spec/models/instructor_spec.rb | 4 +-- spec/models/lock_spec.rb | 4 +-- spec/models/metareview_response_map_spec.rb | 6 ++--- spec/models/participant_spec.rb | 8 +++--- spec/models/response_map_spec.rb | 6 ++--- spec/models/response_spec.rb | 4 +-- spec/models/review_bid_spec.rb | 2 +- spec/models/review_response_map_spec.rb | 4 +-- spec/models/sign_up_topic_spec.rb | 2 +- spec/models/signed_up_team_spec.rb | 2 +- spec/models/student_task_spec.rb | 2 +- spec/models/super_administrator_spec.rb | 4 +-- spec/models/ta_spec.rb | 2 +- spec/models/team_spec.rb | 2 +- .../teammate_review_response_map_spec.rb | 4 +-- spec/models/user_spec.rb | 26 +++++++++---------- spec/models/vm_user_answer_tagging_spec.rb | 2 +- 107 files changed, 206 insertions(+), 207 deletions(-) diff --git a/app/controllers/account_request_controller.rb b/app/controllers/account_request_controller.rb index 396dbe1ac79..0370db7027d 100644 --- a/app/controllers/account_request_controller.rb +++ b/app/controllers/account_request_controller.rb @@ -64,7 +64,7 @@ def user_new(requested_user) new_user.name = requested_user.name new_user.role_id = requested_user.role_id new_user.institution_id = requested_user.institution_id - new_user.fullname = requested_user.fullname + new_user.name = requested_user.name new_user.email = requested_user.email new_user.parent_id = session[:user].id new_user.timezonepref = User.find_by(id: new_user.parent_id).timezonepref @@ -148,7 +148,7 @@ def save_requested_user(requested_user, params) def notify_supers_new_request(requested_user) super_users = User.joins(:role).where('roles.name = ?', 'Super-Administrator') super_users.each do |super_user| - prepared_mail = MailerHelper.send_mail_to_all_super_users(super_user, requested_user, 'New Account Request: ' + requested_user.fullname) + prepared_mail = MailerHelper.send_mail_to_all_super_users(super_user, requested_user, 'New Account Request: ' + requested_user.name) prepared_mail.deliver end # Notifying an email to the administrator regarding the new user request! @@ -163,7 +163,7 @@ def roles_for_request_sign_up end def requested_user_params - params.require(:user).permit(:name, :role_id, :fullname, :institution_id, :email) + params.require(:user).permit(:name, :role_id, :name, :institution_id, :email) .merge(self_introduction: params[:requested_user][:self_introduction]) end end diff --git a/app/controllers/import_file_controller.rb b/app/controllers/import_file_controller.rb index 0f70f5ca0a8..3ad7a473192 100644 --- a/app/controllers/import_file_controller.rb +++ b/app/controllers/import_file_controller.rb @@ -178,8 +178,8 @@ def import_from_hash(session, params) # Produces an array, where each entry in the array is a hash. # The hash keys are the column titles, and the hash values are the associated values. # - # E.G. [ { :name => 'jsmith', :fullname => 'John Smith' , :email => 'jsmith@gmail.com' }, - # { :name => 'jdoe', :fullname => 'Jane Doe', :email => 'jdoe@gmail.com' } ] + # E.G. [ { :name => 'jsmith', :name => 'John Smith' , :email => 'jsmith@gmail.com' }, + # { :name => 'jdoe', :name => 'Jane Doe', :email => 'jdoe@gmail.com' } ] # def hash_rows_with_headers(header, body) new_body = [] @@ -243,7 +243,7 @@ def hash_rows_with_headers(header, body) # and :body refers to the contents of the file except the header. # :header is an array, and :body is a two-dimensional array. # - # E.G. { :header => ['name', 'fullname', 'email'], + # E.G. { :header => ['name', 'name', 'email'], # :body => [ ['jsmith', 'John Smith', 'jsmith@gmail.com'], # ['jdoe', 'Jane Doe', 'jdoe@gmail.com' ] ] } # @@ -263,7 +263,7 @@ def parse_to_hash(import_grid, has_header) # The outer array contains "rows". # The inner arrays contain "elements of rows" or "columns". # - # E.G. [ [ 'name', 'fullname', 'email' ], + # E.G. [ [ 'name', 'name', 'email' ], # [ 'jsmith', 'John Smith', 'jsmith@gmail.com' ], # [ 'jdoe', 'Jane Doe', 'jdoe@gmail.com' ] ] # diff --git a/app/controllers/participants_controller.rb b/app/controllers/participants_controller.rb index a1bca28a7fd..668cca339f5 100644 --- a/app/controllers/participants_controller.rb +++ b/app/controllers/participants_controller.rb @@ -205,7 +205,7 @@ def participant_params def get_user_info(team_user, assignment) user = {} user[:name] = team_user.name - user[:fullname] = team_user.fullname + user[:name] = team_user.name # set by default permission_granted = false assignment.participants.each do |participant| diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb index c7053def3a4..e11a2cc6ee1 100644 --- a/app/controllers/profile_controller.rb +++ b/app/controllers/profile_controller.rb @@ -33,7 +33,7 @@ def update private def user_params - params.require(:user).permit(:fullname, + params.require(:user).permit(:name, :password, :password_confirmation, :email, diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0d93bccce43..fc342faea12 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -68,8 +68,8 @@ def list case search_by.to_i when 1 # Search by username @paginated_users = paginate_list.where('name LIKE ?', "%#{letter}%") - when 2 # Search by fullname - @paginated_users = paginate_list.where('fullname LIKE ?', "%#{letter}%") + when 2 # Search by name + @paginated_users = paginate_list.where('name LIKE ?', "%#{letter}%") when 3 # Search by email @paginated_users = paginate_list.where('email LIKE ?', "%#{letter}%") else @@ -218,7 +218,7 @@ def user_params :crypted_password, :role_id, :password_salt, - :fullname, + :name, :email, :parent_id, :private_by_default, diff --git a/app/helpers/conference_helper.rb b/app/helpers/conference_helper.rb index 049d245e320..dba180feed4 100644 --- a/app/helpers/conference_helper.rb +++ b/app/helpers/conference_helper.rb @@ -120,7 +120,7 @@ def assign_user_params(is_author) def user_params params.require(:user).permit(:name, - :fullname, + :name, :role_id, :email, :parent_id, diff --git a/app/helpers/import_file_helper.rb b/app/helpers/import_file_helper.rb index c0b59049291..5b7d7a80526 100644 --- a/app/helpers/import_file_helper.rb +++ b/app/helpers/import_file_helper.rb @@ -5,7 +5,7 @@ def self.define_attributes(row_hash) attributes = {} attributes['role_id'] = Role.student.id attributes['name'] = row_hash[:username] - attributes['fullname'] = row_hash[:fullname] + attributes['name'] = row_hash[:name] attributes['email'] = row_hash[:email] attributes['email_on_submission'] = 1 attributes['email_on_review'] = 1 diff --git a/app/helpers/participants_helper.rb b/app/helpers/participants_helper.rb index 08494c55737..6be7123f09f 100644 --- a/app/helpers/participants_helper.rb +++ b/app/helpers/participants_helper.rb @@ -16,7 +16,7 @@ def self.define_attributes(line_split, config) attributes = {} attributes['role_id'] = Role.find_by name: 'Student' attributes['name'] = line_split[config['name'].to_i] - attributes['fullname'] = config['fullname'] + attributes['name'] = config['name'] attributes['email'] = line_split[config['email'].to_i] attributes['password'] = (0...8).map { (65 + rand(26)).chr }.join attributes['email_on_submission'] = 1 @@ -65,7 +65,7 @@ def self.get_config while (line = infile.gets) store_item(line, 'dlm', config) store_item(line, 'name', config) - store_item(line, 'fullname', config) + store_item(line, 'name', config) store_item(line, 'email', config) end end diff --git a/app/helpers/review_mapping_helper.rb b/app/helpers/review_mapping_helper.rb index e249a054d1e..6f9ce0c1add 100644 --- a/app/helpers/review_mapping_helper.rb +++ b/app/helpers/review_mapping_helper.rb @@ -112,10 +112,10 @@ def link_updated_since_last?(round, due_dates, link_updated_at) (link_updated_at < submission_due_date) && (link_updated_at > submission_due_last_round) end - # For assignments with 1 team member, the following method returns user's fullname else it returns "team name" that a particular reviewee belongs to. + # For assignments with 1 team member, the following method returns user's name else it returns "team name" that a particular reviewee belongs to. def get_team_reviewed_link_name(max_team_size, _response, reviewee_id, ip_address) team_reviewed_link_name = if max_team_size == 1 - TeamsUser.where(team_id: reviewee_id).first.user.fullname(ip_address) + TeamsUser.where(team_id: reviewee_id).first.user.name(ip_address) else # E1991 : check anonymized view here Team.find(reviewee_id).name diff --git a/app/models/assignment.rb b/app/models/assignment.rb index 8f9bed41aab..362d75cd58f 100755 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -518,7 +518,7 @@ def self.export_data(csv, scores, options) teams_csv << team[:team].name names_of_participants = '' team[:team].participants.each do |p| - names_of_participants += p.fullname + names_of_participants += p.name names_of_participants += '; ' unless p == team[:team].participants.last end teams_csv << names_of_participants diff --git a/app/models/feedback_response_map.rb b/app/models/feedback_response_map.rb index bccf36270d1..2d404dd7e55 100644 --- a/app/models/feedback_response_map.rb +++ b/app/models/feedback_response_map.rb @@ -93,7 +93,7 @@ def email(defn, _participant, assignment) user = User.find(participant.user_id) defn[:to] = user.email - defn[:body][:first_name] = user.fullname + defn[:body][:first_name] = user.name Mailer.sync_message(defn).deliver end end diff --git a/app/models/mentor_management.rb b/app/models/mentor_management.rb index 54a71096463..0e0eba2c9ef 100644 --- a/app/models/mentor_management.rb +++ b/app/models/mentor_management.rb @@ -76,8 +76,8 @@ def self.assign_mentor(assignment_id, team_id) def self.notify_team_of_mentor_assignment(mentor, team) members = team.users emails = members.map(&:email) - members_info = members.map { |mem| "#{mem.fullname} - #{mem.email}" } - mentor_info = "#{mentor.fullname} (#{mentor.email})" + members_info = members.map { |mem| "#{mem.name} - #{mem.email}" } + mentor_info = "#{mentor.name} (#{mentor.email})" message = "#{mentor_info} has been assigned as your mentor for assignment #{Assignment.find(team.parent_id).name}
Current members:
#{members_info.join('
')}" Mailer.delayed_message(bcc: emails, diff --git a/app/models/metareview_response_map.rb b/app/models/metareview_response_map.rb index fdfb87e8dde..f1d15ea224b 100644 --- a/app/models/metareview_response_map.rb +++ b/app/models/metareview_response_map.rb @@ -88,7 +88,7 @@ def email(defn, _participant, assignment) defn[:body][:type] = 'Metareview' reviewee_user = Participant.find(reviewee_id) defn[:body][:obj_name] = assignment.name - defn[:body][:first_name] = User.find(reviewee_user.user_id).fullname + defn[:body][:first_name] = User.find(reviewee_user.user_id).name defn[:to] = User.find(reviewee_user.user_id).email Mailer.sync_message(defn).deliver end diff --git a/app/models/participant.rb b/app/models/participant.rb index cd282e096b7..8ddbda77fcc 100644 --- a/app/models/participant.rb +++ b/app/models/participant.rb @@ -40,7 +40,7 @@ def name(ip_address = nil) end def fullname(ip_address = nil) - user.fullname(ip_address) + user.name(ip_address) end def handle(ip_address = nil) @@ -136,7 +136,7 @@ def self.export(csv, parent_id, options) where(parent_id: parent_id).find_each do |part| tcsv = [] user = part.user - tcsv.push(user.name, user.fullname, user.email) if options['personal_details'] == 'true' + tcsv.push(user.name, user.name, user.email) if options['personal_details'] == 'true' tcsv.push(user.role.name) if options['role'] == 'true' tcsv.push(user.parent.name) if options['parent'] == 'true' tcsv.push(user.email_on_submission, user.email_on_review, user.email_on_review_of_review) if options['email_options'] == 'true' diff --git a/app/models/response.rb b/app/models/response.rb index 77ddc1a216b..cd61ab5ef7c 100644 --- a/app/models/response.rb +++ b/app/models/response.rb @@ -218,10 +218,10 @@ def notify_instructor_on_difference response_map = map reviewer_participant_id = response_map.reviewer_id reviewer_participant = AssignmentParticipant.find(reviewer_participant_id) - reviewer_name = User.find(reviewer_participant.user_id).fullname + reviewer_name = User.find(reviewer_participant.user_id).name reviewee_team = AssignmentTeam.find(response_map.reviewee_id) reviewee_participant = reviewee_team.participants.first # for team assignment, use the first member's name. - reviewee_name = User.find(reviewee_participant.user_id).fullname + reviewee_name = User.find(reviewee_participant.user_id).name assignment = Assignment.find(reviewer_participant.parent_id) Mailer.notify_grade_conflict_message( to: assignment.instructor.email, @@ -253,7 +253,7 @@ def self.score(params) def construct_instructor_html(identifier, self_id, count) identifier += '

Review ' + count.to_s + '

' - identifier += 'Reviewer: ' + map.reviewer.fullname + ' (' + map.reviewer.name + ')' + identifier += 'Reviewer: ' + map.reviewer.name + ' (' + map.reviewer.name + ')' identifier + '   hide review
' end diff --git a/app/models/response_map.rb b/app/models/response_map.rb index 0d6a00830da..3e55f35f5c8 100644 --- a/app/models/response_map.rb +++ b/app/models/response_map.rb @@ -33,7 +33,7 @@ def self.assessments_for(team) @array_sort.clear @sort_to.clear end - responses = responses.sort { |a, b| a.map.reviewer.fullname <=> b.map.reviewer.fullname } + responses = responses.sort { |a, b| a.map.reviewer.name <=> b.map.reviewer.name } end responses end diff --git a/app/models/review_questionnaire.rb b/app/models/review_questionnaire.rb index ffd7270098a..5551143f492 100644 --- a/app/models/review_questionnaire.rb +++ b/app/models/review_questionnaire.rb @@ -35,7 +35,7 @@ def get_assessments_round_for(participant, round) end end # responses = Response.find(:all, :include => :map, :conditions => ['reviewee_id = ? and type = ?',participant.id, self.to_s]) - responses.sort! { |a, b| a.map.reviewer.fullname <=> b.map.reviewer.fullname } + responses.sort! { |a, b| a.map.reviewer.name <=> b.map.reviewer.name } end responses end diff --git a/app/models/review_response_map.rb b/app/models/review_response_map.rb index 0ea43d9a0a7..ab6fdf73b87 100644 --- a/app/models/review_response_map.rb +++ b/app/models/review_response_map.rb @@ -102,7 +102,7 @@ def self.get_responses_for_team_round(team, round) responses << map.response.reject { |r| (r.round != round || !r.is_submitted) }.last end end - responses.sort! { |a, b| a.map.reviewer.fullname <=> b.map.reviewer.fullname } + responses.sort! { |a, b| a.map.reviewer.name <=> b.map.reviewer.name } end responses end @@ -149,7 +149,7 @@ def self.review_response_report(id, assignment, type, review_user) end else # This is a search, so find reviewers by user's full name - user_ids = User.select('DISTINCT id').where('fullname LIKE ?', '%' + review_user[:fullname] + '%') + user_ids = User.select('DISTINCT id').where('name LIKE ?', '%' + review_user[:name] + '%') # E1973 - we use a separate query depending on if the reviewer is a team or participant if assignment.team_reviewing_enabled reviewer_participants = AssignmentTeam.where('id IN (?) and parent_id = ?', team_ids, assignment.id) @@ -171,7 +171,7 @@ def email(defn, _participant, assignment) defn[:body][:type] = 'Peer Review' AssignmentTeam.find(reviewee_id).users.each do |user| defn[:body][:obj_name] = assignment.name - defn[:body][:first_name] = User.find(user.id).fullname + defn[:body][:first_name] = User.find(user.id).name defn[:to] = User.find(user.id).email Mailer.sync_message(defn).deliver_now end diff --git a/app/models/student_task.rb b/app/models/student_task.rb index d6394a83792..4bad1f5d43c 100644 --- a/app/models/student_task.rb +++ b/app/models/student_task.rb @@ -115,7 +115,7 @@ def self.teamed_students(user, ip_address = nil) teammates = [] course_id = Assignment.find_by(id: team.parent_id).course_id team_participants = Team.find(team.id).participants.reject { |p| p.name == user.name } - team_participants.each { |p| teammates << p.user.fullname(ip_address) } + team_participants.each { |p| teammates << p.user.name(ip_address) } next if teammates.empty? if students_teamed[course_id].nil? diff --git a/app/models/survey_response_map.rb b/app/models/survey_response_map.rb index d5649d1ee1b..c3b48ade6db 100644 --- a/app/models/survey_response_map.rb +++ b/app/models/survey_response_map.rb @@ -12,7 +12,7 @@ def email(defn, participant, survey_parent) user = User.find(participant.user_id) defn[:body][:type] = 'Survey Submission' defn[:body][:obj_name] = survey_parent.name - defn[:body][:first_name] = user.fullname + defn[:body][:first_name] = user.name defn[:to] = user.email Mailer.sync_message(defn).deliver_now end diff --git a/app/models/team.rb b/app/models/team.rb index 908a63cec29..c9a548a374c 100755 --- a/app/models/team.rb +++ b/app/models/team.rb @@ -57,7 +57,7 @@ def node_type def author_names names = [] users.each do |user| - names << user.fullname + names << user.name end names end diff --git a/app/models/teammate_review_response_map.rb b/app/models/teammate_review_response_map.rb index 257b9fa24ce..7839bf572a8 100644 --- a/app/models/teammate_review_response_map.rb +++ b/app/models/teammate_review_response_map.rb @@ -40,7 +40,7 @@ def email(defn, _participant, assignment) participant = AssignmentParticipant.find(reviewee_id) defn[:body][:obj_name] = assignment.name user = User.find(participant.user_id) - defn[:body][:first_name] = user.fullname + defn[:body][:first_name] = user.name defn[:to] = user.email Mailer.sync_message(defn).deliver end diff --git a/app/models/user.rb b/app/models/user.rb index 38e80f15b36..d3ee86617f1 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -26,7 +26,7 @@ class User < ApplicationRecord validates :email, presence: { message: "can't be blank" } validates :email, format: { with: /\A[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\z/i, allow_blank: true } - validates :fullname, presence: true + validates :name, presence: true before_validation :randomize_password, if: ->(user) { user.new_record? && user.password.blank? } # AuthLogic @@ -116,12 +116,12 @@ def name(ip_address = nil) User.anonymized_view?(ip_address) ? role.name + ' ' + id.to_s : self[:name] end - def fullname(ip_address = nil) - User.anonymized_view?(ip_address) ? role.name + ', ' + id.to_s : self[:fullname] + def name(ip_address = nil) + User.anonymized_view?(ip_address) ? role.name + ', ' + id.to_s : self[:name] end def first_name(ip_address = nil) - User.anonymized_view?(ip_address) ? role.name : fullname.try(:[], /,.+/).try(:[], /\w+/) || '' + User.anonymized_view?(ip_address) ? role.name : name.try(:[], /,.+/).try(:[], /\w+/) || '' end def email(ip_address = nil) @@ -170,7 +170,7 @@ def self.import(row_hash, _row_header, session, _id = nil) user = ImportFileHelper.create_new_user(attributes, session) else user.email = row_hash[:email] - user.fullname = row_hash[:fullname] + user.name = row_hash[:name] user.parent_id = (session[:user]).id user.save end @@ -257,7 +257,7 @@ def self.export(csv, _parent_id, options) users = User.all users.each do |user| tcsv = [] - tcsv.push(user.name, user.fullname, user.email) if options['personal_details'] == 'true' + tcsv.push(user.name, user.name, user.email) if options['personal_details'] == 'true' tcsv.push(user.role.name) if options['role'] == 'true' tcsv.push(user.parent.name) if options['parent'] == 'true' tcsv.push(user.email_on_submission, user.email_on_review, user.email_on_review_of_review, user.copy_of_emails) if options['email_options'] == 'true' @@ -312,7 +312,7 @@ def teaching_assistant? end def self.search_users(role, user_id, letter, search_by) - key_word = { '1' => 'name', '2' => 'fullname', '3' => 'email' } + key_word = { '1' => 'name', '2' => 'name', '3' => 'email' } sql = "(role_id in (?) or id = ?) and #{key_word[search_by]} like ?" if key_word.include? search_by search_filter = '%' + letter + '%' diff --git a/app/views/account_request/list_pending_requested.html.erb b/app/views/account_request/list_pending_requested.html.erb index 7f65e6fdfcb..43dbb11a301 100644 --- a/app/views/account_request/list_pending_requested.html.erb +++ b/app/views/account_request/list_pending_requested.html.erb @@ -20,7 +20,7 @@ <% @requested_users.each do |requested_user| %> <%= requested_user.name %> - <%= requested_user.fullname %> + <%= requested_user.name %> <%= mail_to requested_user.email, requested_user.email %> <%= Role.find_by(id: requested_user.role_id).try(:name) %>
<%= requested_user.self_introduction %>
diff --git a/app/views/account_request/list_pending_requested_finalized.html.erb b/app/views/account_request/list_pending_requested_finalized.html.erb index 853e73da349..76ee488de2d 100644 --- a/app/views/account_request/list_pending_requested_finalized.html.erb +++ b/app/views/account_request/list_pending_requested_finalized.html.erb @@ -10,7 +10,7 @@ <%= form_tag action: :create_approved_user, id: requested_user.id do %> <%= requested_user.name %> - <%= requested_user.fullname %> + <%= requested_user.name %> <%= mail_to requested_user.email, requested_user.email %> <%= Role.find_by(id: requested_user.role_id).try(:name) %>
<%= requested_user.self_introduction %>
diff --git a/app/views/admin/_show.html.erb b/app/views/admin/_show.html.erb index 7e07daf0950..dad4ace3a23 100644 --- a/app/views/admin/_show.html.erb +++ b/app/views/admin/_show.html.erb @@ -3,7 +3,7 @@ - + diff --git a/app/views/admin/list_administrators.html.erb b/app/views/admin/list_administrators.html.erb index 11f21ccb64a..2254c4042c3 100644 --- a/app/views/admin/list_administrators.html.erb +++ b/app/views/admin/list_administrators.html.erb @@ -6,7 +6,7 @@ - + diff --git a/app/views/admin/list_instructors.html.erb b/app/views/admin/list_instructors.html.erb index 8a912bd544b..ea30e94876b 100644 --- a/app/views/admin/list_instructors.html.erb +++ b/app/views/admin/list_instructors.html.erb @@ -8,7 +8,7 @@ - + diff --git a/app/views/admin/list_super_administrators.html.erb b/app/views/admin/list_super_administrators.html.erb index f9a3bd40d69..f907a3344d4 100644 --- a/app/views/admin/list_super_administrators.html.erb +++ b/app/views/admin/list_super_administrators.html.erb @@ -6,7 +6,7 @@ - + <% end -%> diff --git a/app/views/advertise_for_partner/show.html.erb b/app/views/advertise_for_partner/show.html.erb index 30c5b87d736..d059d5bf5b7 100644 --- a/app/views/advertise_for_partner/show.html.erb +++ b/app/views/advertise_for_partner/show.html.erb @@ -19,7 +19,7 @@ <% for member in @student.team.participants %> - + <% if @student.assignment.questionnaires.find_by_type('TeammateReviewQuestionnaire') != nil and member.user.id != session[:user].id %> diff --git a/app/views/assessment360/all_students_all_reviews.html.erb b/app/views/assessment360/all_students_all_reviews.html.erb index c6822d8df13..2814e38b47d 100644 --- a/app/views/assessment360/all_students_all_reviews.html.erb +++ b/app/views/assessment360/all_students_all_reviews.html.erb @@ -21,7 +21,7 @@ <% @course_participants.each do |cp|%> - + <% @assignments.each do |assignment|%> diff --git a/app/views/assignments/edit/_calibration.html.erb b/app/views/assignments/edit/_calibration.html.erb index def870265ca..1259e67280b 100644 --- a/app/views/assignments/edit/_calibration.html.erb +++ b/app/views/assignments/edit/_calibration.html.erb @@ -21,7 +21,7 @@ <% users_for_curr_team = "" %> <% teams_users.each do |teams_user| %> <% user = User.find(teams_user.user_id) %> - <% users_for_curr_team += user.name(session[:ip]) + ' (' + user.fullname(session[:ip]) + ')' + '
' %> + <% users_for_curr_team += user.name(session[:ip]) + ' (' + user.name(session[:ip]) + ')' + '
' %> <% participants = Array.new %> <% participants << Participant.where(["parent_id = ? AND user_id = ?", assignment.id, user.id]).first %> <% end %> diff --git a/app/views/assignments/list_submissions.html.erb b/app/views/assignments/list_submissions.html.erb index 81342e88533..d7005db49f1 100644 --- a/app/views/assignments/list_submissions.html.erb +++ b/app/views/assignments/list_submissions.html.erb @@ -70,7 +70,7 @@ diff --git a/app/views/grades/_heat_grid_tab.html.erb b/app/views/grades/_heat_grid_tab.html.erb index f4ba9750f20..5fd93cce764 100644 --- a/app/views/grades/_heat_grid_tab.html.erb +++ b/app/views/grades/_heat_grid_tab.html.erb @@ -3,7 +3,7 @@ <% pscore = @scores[:participants][participant.id.to_s.to_sym] %> diff --git a/app/views/grades/_review_table.html.erb b/app/views/grades/_review_table.html.erb index a79b558209e..23be1527622 100644 --- a/app/views/grades/_review_table.html.erb +++ b/app/views/grades/_review_table.html.erb @@ -14,9 +14,9 @@ <% for review in reviews %> <% end %> @@ -31,7 +31,7 @@ <% symbol = "review" + review.round.to_s %> <% score = Response.score(:response => [review], :questions => @questions[symbol.to_sym]) %> <% unless controller.action_name == "view_my_scores" %> - + <% end %> <%if score==-1%> <%= sprintf("--") %>%   diff --git a/app/views/grades/_team.html.erb b/app/views/grades/_team.html.erb index 184e8867c72..341a17f3e3a 100644 --- a/app/views/grades/_team.html.erb +++ b/app/views/grades/_team.html.erb @@ -12,7 +12,7 @@ <%= tscore[:team].name(session[:ip]) + ' (' + SignUpTopic.find(topic_id).topic_identifier + ')' %> <% else %> <% if @assignment.max_team_size == 1 %> - <%= tscore[:team].users.first.name(session[:ip]) + ' (' + tscore[:team].users.first.fullname(session[:ip]) + ')' rescue '' %> + <%= tscore[:team].users.first.name(session[:ip]) + ' (' + tscore[:team].users.first.name(session[:ip]) + ')' rescue '' %> <% else %> <%= tscore[:team].name(session[:ip]) %> | <% for index in 0..tscore[:team].users.length - 2 %> diff --git a/app/views/grades/_view_heatgrid.html.erb b/app/views/grades/_view_heatgrid.html.erb index 1f109d5cdb0..365a41db3f7 100644 --- a/app/views/grades/_view_heatgrid.html.erb +++ b/app/views/grades/_view_heatgrid.html.erb @@ -122,10 +122,10 @@ function toggleFunction(elementId) { <% if (['Student'].include? @current_role_name) && @assignment.is_anonymous%> <% elsif vm.questionnaire_display_type == "Author Feedback" %> - <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewee_id).user_id).fullname(session[:ip]).to_s %> + <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewee_id).user_id).name(session[:ip]).to_s %> <% else %> - <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).fullname(session[:ip]).to_s %> + <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).name(session[:ip]).to_s %> <% end %> <% i += 1 %> diff --git a/app/views/grades/view_team.html.erb b/app/views/grades/view_team.html.erb index a3355ed17a3..2cf3c1de1d2 100644 --- a/app/views/grades/view_team.html.erb +++ b/app/views/grades/view_team.html.erb @@ -137,7 +137,7 @@ <% if (['Student'].include? @current_role_name) && @assignment.is_anonymous%> <%= render :partial => 'add_icon_to_name', :locals => {review: review, i: i, user_name: nil} %> <% else %> - <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).fullname(session[:ip]).to_s %> + <% user_name = User.find(Participant.find(ResponseMap.find(Response.find(review.id).map_id).reviewer_id).user_id).name(session[:ip]).to_s %> <%= render :partial => 'add_icon_to_name', :locals => {review: review, i: i, user_name: user_name} %> <% end %> <% i_final = 0%> diff --git a/app/views/import_file/_user.html.erb b/app/views/import_file/_user.html.erb index 49cdc13529b..840c6a04abb 100644 --- a/app/views/import_file/_user.html.erb +++ b/app/views/import_file/_user.html.erb @@ -25,13 +25,13 @@ diff --git a/app/views/participants/_participant.html.erb b/app/views/participants/_participant.html.erb index e848939755a..7094f2b05c5 100644 --- a/app/views/participants/_participant.html.erb +++ b/app/views/participants/_participant.html.erb @@ -1,7 +1,7 @@ <% userid << participant.user_id %> - + diff --git a/app/views/participants/view_copyright_grants.html.erb b/app/views/participants/view_copyright_grants.html.erb index 92780febf6e..39348f6eaab 100644 --- a/app/views/participants/view_copyright_grants.html.erb +++ b/app/views/participants/view_copyright_grants.html.erb @@ -36,7 +36,7 @@ <% users.each do |user| %> - +
Full Name:<%= @user.fullname(session[:ip]) %><%= @user.name(session[:ip]) %>
Email Address:
<%= link_to user.name(session[:ip]), :action => 'show_administrator', :id => user.id %> <%= user.fullname(session[:ip]) %> <%= user.name(session[:ip]) %> <%= user.email(session[:ip]) %> <%= (User.find(user.parent_id)).name %>
<%= link_to user.name(session[:ip]), :action => 'show_instructor', :id => user.id %><%= user.fullname(session[:ip]) %><%= user.name(session[:ip]) %> <%= user.email(session[:ip]) %> <%= (User.find(user.parent_id)).name %>
<%= link_to user.name(session[:ip]), :action => 'show_super_administrator', :id => user.id %><%= user.fullname(session[:ip]) %><%= user.name(session[:ip]) %> <%= user.email(session[:ip]) %>
<%= member.user.name(session[:ip]) %><%= member.user.fullname(session[:ip]) %><%= member.user.name(session[:ip]) %> <%= member.user.email(session[:ip]) %>
<%= "#{cp.name(session[:ip])} (#{cp.fullname(session[:ip])})" %> <%= "#{cp.name(session[:ip])} (#{cp.name(session[:ip])})" %> <%= @teamed_count[cp.id] %><%= @meta_review[cp.id][assignment.id] unless @meta_review.nil? %> <% users_for_curr_team.each do |user| %> <%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user.name(session[:ip])}), :method => :post %> - (<%= user.fullname(session[:ip])%>)
+ (<%= user.name(session[:ip])%>)
<% end %>
- <%= participant.fullname(session[:ip]) %> + <%= participant.(session[:ip]) %> view heatgrid
<% unless controller.action_name == "view_my_scores"%> -  <%= review.map.reviewer.fullname(session[:ip]) %> <%=link_to image_tag("/assets/delete_icon.png", :border => 0), {:controller => 'response', :action => 'delete', :id => review.id, :return => 'instructor'} %> +  <%= review.map.reviewer.name(session[:ip]) %> <%=link_to image_tag("/assets/delete_icon.png", :border => 0), {:controller => 'response', :action => 'delete', :id => review.id, :return => 'instructor'} %> <% else %> -  <%= review.map.reviewer.fullname(session[:ip]) %>  +  <%= review.map.reviewer.name(session[:ip]) %>  <% end %> <%= "Review " + i.to_s %> <%= user_name.to_s %> <%= user_name.to_s %> @@ -40,7 +40,7 @@
<%= link_to participant.user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => participant.user.name(session[:ip])}), :method => :post %><%= link_to participant.user.fullname(session[:ip]), :controller=> 'users', :action => 'show', :id => participant.user_id %><%= link_to participant.user.name(session[:ip]), :controller=> 'users', :action => 'show', :id => participant.user_id %> <%= participant.user.email(session[:ip]) %> <%= participant.user.role.name %> <%= (User.find(participant.user.parent_id)).name(session[:ip]) %> <%=user[:name]%> <%=user[:fullname]%> <%=user[:name]%> <%=user[:pub_rights]%> <% if user[:verified] %> diff --git a/app/views/popup/author_feedback_popup.html.erb b/app/views/popup/author_feedback_popup.html.erb index 0f82a32cd3b..e9b3c0ba23f 100644 --- a/app/views/popup/author_feedback_popup.html.erb +++ b/app/views/popup/author_feedback_popup.html.erb @@ -13,9 +13,9 @@
<%else%> <% if params[:source] == 'author_feedback' %> -

Author Feedback to <%= @user.fullname(session[:ip]) %>

+

Author Feedback to <%= @user.name(session[:ip]) %>

<% elsif params[:source] == 'teammate_review' %> -

Teammate Review to <%= @user.fullname(session[:ip]) %>

+

Teammate Review to <%= @user.name(session[:ip]) %>

<% end %> diff --git a/app/views/popup/participants_popup.html.erb b/app/views/popup/participants_popup.html.erb index 03430e6583e..e80d8060b1a 100644 --- a/app/views/popup/participants_popup.html.erb +++ b/app/views/popup/participants_popup.html.erb @@ -19,7 +19,7 @@
<%else%> -

Reviewed by <%= User.find(@reviewer_id).fullname%>

+

Reviewed by <%= User.find(@reviewer_id).name%>

-

Review scores for <%= @user.fullname(session[:ip]) %>

+

Review scores for <%= @user.name(session[:ip]) %>

User's Average Score: @@ -48,7 +48,7 @@
diff --git a/app/views/popup/reviewer_details_popup.html.erb b/app/views/popup/reviewer_details_popup.html.erb index a83b7111a51..fd2c9976e6b 100644 --- a/app/views/popup/reviewer_details_popup.html.erb +++ b/app/views/popup/reviewer_details_popup.html.erb @@ -5,7 +5,7 @@
- + diff --git a/app/views/popup/team_users_popup.html.haml b/app/views/popup/team_users_popup.html.haml index f7b41c75dd7..b7199ca4e96 100644 --- a/app/views/popup/team_users_popup.html.haml +++ b/app/views/popup/team_users_popup.html.haml @@ -8,7 +8,7 @@ - @team_users.each do |t| %tr %td - \- #{User.find(t.user_id).fullname(@ip)} + \- #{User.find(t.user_id).name(@ip)} - (1..@assignment.num_review_rounds).each do |round| - next if instance_variable_get('@response_round_' + round.to_s).nil? - if instance_variable_get('@scores_round_' + round.to_s).nil? @@ -21,7 +21,7 @@ %td{:align => "center"} -- %br/ - else - %h3= "Reviewed by #{User.find(@reviewer_id).fullname(@ip)} (Round #{round})" + %h3= "Reviewed by #{User.find(@reviewer_id).name(@ip)} (Round #{round})" %table{:class => "general", :border => "1px solid #ccc"} %tr %th{:align => "left", :width => "50%"} Question diff --git a/app/views/reports/_answer_tagging_report.html.erb b/app/views/reports/_answer_tagging_report.html.erb index 46484416b69..b5e41f55b70 100644 --- a/app/views/reports/_answer_tagging_report.html.erb +++ b/app/views/reports/_answer_tagging_report.html.erb @@ -46,7 +46,7 @@ <% report_lines.each do |report_line| %> - + @@ -95,7 +95,7 @@ <% @user_tagging_report.each do |key, val| %> - + diff --git a/app/views/reports/_bookmark_rating_report.html.erb b/app/views/reports/_bookmark_rating_report.html.erb index 68fb61d6d04..28a7db04982 100644 --- a/app/views/reports/_bookmark_rating_report.html.erb +++ b/app/views/reports/_bookmark_rating_report.html.erb @@ -19,7 +19,7 @@ <% if maps.count > 0 %> diff --git a/app/views/reports/_feedback_report.html.erb b/app/views/reports/_feedback_report.html.erb index a46ead170d3..2ad87fbae48 100644 --- a/app/views/reports/_feedback_report.html.erb +++ b/app/views/reports/_feedback_report.html.erb @@ -52,7 +52,7 @@ <% %w[one two three].each do |round| %> <% if @first_col_identifier %> - <% @reviewer_name = rejoinder.user.fullname(session[:ip]) %> + <% @reviewer_name = rejoinder.user.name(session[:ip]) %> <%row_span = @assignment.varying_rubrics_by_round? ? (@rspan_round_one + @rspan_round_two + @rspan_round_three) : @rspan %> <%# If no feedback has been submitted, rowspan is seen as 0, then rowspan manually set to 1 so that it takes up its own row.%> <% if row_span.zero? %> @@ -91,14 +91,14 @@ <% else %> - <% @reviewee_name = Participant.find(@frm.reviewee_id).user.fullname(session[:ip]) %> + <% @reviewee_name = Participant.find(@frm.reviewee_id).user.name(session[:ip]) %> <% if Response.exists?(map_id: @frm.id) %> <% feedback_response = Response.where(map_id: @frm.id).first %> @@ -137,7 +137,7 @@ <% if row_span.zero? %> @@ -146,7 +146,7 @@ <%else %> <%end %> @@ -166,14 +166,14 @@ <% else %> - <% @reviewee_name = Participant.find(@frm.reviewee_id).user.fullname(session[:ip]) %> + <% @reviewee_name = Participant.find(@frm.reviewee_id).user.name(session[:ip]) %> <% if Response.exists?(map_id: @frm.id) %> <% feedback_response = Response.where(map_id: @frm.id).first %> diff --git a/app/views/reports/_review_report.html.erb b/app/views/reports/_review_report.html.erb index d6ecafcfc77..1734eb1b750 100644 --- a/app/views/reports/_review_report.html.erb +++ b/app/views/reports/_review_report.html.erb @@ -69,7 +69,7 @@ + <%end%> <% quiz_scores = [] %> diff --git a/app/views/student_teams/_send_invitations.html.erb b/app/views/student_teams/_send_invitations.html.erb index 726d8031f87..edae99886d8 100644 --- a/app/views/student_teams/_send_invitations.html.erb +++ b/app/views/student_teams/_send_invitations.html.erb @@ -36,7 +36,7 @@ <% @users_on_waiting_list.each do |user|%> - + <% end%> diff --git a/app/views/student_teams/_team_display.html.erb b/app/views/student_teams/_team_display.html.erb index 8aa37858823..782accafc77 100644 --- a/app/views/student_teams/_team_display.html.erb +++ b/app/views/student_teams/_team_display.html.erb @@ -16,7 +16,7 @@ <% @student.team.participants.each do |member| %> - + <%if @student.assignment.duty_based_assignment? %> <% team_user = member.team_user %> diff --git a/app/views/student_teams/mentor.html.erb b/app/views/student_teams/mentor.html.erb index 1b7660e6e1c..e0dc029645a 100644 --- a/app/views/student_teams/mentor.html.erb +++ b/app/views/student_teams/mentor.html.erb @@ -32,7 +32,7 @@ <% unless MentorManagement.user_a_mentor?(member.user) %> - + <%if @student.assignment.duty_based_assignment? %> <% team_user = member.team_user %> diff --git a/app/views/student_teams/view.html.erb b/app/views/student_teams/view.html.erb index 4b75fa8d03a..ff480177c5a 100644 --- a/app/views/student_teams/view.html.erb +++ b/app/views/student_teams/view.html.erb @@ -62,7 +62,7 @@ <% @student.team.participants.each do |member| %> - + <%if @student.assignment.duty_based_assignment? %> <% team_user = member.team_user %> @@ -142,7 +142,7 @@ <% @student.team.participants.each do |member| %> - + <% status = TeamsUser.find_by(user_id: member.user.id, team_id: member.team.id).pair_programming_status %> <% if (status == "W" || status.nil?) and current_user.id != member.user.id %> @@ -246,7 +246,7 @@ <% @users_on_waiting_list.each do |user|%> - + <% end%> diff --git a/app/views/users/_name.html.erb b/app/views/users/_name.html.erb index 09a29018697..1756654a6a8 100644 --- a/app/views/users/_name.html.erb +++ b/app/views/users/_name.html.erb @@ -1,2 +1,2 @@ - + diff --git a/app/views/users/keys.html.erb b/app/views/users/keys.html.erb index 8669f9c842c..cdd9ddb3a51 100644 --- a/app/views/users/keys.html.erb +++ b/app/views/users/keys.html.erb @@ -3,7 +3,7 @@
Full name: <%= @user.fullname(session[:ip]) %> <%= @user.name(session[:ip]) %> <%= image_tag "blank_profile_pic.jpg", :width=>"100px", :height=>"100px", :border=>1%>
<%= report_line.user.name(session[:ip]) %><%= report_line.user.fullname(session[:ip]) %><%= report_line.user.name(session[:ip]) %> <%= report_line.percentage.to_s %>% <%= report_line.no_tagged.to_s %> <%= report_line.no_not_tagged.to_s %>
<%= val.user.name(session[:ip]) %><%= val.user.fullname(session[:ip]) %><%= val.user.name(session[:ip]) %> <%= val.percentage.to_s %>% <%= val.no_tagged.to_s %> <%= val.no_not_tagged.to_s %> rowspan= <%= maps.count %>> - <% @reviewer_name = @user.fullname(session[:ip]) %> + <% @reviewer_name = @user.name(session[:ip]) %> <%= link_to @reviewer_name, :controller => 'popup', :action => 'reviewer_details_popup', :id => r.reviewer_id, :assignment_id => @id %> <%= link_to user_name = Participant.find(review_response.response_map.reviewer_id).user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user_name}), :method => :post, :title => "Click here to impersonate this user" %> - (<%= Participant.find(review_response.response_map.reviewer_id).user.fullname(session[:ip]) %>) + (<%= Participant.find(review_response.response_map.reviewer_id).user.name(session[:ip]) %>) No
> - <% @reviewer_name = rejoinder.user.fullname(session[:ip]) %> + <% @reviewer_name = rejoinder.user.name(session[:ip]) %> <%= link_to @reviewer_name, :controller => 'popup', :action => 'reviewer_details_popup', :id => rejoinder.id, :assignment_id => @id %>
> - <% @reviewer_name = rejoinder.user.fullname(session[:ip]) %> + <% @reviewer_name = rejoinder.user.name(session[:ip]) %> <%= link_to @reviewer_name, :controller => 'popup', :action => 'reviewer_details_popup', :id => rejoinder.id, :assignment_id => @id %> <%= link_to user_name = Participant.find(review_response.response_map.reviewer_id).user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user_name}), :method => :post, :title => "Click here to impersonate this user" %> - (<%= reviewee_name = Participant.find(review_response.response_map.reviewer_id).user.fullname(session[:ip]) %>) + (<%= reviewee_name = Participant.find(review_response.response_map.reviewer_id).user.name(session[:ip]) %>) No
<%= index + 1 %>. <%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user.name(session[:ip])}), :method => :post, :class => "user_unityID" %> - (<%= user.fullname(session[:ip]) %>) + (<%= user.name(session[:ip]) %>) diff --git a/app/views/reports/_self_review_report.html.erb b/app/views/reports/_self_review_report.html.erb index 2b6afc8a776..09249baf27e 100644 --- a/app/views/reports/_self_review_report.html.erb +++ b/app/views/reports/_self_review_report.html.erb @@ -12,7 +12,7 @@ align='left'> <% if sr.response.first %> - <%= link_to @user_name, controller: 'popup', action: 'self_review_popup', response_id: sr.response.first.id, user_fullname: Participant.find(sr.reviewer_id).user.fullname(session[:ip]) %> + <%= link_to @user_name, controller: 'popup', action: 'self_review_popup', response_id: sr.response.first.id, user_fullname: Participant.find(sr.reviewer_id).user.name(session[:ip]) %> <% else %> <%= @user_name %> <% end %> diff --git a/app/views/reports/_teammate_review_report.html.erb b/app/views/reports/_teammate_review_report.html.erb index c525dd88376..f23fec63508 100644 --- a/app/views/reports/_teammate_review_report.html.erb +++ b/app/views/reports/_teammate_review_report.html.erb @@ -44,7 +44,7 @@ <% @team_member_count > 1 ? @rspan = @team_member_count : @rspan = 1 %> <%if Participant.exists?(id: reviewer.reviewer_id) %> - <% @reviewer_name = @user.fullname(session[:ip]) %> + <% @reviewer_name = @user.name(session[:ip]) %> > <%= link_to @reviewer_name, :controller => 'popup', :action => 'reviewer_details_popup', :id => reviewer.reviewer_id, :assignment_id => @id%> diff --git a/app/views/review_mapping/_list_review_mappings.html.erb b/app/views/review_mapping/_list_review_mappings.html.erb index 214c360de44..d239229b3b2 100644 --- a/app/views/review_mapping/_list_review_mappings.html.erb +++ b/app/views/review_mapping/_list_review_mappings.html.erb @@ -59,12 +59,12 @@ <% if assignment.max_team_size < 2 %> <% user_id = TeamsUser.where(team_id: contributor.id).first.user_id %> - <%= User.find(user_id).fullname(session[:ip]) %> (<%= User.find(user_id).name(session[:ip]) %>)
+ <%= User.find(user_id).name(session[:ip]) %> (<%= User.find(user_id).name(session[:ip]) %>)
<% else %>
<%= contributor.name %>
<% team_members = TeamsUser.where(team_id: contributor.id) %> <% team_members.each do |team_member| %> - <%= User.find(team_member['user_id']).fullname(session[:ip]) %>  + <%= User.find(team_member['user_id']).name(session[:ip]) %>  (<%= User.find(team_member['user_id']).name(session[:ip]) %>)
<% end %> <% end %> diff --git a/app/views/student_quizzes/review_questions.html.erb b/app/views/student_quizzes/review_questions.html.erb index 7483115c925..c4d82b5e8e0 100644 --- a/app/views/student_quizzes/review_questions.html.erb +++ b/app/views/student_quizzes/review_questions.html.erb @@ -20,7 +20,7 @@ <% response_maps.each do |response_map| %> <% reviewer_paritcipant_id = response_map.reviewer_id%> <% reviewer_user_id = Participant.find(reviewer_paritcipant_id).user_id%> -
<%=User.find(reviewer_user_id).fullname%> <%=User.find(reviewer_user_id).name%>
  <%=user.name(session[:ip])%>     <%=user.fullname(session[:ip])%>     <%=user.name(session[:ip])%>     <%=user.email(session[:ip])%>  
<%= member.user.name(session[:ip]) %><%= member.user.fullname(session[:ip]) %><%= member.user.name(session[:ip]) %>
<%= member.user.name(session[:ip]) %><%= member.user.fullname(session[:ip]) %><%= member.user.name(session[:ip]) %>
<%= member.user.name(session[:ip]) %><%= member.user.fullname(session[:ip]) %><%= member.user.name(session[:ip]) %>
<%= member.user.name(session[:ip]) %><%= member.user.fullname(session[:ip]) %><%= member.user.name(session[:ip]) %> <%= member.user.email(session[:ip]) %>
  <%=user.name(session[:ip])%>     <%=user.fullname(session[:ip])%>     <%=user.name(session[:ip])%>     <%=user.email(session[:ip])%>  
- <%= text_field 'user', 'fullname', class: "form-control width-250"%>
+ <%= text_field 'user', 'name', class: "form-control width-250"%>
- + diff --git a/app/views/users/list.html.erb b/app/views/users/list.html.erb index 34925ecd67d..7549495d5a9 100644 --- a/app/views/users/list.html.erb +++ b/app/views/users/list.html.erb @@ -22,7 +22,7 @@ <% if (params[:show] != 'true' && !user.name(session[:ip]).include?("_hidden")) || params[:show] == 'true'%> - + diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index 4c5a301452d..ae1c000747b 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -3,7 +3,7 @@
Full Name:<%= @user.fullname(session[:ip]) %><%= @user.name(session[:ip]) %>
Email Address:
<%= link_to user.name(session[:ip]), impersonate_impersonate_path(:user => {:name => user.name(session[:ip])}), :method => :post %><%= link_to user.fullname(session[:ip]), :controller=> 'users', :action => 'show', :id => user.id %><%= link_to user.name(session[:ip]), :controller=> 'users', :action => 'show', :id => user.id %> <%= user.email(session[:ip]) %> <%= link_to user.role.name, :controller => 'roles', :action => 'show', :id => user.role.id %> <%= user.parent.try :name %>
- + diff --git a/db/data_migrations/scrub_database.rb b/db/data_migrations/scrub_database.rb index f7bd5e57737..1ee60ca9de7 100644 --- a/db/data_migrations/scrub_database.rb +++ b/db/data_migrations/scrub_database.rb @@ -11,7 +11,7 @@ def self.run! num = rand(1..9) role = user.role.name.downcase.gsub(/[- ]/, '_') user.name = role == 'student' ? "#{fake_name}_#{fake_lastname[0..3]}#{num}" : "#{role}_#{fake_name}__#{fake_lastname[0..3]}" - user.fullname = role == 'student' ? "#{fake_lastname}, #{fake_name}" : "#{fake_name}, #{role}" + user.name = role == 'student' ? "#{fake_lastname}, #{fake_name}" : "#{fake_name}, #{role}" user.email = 'expertiza@mailinator.com' user.handle = 'handle' user.password = 'password' diff --git a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb index bf3d88a36fc..c7d3cf1280c 100644 --- a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb +++ b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb @@ -1,6 +1,5 @@ class RenameNameAndFullnameInUsers < ActiveRecord::Migration[5.1] def change - # Renaming columns rename_column :users, :name, :username rename_column :users, :fullname, :name end diff --git a/spec/controllers/account_request_controller_spec.rb b/spec/controllers/account_request_controller_spec.rb index e640e95226b..fe3c8fdbaae 100644 --- a/spec/controllers/account_request_controller_spec.rb +++ b/spec/controllers/account_request_controller_spec.rb @@ -120,7 +120,7 @@ requested_user: { self_introduction: 'I am good' }, user: { name: 'instructor6', role_id: 2, - fullname: '6, instructor', + name: '6, instructor', institution_id: 1, email: 'chenzy@gmail.com' } } diff --git a/spec/controllers/conference_controller_spec.rb b/spec/controllers/conference_controller_spec.rb index 475809e0b4f..4a8fef559af 100644 --- a/spec/controllers/conference_controller_spec.rb +++ b/spec/controllers/conference_controller_spec.rb @@ -49,7 +49,7 @@ user: { name: 'lily', role_id: 2, email: 'chenzy@gmail.com', - fullname: 'John Bumgardner', + name: 'John Bumgardner', assignment: '2' } } allow(Assignment).to receive(:find_by_id).with('2').and_return(assignment1) @@ -78,7 +78,7 @@ user: { name: 'lily', role_id: 2, email: 'chenzy@gmail.com', - fullname: 'John Bumgardner', + name: 'John Bumgardner', assignment: '2' } } allow(Assignment).to receive(:find_by_id).with('2').and_return(assignment1) @@ -91,7 +91,7 @@ user: { name: 'lily23', role_id: 2, email: 'chenzy@gmail.com', - fullname: 'John Bumgardner', + name: 'John Bumgardner', assignment: '2' } } allow(Assignment).to receive(:find_by_id).with('2').and_return(assignment1) @@ -110,7 +110,7 @@ crypted_password: 'password', role_id: 1, password_salt: 1, - fullname: '6, instructor', + name: '6, instructor', email: 'chenzy@gmail.com', parent_id: 1, private_by_default: false, @@ -140,7 +140,7 @@ crypted_password: 'password', role_id: 1, password_salt: 1, - fullname: '6, instructor', + name: '6, instructor', email: 'chenzy2@gmail.com', parent_id: 1, private_by_default: false, diff --git a/spec/controllers/invitations_controller_spec.rb b/spec/controllers/invitations_controller_spec.rb index 4cf1e007778..c8c3c5e4671 100644 --- a/spec/controllers/invitations_controller_spec.rb +++ b/spec/controllers/invitations_controller_spec.rb @@ -59,7 +59,7 @@ allow(User).to receive(:skip_callback).with(:create, :after, :email_welcome).and_return(true) request_params = { user: { name: 'testuser@gmail.com', - fullname: 'John Bumgardner', + name: 'John Bumgardner', parent_id: 1, institution_id: 1 }, student_id: 1, diff --git a/spec/controllers/participants_controller_spec.rb b/spec/controllers/participants_controller_spec.rb index a37f5211621..f9335a597a9 100644 --- a/spec/controllers/participants_controller_spec.rb +++ b/spec/controllers/participants_controller_spec.rb @@ -236,9 +236,9 @@ allow(participant).to receive(:permission_granted?).and_return(true) allow(participant).to receive(:user).and_return(student) allow(student).to receive(:name).and_return('name') - allow(student).to receive(:fullname).and_return('fullname') + allow(student).to receive(:name).and_return('name') pc = ParticipantsController.new - expect(pc.send(:get_user_info, student, assignment)).to eq(name: 'name', fullname: 'fullname', pub_rights: 'Granted', verified: false) + expect(pc.send(:get_user_info, student, assignment)).to eq(name: 'name', name: 'name', pub_rights: 'Granted', verified: false) end end diff --git a/spec/controllers/password_retrieval_controller_spec.rb b/spec/controllers/password_retrieval_controller_spec.rb index dec9aded183..964afe4f6ca 100644 --- a/spec/controllers/password_retrieval_controller_spec.rb +++ b/spec/controllers/password_retrieval_controller_spec.rb @@ -3,7 +3,7 @@ it 'create new entry in password_resets table' do @user = User.new @user.email = 'example@example.edu' - @user.fullname = 'John Bumgardner' + @user.name = 'John Bumgardner' @user.name = 'ex' @user.save! request_params = { user: { email: 'example@example.edu' } } @@ -13,7 +13,7 @@ it 'modifies the token in password_resets_table' do @user = User.new @user.email = 'example@example.edu' - @user.fullname = 'John Bumgardner' + @user.name = 'John Bumgardner' @user.name = 'Shubham' @user.save! @password_retrival = PasswordReset.new @@ -29,7 +29,7 @@ @user = User.new @user.email = 'aexample@example.edu' @user.name = 'Shubham' - @user.fullname = 'John Bumgardner' + @user.name = 'John Bumgardner' @user.save! request_params = { user: { email: 'example@example.edu' } } post :send_password, params: request_params diff --git a/spec/controllers/popup_controller_spec.rb b/spec/controllers/popup_controller_spec.rb index f9f472e1e99..2a05e92d3fd 100644 --- a/spec/controllers/popup_controller_spec.rb +++ b/spec/controllers/popup_controller_spec.rb @@ -123,14 +123,14 @@ describe '#reviewer_details_popup' do it 'render reviewer_details_popup page successfully' do participant = double(:participant, user_id: 1) - user = double(:user, fullname: 'Test User', name: 'Test', email: 'test@gmail.com', handle: 1) + user = double(:user, name: 'Test User', name: 'Test', email: 'test@gmail.com', handle: 1) allow(Participant).to receive(:find).with('1').and_return(participant) allow(User).to receive(:find).with(participant.user_id).and_return(user) request_params = { id: 1, assignment_id: 1 } user_session = { user: instructor } get :reviewer_details_popup, params: request_params, session: user_session expect(@response).to have_http_status(200) - expect(user.fullname).to eq('Test User') + expect(user.name).to eq('Test User') expect(user.name).to eq('Test') expect(user.email).to eq('test@gmail.com') expect(user.handle).to eq(1) diff --git a/spec/controllers/review_bids_controller_spec.rb b/spec/controllers/review_bids_controller_spec.rb index a2550675eb9..3b7b410e613 100644 --- a/spec/controllers/review_bids_controller_spec.rb +++ b/spec/controllers/review_bids_controller_spec.rb @@ -1,7 +1,7 @@ describe ReviewBidsController do # let(:assignment) { double('Assignment', id: 1) } # let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } let(:assignment) { build(:assignment, id: 1, name: 'Test Assgt', rounds_of_reviews: 2) } let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) } diff --git a/spec/controllers/sample_reviews_controller_spec.rb b/spec/controllers/sample_reviews_controller_spec.rb index 175663bfb4e..0e9aee9d9dd 100644 --- a/spec/controllers/sample_reviews_controller_spec.rb +++ b/spec/controllers/sample_reviews_controller_spec.rb @@ -23,8 +23,8 @@ let(:response1) { build(:response, id: 2, map_id: 1, round: 2, response_map: review_response_map) } let(:response2) { build(:response, id: 3, map_id: 1, round: nil, response_map: review_response_map, is_submitted: true) } let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student1) { build(:student, id: 2, name: 'name1', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student1) { build(:student, id: 2, name: 'name1', name: 'no one', email: 'expertiza@mailinator.com') } let(:questionnaire) { Questionnaire.new(id: 1, type: 'ReviewQuestionnaire') } let(:answer) { Answer.new(id: 5, question_id: 1) } let(:samplereview1) { SampleReview.new id: 3, assignment_id: 10, response_id: 5 } diff --git a/spec/controllers/submission_records_controller_spec.rb b/spec/controllers/submission_records_controller_spec.rb index 7eec4130e4e..d3b99646d43 100644 --- a/spec/controllers/submission_records_controller_spec.rb +++ b/spec/controllers/submission_records_controller_spec.rb @@ -6,7 +6,7 @@ let(:ta) { build(:teaching_assistant, id: 8) } let(:assignment) { build(:assignment, id: 1, name: 'Test Assgt', rounds_of_reviews: 2, instructor_id: 10) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } let(:team) { build(:assignment_team, id: 1, name: 'team no name', assignment: assignment, users: [student], parent_id: 1) } let(:submission_record) { build(:submission_record, id: 1, team_id: 27158, assignment_id: 1) } diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb index e19ba856282..062dfe5ace0 100644 --- a/spec/controllers/users_controller_spec.rb +++ b/spec/controllers/users_controller_spec.rb @@ -12,7 +12,7 @@ let(:institution1) { build(:institution, id: 1) } let(:requested_user1) do - AccountRequest.new id: 4, name: 'requester1', role_id: 2, fullname: 're, requester1', + AccountRequest.new id: 4, name: 'requester1', role_id: 2, name: 're, requester1', institution_id: 1, email: 'requester1@test.com', status: nil, self_introduction: 'no one' end let(:superadmin) { build(:superadmin) } @@ -204,7 +204,7 @@ crypted_password: 'password', role_id: 2, password_salt: 1, - fullname: '6, instructor', + name: '6, instructor', email: 'chenzy@gmail.com', parent_id: 1, private_by_default: false, @@ -234,7 +234,7 @@ crypted_password: 'password', role_id: 2, password_salt: 1, - fullname: '6, instructor', + name: '6, instructor', email: 'chenzy@gmail.com', parent_id: 1, private_by_default: false, @@ -265,7 +265,7 @@ crypted_password: 'password', role_id: 2, password_salt: 1, - fullname: '6, instructor', + name: '6, instructor', email: 'chenzy@gmail.com', parent_id: 1, private_by_default: false, diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index c359e784672..d54b3a5d28d 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -147,7 +147,7 @@ role { Role.where(name: 'Instructor').first || association(:role_of_instructor) } password 'password' password_confirmation 'password' - fullname '6, instructor' + name '6, instructor' email 'expertiza@mailinator.com' parent_id 1 private_by_default false @@ -169,7 +169,7 @@ role { Role.where(name: 'Teaching Assistant').first || association(:role_of_teaching_assistant) } password 'password' password_confirmation 'password' - fullname '5888, teaching assistant' + name '5888, teaching assistant' email 'expertiza@mailinator.com' parent_id 1 private_by_default false @@ -574,7 +574,7 @@ factory :requested_user, class: AccountRequest do name 'requester1' role_id 2 - fullname 'requester, requester' + name 'requester, requester' institution_id 1 email 'requester1@test.com' status 'Under Review' @@ -641,7 +641,7 @@ factory :test_user, class: User do name 'username' - fullname 'full name' + name 'full name' email 'abc@mailinator.com' end diff --git a/spec/features/quiz_spec.rb b/spec/features/quiz_spec.rb index 1cfec0bf2f8..c9f921e6651 100644 --- a/spec/features/quiz_spec.rb +++ b/spec/features/quiz_spec.rb @@ -310,7 +310,7 @@ def init_instructor_tests visit "/student_quizzes/review_questions?id=#{@assignment.id}&type=Assignment" student = all('tr > td')[0] score = all('tr > td')[1] - expect(student).to have_text(@student2.fullname) + expect(student).to have_text(@student2.name) expect(score).to have_text('100.0') expect(page).to have_text('Average score for quiz takers: 100.0') expect(page).to have_text('1') diff --git a/spec/helpers/answer_helper_spec.rb b/spec/helpers/answer_helper_spec.rb index f758fc045b9..fb3750f0ac5 100644 --- a/spec/helpers/answer_helper_spec.rb +++ b/spec/helpers/answer_helper_spec.rb @@ -20,7 +20,7 @@ @assignment_questionnaire1 = create(:assignment_questionnaire, id: 1, assignment_id: @assignment1.id, questionnaire_id: @questionnaire1.id, used_in_round: 1) @assignment_questionnaire2 = create(:assignment_questionnaire, id: 2, assignment_id: @assignment1.id, questionnaire_id: @questionnaire2.id, used_in_round: 2) @assignment_questionnaire3 = create(:assignment_questionnaire, id: 3, assignment_id: @assignment2.id, questionnaire_id: @questionnaire3.id, used_in_round: nil) - @user = create(:student, name: 'name', fullname: 'name') + @user = create(:student, name: 'name', name: 'name') @participant = create(:participant, user_id: @user.id, parent_id: @assignment1.id) @response_map = create(:review_response_map, reviewer: @participant, assignment: @assignment1) @response = create(:response, response_map: @response_map, created_at: '2019-11-01 23:30:00') diff --git a/spec/helpers/participants_helper_spec.rb b/spec/helpers/participants_helper_spec.rb index 2199dfceddc..28db1584525 100644 --- a/spec/helpers/participants_helper_spec.rb +++ b/spec/helpers/participants_helper_spec.rb @@ -26,12 +26,12 @@ let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') } it 'returns correct user when create_new_user is called' do - attributes = {'role_id' => 1, 'name' => 'Test1', 'fullname' => 'test2', 'email' => 'test@ncsu.edu', 'email_on_submission' => 1, 'email_on_review' => 1, 'email_on_review_of_review' => 1} + attributes = {'role_id' => 1, 'name' => 'Test1', 'name' => 'test2', 'email' => 'test@ncsu.edu', 'email_on_submission' => 1, 'email_on_review' => 1, 'email_on_review_of_review' => 1} session = {user: instructor1} user = ParticipantsHelper.create_new_user(attributes, session) expect(user['role_id']).to eq(1) expect(user['name']).to eq('Test1') - expect(user['fullname']).to eq('test2') + expect(user['name']).to eq('test2') expect(user['email']).to eq('test@ncsu.edu') expect(user['email_on_submission']).to eq(true) expect(user['email_on_review']).to eq(true) diff --git a/spec/helpers/review_mapping_helper_spec.rb b/spec/helpers/review_mapping_helper_spec.rb index 28a336a96db..c8da5fc9e23 100644 --- a/spec/helpers/review_mapping_helper_spec.rb +++ b/spec/helpers/review_mapping_helper_spec.rb @@ -436,7 +436,7 @@ # return the user name if team size equal 1 it 'should return (Adam) if max_team_size = 1' do max_team_size = 1 - student = create(:student, fullname: 'Adam') + student = create(:student, name: 'Adam') create(:team_user, user: student, team: @reviewee) @response = create(:response, response_map: @response_map) @@ -1004,7 +1004,7 @@ @assignment1 = create(:assignment, name: 'name1') @questionnaire = create(:questionnaire) @question = create(:question, questionnaire_id: @questionnaire.id) - @user = create(:student, name: 'name', fullname: 'name') + @user = create(:student, name: 'name', name: 'name') @participant = create(:participant, user_id: @user.id, parent_id: @assignment1.id) @response_map = create(:review_response_map, reviewer: @participant, assignment: @assignment1) @response = create(:response, response_map: @response_map, created_at: '2019-11-01 23:30:00') @@ -1022,7 +1022,7 @@ @assignment1 = create(:assignment, name: 'name1') @questionnaire = create(:questionnaire) @question = create(:question, questionnaire_id: @questionnaire.id) - @user = create(:student, name: 'name', fullname: 'name') + @user = create(:student, name: 'name', name: 'name') @participant = create(:participant, user_id: @user.id, parent_id: @assignment1.id) @response_map = create(:review_response_map, reviewer: @participant, assignment: @assignment1) @response = create(:response, response_map: @response_map, created_at: '2019-11-01 23:30:00') @@ -1042,7 +1042,7 @@ @assignment1 = create(:assignment, name: 'name1') @questionnaire = create(:questionnaire) @question = create(:question, questionnaire_id: @questionnaire.id) - @user = create(:student, name: 'name', fullname: 'name') + @user = create(:student, name: 'name', name: 'name') @participant = create(:participant, user_id: @user.id, parent_id: @assignment1.id) @response_map = create(:review_response_map, reviewer: @participant, assignment: @assignment1) @id = @assignment1.id @@ -1058,7 +1058,7 @@ @assignment1 = create(:assignment, name: 'name1') @questionnaire = create(:questionnaire) @question = create(:question, questionnaire_id: @questionnaire.id) - @user = create(:student, name: 'name', fullname: 'name') + @user = create(:student, name: 'name', name: 'name') @participant = create(:participant, user_id: @user.id, parent_id: @assignment1.id) @response_map = create(:review_response_map, reviewer: @participant, assignment: @assignment1) @id = @assignment1.id diff --git a/spec/lib/scoring_spec.rb b/spec/lib/scoring_spec.rb index 4587ca33915..5068bbdfcf5 100644 --- a/spec/lib/scoring_spec.rb +++ b/spec/lib/scoring_spec.rb @@ -12,7 +12,7 @@ let(:signed_up_team) { build(:signed_up_team, team_id: contributor.id) } # ReviewResponseMap Spec Additions - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) } let(:response3) { build(:response) } let(:question) { double('Question') } diff --git a/spec/models/administrator_spec.rb b/spec/models/administrator_spec.rb index 7c5b722f18b..4734d336d2d 100644 --- a/spec/models/administrator_spec.rb +++ b/spec/models/administrator_spec.rb @@ -1,7 +1,7 @@ describe Administrator do describe 'class' do it 'creates a valid object' do - expect(Administrator.new(name: 'name', fullname: 'John Bumgardner', email: 'email@email.com')).to be_valid + expect(Administrator.new(name: 'name', name: 'John Bumgardner', email: 'email@email.com')).to be_valid end end end diff --git a/spec/models/answer_tag_spec.rb b/spec/models/answer_tag_spec.rb index 932bbef4fe1..68797f3f121 100644 --- a/spec/models/answer_tag_spec.rb +++ b/spec/models/answer_tag_spec.rb @@ -10,7 +10,7 @@ let(:tag_prompt_cb) { TagPrompt.create id: 1, prompt: '??', desc: 'desc', control_type: 'checkbox' } let(:tag_deploy) { TagPromptDeployment.create id: 1, tag_prompt: tag_prompt, question_type: 'Criterion' } let(:tag_deploy_cb) { TagPromptDeployment.create id: 1, tag_prompt: tag_prompt_cb, question_type: 'Criterion' } - let(:user) { User.new name: 'abc', fullname: 'abc xyz', email: 'abcxyz@gmail.com', password: '12345678', password_confirmation: '12345678' } + let(:user) { User.new name: 'abc', name: 'abc xyz', email: 'abcxyz@gmail.com', password: '12345678', password_confirmation: '12345678' } it 'is invalid without valid attributes' do expect(AnswerTag.new).not_to be_valid diff --git a/spec/models/assignment_participant_spec.rb b/spec/models/assignment_participant_spec.rb index f60546a1e7c..0cc5efca7dd 100644 --- a/spec/models/assignment_participant_spec.rb +++ b/spec/models/assignment_participant_spec.rb @@ -135,7 +135,7 @@ context 'when no user is found by offered username' do context 'when the record has less than 4 items' do it 'raises an ArgumentError' do - row = { username: 'no one', fullname: 'no one', email: 'no_one@email.com' } + row = { username: 'no one', name: 'no one', email: 'no_one@email.com' } expect(ImportFileHelper).not_to receive(:create_new_user) expect { AssignmentParticipant.import(row, nil, nil, nil) }.to raise_error('The record containing no one does not have enough items.') end @@ -143,10 +143,10 @@ context 'when new user needs to be created' do let(:row) do - { username: 'no one', fullname: 'no one', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } + { username: 'no one', name: 'no one', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } end let(:attributes) do - { role_id: 1, name: 'no one', fullname: 'no one', email: 'name@email.com', email_on_submission: 'name@email.com', + { role_id: 1, name: 'no one', name: 'no one', email: 'name@email.com', email_on_submission: 'name@email.com', email_on_review: 'name@email.com', email_on_review_of_review: 'name@email.com' } end let(:test_user) do @@ -156,7 +156,7 @@ ActionMailer::Base.deliveries.clear allow(ImportFileHelper).to receive(:define_attributes).with(row).and_return(attributes) allow(ImportFileHelper).to receive(:create_new_user) do - test_user = User.new(name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com') + test_user = User.new(name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com') test_user.id = 123 test_user.save! password = test_user.reset_password # the password is reset @@ -177,10 +177,10 @@ context 'when the record has more than 4 items' do let(:row) do - { username: 'no one', fullname: 'no one', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } + { username: 'no one', name: 'no one', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } end let(:attributes) do - { role_id: 1, name: 'no one', fullname: 'no one', email: 'name@email.com', email_on_submission: 'name@email.com', + { role_id: 1, name: 'no one', name: 'no one', email: 'name@email.com', email_on_submission: 'name@email.com', email_on_review: 'name@email.com', email_on_review_of_review: 'name@email.com' } end before(:each) do @@ -213,7 +213,7 @@ describe '.export' do it 'exports all participants in current assignment' do allow(AssignmentParticipant).to receive_message_chain(:where, :find_each).with(parent_id: 1).with(no_args).and_yield(participant) - allow(participant).to receive(:user).and_return(build(:student, name: 'student2065', fullname: '2065, student')) + allow(participant).to receive(:user).and_return(build(:student, name: 'student2065', name: '2065, student')) options = { 'personal_details' => 'true', 'role' => 'true', 'handle' => 'true', 'parent' => 'true', 'email_options' => 'true' } expect(AssignmentParticipant.export([], 1, options)).to eq( [['student2065', diff --git a/spec/models/assignment_survey_response_map_spec.rb b/spec/models/assignment_survey_response_map_spec.rb index 2473212c1bf..56803b2c7ae 100644 --- a/spec/models/assignment_survey_response_map_spec.rb +++ b/spec/models/assignment_survey_response_map_spec.rb @@ -1,10 +1,10 @@ describe AssignmentSurveyResponseMap, type: :model do - let(:participant) { build(:participant, user_id: 1, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) } + let(:participant) { build(:participant, user_id: 1, user: build(:student, name: 'Jane', name: 'Doe, Jane', id: 1)) } let(:assignment_questionnaire1) { build(:assignment_questionnaire, id: 1, assignment_id: 1, questionnaire_id: 1) } let(:previous_day) { (Time.now.getlocal - 1 * 86_400).strftime('%Y-%m-%d %H:%M:%S') } let(:next_day) { (Time.now.getlocal + 1 * 86_400).strftime('%Y-%m-%d %H:%M:%S') } let(:assignment) { build(:assignment, id: 1, name: 'Assignment1') } - let(:user) { build(:student, email: 'expertiza.debugging@gmail.com', name: 'Jane', fullname: 'Doe, Jane', id: 1) } + let(:user) { build(:student, email: 'expertiza.debugging@gmail.com', name: 'Jane', name: 'Doe, Jane', id: 1) } before(:each) do survey_deployment = AssignmentSurveyDeployment.new questionnaire_id: 1, start_date: previous_day, end_date: next_day, parent_id: '12345678', type: 'AssignmentSurveyDeployment' @assignment_survey_response_map = AssignmentSurveyResponseMap.new diff --git a/spec/models/cake_spec.rb b/spec/models/cake_spec.rb index c0472a2a6d2..acb4fb514e8 100644 --- a/spec/models/cake_spec.rb +++ b/spec/models/cake_spec.rb @@ -4,7 +4,7 @@ let(:answer) { Answer.new answer: 45 } let(:answer1) { Answer.new answer: 50 } let(:team) { build(:assignment_team, id: 1, name: 'no team', users: [user]) } - let(:user) { build(:student, id: 1, name: 'no name', fullname: 'no one', participants: [participant]) } + let(:user) { build(:student, id: 1, name: 'no name', name: 'no one', participants: [participant]) } let(:participant) { build(:participant, user_id: 1) } describe '#edit' do it 'returns the html ' do diff --git a/spec/models/course_analytic_spec.rb b/spec/models/course_analytic_spec.rb index 53a03110ad2..f4d4e16fccd 100644 --- a/spec/models/course_analytic_spec.rb +++ b/spec/models/course_analytic_spec.rb @@ -12,9 +12,9 @@ def initialize(course, participants, assignments) describe CourseAnalytic do let(:course) { build(:course, id: 1, name: 'ECE517') } - let(:participant) { build(:participant, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) } - let(:participant2) { build(:participant, user: build(:student, name: 'John', fullname: 'Doe, John', id: 2)) } - let(:participant3) { build(:participant, can_review: false, user: build(:student, name: 'King', fullname: 'Titan, King', id: 3)) } + let(:participant) { build(:participant, user: build(:student, name: 'Jane', name: 'Doe, Jane', id: 1)) } + let(:participant2) { build(:participant, user: build(:student, name: 'John', name: 'Doe, John', id: 2)) } + let(:participant3) { build(:participant, can_review: false, user: build(:student, name: 'King', name: 'Titan, King', id: 3)) } let(:assignment) { build(:assignment, id: 1, name: 'no assignment', participants: [participant], teams: [team]) } let(:assignment2) { build(:assignment, id: 2, name: 'no assignment', participants: [participant], teams: [team]) } let(:assignment3) { build(:assignment, id: 3, name: 'no assignment', participants: [participant], teams: [team]) } diff --git a/spec/models/course_node_spec.rb b/spec/models/course_node_spec.rb index caf9e8a7f7c..03d1881c911 100644 --- a/spec/models/course_node_spec.rb +++ b/spec/models/course_node_spec.rb @@ -1,7 +1,7 @@ describe CourseNode do let(:course) { build(:course, id: 1, name: 'ECE517') } let(:course_node) { build(:course_node, id: 1) } - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } let(:assignment) { build(:assignment, id: 1) } before(:each) do course_node.node_object_id = 1 diff --git a/spec/models/course_spec.rb b/spec/models/course_spec.rb index 4b35aa439cf..6eb8a7725a1 100644 --- a/spec/models/course_spec.rb +++ b/spec/models/course_spec.rb @@ -3,10 +3,10 @@ let(:course_team1) { build(:course_team, id: 1) } let(:course_team2) { build(:course_team, id: 2) } let(:instructor) { build(:instructor, id: 6) } - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } - let(:user2) { User.new name: 'bcd', fullname: 'cbd ccd', email: 'bcdccd@gmail.com', password: '123456789', password_confirmation: '123456789' } - let(:participant) { build(:participant, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) } - let(:participant2) { build(:participant, user: build(:student, name: 'John', fullname: 'Doe, John', id: 2)) } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user2) { User.new name: 'bcd', name: 'cbd ccd', email: 'bcdccd@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:participant) { build(:participant, user: build(:student, name: 'Jane', name: 'Doe, Jane', id: 1)) } + let(:participant2) { build(:participant, user: build(:student, name: 'John', name: 'Doe, John', id: 2)) } let(:assignment) { build(:assignment, id: 1, name: 'no assgt') } describe 'validations' do diff --git a/spec/models/course_survey_response_map_spec.rb b/spec/models/course_survey_response_map_spec.rb index 79f7fde0659..240ea3f9766 100644 --- a/spec/models/course_survey_response_map_spec.rb +++ b/spec/models/course_survey_response_map_spec.rb @@ -1,9 +1,9 @@ describe CourseSurveyResponseMap do - let(:participant) { build(:participant, user_id: 1, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) } + let(:participant) { build(:participant, user_id: 1, user: build(:student, name: 'Jane', name: 'Doe, Jane', id: 1)) } let(:course_survey_questionnaire) { CourseSurveyQuestionnaire.new id: 985, name: 'course_survey', private: 0, min_question_score: 0, max_question_score: 10, instructor_id: 1234 } let(:previous_day) { (Time.now.getlocal - 1 * 86_400).strftime('%Y-%m-%d %H:%M:%S') } let(:next_day) { (Time.now.getlocal + 1 * 86_400).strftime('%Y-%m-%d %H:%M:%S') } - let(:user) { build(:student, email: 'expertiza.debugging@gmail.com', name: 'Jane', fullname: 'Doe, Jane', id: 1) } + let(:user) { build(:student, email: 'expertiza.debugging@gmail.com', name: 'Jane', name: 'Doe, Jane', id: 1) } let(:course) { build(:course, id: 1, name: 'ECE517') } before(:each) do survey_deployment = CourseSurveyDeployment.new questionnaire_id: 985, start_date: previous_day, end_date: next_day, parent_id: '12345678', type: 'CourseSurveyDeployment' diff --git a/spec/models/duty_spec.rb b/spec/models/duty_spec.rb index 9a01bc75079..d867b1322fa 100644 --- a/spec/models/duty_spec.rb +++ b/spec/models/duty_spec.rb @@ -3,9 +3,9 @@ let(:participant) { build(:participant, id: 1, user_id: 1) } let(:participant2) { build(:participant, id: 2, user_id: 2) } let(:participant3) { build(:participant, id: 3, user_id: 3) } - let(:user) { build(:student, id: 1, name: 'no name', fullname: 'no one', participants: [participant]) } - let(:user2) { build(:student, id: 2, name: 'no name2', fullname: 'no one2', participants: [participant2]) } - let(:user3) { build(:student, id: 3, name: 'no name3', fullname: 'no one3', participants: [participant3]) } + let(:user) { build(:student, id: 1, name: 'no name', name: 'no one', participants: [participant]) } + let(:user2) { build(:student, id: 2, name: 'no name2', name: 'no one2', participants: [participant2]) } + let(:user3) { build(:student, id: 3, name: 'no name3', name: 'no one3', participants: [participant3]) } let(:team1) { build(:assignment_team, id: 1, name: 'no team', users: [user, user2, user3]) } let(:sample_duty_taken) { build(:duty, id: 1, name: 'Developer', max_members_for_duty: 1, assignment_id: 1) } diff --git a/spec/models/feedback_response_map_spec.rb b/spec/models/feedback_response_map_spec.rb index 79039b10ec4..dad190208a3 100644 --- a/spec/models/feedback_response_map_spec.rb +++ b/spec/models/feedback_response_map_spec.rb @@ -9,7 +9,7 @@ let(:review_response_map) { build(:review_response_map, id: 2, assignment: assignment, reviewer: participant, reviewee: team) } let(:answer) { Answer.new(answer: 1, comments: 'Answer text', question_id: 1) } let(:response) { build(:response, id: 1, map_id: 1, response_map: review_response_map, scores: [answer]) } - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } before(:each) do questionnaires = [questionnaire1, questionnaire2] allow(feedback_response_map).to receive(:reviewee).and_return(participant) diff --git a/spec/models/instructor_spec.rb b/spec/models/instructor_spec.rb index 607b063936c..70fbfd6a3f8 100644 --- a/spec/models/instructor_spec.rb +++ b/spec/models/instructor_spec.rb @@ -5,8 +5,8 @@ let(:participant2) { build(:participant, id: 2) } let(:team) { build(:assignment_team, id: 1, name: 'no team') } let(:course) { build(:course) } - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } - let(:user2) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user2) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } let(:ta_mapping1) { TaMapping.new } let(:ta_mapping2) { TaMapping.new } before(:each) do diff --git a/spec/models/lock_spec.rb b/spec/models/lock_spec.rb index 9f929d9b323..88e7eba83b1 100644 --- a/spec/models/lock_spec.rb +++ b/spec/models/lock_spec.rb @@ -7,10 +7,10 @@ before(:each) do # I was unable to use regular create! calls for user. # I think this might be because the writers of user.rb overrode User.initialize - @smyoder = User.new(name: 'smyoder', fullname: 'John Bumgardner', email: 'smyoder@ncsu.edu') + @smyoder = User.new(name: 'smyoder', name: 'John Bumgardner', email: 'smyoder@ncsu.edu') @smyoder.save! - @smyoder1 = User.new(name: 'smyoder1', fullname: 'John Bumgardner', email: 'smyoder1@ncsu.edu') + @smyoder1 = User.new(name: 'smyoder1', name: 'John Bumgardner', email: 'smyoder1@ncsu.edu') @smyoder1.save! @response = Response.create!(round: 1) end diff --git a/spec/models/metareview_response_map_spec.rb b/spec/models/metareview_response_map_spec.rb index 571450b0e84..6a081083ff3 100644 --- a/spec/models/metareview_response_map_spec.rb +++ b/spec/models/metareview_response_map_spec.rb @@ -24,9 +24,9 @@ let(:response2) { build(:response, id: 3, map_id: 1, round: nil, response_map: review_response_map, is_submitted: true) } let(:response3) { build(:response) } let(:metareview_response_map) { build(:meta_review_response_map, review_mapping: review_response_map) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student1) { build(:student, id: 2, name: 'name1', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student2) { build(:student, id: 3, name: 'name2', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student1) { build(:student, id: 2, name: 'name1', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student2) { build(:student, id: 3, name: 'name2', name: 'no one', email: 'expertiza@mailinator.com') } let(:assignment_questionnaire1) { build(:assignment_questionnaire, id: 1, assignment_id: 1, questionnaire_id: 1) } let(:assignment_questionnaire2) { build(:assignment_questionnaire, id: 2, assignment_id: 1, questionnaire_id: 2) } let(:questionnaire1) { build(:questionnaire, type: 'ReviewQuestionnaire') } diff --git a/spec/models/participant_spec.rb b/spec/models/participant_spec.rb index 3a5bdc4291a..f1996db22be 100644 --- a/spec/models/participant_spec.rb +++ b/spec/models/participant_spec.rb @@ -1,11 +1,11 @@ describe Participant do let(:team) { build(:assignment_team, id: 1, name: 'myTeam') } - let(:user) { build(:student, id: 4, name: 'no name', fullname: 'no two') } + let(:user) { build(:student, id: 4, name: 'no name', name: 'no two') } let(:team_user) { build(:team_user, id: 1, user: user, team: team) } let(:topic) { build(:topic) } - let(:participant) { build(:participant, user: build(:student, name: 'Jane', fullname: 'Doe, Jane', id: 1)) } - let(:participant2) { build(:participant, user: build(:student, name: 'John', fullname: 'Doe, John', id: 2)) } - let(:participant3) { build(:participant, can_review: false, user: build(:student, name: 'King', fullname: 'Titan, King', id: 3)) } + let(:participant) { build(:participant, user: build(:student, name: 'Jane', name: 'Doe, Jane', id: 1)) } + let(:participant2) { build(:participant, user: build(:student, name: 'John', name: 'Doe, John', id: 2)) } + let(:participant3) { build(:participant, can_review: false, user: build(:student, name: 'King', name: 'Titan, King', id: 3)) } let(:participant4) { Participant.new } let(:assignment) { build(:assignment, id: 1, name: 'no assgt') } let(:participant5) { build(:participant, user: user, assignment: assignment) } diff --git a/spec/models/response_map_spec.rb b/spec/models/response_map_spec.rb index bcfc7648226..ba994d0e274 100644 --- a/spec/models/response_map_spec.rb +++ b/spec/models/response_map_spec.rb @@ -5,9 +5,9 @@ let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) } let(:participant1) { build(:participant, id: 2, parent_id: 2, user: student1) } let(:participant2) { build(:participant, id: 3, parent_id: 3, user: student2) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student1) { build(:student, id: 2, name: 'name1', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student2) { build(:student, id: 3, name: 'name2', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student1) { build(:student, id: 2, name: 'name1', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student2) { build(:student, id: 3, name: 'name2', name: 'no one', email: 'expertiza@mailinator.com') } let(:assignment) { build(:assignment, id: 1, name: 'Test Assgt', rounds_of_reviews: 2) } let(:assignment1) { build(:assignment, id: 2, name: 'Test Assgt2', rounds_of_reviews: 2) } diff --git a/spec/models/response_spec.rb b/spec/models/response_spec.rb index a6fb704ca8a..dc5b6087c24 100644 --- a/spec/models/response_spec.rb +++ b/spec/models/response_spec.rb @@ -1,6 +1,6 @@ describe Response do - let(:user) { build(:student, id: 1, role_id: 1, name: 'no name', fullname: 'no one') } - let(:user2) { build(:student, id: 2, role_id: 2, name: 'no name2', fullname: 'no one2') } + let(:user) { build(:student, id: 1, role_id: 1, name: 'no name', name: 'no one') } + let(:user2) { build(:student, id: 2, role_id: 2, name: 'no name2', name: 'no one2') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: user) } let(:participant2) { build(:participant, id: 2, parent_id: 2, user: user2) } let(:assignment) { build(:assignment, id: 1, name: 'Test Assgt') } diff --git a/spec/models/review_bid_spec.rb b/spec/models/review_bid_spec.rb index 7f0a7e7b28f..b136381f763 100644 --- a/spec/models/review_bid_spec.rb +++ b/spec/models/review_bid_spec.rb @@ -1,7 +1,7 @@ describe ReviewBid do let(:bid1) { build(:review_bid, priority: 3, participant_id: 7601, signuptopic_id: 123, assignment_id: 2085, updated_at: '2018-01-01 00:00:00') } let(:bid2) { build(:review_bid, priority: 2, participant_id: '7602', signuptopic_id: 124, assignment_id: 2086) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: student, assignment: assignment1) } let(:topic) { build(:topic, id: 1, topic_name: 'New Topic') } let(:assignment1) { build(:assignment, id: 2, name: 'Test Assgt', rounds_of_reviews: 1) } diff --git a/spec/models/review_response_map_spec.rb b/spec/models/review_response_map_spec.rb index efc6fc6b956..5aca443358e 100755 --- a/spec/models/review_response_map_spec.rb +++ b/spec/models/review_response_map_spec.rb @@ -24,8 +24,8 @@ let(:response2) { build(:response, id: 3, map_id: 1, round: nil, response_map: review_response_map, is_submitted: true) } let(:response3) { build(:response) } let(:metareview_response_map) { build(:meta_review_response_map, reviewed_object_id: 1) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student1) { build(:student, id: 2, name: 'name1', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student1) { build(:student, id: 2, name: 'name1', name: 'no one', email: 'expertiza@mailinator.com') } let(:assignment_questionnaire1) { build(:assignment_questionnaire, id: 1, assignment_id: 1, questionnaire_id: 1) } let(:assignment_questionnaire2) { build(:assignment_questionnaire, id: 2, assignment_id: 1, questionnaire_id: 2) } let(:questionnaire1) { build(:questionnaire, type: 'ReviewQuestionnaire') } diff --git a/spec/models/sign_up_topic_spec.rb b/spec/models/sign_up_topic_spec.rb index 367f206fab5..b309b66faba 100755 --- a/spec/models/sign_up_topic_spec.rb +++ b/spec/models/sign_up_topic_spec.rb @@ -216,7 +216,7 @@ let(:instructor) do User.create!( name: 'Instructor', - fullname: 'Full', # Ensure this matches the expected format if there are specific validations. + name: 'Full', # Ensure this matches the expected format if there are specific validations. email: 'instructor@example.com', # Provide a valid email format. password: 'securepassword', # Assume a password is required for user creation. password_confirmation: 'securepassword' # Match the password confirmation if necessary. diff --git a/spec/models/signed_up_team_spec.rb b/spec/models/signed_up_team_spec.rb index e0742f24c08..b0b252890e0 100644 --- a/spec/models/signed_up_team_spec.rb +++ b/spec/models/signed_up_team_spec.rb @@ -7,7 +7,7 @@ let(:user2) { create(:student, name: 'qwertyui', id: 5) } describe '.drop_signup_record' do - let(:instructor) { User.create!(name: 'Instructor', fullname: 'FullInstructor', email: 'instructor@example.com', password: 'securepassword', password_confirmation: 'securepassword') } + let(:instructor) { User.create!(name: 'Instructor', name: 'FullInstructor', email: 'instructor@example.com', password: 'securepassword', password_confirmation: 'securepassword') } let(:assignment) { Assignment.create!(name: 'Test Assignment', instructor_id: instructor.id, directory_path: 'test/path') } let(:topic) { SignUpTopic.create!(topic_name: 'Sample Topic', assignment: assignment) } let(:team) { Team.create!(name: 'Sample Team') } diff --git a/spec/models/student_task_spec.rb b/spec/models/student_task_spec.rb index 2988b1f8419..a0961ed72f6 100644 --- a/spec/models/student_task_spec.rb +++ b/spec/models/student_task_spec.rb @@ -226,7 +226,7 @@ allow(AssignmentParticipant).to receive(:find_by).with(user_id: 1, parent_id: assignment.id).and_return(participant) allow(AssignmentParticipant).to receive(:find_by).with(user_id: 5, parent_id: assignment.id).and_return(participant2) allow(Assignment).to receive(:find_by).with(id: team.parent_id).and_return(assignment) - expect(StudentTask.teamed_students(user)).to eq(assignment.course_id => [user2.fullname]) + expect(StudentTask.teamed_students(user)).to eq(assignment.course_id => [user2.name]) end end end diff --git a/spec/models/super_administrator_spec.rb b/spec/models/super_administrator_spec.rb index 638357eac1c..3d730b744f2 100644 --- a/spec/models/super_administrator_spec.rb +++ b/spec/models/super_administrator_spec.rb @@ -1,6 +1,6 @@ describe SuperAdministrator do - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } - let(:user2) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user2) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } let(:superadmin) { build(:superadmin) } describe '#get_user_list' do it 'should return a list of all users in the system' do diff --git a/spec/models/ta_spec.rb b/spec/models/ta_spec.rb index 87551feaa19..032d3396364 100644 --- a/spec/models/ta_spec.rb +++ b/spec/models/ta_spec.rb @@ -6,7 +6,7 @@ let(:assignment) { build(:assignment, id: 1, name: 'no assignment', participants: [participant], teams: [team]) } let(:participant) { build(:participant, id: 1) } let(:team) { build(:assignment_team, id: 1, name: 'no team') } - let(:user) { build(:student, id: 4, name: 'no name', fullname: 'no two') } + let(:user) { build(:student, id: 4, name: 'no name', name: 'no two') } describe '#teaching_assistant?' do it 'returns true for a teaching assistant' do diff --git a/spec/models/team_spec.rb b/spec/models/team_spec.rb index 146d3e6bfea..7e27d82022c 100644 --- a/spec/models/team_spec.rb +++ b/spec/models/team_spec.rb @@ -3,7 +3,7 @@ let(:participant) { build(:participant, user_id: 1) } let(:participant2) { build(:participant, user_id: 2) } let(:participant3) { build(:participant, user_id: 3) } - let(:user) { build(:student, id: 1, name: 'no name', fullname: 'no one', participants: [participant]) } + let(:user) { build(:student, id: 1, name: 'no name', name: 'no one', participants: [participant]) } let(:user2) { build(:student, id: 2) } let(:user3) { build(:student, id: 3) } let(:team) { build(:assignment_team, id: 1, name: 'no team', users: [user]) } diff --git a/spec/models/teammate_review_response_map_spec.rb b/spec/models/teammate_review_response_map_spec.rb index dbebd4e330a..d47c94d1acd 100644 --- a/spec/models/teammate_review_response_map_spec.rb +++ b/spec/models/teammate_review_response_map_spec.rb @@ -13,8 +13,8 @@ let(:assignment) { build(:assignment, id: 1, name: 'Test Assgt', rounds_of_reviews: 2) } let(:assignment1) { build(:assignment, id: 2, name: 'Test Assgt', rounds_of_reviews: 1) } let(:response) { build(:response, id: 1, map_id: 1, round: 1, response_map: teammate_review_response_map1, is_submitted: true) } - let(:student) { build(:student, id: 1, name: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } - let(:student1) { build(:student, id: 2, name: 'name1', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, name: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student1) { build(:student, id: 2, name: 'name1', name: 'no one', email: 'expertiza@mailinator.com') } # let(:assignment_teammate_questionnaire1) { build(:assignment_teammate_questionnaire, id: 1, assignment: assignment1, questionnaire: teammate_questionnaire1) } # let(:assignment_teammate_questionnaire2) { build(:assignment_teammate_questionnaire, id: 2, assignment_id: 2, questionnaire_id: 2) } # let(:teammate_questionnaire1) { build(:teammate_questionnaire, id: 1, type: 'TeammateReviewQuestionnaire') } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8275c02e145..db8ba0b797a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,10 +1,10 @@ describe User do let(:user) do - User.new name: 'abc', fullname: 'abc xyz', email: 'abcxyz@gmail.com', password: '12345678', password_confirmation: '12345678', + User.new name: 'abc', name: 'abc xyz', email: 'abcxyz@gmail.com', password: '12345678', password_confirmation: '12345678', email_on_submission: 1, email_on_review: 1, email_on_review_of_review: 0, copy_of_emails: 1, handle: 'handle' end - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } - let(:user2) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user2) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbe@gmail.com', password: '123456789', password_confirmation: '123456789' } describe '#name' do it 'returns the name of the user' do @@ -25,18 +25,18 @@ end end - describe '#fullname' do + describe '#name' do it 'returns the full name of the user' do - expect(user.fullname).to eq('abc xyz') + expect(user.name).to eq('abc xyz') end - it 'Validate presence of fullname which cannot be blank' do - user.fullname = ' ' + it 'Validate presence of name which cannot be blank' do + user.name = ' ' expect(user).not_to be_valid end it 'Validate the email format correctness' do - user.fullname = 'John Bumgardner' + user.name = 'John Bumgardner' expect(user).to be_valid end end @@ -207,18 +207,18 @@ describe '.import' do it 'raises error if import column does not equal to 3' do - row = { 'name' => 'abc', 'fullname' => 'abc xyz' } + row = { 'name' => 'abc', 'name' => 'abc xyz' } expect { User.import(row, nil, nil, nil) }.to raise_error(ArgumentError) end it 'updates an existing user with info from impor file' do create(:student, name: 'abc') - row = { username: 'abc', fullname: 'test, test', email: 'test@gmail.com' } + row = { username: 'abc', name: 'test, test', email: 'test@gmail.com' } allow(user).to receive(:id).and_return(6) User.import(row, nil, { user: user }, nil) updated_user = User.find_by(name: 'abc') expect(updated_user.email).to eq 'test@gmail.com' - expect(updated_user.fullname).to eq 'test, test' + expect(updated_user.name).to eq 'test, test' expect(updated_user.parent_id).to eq 6 end end @@ -455,7 +455,7 @@ before(:each) do allow(User).to receive_message_chain(:order, :where).with('(role_id in (?) or id = ?) and name like ?', role.get_available_roles, @user_id, '%name%') - allow(User).to receive_message_chain(:order, :where).with('(role_id in (?) or id = ?) and fullname like ?', role.get_available_roles, @user_id, '%fullname%') + allow(User).to receive_message_chain(:order, :where).with('(role_id in (?) or id = ?) and name like ?', role.get_available_roles, @user_id, '%name%') allow(User).to receive_message_chain(:order, :where).with('(role_id in (?) or id = ?) and email like ?', role.get_available_roles, @user_id, '%email%') user_id = double end @@ -469,7 +469,7 @@ it 'when the search_by is 2' do search_by = '2' allow(User).to receive_message_chain(:order, :where).and_return(user) - expect(User.search_users(role, @user_id, 'fullname', search_by)).to eq user + expect(User.search_users(role, @user_id, 'name', search_by)).to eq user end it 'when the search_by is 3' do diff --git a/spec/models/vm_user_answer_tagging_spec.rb b/spec/models/vm_user_answer_tagging_spec.rb index 1daa2d0bb14..38443b6507a 100644 --- a/spec/models/vm_user_answer_tagging_spec.rb +++ b/spec/models/vm_user_answer_tagging_spec.rb @@ -1,5 +1,5 @@ describe VmUserAnswerTagging do - let(:user1) { User.new name: 'abc', fullname: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } + let(:user1) { User.new name: 'abc', name: 'abc bbc', email: 'abcbbc@gmail.com', password: '123456789', password_confirmation: '123456789' } describe '#initialize' do it 'sets the instance variables' do vm_user_answer_tagging = VmUserAnswerTagging.new(user1, 75, true, true, true, '3000-01-31') From 8f63b5c5467459db873fa4c425c635e0607b3fef Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sat, 26 Oct 2024 18:07:46 -0400 Subject: [PATCH 02/18] Some more fullname to name --- app/views/import_file/_participant.html.erb | 8 ++++---- app/views/import_file/start.html.erb | 2 +- app/views/participants/view_copyright_grants.html.erb | 2 +- config/locales/en_US.yml | 2 +- config/locales/hi_IN.yml | 2 +- spec/factories/factories.rb | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/import_file/_participant.html.erb b/app/views/import_file/_participant.html.erb index 9e023cf311a..3fd74bfbb34 100644 --- a/app/views/import_file/_participant.html.erb +++ b/app/views/import_file/_participant.html.erb @@ -25,7 +25,7 @@ @@ -50,7 +50,7 @@ diff --git a/app/views/import_file/start.html.erb b/app/views/import_file/start.html.erb index c936f0fe5b5..448303b444f 100644 --- a/app/views/import_file/start.html.erb +++ b/app/views/import_file/start.html.erb @@ -26,7 +26,7 @@ diff --git a/app/views/participants/view_copyright_grants.html.erb b/app/views/participants/view_copyright_grants.html.erb index 39348f6eaab..890035f4c85 100644 --- a/app/views/participants/view_copyright_grants.html.erb +++ b/app/views/participants/view_copyright_grants.html.erb @@ -15,7 +15,7 @@ - + diff --git a/config/locales/en_US.yml b/config/locales/en_US.yml index e4b85f2f023..d6e8034ce4e 100644 --- a/config/locales/en_US.yml +++ b/config/locales/en_US.yml @@ -265,7 +265,7 @@ en_US: team_name_up: "Team Name:" team_members: "Team members" username: "Username" - fullname: "Full name" + name: "Full name" email_address: "Email address" review_action: "Review action" send_invite: "Send invitations" diff --git a/config/locales/hi_IN.yml b/config/locales/hi_IN.yml index f593fc65987..18af3d04baa 100644 --- a/config/locales/hi_IN.yml +++ b/config/locales/hi_IN.yml @@ -255,7 +255,7 @@ hi_IN: team_name_up: "टीम का नाम:" team_members: "टीम के सदस्या" username: "यूजरनाम " - fullname: "पूरा नाम" + name: "पूरा नाम" email_address: "ईमेल एड्रेस" review_action: "रिव्यु एक्शन" send_invite: "निमंत्रण भेजें" diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index d54b3a5d28d..8d389498465 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -53,7 +53,7 @@ role { Role.where(name: 'Administrator').first || association(:role_of_administrator) } password 'password' password_confirmation 'password' - sequence(:fullname) { |n| "#{n}, administrator" } + sequence(:name) { |n| "#{n}, administrator" } email 'expertiza@mailinator.com' parent_id 1 private_by_default false From 960ee4be00cb6bab78b1a63496501731160354fa Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 17:56:05 -0400 Subject: [PATCH 03/18] some more fullname to name --- app/controllers/account_request_controller.rb | 2 +- app/controllers/popup_controller.rb | 2 +- app/models/account_request.rb | 2 +- app/models/assignment_team.rb | 2 +- app/models/controller_action.rb | 2 +- app/views/popup/self_review_popup.html.erb | 2 +- app/views/reports/_self_review_report.html.erb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/account_request_controller.rb b/app/controllers/account_request_controller.rb index 660cb5f4ba8..315d3fe9e11 100644 --- a/app/controllers/account_request_controller.rb +++ b/app/controllers/account_request_controller.rb @@ -163,7 +163,7 @@ def roles_for_request_sign_up end def requested_user_params - params.require(:user).permit(:username, :role_id, :fullname, :institution_id, :email) + params.require(:user).permit(:username, :role_id, :name, :institution_id, :email) .merge(self_introduction: params[:requested_user][:self_introduction]) end end diff --git a/app/controllers/popup_controller.rb b/app/controllers/popup_controller.rb index 816554ef4c8..f98fda0eef6 100644 --- a/app/controllers/popup_controller.rb +++ b/app/controllers/popup_controller.rb @@ -99,7 +99,7 @@ def reviewer_details_popup # this can be called from "response_report" by clicking reviewer names from instructor end. def self_review_popup @response_id = params[:response_id] - @user_fullname = params[:user_fullname] + @user_name = params[:user_name] unless @response_id.nil? first_question_in_questionnaire = Answer.where(response_id: @response_id).first.question_id questionnaire_id = Question.find(first_question_in_questionnaire).questionnaire_id diff --git a/app/models/account_request.rb b/app/models/account_request.rb index bd9ac143843..7475f4493f7 100644 --- a/app/models/account_request.rb +++ b/app/models/account_request.rb @@ -7,5 +7,5 @@ class AccountRequest < ApplicationRecord format: { with: VALID_EMAIL_REGEX, message: 'format is wrong' }, uniqueness: { case_sensitive: false, message: 'has already existed in Expertiza' } - validates :fullname, presence: true, length: { maximum: 100, message: 'is too long' } + validates :name, presence: true, length: { maximum: 100, message: 'is too long' } end diff --git a/app/models/assignment_team.rb b/app/models/assignment_team.rb index 4d9880af3a3..dbe08995ab7 100755 --- a/app/models/assignment_team.rb +++ b/app/models/assignment_team.rb @@ -43,7 +43,7 @@ def self.parent_model(id) end # Get the name of the class - def fullname + def name name end diff --git a/app/models/controller_action.rb b/app/models/controller_action.rb index c1ee997e1bd..3f325c91f3d 100644 --- a/app/models/controller_action.rb +++ b/app/models/controller_action.rb @@ -31,7 +31,7 @@ def effective_permission_id permission_id || controller.permission_id end - def fullname + def name if site_controller_id && (site_controller_id > 0) "#{controller.name}: #{name}" else diff --git a/app/views/popup/self_review_popup.html.erb b/app/views/popup/self_review_popup.html.erb index 8d56181bbfe..35a1aa466f4 100644 --- a/app/views/popup/self_review_popup.html.erb +++ b/app/views/popup/self_review_popup.html.erb @@ -12,7 +12,7 @@
<% else %> -

<%=t ".self_review_of"%> <%= @user_fullname %>

+

<%=t ".self_review_of"%> <%= @user_name %>

Full Name:<%= @user.fullname(session[:ip]) %><%= @user.name(session[:ip]) %>
Email Address: @@ -33,7 +33,7 @@ @@ -42,7 +42,7 @@
- <%= radio_button_tag 'has_header', 'true' %> File has a header, including name, fullname, and email address.
+ <%= radio_button_tag 'has_header', 'true' %> File has a header, including name, name, and email address.
<%= radio_button_tag 'has_header', 'false', true %> File does not have a header
NameFullnameName Publish Rights Verified
diff --git a/app/views/reports/_self_review_report.html.erb b/app/views/reports/_self_review_report.html.erb index 64e39147766..67f22a91b47 100644 --- a/app/views/reports/_self_review_report.html.erb +++ b/app/views/reports/_self_review_report.html.erb @@ -12,7 +12,7 @@
<%=t ".question"%> align='left'> <% if sr.response.first %> - <%= link_to @user_name, controller: 'popup', action: 'self_review_popup', response_id: sr.response.first.id, user_fullname: Participant.find(sr.reviewer_id).user.name(session[:ip]) %> + <%= link_to @user_name, controller: 'popup', action: 'self_review_popup', response_id: sr.response.first.id, user_name: Participant.find(sr.reviewer_id).user.name(session[:ip]) %> <% else %> <%= @user_name %> <% end %> From af43867e6751201ba387420ed172e69c7e62e988 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 17:58:09 -0400 Subject: [PATCH 04/18] update migration for fullname to name --- db/migrate/20241009142307_rename_name_and_fullname_in_users.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb index d72fe3c0bc5..49ce7307494 100644 --- a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb +++ b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb @@ -2,5 +2,6 @@ class RenameNameAndFullnameInUsers < ActiveRecord::Migration[5.1] def change rename_column :users, :name, :username rename_column :account_requests, :name, :username + rename_column :users, :fullname, :name end end \ No newline at end of file From 62997319eefb97427aa21a2f030043e597a2cecd Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:16:00 -0400 Subject: [PATCH 05/18] edit migration --- db/migrate/20241009142307_rename_name_and_fullname_in_users.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb index 49ce7307494..2be1fe111f1 100644 --- a/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb +++ b/db/migrate/20241009142307_rename_name_and_fullname_in_users.rb @@ -3,5 +3,6 @@ def change rename_column :users, :name, :username rename_column :account_requests, :name, :username rename_column :users, :fullname, :name + rename_column :account_requests, :fullname, :username end end \ No newline at end of file From 7a03475d139fdfc10b24f3e5f4963afb00d9c2f9 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:23:44 -0400 Subject: [PATCH 06/18] attempt lib test failure fix --- spec/lib/scoring_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/scoring_spec.rb b/spec/lib/scoring_spec.rb index 879acf8f733..a1152c31dfb 100644 --- a/spec/lib/scoring_spec.rb +++ b/spec/lib/scoring_spec.rb @@ -12,7 +12,7 @@ let(:signed_up_team) { build(:signed_up_team, team_id: contributor.id) } # ReviewResponseMap Spec Additions - let(:student) { build(:student, id: 1, username: 'name', name: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, username: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) } let(:response3) { build(:response) } let(:question) { double('Question') } From a7fa17afeec68506ab94c0ce70017c6c7c8fad34 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:36:32 -0400 Subject: [PATCH 07/18] change factory --- spec/factories/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index 5614d301022..0a3fb859b95 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -147,7 +147,7 @@ role { Role.where(name: 'Instructor').first || association(:role_of_instructor) } password 'password' password_confirmation 'password' - name '6, instructor' + fullname '6, instructor' email 'expertiza@mailinator.com' parent_id 1 private_by_default false From 6d625f432e4f95a0a2e4487b9a6d8dc603cdcd29 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:38:13 -0400 Subject: [PATCH 08/18] revert scoring --- spec/lib/scoring_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/scoring_spec.rb b/spec/lib/scoring_spec.rb index a1152c31dfb..879acf8f733 100644 --- a/spec/lib/scoring_spec.rb +++ b/spec/lib/scoring_spec.rb @@ -12,7 +12,7 @@ let(:signed_up_team) { build(:signed_up_team, team_id: contributor.id) } # ReviewResponseMap Spec Additions - let(:student) { build(:student, id: 1, username: 'name', fullname: 'no one', email: 'expertiza@mailinator.com') } + let(:student) { build(:student, id: 1, username: 'name', name: 'no one', email: 'expertiza@mailinator.com') } let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) } let(:response3) { build(:response) } let(:question) { double('Question') } From 850373da8e8637f76aa643c9060ee7feeb86feda Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:48:33 -0400 Subject: [PATCH 09/18] factories update --- spec/factories/factories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index 0a3fb859b95..5614d301022 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -147,7 +147,7 @@ role { Role.where(name: 'Instructor').first || association(:role_of_instructor) } password 'password' password_confirmation 'password' - fullname '6, instructor' + name '6, instructor' email 'expertiza@mailinator.com' parent_id 1 private_by_default false From 3c5d9a400f76c97c8a36509ab1848c2a13577bd6 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:54:33 -0400 Subject: [PATCH 10/18] run migrate --- db/schema.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 7f2c00ba68a..2b6ad48596b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -15,7 +15,7 @@ create_table "account_requests", id: :integer, force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1" do |t| t.string "username" t.integer "role_id" - t.string "fullname" + t.string "name" t.string "institution_id" t.string "email" t.string "status" @@ -977,7 +977,7 @@ t.string "crypted_password", limit: 40, default: "", null: false t.integer "role_id", default: 0, null: false t.string "password_salt" - t.string "fullname" + t.string "name" t.string "email" t.integer "parent_id" t.boolean "private_by_default", default: false From 66c81b65736de03ef9b11df74c3765778abb6115 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 18:58:37 -0400 Subject: [PATCH 11/18] change factory --- spec/factories/factories.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/factories/factories.rb b/spec/factories/factories.rb index 5614d301022..27b7792796b 100644 --- a/spec/factories/factories.rb +++ b/spec/factories/factories.rb @@ -75,7 +75,7 @@ role { Role.where(name: 'Super-Administrator').first || association(:role_of_superadministrator) } password 'password' password_confirmation 'password' - sequence(:fullname) { |n| "#{n}, superadministrator" } + sequence(:name) { |n| "#{n}, superadministrator" } email 'expertiza@mailinator.com' parent_id 1 private_by_default false @@ -125,7 +125,7 @@ role { Role.where(name: 'Student').first || association(:role_of_student) } password 'password' password_confirmation 'password' - sequence(:fullname) { |n| n = n % 3; "206#{n + 4}, student" } + sequence(:name) { |n| n = n % 3; "206#{n + 4}, student" } email 'expertiza@mailinator.com' parent_id 1 private_by_default false From ff6dca75f4b10291d4d2b910971185eddda195dd Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 19:09:00 -0400 Subject: [PATCH 12/18] helper fixes --- app/models/assignment_team.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/assignment_team.rb b/app/models/assignment_team.rb index dbe08995ab7..4d9880af3a3 100755 --- a/app/models/assignment_team.rb +++ b/app/models/assignment_team.rb @@ -43,7 +43,7 @@ def self.parent_model(id) end # Get the name of the class - def name + def fullname name end From 60d2730cfb864cfdf523d39176e48614bb4fe4fb Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 19:17:42 -0400 Subject: [PATCH 13/18] helper fixes --- spec/helpers/participants_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/participants_helper_spec.rb b/spec/helpers/participants_helper_spec.rb index 991fe7cfe54..d330b4937ec 100644 --- a/spec/helpers/participants_helper_spec.rb +++ b/spec/helpers/participants_helper_spec.rb @@ -10,7 +10,7 @@ attribute = ParticipantsHelper.define_attributes(line_split,config) expect(attribute['role_id']).to eq(1) expect(attribute['username']).to eq('Test1') - expect(attribute['fullname']).to eq('test2') + expect(attribute['name']).to eq('test2') expect(attribute['email']).to eq('test@ncsu.edu') expect(attribute['password'].length).to eq(8) expect(attribute['email_on_submission']).to eq(1) From 4bd303f18701c1d054f56dd4978c626db6ea5497 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 19:32:29 -0400 Subject: [PATCH 14/18] helper change --- spec/helpers/participants_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/participants_helper_spec.rb b/spec/helpers/participants_helper_spec.rb index d330b4937ec..56685778fa7 100644 --- a/spec/helpers/participants_helper_spec.rb +++ b/spec/helpers/participants_helper_spec.rb @@ -3,7 +3,7 @@ context 'when define_attributes is called' do #Checking if attributes have been correctly defined line_split = ['Test1','test@ncsu.edu'] - config = {'name'=>'0','fullname'=>'test2','email'=>'1'} + config = {'fullname'=>'test2','email'=>'1'} it 'returns correct hash "attributes" when define_attributes is called' do allow(Role).to receive(:find_by).with({:name=>'Student'}).and_return(1) From 1e766c04853a7fee478f70704cff83de600337ae Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 19:33:48 -0400 Subject: [PATCH 15/18] helper change --- spec/helpers/participants_helper_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/helpers/participants_helper_spec.rb b/spec/helpers/participants_helper_spec.rb index 56685778fa7..a27d02ae891 100644 --- a/spec/helpers/participants_helper_spec.rb +++ b/spec/helpers/participants_helper_spec.rb @@ -3,7 +3,7 @@ context 'when define_attributes is called' do #Checking if attributes have been correctly defined line_split = ['Test1','test@ncsu.edu'] - config = {'fullname'=>'test2','email'=>'1'} + config = {'name'=>'test2','email'=>'1'} it 'returns correct hash "attributes" when define_attributes is called' do allow(Role).to receive(:find_by).with({:name=>'Student'}).and_return(1) From fe917a7df74e3751b63d02631de5f517623d10dd Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 19:48:08 -0400 Subject: [PATCH 16/18] fix controller test --- spec/controllers/account_request_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/account_request_controller_spec.rb b/spec/controllers/account_request_controller_spec.rb index 19e3d77c40e..83a58e8010e 100644 --- a/spec/controllers/account_request_controller_spec.rb +++ b/spec/controllers/account_request_controller_spec.rb @@ -11,7 +11,7 @@ let(:institution1) { build(:institution, id: 1) } let(:requested_user1) do - AccountRequest.new id: 4, username: 'requester1', role_id: 2, fullname: 're, requester1', + AccountRequest.new id: 4, username: 'requester1', role_id: 2, name: 're, requester1', institution_id: 1, email: 'requester1@test.com', status: nil, self_introduction: 'no one' end let(:superadmin) { build(:superadmin) } From 0441b5a5259599353721f664a4dbdb35e7044553 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 20:08:15 -0400 Subject: [PATCH 17/18] fix more tests --- app/models/controller_action.rb | 2 +- spec/models/course_participant_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/controller_action.rb b/app/models/controller_action.rb index 3f325c91f3d..c1ee997e1bd 100644 --- a/app/models/controller_action.rb +++ b/app/models/controller_action.rb @@ -31,7 +31,7 @@ def effective_permission_id permission_id || controller.permission_id end - def name + def fullname if site_controller_id && (site_controller_id > 0) "#{controller.name}: #{name}" else diff --git a/spec/models/course_participant_spec.rb b/spec/models/course_participant_spec.rb index 99029023a47..78762987ad1 100644 --- a/spec/models/course_participant_spec.rb +++ b/spec/models/course_participant_spec.rb @@ -28,7 +28,7 @@ end it 'raise error if record does not have enough items ' do - row = { username: 'user_name', fullname: 'user_fullname', email: 'name@email.com' } + row = { username: 'user_name', name: 'user_name', email: 'name@email.com' } expect { CourseParticipant.import(row, nil, nil, nil) }.to raise_error("The record containing #{row[:username]} does not have enough items.") end @@ -38,7 +38,7 @@ row = [] allow(Course).to receive(:find).and_return(nil) allow(session[:user]).to receive(:id).and_return(1) - row = { username: 'user_name', fullname: 'user_fullname', email: 'name@gmail.com', password: 'user_password' } + row = { username: 'user_name', name: 'user_name', email: 'name@gmail.com', password: 'user_password' } expect { CourseParticipant.import(row, nil, session, 2) }.to raise_error('The course with the id "2" was not found.') end @@ -48,7 +48,7 @@ row = [] allow(Course).to receive(:find).and_return(course) allow(session[:user]).to receive(:id).and_return(1) - row = { username: 'user_name', fullname: 'user_fullname', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } + row = { username: 'user_name', name: 'user_name', email: 'name@email.com', role: 'user_role_name', parent: 'user_parent_name' } course_part = CourseParticipant.import(row, nil, session, 2) expect(course_part).to be_an_instance_of(CourseParticipant) end From dbcb029749e27e59527a68f077e5029abf0eec79 Mon Sep 17 00:00:00 2001 From: Manav Patel Date: Sun, 27 Oct 2024 20:18:38 -0400 Subject: [PATCH 18/18] fix response.rb spec --- app/models/response.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/response.rb b/app/models/response.rb index cd61ab5ef7c..1f8a68eb8dc 100644 --- a/app/models/response.rb +++ b/app/models/response.rb @@ -253,7 +253,7 @@ def self.score(params) def construct_instructor_html(identifier, self_id, count) identifier += '

Review ' + count.to_s + '

' - identifier += 'Reviewer: ' + map.reviewer.name + ' (' + map.reviewer.name + ')' + identifier += 'Reviewer: ' + map.reviewer.fullname + ' (' + map.reviewer.name + ')' identifier + '   hide review
' end