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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>