Commit Graph

15 Commits

Author SHA1 Message Date
Bracken Mosbacker 38ab6c39ce correctly prepare quiz questions when copying course
some quiz questions weren't being processed for import
correctly because they were pointing to an AQ and
expected to get the AQ question data

Test Plan:
 * Create some quizzes with images in the questions
 * Copy the course
 * The new course should have the images in the quiz questions

closes #8476

Change-Id: Ieaaef88f9551afa79aa8daab8b784ce388857f48
Reviewed-on: https://gerrit.instructure.com/10591
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-05-08 09:10:41 -06:00
Bracken Mosbacker f803aa65dc make question data always a HashWithIndifferentAccess
All the code that works with question data is dependant on
the data being a HashWithIndifferentAccess. This commit
makes sure to use that in AQs and QQs, and made the
accessor to question_data set it to the expected hash
type so that old incorrectly serialized data doesn't have
to be updated.

Test Plan:
 * Create some assessment questions that will run through translate_links
 * When accesssing that data id should be an indifferent access hash
 * When viewing those questions in the UI they should display correctly for students and teachers
 * Manually set question data as a hash on a AQ or QQ, when you access it through the AQ/QQ it should be a HWIA

closes #6897

Change-Id: I526ab886aad2f96a3741330059439b100b6a1011
Reviewed-on: https://gerrit.instructure.com/8623
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-02-09 16:29:54 -07:00
Jacob Fugal 5e9ae28f13 cleanup links in quiz questions; fixes #6212
find links in quiz questions from courses other than the course the
question's quiz is in; find related assessment question and pull the
corresponding link from there to use instead.

Change-Id: I4dd2f0c279a6263f753ec898dc17e91e62997923
Reviewed-on: https://gerrit.instructure.com/6910
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-11-22 16:23:44 -07:00
Jon Jensen 0300755aec migrate all quiz images in course copy, fixes #5611
Change-Id: I1d6d6714aff59246d79e3f4a6d0d1ccce3eb79b0
Reviewed-on: https://gerrit.instructure.com/6542
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-10-28 14:15:08 -06:00
Jacob Fugal 1a761c2d1f explicit utc db times in update_all
update_all's update hash doesn't have any magic performed on bare Time
objects; it assumes any Time object it's given is already in UTC. using
a TimeWithZone object (regardless of timezone), which Fixnum#ago and
friends happen to return, is still fine.

Change-Id: I297b2a3211b896b5225ebcfaaee3c1eb56e55fb6
Reviewed-on: https://gerrit.instructure.com/5351
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-08-30 16:46:25 -06:00
Jon Jensen b2b21a794b account-level question banks, closes #5025
phased out AssessmentQuestion#context, did some ground work for #5026
and #5027

Change-Id: Ice4567a0f069dd49da8ce57bf0c8325b0b062115
Reviewed-on: https://gerrit.instructure.com/5303
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-08-29 16:24:49 -06:00
Brian Palmer 92feb2bcdb replace ActiveRecord::Base calls with subclass calls where it makes sense
This was already a small issue if the job queue was on a different
database driver than the main database, and it'll become more important
as more AR connections are introduced.

Change-Id: I204becadd32bb935df096e8c937a04bb6962f0b2
Reviewed-on: https://gerrit.instructure.com/4601
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-07-18 13:56:08 -06:00
Bracken Mosbacker dd0389c3d8 set correct position when importing quiz questions
closes #4870

Change-Id: I3071d329ed6613aa43b57bfe0eaaa3b0204c20a6
Reviewed-on: https://gerrit.instructure.com/4563
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-07-06 10:51:54 -06:00
Cody Cutrer fa51dd18c4 i18n quiz_question
Change-Id: Idebb6326375584edc8af9dde166212f8656e1b97
Reviewed-on: https://gerrit.instructure.com/4280
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-20 09:10:06 -06:00
Brian Palmer d3d6a266cf remove question id from data on clone, fixes #4684
Change-Id: I1ba23dfe1e20b33503b40711098ea7d329a5aba6
Reviewed-on: https://gerrit.instructure.com/3880
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-05-26 16:14:01 -06:00
Jon Jensen cdc2f43d27 sanitize question/answer html on import too, added specs
Change-Id: I6d733640f9e4c6c6dd985d70bafd620a9332cb57
Reviewed-on: https://gerrit.instructure.com/3377
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-02 09:41:13 -06:00
Bracken Mosbacker 31374465fe export/import question banks
refs #3396

Change-Id: I4199264bf07e145be2b3949bc4a56a37cda715b7
Reviewed-on: https://gerrit.instructure.com/3223
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-04-25 07:29:12 -06:00
Brian Whitmer 2a5976b20b don't let question names be blank
fixes #4027

Change-Id: Ic1d590daf29ed5972c689de5554c68cf5c7b43cd
Reviewed-on: https://gerrit.instructure.com/2624
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2011-03-12 21:26:51 -07:00
Brian Whitmer 90e8f0e5be open_object quiz fixes
- @stored_params was sometimes a hash but everything was still
expecting an open_object
- missed a place where the code now failed on nil

fixes #3804

Change-Id: I1b74dadc5956314ebbf1da0baa0dd2d41940aad7
Reviewed-on: https://gerrit.instructure.com/2283
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-02-15 16:46:27 -07:00
Brian Whitmer 8b8173dcc9 Initial commit.
closes #6988138
2011-01-31 18:57:29 -07:00