Change-Id: Ie26c2eb56d1e29c1108f13d9ef8d7773e908a298
Reviewed-on: https://gerrit.instructure.com/29606
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
refs CNVS-9546
for rails2, when using multiple environment-conditioned caches,
middleware must be inserted for each cache. so we need to instantiate
them and manage the middleware at boot. adjust accordingly
for rails3, we're using switchman and switchman has been updated to
manage this for us. we just need to give it the full cache configuration
map up front.
also changes the default for Canvas.cache_store_config's second
parameter to true, extracting the nil_is_nil=false behavior into the
fallback value for Rails.env in the new Canvas.cache_stores method. the
only remaining callers of this method are in some plugins which passed
an explicit true value for that parameter. once those plugins are
updated to access Canvas.cache_stores directly,
Canvas.cache_store_config will be removed.
Change-Id: I80eb09679303f2778a6ddc9ab476e695a6754465
Reviewed-on: https://gerrit.instructure.com/28441
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Change-Id: I86bde6da2cc006e92c00113dccb95f100c2dadee
Reviewed-on: https://gerrit.instructure.com/29393
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I926d13c5ce839e7236d8e2c7720be01e5e044eea
Reviewed-on: https://gerrit.instructure.com/29530
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I746004e5d6ab6ac0a4d7d557a799f878c0a84501
Reviewed-on: https://gerrit.instructure.com/29401
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: Ic533c19fb4c54ca3de2acb4265b2d884036e28f6
Reviewed-on: https://gerrit.instructure.com/29442
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
* vendoring gems to allow the gems that we own to reference a locked
* down version in their gemspecs. Specifically, with the old version of
* ActiveSupport that we were getting from the LTS Rails repo, there is
* no way to tell bundler to install a gem that is a subdirectory of a
* git repo.
Change-Id: I32d9d0fae15da1fcf27f11e5cd8fca26af18d383
Signed-off-by: David Julia <djulia@pivotallabs.com>
Reviewed-on: https://gerrit.instructure.com/29438
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
Change-Id: Iff18c336743dfe3492337bdf576ccec145b9e375
Reviewed-on: https://gerrit.instructure.com/29256
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: Ic853af26b6f1722c80e45319e46f296f48aa926d
Reviewed-on: https://gerrit.instructure.com/29435
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Change-Id: I9637715c285890404d22d1f78c07def3ca7930e1
Reviewed-on: https://gerrit.instructure.com/29271
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
fixes PS-969
test plan:
*the posistion should reflect the posistion displayed in the UI
*the visibility should reflect the visibility in the UI
*hidden should be set if the nav tab is hidden
*unused should be set if the nav item has no content
*you should be able to update a tabs position
*you should be able to set a tab to hidden
*you shouldn't be able to modify home, or settings tabs
Change-Id: I96beba411551ea0709ecf0e876c61d90b35b8482
Reviewed-on: https://gerrit.instructure.com/28093
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
refs CNVS-9546
to avoid mucking around with RAILS_CACHE and
ActionController::Base.cache_store=
Change-Id: Ic94416634fdd1c4c0754529a8a2c927c6541c8ab
test-plan: specs
Reviewed-on: https://gerrit.instructure.com/29228
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
refs CNVS-9546
pull the common code into
* Rails.force_cache!,
* Rails.unforce_cache!,
* Rails.force_cache{},
* Rails.disable_cache!, and
* Rails.disable_cache{}
methods. leave the implementation of those methods close to the code
they're replacing for now, but in the near future we'll reimplement
those methods to be cleaner (i.e. not mucking around with version
specific internal constants and such).
test-plan: specs
Change-Id: Ie5f47a64f57dea0034933d8dad84e17633869a49
Reviewed-on: https://gerrit.instructure.com/28086
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
This patch makes it possible to list the "question records" for a QS
which clients can use to tell what questions are answered, flagged,
etc.
closes CNVS-10025
TEST PLAN
---- ----
Fire up some computer, launch a Canvas instance, create a quiz with a
question or two, take it as a student, answer it, then get ready for
API business:
> Index action - Listing all question records
[GET] api/v1/quiz_submissions/:quiz_submission_id/questions
- Perform the request
- Verify you get N entries, one for each question you answered or
marked
- Set an "include" parameter with "quiz_question" (ie,
"?include=user")
- Verify that the returned set now contains 3 entries:
1. "quiz_submission_questions" what you saw earlier
2. "quiz_questions" with Quiz Questions that you answered
3. "meta" that you can safely ignore
> Show action - Fetching a single question record
[GET] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id
- Perform the request
- Verify you get 1 entry
- Try the "include" parameter as you did in the Index case
As a sidenote, the output of these endpoints should be the same as the
stuff you get when you answer a question (see CNVS-9844), they
basically should tell you what answer you provided if you did, and if
you marked the question or not.
Change-Id: If39b84d8fda77870c3990822ade06bd28b276c3d
Reviewed-on: https://gerrit.instructure.com/27598
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz'). JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
we already use it that way, and it makes the spec less fragile
Change-Id: Ia38ee9d735a7d2652565edbb46f1dbb11bfdd879
Reviewed-on: https://gerrit.instructure.com/29184
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
rails 2 doesn't know about respond_to_missing? in ruby 1.9, so
Marshal.dump(User.where("syntax error")) calls respond_to?, which
chains to respond_to_missing?, which Rails 2 delegated to proxy_found,
thinking it was a useful instance method from Array
simply removing the delegated method and letting the default
implementation return false is sufficient
Change-Id: I6fe4b4daf5fa5b4a4489c8aedaa711945bb764ed
Reviewed-on: https://gerrit.instructure.com/28906
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Rob Orton <rob@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This patch provides support for answering Quiz Questions via the API.
closes CNVS-9844, CNVS-10225
TEST PLAN
---- ----
Testing this will be a bit rough because there are many variations and
validations to cover. I'll spare the validations that are covered by
specs from the test plan.
Create a quiz with a question of *each* type except "Text" and "File
Upload". There's a script that creates a quiz with its questions
automatically for you if you don't want to keep doing this manually. See
references.
> Answering Questions
Now you need to answer each question via the API. Most of them vary in
formats, but they are fully specified in the API documentation page
(along with examples). See DOCUMENTATION for more info.
> Flagging Questions
Flagging, and unflagging, a question is the same regardless of its type,
see the "EXAMPLE REQUESTS" section.
> Access Validations
Here are some generic, non-question based validations to verify. You
should NOT be able to answer a question if:
- the quiz submission has been turned in
- the quiz submission is overdue
- the Access Code for the quiz is invalid
- the IP filter of the Quiz prohibits you from taking the quiz
- the quiz submission :validation_token is incorrectly specified (ie,
other students shouldn't be able to answer your questions)
- you don't specify the latest :attempt, so if the Quiz has multiple
attempts, and this is your 2nd take, you specify an :attempt of 1,
3, or anything but 2 should fail
- NEW: turn quiz into an OQAAT quiz with the "Can't go back" flag on;
the API should not reject all requests to modify any of the
questions with a 501 error saying that type of quizzes is not
supported yet (support will come in CNVS-10224)
> Grading
Also, when you're done answering the questions, take a look at the
grades and make sure everything gets graded just like it does when using
the UI directly.
> Verifying results in the browser
While taking a quiz in the canvas UI, the scripts perform backups in the
background that would overwrite any changes you do via the API. If you
want to verify the changes you make via the API from the UI, you must
append "?backup=false" to the take quiz page URL, something like this:
http://localhost:3000/courses/1/quizzes/1/take?backup=false
Setting that flag will (for now) disable the backup behaviour and should
make things tick.
EXAMPLE REQUESTS
------- --------
Don't forget to set the 'Content-Type' header to 'application/json'!
> Answering a Multiple-Choice question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id
{
"attempt": 1,
"validation_token": "1babd0...",
"answer": 10
}
> Flagging a question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/flag
{
"attempt": 1,
"validation_token": "1babd0..."
}
> Unflagging a question
[PUT] /api/v1/quiz_submissions/:quiz_submission_id/questions/:id/unflag
{
"attempt": 1,
"validation_token": "1babd0..."
}
DOCUMENTATION
-------------
Run `bundle exec rake doc:api` and check out the Quiz Submission
Questions page. There's an Appendix that contains example requests for
each question type, as well as the errors produced by each handler.
LINKS
-----
- bootstrap script:
https://gist.github.com/amireh/e7e8f835ffbf1d053e4c
- direct link to the API documentation page:
http://canvas.docs.kodoware.com/quiz_submission_questions.html
Change-Id: I9a958323ece8854bc21a24c2affd8dc3972e46d5
Reviewed-on: https://gerrit.instructure.com/27206
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
Change-Id: I4a705425461ac7a0453ac14f7627b410a1f6189b
Reviewed-on: https://gerrit.instructure.com/28773
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
in particular, prevent it from initializing when nil,
and prevent it from overwriting the value with the serialized
value (this causes problems in specs when mocking for attributes
such as Attachment.scribd_doc)
Change-Id: I4c37d9222e51a85da692dc351d515e0f326f435b
Reviewed-on: https://gerrit.instructure.com/28899
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
fixes: CNVS-392
Added logging for course events. This is on a more generic level allowing us
to add all sorts of event types to courses. First adds a general event for
course details. Later we can add other event types such as assignment date
changes.
Test Plan:
Setup:
- Create a course
Security:
- Query API and should return success.
- Remove account level permissions for viewing course changes.
- Query API and should return invalid.
- Add credentials back.
- Query API and should return success.
Course Details:
- Change some details on the course.
- API should return an event containing the data for the changes made to the
course details.
Change-Id: I5ab139868842c2ad9777245d5a81452caf0d0970
Reviewed-on: https://gerrit.instructure.com/27807
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
Attempt to fix our sis batch tempfile usage, which wasn't compatible
with the travis environment.
Found more SAML specs to mark as pending when SAML isn't enabled.
Use webmock instead of our own home-grown solution, since Travis
enforces webmock.
Select only the users we're interested in sorting, to remove dependency
on empty db.
refs CNVS-10467
Change-Id: Icf9b093c6cc4a6b7b19da9dd2abab9f39457f817
Reviewed-on: https://gerrit.instructure.com/28949
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Use encrypted_cookie_store by default, since it's the best option. This
fixes the session timeout specs failing with the default config.
Also remove the documentation on memcache/redis session store, since
those are deprecated.
refs CNVS-10467 (fixes a travis.ci build error)
Change-Id: Iafe633f601565d4306bb2f144d5d846d6fd527d5
Reviewed-on: https://gerrit.instructure.com/28946
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
added include parameter to outcome rollups api so we can
efficiently query the outcome groups and links so we can display
outcome paths in the interface. Added additional endpoints to
outcome groups controller so this information is also available
via separate api call.
fixes CNVS-10396
test plan:
- check documentation for new outcomes groups endpoints:
- outcome groups for course and account.
- outcome links for course and account.
- check the documentation for the new "include[]" parameter of
the outcome results rollups endpoint.
- make the api calls and make sure they behave as advertised.
- mastery gradebook should still function as before.
Change-Id: I2c5611385af5c39dcef0929beff5261b9aadf391
Reviewed-on: https://gerrit.instructure.com/28576
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
passing options to self.transaction (as opposed to
self.class.transaction) does not work in all versions
of rails
Change-Id: I438a1905f8aea44d87424390dd5c12bed950025a
Reviewed-on: https://gerrit.instructure.com/28513
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
API to export a course in .imscc format, or a course's quizzes
in QTI .zip format
test plan:
- consult the API documentation for Content Exports
- begin a course export with the API
- confirm the returned progress_url shows progress
- when the progress API says it's done, use the
show export endpoint (and the id returned when
you created the export) to get the URL of the
download
- download and re-import the .imscc to make sure it
was exported correctly
- repeat the above, but for a QTI quiz export instead
- use the index action to list exports performed
- also do a quick regression test on the content export
functionality in the Course Settings UI
fixes CNVS-10259
Change-Id: I187671cb060ccaca075c94f5c7c20ef0591abb6f
Reviewed-on: https://gerrit.instructure.com/28207
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
refs CNVS-5856
Test plan:
* create some custom gradebook columns
* drag them into a different order in gradebook2
* after reloading, the order of custom columns should be preserved
Change-Id: Ib3ef172b01baabe8480b12846775fde965880215
Reviewed-on: https://gerrit.instructure.com/28155
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
closes CNVS-5856
Test plan:
* in a course that has n custom gradebook columns, load the gradebook
* the custom columns should be displayed in the frozen section
* you should be able to edit the content for those cells and it
should be remembered
* enable the teacher notes column (in the gradebook dropdown)
* use the teacher notes column
* hide the teacher notes column
Change-Id: Ie7ab048d29047e895f4dac4018bce0d9b3897591
Reviewed-on: https://gerrit.instructure.com/27898
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Change-Id: Ia718f317d2528e0382a3c10f9d2b6de423195479
Reviewed-on: https://gerrit.instructure.com/28219
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
presumably you're not using identical sql, so hash the sql and
include it in the cursor name
Change-Id: Iedc3884571d0962b93dc700b9aec03fd1beb88b0
Reviewed-on: https://gerrit.instructure.com/28177
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>