Commit Graph

62 Commits

Author SHA1 Message Date
Cody Cutrer 102fdfc849 no more dynamic finders (models)
refs CNVS-15126

Change-Id: I2996e0e262c41274c34d0ea3bfde757074416b8c
Reviewed-on: https://gerrit.instructure.com/40973
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-09-24 20:51:48 +00:00
Cody Cutrer 1277aaae90 stabby lambda scopes for rails4
Change-Id: I34f2527471cdb4d8cab5cde426ba959baa26189e
Reviewed-on: https://gerrit.instructure.com/37151
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-04 02:11:56 +00:00
Nick Cloward e9595976c1 clean up permission calls for grants_rights?
refs: CNVS-11425

Change-Id: Ia0145e4b4d1da9e0f83a1845647ce203b3586057
Reviewed-on: https://gerrit.instructure.com/34280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-06-19 18:10:30 +00:00
James Williams 2ba4531f73 migration refactor: account question banks import
test plan:
* course migration regressions (canvas cc, course copy)

* in addition:
 use the content migrations api to queue a content migration
 for an account ("/accounts/:account_id/content_migrations")
 to import a qti/cc package.
* confirm that the question banks from the package
 that would have been normally imported into a course are now
 imported into the account

closes #CNVS-12529

Change-Id: I2ef306341d2f7defe03c63a981679a3987f1aaa0
Reviewed-on: https://gerrit.instructure.com/34303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-05-12 16:30:10 +00:00
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
James Williams 7692af009a move all importing methods into models/importers
test plan:
* migration regressions

Change-Id: Ibed8d4820c05b9c69101b215932af32055c3e006
Reviewed-on: https://gerrit.instructure.com/33728
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-02 17:31:15 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Cody Cutrer 65da18174e improve acts_as_list
fixes CNVS-9622

basically, stop with the assumption that lists must be contiguous,
so that we don't have to keep compacting them all the time. allows
for far simpler queries adding things to lists.

test plan:
 * regression test on lists - files, context modules, assignments,
   etc.
 * basically make sure that adding new items puts them in the same
   spot as it did before (bottom of list?), and that reordering
   still works

Change-Id: I31c9ad4ed9b7db2b23e032617d4a01611c8e3c03
Reviewed-on: https://gerrit.instructure.com/26709
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-17 19:55:43 +00:00
Josh Simpson b5b627efa6 Quiz question refactor / api implementation
fixes CNVS-7982
Changes parsing mechanisms for question data, and adds
API for quiz questions.

Change-Id: I483fc9c4718af50e1bed2ee3547905f857de6285
Reviewed-on: https://gerrit.instructure.com/25346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-22 17:03:45 +00:00
Cody Cutrer 419877ff9d clean up sorting all over
* use sort_by instead of sort where possible to avoid repeating yourself
 * use new SortFirst/SortLast sentinels to avoid strange magical constants
 * fix a few places of complicated logic for tiered sorting to just use
   an array

Change-Id: I184ef0b4e31fa18294c9beb32770101d383bbea1
Reviewed-on: https://gerrit.instructure.com/24867
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 21:38:08 +00:00
Derek DeVries bc043d8e3c add relative margin of error in formula questions
closes CNVS-7197

test plan:
- add a formula question type in a quiz
- create your variable definitions and formula definitions

  scenario 1:
- generate possible solutions, and add a margin of +/- a percentage value (5%)
- make sure that when a student answers a quiz question that it allows the
  percentage margin of error entered

  scenario 2:
- generate possible solutions, and add a margin of +/- a point value (2.0)
- make sure that when a student answers a quiz question that it allows the
  margin of error entered (as it worked previously)

Change-Id: Ib819cdd2b3412dfb080e44cacf6516ceb8fa4944
Reviewed-on: https://gerrit.instructure.com/24539
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-09-30 20:08:21 +00:00
James Williams 9d4660b641 fix respondus question bank and quiz importing
test plan:
* publishing through respondus should work for question banks
and for quizzes when settings are applied

fixes #CNVS-8276 #CNVS-4297

Change-Id: I3b254c6375aa5524f6ecf78c31e64d34a13ba4a7
Reviewed-on: https://gerrit.instructure.com/24566
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
2013-09-24 19:39:51 +00:00
Cody Cutrer d3f0b18684 validate nullness in the db on a bunch of columns
fixes CNVS-7414

Change-Id: I60978f66d88d916dc5736dbb975715172bd1e14b
Reviewed-on: https://gerrit.instructure.com/23141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-09-12 22:20:39 +00:00
James Williams 33570f6913 keep question and answer comments editable on copy
test plan:
* create a multiple-choice question in a quiz or question bank
* add comments to the question and answers
* copy the course
* edit the new question
* make sure that the comments are editable

fixes #CNVS-318

Change-Id: Id4b7f13b28fa6602653b65b1e2b44f00f1cac394
Reviewed-on: https://gerrit.instructure.com/23795
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-08-29 15:49:09 +00:00
James Williams fb09ce461c import assessment questions and banks only for selected quizzes
test plan:
* import the package referenced in the ticket
* only select certain quizzes
* confirm that question banks are created only
for those quizzes that you selected

fixes #CNVS-7633

Change-Id: Ib19eef3fc0e69b56e1cb0eab89938e24c13bfa4b
Reviewed-on: https://gerrit.instructure.com/23584
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2013-08-29 15:24:54 +00:00
Cody Cutrer 7c8623e9a3 optimize question bank importing
same idea as the quiz question import optimization - don't send a
huge list of strings to the database, and get a huge blob back, when
 we can exchange much less information to accomplish the same thing

test plan:
 * import a course with a question bank
 * it should work

Change-Id: I73d57cbbd600ac7c13618dc5b1dcfcef3bb92484
Reviewed-on: https://gerrit.instructure.com/23448
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-08-22 15:29:47 +00:00
Cody Cutrer 63cd530c59 provide PK to Adapter#insert
so that it doesn't do a query to infer the PK

test plan:
 * import a package with question banks and quizzes

Change-Id: I6357123dca955071e0a81f4042afb72716d597ed
Reviewed-on: https://gerrit.instructure.com/23554
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-08-21 18:23:31 +00:00
James Williams 64ccf532c1 fix moodle multiple_dropdowns importing
test plan:
* import the package referenced in the ticket
* importing should not fail

* however, it should give migration warnings explaining that
 the "Multiple dropdown" questions may be incorrect,
 including direct links to the questions

fixes #CNVS-7048

Change-Id: Iff001c0181086986be0b4ead38970df7abd9878a
Reviewed-on: https://gerrit.instructure.com/23165
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-08-20 20:08:06 +00:00
Stanley Stuart 9b76539a3e add the ability to regrade a quiz
This commit gives teachers the ability to regrade quizzes by using
different options per quiz question:

* Current Correct Only
* Full Credit (regardless of answer choice)
* Previous and Current Correct
* No Point change (for updating the display of a question)

Test Plan:
  You'll want to run through each question regrade option making sure
  scores change appropriately.

"I seldom end up where I wanted to go, but almost always end up where I
need to be." - Douglas Adams

Change-Id: I9dbb88154cd3ac630bf59dbf3e997a87f75649dc
Reviewed-on: https://gerrit.instructure.com/22018
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-08-19 17:29:26 +00:00
Sterling Cobb 2bbe9eff30 Serialize radio button values and add styles
fixes #CNVS-6405

Change-Id: Ia8fa25d00997b333a6fce0082877ef038948136f
Reviewed-on: https://gerrit.instructure.com/21709
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-27 18:39:20 +00:00
Bracken Mosbacker 93643f6d6c content migration creation api
allows creating content migration through the api

Test Plan:
 * Create a content migration through the api along with a file upload
 * You should be able to follow along with the progress and
   the migration should be complete when the progress is done
 * Try to update the migration type, you should get an error
 * Upload a wrong file type the first time, then go through
   the file upload process again on the update endpoint.

refs CNVS-4228

Change-Id: Iab1082ca68b61d1b0493c191b48169a164444d06
Reviewed-on: https://gerrit.instructure.com/19108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2013-05-17 22:34:09 +00:00
James Williams 6b3bde6df3 fix and refactor content migration issue messages
test plan:
* import a package containing an item that is
 invalid so it will create a
 "Couldn't import the" item warning, but also
have an extremely long title (~250 characters)
(an example is attached to the ticket)
* confirm that when trying to import,
 the entire migration does not fail silently,
 and thus hang in the import phase,
 but instead creates a proper migration issue
 for the invalid item and continues the import
 normally

fixes #CNVS-5467

Change-Id: I2659ac0c5531ad609f3f58abc1fc0960e9d85c51
Reviewed-on: https://gerrit.instructure.com/19961
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-26 21:33:24 +00:00
Simon Williams ff85faf46a basic support for file upload quiz question type
note: this currently just adds all the necessary hooks for a new question type,
and is currently disabled while the specific file upload functionality is
implemented.

closes CNVS-1150

test plan:
- should see no change with adding quiz questions, taking a quiz, or viewing
  statistics

Change-Id: I3360f00055d1d0c4f9c9703d70590e888cd636d7
Reviewed-on: https://gerrit.instructure.com/19560
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-19 21:42:13 +00:00
James Williams 21d1788f22 add migration warnings for missing references in html content
adds migration warnings when links and other references point
to missing or unknown internal content

test plan:
* upload a content migration with missing relative links
 (an example is attached in the ticket)
* import all the content
* view previous migrations for the course
 (at "/courses/:id/imports/list")
* confirm that warning messages are shown
* the ui in in progress, but the warnings should
 have links associated with them that point to the
 content with missing links. to see them, use the
 migration issues API

closes #CNVS-134

Change-Id: I1d0a9217fe0c1678968410be8b2eba5b990b8305
Reviewed-on: https://gerrit.instructure.com/19367
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-11 18:28:59 +00:00
Cody Cutrer 8c94e53dc7 arel-ify scopes
s/named_scope/scope/g

refs CNVS-4707

Change-Id: I930d229fc9985c7c0096a0f4888933addd4f3aee
Reviewed-on: https://gerrit.instructure.com/18834
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 21:57:16 +00:00
Cody Cutrer d9111f5414 arel-ify models
closes CNVS-4707

Change-Id: I32c8ec5a53525f89cf232890eaac790fbc2b4744
Reviewed-on: https://gerrit.instructure.com/18745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 18:42:38 +00:00
James Williams 9af4014b51 import assessment questions into an active question bank
changes the assessment question import so it will
create a new active question bank if it finds a deleted
one that matches the migration id instead of putting
them in the deleted bank

test plan:
* import a quiz from file
* delete the question bank created by the import
* import the same file
* should have a question bank for the import

fixes #CNVS-3682

Change-Id: I6fb8cac24af4ef11dd5ce5d75913a6742e831d87
Reviewed-on: https://gerrit.instructure.com/17693
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-03-15 08:09:55 -06:00
Jeremy Stanley 76b4da53bf fix copying calculated questions that are missing formulas
test plan:
 - import a blackboard quiz containing formula questions
   (a suitable one is attached to CNVS-3468)
 - take the quiz and ensure it is graded properly
 - using Settings / Copy This Course, copy the imported Canvas
   course to a new Canvas course
 - take the quiz in the new course and ensure it is graded
   properly

fixes #CNVS-3468

Change-Id: Iedfbc4e9a2440a5f88208a10150195050ddfd3c6
Reviewed-on: https://gerrit.instructure.com/17416
Reviewed-by: Mark Severson <markse@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-02-19 14:28:44 -07:00
James Williams f58b18cfb5 overwrite quiz and assessment questions on re-import if checked
fixed a problem where checking the "Overwrite assessment
content with matching IDs" on the "Import Quizzes" page
wasn't actually overwriting the content

test plan:
* import the original quiz file from redmine
* look at the quiz questions
* import the updated quiz file from redmine, checking
 the "overwrite" option
* confirm that another quiz has not been added
 and that the original quiz questions have been updated

closes #11662

Change-Id: Ib4ec5d79e062a4ae3e8abad4cbdede96b600a64a
Reviewed-on: https://gerrit.instructure.com/15282
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-16 10:44:04 -07:00
James Williams c44dfb8206 qti quiz import should create a question bank for quiz
fixes a problem where quiz questions imported from a qti
file would always be added to the "Imported Questions"
bank, rather than a quiz specific bank.

test plan:

* import the qti quiz file from redmine
* go to quizzes -> question banks
* confirm that the questions were added to a question bank
 with the same title as the imported quiz

closes #11689

Change-Id: Id97ceef6f3db6c835ec8897ed94e6516e5b5b7c1
Reviewed-on: https://gerrit.instructure.com/15266
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
2012-11-14 10:11:09 -07:00
Jon Willesen a9d1a9ea60 move infer_defaults to before_validation so validation passes
this will allow an existing invalid assessment question name to
be updated instead of continually failing validation

fixes #11230

test plan:
 - create a question bank with a question that has a name longer than 255 characters (see #11230)
 - edit the question and modify its name so it is shorter than 255 characters
 - save the question; it should save successfully now

Change-Id: I9342d5aeb0541947196e132481d77c83b0ba750c
Reviewed-on: https://gerrit.instructure.com/14419
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
2012-10-17 09:58:10 -06:00
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 649e9a2495 properley handle query string params on translate links
If there were existing query string parameters when
translating link on an Assessment Question the resultant
string would have two '?' instead of separating them with '&'

Test Plan:
 * Create an assessment question and have the description point to an image in the course by selecting one in the wiki sidebar
 * Before you save the question, add something like "?wrap=1" to the end of the img src
 * Save the question
 * Looking at the source of the question text after save should show that the wrap has a '&' before instead of a '?'

refs #8365

Change-Id: I5e5bb6499013b43a4fd3b2144dc9d8f9536ad174
Reviewed-on: https://gerrit.instructure.com/10411
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-04-30 14:29:04 -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
Bracken Mosbacker 355dbf97d9 find relative pathed files when translating links on assessment questions
sometimes urls to files/images have relative urls instead of
the id of a file. Those should also be attempted to be
translated.

Test Plan:
 * Make an assessment question with both types of urls
 * run translate links on that question
 * The urls should be happy when done

refs #6951

Change-Id: I9d4a526357871ac8ea7e1018df6c39f0dda95060
Reviewed-on: https://gerrit.instructure.com/8196
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2012-01-31 12:13:07 -07:00
Bracken Mosbacker 2478f305a8 don't strip numeric (and other) types when saving questions
The translating of attachment links caused non string/array/hash
types to become nil in the question_data hash

Test Plan:
 * Create a question in a question bank
 * Edit the points possible
 * reload the page, the points possible should be what you set them to

closes #6718

Change-Id: Ib4eaecff3a8540ffe1349603ce9236960f762461
Reviewed-on: https://gerrit.instructure.com/7761
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-12-29 21:32:50 -07:00
Zach Wily a74962833c translate links on imported assessment questions
Previously, assessment questions created via imports did not get their links
translated, since they are created with straight SQL. For now we will detect
when a question possibly has a link inside, and if it does, load the AQ model
and run translate_links on it.

This also includes a fix to translate_links to find them inside arrays too
(like in the answers array).

testplan:
 * import a QTI package with images in the questions and answer feedback
 * verify that the new questions in your question banks have links pointing to
   /assessment_questions/ and not /courses/ for the images
 * the existing translate_links specs cover the translate_links refactor

Change-Id: Idf36e65ef6a9887369feb1b2cdcbb2db1f2f70f3
Reviewed-on: https://gerrit.instructure.com/7136
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-11-29 13:07:23 -07:00
Zach Wily 5f3a79011d log the id of the assessment question when link translation fails
Change-Id: I2b0e41de7e2c9da14cbef7aa7b01e015efc69d43
Reviewed-on: https://gerrit.instructure.com/6850
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-11-10 11:57:36 -07:00
Bracken Mosbacker f15c5cc9c1 make sure matching questions are formatted correctly when imported
imported matching answers were missing the required 'left' field

import the package attached to the ticket to test

closes #6146

Change-Id: I97e4af7070cb2068e677af91d3f23cde8e077987
Reviewed-on: https://gerrit.instructure.com/6615
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-11-03 09:17:36 -06:00
Zach Wily 052283dbfa fix assessment question link translation; refs #6012
Moved the translate_links call back to an after_save, and fixed some of the
logic.

Change-Id: I46f7f4618f3e8bf5019bb2cac2501ec82dc04af1
Reviewed-on: https://gerrit.instructure.com/6372
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-10-21 15:12:57 -06:00
Zach Wily a4e55af920 make sure links in assessment questions are correctly translated, fixes #6012
Assessment questions can be shared among multiple contexts, so we need to make
the Canvas links used inside authorized to anyone with the link.

Change-Id: I0df4907405fd518ee0efebccf1b9fb8717dca141
Reviewed-on: https://gerrit.instructure.com/6341
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-10-21 08:36:34 -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 dbe0d239e9 add html/image support to quiz question/answer feedback
closes #5284

Change-Id: I51aad86e8b389ab1f3d6b700ebcef968803f0b10
Reviewed-on: https://gerrit.instructure.com/5097
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
2011-08-24 10:09:22 -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
Cody Cutrer 7f5cc0693b optimize AdheresToPolicy
Basically, don't call a bazillion procs everytime you check_policy;
just the "given" statement.  Everything else is evaluated just once,
and cached on the class.  This does lose functionality (the ability
to access the instance inside of set_policy, and set methods), but
none of it was currently in use.

Change-Id: I736879d98beb4115a2e8c492931c755076291d08
Reviewed-on: https://gerrit.instructure.com/4665
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-07-14 13:25:28 -06:00
Bracken Mosbacker a03dd41895 don't allow single item failures to stop a whole import
Before if any single item had an error the whole import
errored out. This lets items fail and the rest continue to
import. The single item failures are logged as warnings in
the ContentMigration and this allows the user to know what
failed.

All the warnings/failures are also shown on the migration
list page to help admins diagnose problems.

refs #4903

Change-Id: I66b81ce1c243258dfc8c1d7d1381b2ea8daa3e72
Reviewed-on: https://gerrit.instructure.com/4268
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2011-06-17 12:21:59 -06:00
Cody Cutrer 6ea73305f7 i18n AssessmentQuestionBank
Change-Id: Ib9daa923e91dcf44b3717bfd9e837f8917d61695
Reviewed-on: https://gerrit.instructure.com/4133
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-06-10 10:07:01 -06:00
Cody Cutrer 625f475ff6 i18n AssessmentQuestion
Change-Id: I6a0a162fcca190bc620b95b3eda1790035cf29e2
Reviewed-on: https://gerrit.instructure.com/4131
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-06-10 10:06:53 -06:00
Cody Cutrer b81a49021a i18n ApplicationController
Change-Id: I99cd8d56be94cfff1dc42eaca008712536ea53ec
Reviewed-on: https://gerrit.instructure.com/4130
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2011-06-09 16:33:04 -06:00
Cody Cutrer 3404788721 only create one version per create/update of AssessmentQuestion
refs #4189

Change-Id: Ic96b542dfb441e8f1da85a6c784ccc8fbc33023c
Reviewed-on: https://gerrit.instructure.com/3949
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
2011-05-31 15:54:43 -06:00