Commit Graph

1273 Commits

Author SHA1 Message Date
Ryan Florence 8a9a431978 spec: use hex html escape in rails 2 like rails 3
Change-Id: I258cba55d55eda0c5c35654b2163fb6417fed16f
Reviewed-on: https://gerrit.instructure.com/29609
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2014-02-05 18:24:27 +00:00
James Williams 982ea2ef16 fix selective_content_formatter for rails 3
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>
2014-02-05 16:38:14 +00:00
Cody Cutrer 69ad476f7e fix creation of new shards through a view on postgres 9.3 on rails 3
Change-Id: Ibd25dde8758ebaee3db855fb89fecb72d898457b
Reviewed-on: https://gerrit.instructure.com/29577
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>
2014-02-05 16:37:05 +00:00
Jacob Fugal 2315ddcc40 list enrollment term api
fixes CNVS-10433

test-plan:
  - fetch /api/v1/accounts/<root account id>/terms
  - generate api docs and terms should render

Change-Id: Ic63197fccc21198922c8d737ff6fe6920f2e1d7c
Reviewed-on: https://gerrit.instructure.com/21610
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-04 20:51:38 +00:00
Jacob Fugal c7ef846e86 update cache_store initialization
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>
2014-02-04 15:55:46 +00:00
James Williams 88dcdc266c fixes for conversations and sharding for rails 3
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>
2014-02-04 15:08:06 +00:00
James Williams 149e121534 fix switchman settings initialization for rails 3
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>
2014-02-03 21:13:45 +00:00
James Williams a204c43bbd fix scope(:find, :select/:group/:shard/:conditions) for rails 3
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>
2014-02-03 18:14:37 +00:00
James Williams 2a1b7f8778 delayed_jobs extensions for sharding in rails 3
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>
2014-02-03 17:50:18 +00:00
Cody Cutrer 0f5ebf9e1e fix find_ids_in_ranges for tables with custom PKs
Change-Id: I3298f187f3fa4976734ef24b9438f5542ceeeeb7
Reviewed-on: https://gerrit.instructure.com/29493
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-31 17:46:21 +00:00
Raphael Weiner a9f131e55b convert adheres to policy plugin into proper gem
* 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>
2014-01-31 17:22:45 +00:00
James Williams a48ef60a99 define .length for ActiveModel::Errors for rails 3
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>
2014-01-31 17:06:52 +00:00
James Williams 4544ebeb34 set DatabaseServer to Switchman::DatabaseServer in rails 3
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>
2014-01-31 17:06:03 +00:00
James Williams dfebdc049c implement encryption_key settings for rails 3 switchman shard
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>
2014-01-31 17:01:28 +00:00
Raphael Weiner 6d46974518 convert crummy plugin to proper gem
Change-Id: I611b9fbc72d65696ee0c7f4889515eec56d3c463
Reviewed-on: https://gerrit.instructure.com/29451
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>
Tested-by: Stephan Hagemann <stephan@pivotallabs.com>
2014-01-30 18:30:15 +00:00
Raphael Weiner 91944495c2 convert sanitize field plugin into proper gem: CanvasSanitize
Change-Id: I5562a318bb3f52c1374a3a69f288bfb2381f8ee7
Reviewed-on: https://gerrit.instructure.com/29405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-28 22:36:18 +00:00
Nathan Mills b9ddd5d5d1 enhance tabs get api, and add put api
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>
2014-01-28 21:18:28 +00:00
Jacob Fugal aa1052a171 clean up cache forcing implementation
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>
2014-01-27 19:31:08 +00:00
Cody Cutrer 1990a81baa fix detection of DISTINCT for find_in_batches_with_usefullness in Rails 3
Change-Id: Ia5db4e12c67517b29809d4651c56965822761a59
Reviewed-on: https://gerrit.instructure.com/29281
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-27 18:28:05 +00:00
Jacob Fugal d7d3ccce4f clean up code around cache forcing
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>
2014-01-27 16:58:07 +00:00
Cody Cutrer 6fabae6436 fix find_ids_in_batches for rails 3
Change-Id: I23a37b67f37f6545227375432aaf6ca4f61612e9
Reviewed-on: https://gerrit.instructure.com/29276
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-01-27 16:57:12 +00:00
Ahmad Amireh db99de4616 Quiz Submission Questions - Index/Show
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>
2014-01-24 11:03:30 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
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>
2014-01-24 00:08:46 +00:00
Cody Cutrer 25131a110f support scopes for find_ids_in_batches
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>
2014-01-23 23:09:09 +00:00
Cody Cutrer 1014221fcc fix scopes loading when serializing
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>
2014-01-23 17:58:51 +00:00
Ahmad Amireh 20a3562779 Quiz Submission Questions API - Update
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>
2014-01-23 17:49:36 +00:00
Cody Cutrer d2d57c7ab8 fix distinct_on for mysql with a single column
refs CNVS-7032

Change-Id: Iefcdeeed62d718d52ce120cfa689b31d308e9004
Reviewed-on: https://gerrit.instructure.com/29057
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-23 17:09:48 +00:00
James Williams ce6bc221d8 implement :include_root option in as_json for rails 3
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>
2014-01-22 20:27:23 +00:00
James Williams 3ced9c1359 fix serialized attributes for rails 3
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>
2014-01-22 20:27:09 +00:00
Nick Cloward 0859606756 add option for course content changes (log auditing)
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>
2014-01-22 16:15:23 +00:00
Brian Palmer 6aa6db8610 spec: fix some travis spec errors
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>
2014-01-21 19:17:39 +00:00
Brian Palmer 27a4f9763a update the example session_store.yml
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>
2014-01-21 02:15:18 +00:00
Cody Cutrer e5c26d309e work around weird mysql behavior with text column defaults
refs CNVS-7032

Change-Id: Ia6474a8ae39e78b858a993993852139ec9f0c624
Reviewed-on: https://gerrit.instructure.com/28795
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-20 19:58:30 +00:00
Cody Cutrer d4fa6d3895 we don't use memoize anymore
Change-Id: I2061b9e1d37c52a7dcf4000f2ffff553bd9f81ba
Reviewed-on: https://gerrit.instructure.com/28709
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-20 17:22:48 +00:00
Cody Cutrer ecc69df1f3 allow rails 3 style "don't validate" options to ActiveRecord::Base#save
Change-Id: Ice8121bce49982641b4f30d01fa31f2a1722bac7
Reviewed-on: https://gerrit.instructure.com/28713
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-20 17:21:19 +00:00
Jon Willesen b1ae5c89ae add index actions to outcome groups api, includes to rollups
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>
2014-01-17 21:22:52 +00:00
Bryan Madsen 6762d56110 spec: enable redis on travis
Change-Id: If25a8372575241a1196bf426b7165bc120fa270a
Reviewed-on: https://gerrit.instructure.com/28712
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-16 22:03:30 +00:00
Brian Palmer ef58f6d48c add long enough security.yml for test env
Change-Id: I4baf75daa50c2caec223f73c05d3fc9371c6a0af
Signed-off-by: Stephan Hagemann <stephan.hagemann@instructure.com>
Reviewed-on: https://gerrit.instructure.com/28634
Product-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-15 23:06:03 +00:00
Jon Jensen c87d12c573 self-enrollment API, fixes CNVS-10419
move existing self-enrollment endpoint (undocumented) into enrollment api

depends on g/28504

test plan:
1. specs should pass
2. existing self enrollment forms should work, specifically:
   1. enrollment dialog on public course page
   2. self enrollment url (from course settings)
   3. canvas.net enrollment dialog

Change-Id: I0c876720203654e0a589b9ef2d25b80c3e4dfb08
Reviewed-on: https://gerrit.instructure.com/28506
Reviewed-by: Dan Dorman <ddorman@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2014-01-15 21:17:04 +00:00
Brian Palmer c0ef4643b8 Added .travis.yml
Change-Id: Iff43630b0f17c5d729e03da7a7c4243a3645ec27
Signed-off-by: Stephan Hagemann <stephan.hagemann@instructure.com>
Reviewed-on: https://gerrit.instructure.com/28593
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2014-01-15 20:30:11 +00:00
Cody Cutrer 610089bc33 return integers from find_ids_in_ranges for integers
refs CNVS-7032

Change-Id: I238aad57923ca0c841843bd8a90f3789082d449f
Reviewed-on: https://gerrit.instructure.com/28554
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-14 22:12:13 +00:00
James Williams 51410731e5 fix find_or_create_submissions
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>
2014-01-14 21:36:04 +00:00
Cody Cutrer cb084f8d02 fix find_in_batches_with_temp_table on mysql to not commit the transaction
Change-Id: I1d4207506173cd1c84c4ac31e6ea6b54d42860da
Reviewed-on: https://gerrit.instructure.com/28526
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-14 20:45:02 +00:00
Jeremy Stanley 97120caea6 Content Exports API
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>
2014-01-10 23:24:23 +00:00
Cameron Matheson 16d7b04c9d support for reordering custom gradebook columns
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>
2014-01-10 23:21:18 +00:00
Cameron Matheson fbf3da7073 custom gradebook columns ui
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>
2014-01-10 23:21:08 +00:00
James Williams 45f18caa84 use dup instead of clone for active record in rails 3
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>
2014-01-10 17:27:14 +00:00
Cody Cutrer bc8938bf9e fix for nested cursors
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>
2014-01-10 16:30:28 +00:00
Transifreq c0f06d4d2a Updated ja translation 2014-01-10 05:06:55 -07:00
Hannah Bottalla 5e74795487 bullet gem test build
Change-Id: Id718aaf59bc854dbd85c55b6a51fda2a9b32b941
Reviewed-on: https://gerrit.instructure.com/28079
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Hannah Bottalla <hannah@instructure.com>
2014-01-09 17:47:55 +00:00