canvas-lms/app/models
Josh Simpson ad7d4b04fb fix answer comment saving/display problem
fixes CNVS-10148
this commit addresses a bug where answer comments were not being saved
on numerous question types. a RawFields#fetch_any method was added, to
deal with both old question data and new question data.

Test plan:
1. Create a quiz with each question type: Matching, Fill in the Blank,
Fill in Multiple Blanks, Multiple Choice, Multiple Dropdowns, and True/False,
and add relevant answer comments to each.
2. Note that all answer comments are saved.
3. Take the quiz, and ensure all questions are working properly
4. Review the quiz results, and note the answer comments you previously
created are displaying.

Change-Id: I99324efdfeb79aa1e386f215897e4aad1036cfc5
Reviewed-on: https://gerrit.instructure.com/27887
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-12-26 21:11:11 +00:00
..
broadcast_policies assignment created notifications only on publish 2013-12-11 17:30:42 +00:00
discussion_topic don't include ActionController::UrlWriter w/rails3 2013-10-29 15:50:39 +00:00
quiz_question fix answer comment saving/display problem 2013-12-26 21:11:11 +00:00
quiz_statistics correctly calculate number of questions affected by multiple regrades 2013-11-04 15:00:51 +00:00
abstract_course.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
access_token.rb add push communication channel type 2013-11-21 21:38:45 +00:00
account.rb add ability to restrict students from viewing quiz questions after course conclusion 2013-12-20 22:05:21 +00:00
account_authorization_config.rb use the now-standard timeout_protection for ldap binding 2013-10-03 22:18:16 +00:00
account_notification.rb deprecate Setting.get_cached 2013-10-10 00:42:52 +00:00
account_report.rb show when an account report fails in the ui and api 2013-12-02 22:57:25 +00:00
account_user.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
alert.rb use CANVAS_RAILS2 for conditionals 2013-10-10 15:58:43 +00:00
alert_criterion.rb alerts, closes #4317 2011-08-24 10:19:44 -06:00
announcement.rb improve acts_as_list 2013-12-17 19:55:43 +00:00
appointment_group.rb ignore deleted contexts in appt. group permissions 2013-12-20 21:30:47 +00:00
appointment_group_context.rb multiple contexts per appointment group 2012-04-30 15:30:03 -06:00
appointment_group_sub_context.rb multiple contexts per appointment group 2012-04-30 15:30:03 -06:00
assessment_question.rb improve acts_as_list 2013-12-17 19:55:43 +00:00
assessment_question_bank.rb make randomization of quiz questions work better within quiz groups 2013-11-06 19:44:08 +00:00
assessment_question_bank_user.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
assessment_request.rb Solving Email URL and Recipient 2013-12-09 15:57:31 +01:00
asset_user_access.rb remove unused local variables 2013-12-17 17:07:06 +00:00
assignment.rb remove code for max_score/min_score/mastery_score 2013-12-23 20:31:57 +00:00
assignment_group.rb added frontend and backend validation on assignment groups 2013-12-20 23:07:03 +00:00
assignment_override.rb destroy section overrides when crosslisting sections 2013-12-04 19:43:54 +00:00
assignment_override_student.rb arel-ify models 2013-04-01 18:42:38 +00:00
attachment.rb remove uses of memoize 2013-12-06 22:03:24 +00:00
attachment_association.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
authorization_code.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
big_blue_button_conference.rb BBB: request recordings only if conference was recorded 2013-12-18 22:45:56 +00:00
bookmark_service.rb i18n Bookmark Service 2011-06-16 07:16:10 -06:00
calendar_event.rb fix all day calendar event importing 2013-11-08 18:10:00 +00:00
cloned_item.rb make sure links in assessment questions are correctly translated, fixes #6012 2011-10-21 08:36:34 -06:00
collaboration.rb improve collaboration/group query 2013-10-18 00:05:10 +00:00
collaborator.rb add groups to collaborators table, add api endpoint. 2013-01-04 20:18:04 -07:00
collection.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
collection_item.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
collection_item_data.rb get rspec 2 running with rails 3.0 2013-03-27 15:41:28 +00:00
collection_item_upvote.rb arel-ify models 2013-04-01 18:42:38 +00:00
communication_channel.rb remove tinychat code 2013-12-18 22:51:45 +00:00
content_export.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
content_migration.rb rubyzip 1.0.0 upgrade 2013-11-22 19:23:34 +00:00
content_participation.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
content_participation_count.rb deprecate Setting.get_cached 2013-10-10 00:42:52 +00:00
content_tag.rb fix assignment.title validation 2013-12-04 00:13:26 +00:00
context.rb move draft state under feature flag umbrella 2013-11-26 20:43:49 +00:00
context_external_tool.rb keep external tool id references for copied module items 2013-12-23 19:13:45 +00:00
context_module.rb keep external tool id references for copied module items 2013-12-23 19:13:45 +00:00
context_module_item.rb change available_for? and locked_for? to be more consistent 2013-06-07 21:41:21 +00:00
context_module_progression.rb add framework for events to be triggered when a module is completed 2013-10-15 21:59:07 +00:00
context_module_sub_header.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
conversation.rb limit fake_arel caveats to rails2 2013-11-19 19:46:30 +00:00
conversation_batch.rb allow bulk messaging in new conversations 2013-09-24 00:29:53 +00:00
conversation_message.rb don't include ActionController::UrlWriter w/rails3 2013-10-29 15:50:39 +00:00
conversation_message_participant.rb add soft delete to conversation_message_participants 2013-08-08 16:00:51 +00:00
conversation_participant.rb remove uses of memoize 2013-12-06 22:03:24 +00:00
course.rb custom gradebook columns api 2013-12-26 17:45:40 +00:00
course_account_association.rb optimize Account#/Course.update_account_associations a bit 2013-06-07 14:47:09 +00:00
course_import.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
course_profile.rb improve acts_as_list 2013-12-17 19:55:43 +00:00
course_section.rb destroy section overrides when crosslisting sections 2013-12-04 19:43:54 +00:00
crocodoc_document.rb optimize CrocodocDocument.update_process_states 2013-08-22 19:12:15 +00:00
custom_gradebook_column.rb custom gradebook columns api 2013-12-26 17:45:40 +00:00
custom_gradebook_column_datum.rb custom gradebook columns api 2013-12-26 17:45:40 +00:00
delayed_message.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
delayed_notification.rb remove uses of memoize 2013-12-06 22:03:24 +00:00
designer_enrollment.rb straighten out course designer permissions 2012-01-13 18:56:50 -07:00
developer_key.rb remove uses of memoize 2013-12-06 22:03:24 +00:00
discussion_entry.rb discussion draft state backend 2013-12-10 18:10:57 +00:00
discussion_entry_participant.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
discussion_topic.rb improve acts_as_list 2013-12-17 19:55:43 +00:00
discussion_topic_participant.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
document_service.rb Initial commit. 2011-01-31 18:57:29 -07:00
enrollment.rb update fake_arel 2013-12-04 16:25:39 +00:00
enrollment_dates_override.rb term start/term end, rather than whenever 2011-09-13 15:20:15 -06:00
enrollment_term.rb avoid :conditions argument to find, count, etc. 2013-10-14 19:29:27 +00:00
eportfolio.rb record when a quiz or user gets deleted 2013-10-29 23:07:12 +00:00
eportfolio_category.rb improve error handling for ePortfolio section editing 2013-09-11 20:36:14 +00:00
eportfolio_entry.rb remove some egregious usages of Enumerable#select when a query will do 2013-05-31 22:11:15 +00:00
error_report.rb use exception class for category in ErrorReport 2013-12-12 19:39:21 +00:00
etherpad_collaboration.rb don't re-calculate the etherpad url when a new user joins 2013-11-08 21:45:44 +00:00
external_feed.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
external_feed_entry.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
external_url.rb optimize AdheresToPolicy 2011-07-14 13:25:28 -06:00
favorite.rb arel-ify scopes 2013-04-01 21:57:16 +00:00
feature_flag.rb feature flags infrastructure and API 2013-11-19 20:50:03 +00:00
folder.rb remove uses of memoize 2013-12-06 22:03:24 +00:00
google_docs_collaboration.rb move google docs domain restriction to feature flag 2013-11-27 15:37:01 +00:00
gradebook_upload.rb prepare for foreign keys refs #6895 2012-05-10 09:46:05 -06:00
grading_standard.rb use unicode sorting for ruby and db stuff 2013-10-02 21:38:03 +00:00
group.rb remove tinychat code 2013-12-18 22:51:45 +00:00
group_category.rb optimize random group assignment 2013-12-13 22:30:48 +00:00
group_membership.rb avoid excessive update-cached-due-date callbacks 2013-10-16 21:04:03 +00:00
ignore.rb arel-ify models 2013-04-01 18:42:38 +00:00
inbox_item.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
learning_outcome.rb remove unnecessary clone_for methods 2013-10-09 12:13:18 +00:00
learning_outcome_group.rb remove unnecessary clone_for methods 2013-10-09 12:13:18 +00:00
learning_outcome_result.rb simplify SimplyVersioned option storage and add callbacks 2013-04-20 13:20:29 +00:00
mailer.rb better handle varying number of parts for mailer 2013-11-14 03:27:57 +00:00
media_object.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
media_track.rb Allow uploading subtitle tracks to videos 2013-02-01 12:53:16 -07:00
message.rb remove tinychat code 2013-12-18 22:51:45 +00:00
migration_issue.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
notification.rb notification preferences API 2013-12-20 22:44:02 +00:00
notification_policy.rb notification preferences API 2013-12-20 22:44:02 +00:00
oauth_request.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
observer_enrollment.rb arel-ify models 2013-04-01 18:42:38 +00:00
open_object.rb simplify OpenStruct/OpenObject json serialization 2013-08-29 16:44:13 +00:00
page_comment.rb arel-ify scopes 2013-04-01 21:57:16 +00:00
page_view.rb force encoding on all string fields in page views 2013-12-19 00:15:26 +00:00
plugin_setting.rb Revert "Revert "use the cached plugin settings to determine if enabled"" 2013-10-16 19:54:11 +00:00
profile.rb adds unlisted to the list of valid profile visibility values 2013-05-31 03:09:23 +00:00
progress.rb support tracking a delayed job in the Progress model 2013-07-10 14:11:48 +00:00
pseudonym.rb remove tinychat code 2013-12-18 22:51:45 +00:00
pseudonym_session.rb skip authlogic 3.2 remember_me check for rails 3 2013-12-20 16:38:19 +00:00
quiz.rb import ActiveModel::Serializers port and convert quizzes api to it 2013-12-26 20:32:39 +00:00
quiz_group.rb add input validation for quiz groups 2013-11-26 18:45:45 +00:00
quiz_participant.rb Quiz Submissions API - Create & Complete 2013-12-19 06:44:28 +00:00
quiz_question.rb Quiz question refactor / api implementation 2013-11-22 17:03:45 +00:00
quiz_question_regrade.rb add the ability to regrade a quiz 2013-08-19 17:29:26 +00:00
quiz_regrade.rb add the ability to regrade a quiz 2013-08-19 17:29:26 +00:00
quiz_regrade_run.rb add the ability to regrade a quiz 2013-08-19 17:29:26 +00:00
quiz_sortables.rb refactor and add api to quiz group reorder 2013-11-21 18:17:48 +00:00
quiz_statistics.rb only strand quiz_stats jobs per quiz 2013-06-05 17:22:07 +00:00
quiz_submission.rb add ability to restrict students from viewing quiz questions after course conclusion 2013-12-20 22:05:21 +00:00
quiz_submission_attempt.rb correctly calculate number of questions affected by multiple regrades 2013-11-04 15:00:51 +00:00
quiz_submission_history.rb correctly calculate number of questions affected by multiple regrades 2013-11-04 15:00:51 +00:00
quiz_submission_snapshot.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
report_snapshot.rb arel-ify scopes 2013-04-01 21:57:16 +00:00
role.rb record when a quiz or user gets deleted 2013-10-29 23:07:12 +00:00
role_override.rb add option for course grade change (log auditing) 2013-11-21 20:53:27 +00:00
rubric.rb added 255 character max title length to rubric in model 2013-12-02 23:52:22 +00:00
rubric_assessment.rb assessor_name should be the 'displayed user name (short_name)' in rubric assessments instead of 'private user name' 2013-12-09 15:57:44 +01:00
rubric_association.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
scribd_mime_type.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
session_persistence_token.rb fix session persistence tokens for out-of-shard users 2013-06-27 20:01:47 +00:00
setting.rb deprecate Setting.get_cached 2013-10-10 00:42:52 +00:00
sis_batch.rb detect failed SIS jobs 2013-10-15 21:57:56 +00:00
stream_item.rb prevent deadlocks creating stream items on postgres 2013-12-21 00:18:59 +00:00
stream_item_instance.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
student_enrollment.rb Minor fixes to StudentEnrollment associations. 2012-05-04 16:46:43 -06:00
student_view_enrollment.rb student view; closes #6995 2012-04-03 14:11:07 -06:00
submission.rb prefer actual submissions during user merge 2013-12-26 15:24:07 +00:00
submission_comment.rb allow adding submission comments with attachments via the api 2013-12-04 20:38:38 +00:00
submission_comment_participant.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
submission_version.rb make data fixup resilient to missing submission rows 2013-11-11 23:31:36 +00:00
ta_enrollment.rb straighten out course designer permissions 2012-01-13 18:56:50 -07:00
tableless.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
teacher_enrollment.rb straighten out course designer permissions 2012-01-13 18:56:50 -07:00
thumbnail.rb update thumbnail attachment options like Attachment's 2013-03-26 18:46:14 +00:00
user.rb replace original_id attr_accessor with previous_id 2013-12-10 21:33:24 +00:00
user_account_association.rb clean up user account associations 2013-01-31 10:41:55 -07:00
user_follow.rb use rails3 style validate/before_validation 2013-10-14 19:28:28 +00:00
user_note.rb record when a quiz or user gets deleted 2013-10-29 23:07:12 +00:00
user_observer.rb user co-enrollment backend work, closes #8588 2012-05-23 12:21:00 -06:00
user_profile.rb prevent text overflow for user_profile.title 2013-08-23 20:05:19 +00:00
user_profile_link.rb add data validation to user profile links 2012-09-24 15:38:26 -06:00
user_service.rb validate nullness in the db on a bunch of columns 2013-09-12 22:20:39 +00:00
web_conference.rb add api endpoint to list web conferences 2013-12-23 22:59:28 +00:00
web_conference_participant.rb check all models for protecting attributes refs #3847 2011-05-25 17:38:50 -06:00
wiki.rb move draft state under feature flag umbrella 2013-11-26 20:43:49 +00:00
wiki_page.rb "Only Teachers" means "Only users with manage_wiki rights" 2013-12-17 20:51:34 +00:00
wimba_conference.rb handle wimba conference date parsing in ruby18/ruby19. 2013-02-08 12:43:19 -07:00
zip_file_import.rb use the birth shard so that the default shard can be changed 2013-05-07 15:44:17 +00:00