Commit Graph

1307 Commits

Author SHA1 Message Date
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
Anthus Williams e5604eab78 correct comments re. extent of ruby compatibility fixes
having audited all of the compatibility fixes for
ruby < 2.0 on rails 3, this commit simply corrects
a comment which stated that the fixes were just for
rails 2.3. That is to say, all the CANVAS_RAILS2
guards are correct in config/initializers/
ruby_version_compat.rb

refs CNVS-9520

Change-Id: I62f0a95655a3a2ec114b238cd3215fe4f43871b5
Reviewed-on: https://gerrit.instructure.com/28147
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-01-09 17:07:21 +00:00
James Williams 4b5ef5d093 fix active record update_all with joins for rails 3
also update due_date_cacher sql to not break in rails 3
when the joins are applied in reverse order

Change-Id: I9638f0483cc7c995773b512e0f9bfe1fdc3aa682
Reviewed-on: https://gerrit.instructure.com/28173
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-09 16:43:11 +00:00
James Williams 751f6903f0 add ActiveSupport::HashWithIndifferentAccess to YAML whitelist
for rails 3 compatibility

Change-Id: I4e75d6aa9d00c3f001561254ef161d016678ae5f
Reviewed-on: https://gerrit.instructure.com/28238
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-01-09 12:56:48 +00:00
Transifreq 507fe54e27 Updated pt translation 2014-01-09 05:06:54 -07:00
Cody Cutrer 70c98bdcf6 backport subqueries in array conditions from Rails 4 to Rails 3
we've already backported it to Rails 2

Change-Id: Ibe8ff2f5263f524f9b899966e350dfac8cb3ba29
Reviewed-on: https://gerrit.instructure.com/28001
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-08 21:33:00 +00:00
Transifreq 6d18b1ac12 Updated pl translation 2014-01-07 05:10:07 -07:00
Transifreq 166fee9786 Updated fr translation 2014-01-07 05:08:30 -07:00
Transifreq 18cde8942e Updated de translation 2014-01-07 05:06:51 -07:00
Cody Cutrer 9ad391efa6 make ruby gems fix more accurate
it's not precisely Ruby 2.0 that's missing this method, just a newer
version of RubyGems, so look for the method we're replacing

Change-Id: I9cbd145dfe04e5f21ad1928df756a785645ba954
Reviewed-on: https://gerrit.instructure.com/28122
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-06 18:51:30 +00:00
Transifreq 8279a7eb2c Updated fr translation 2014-01-06 05:06:49 -07:00
Transifreq b9c9638db7 Updated ar translation 2014-01-04 05:06:51 -07:00
James Williams 065f2e1124 fix g/27931 for rails 3
Change-Id: I5d8dec5dd857fcfcbc65d2f5e40ecfb4d5105053
Reviewed-on: https://gerrit.instructure.com/28024
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-03 12:42:47 +00:00
Transifreq e92be9dbb2 Updated zh translation 2014-01-03 05:07:04 -07:00
Jon Willesen f8042f63cc start of new outcome results api
fixes CNVS-10034

test plan:
 - check the new outcome results api documentation.
 - generate some outcome results:
   - create assignments with rubrics that have linked outcomes.
   - grade those assignments with the rubric.
 - call the /api/v1/outcome_results api endpoint.
 - make sure the returned student scores contain the maxiumum
   score achieved for each outcome.
 - students should not be able to access the api.

Change-Id: Icddec2aa9000c01f3b05c1c3c21260f7c15f7f7e
Reviewed-on: https://gerrit.instructure.com/27631
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-02 22:35:02 +00:00
Shawn Meredith 13c79e16ef spec: simple_cov parallelized_specs exclusion
Change-Id: Ie5fa2f5e32fc19351541e62e0192be74afc11694
Reviewed-on: https://gerrit.instructure.com/28036
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-02 21:05:05 +00:00
Rob Orton ed12014bdb validate sis_id, section name and drop section_code
fixes CNVS-10147

test plan
 - set sis id, section name to longer than 255 chars
 - should throw rails error
 - should not throw database error

Change-Id: I05ebdf3ae89ace4f737ae6c124f015efceafec1d
Reviewed-on: https://gerrit.instructure.com/27835
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2014-01-02 20:43:52 +00:00
Cody Cutrer 4b0f509aed prevent dumping of associations from loading them all
Change-Id: Ia76c6f4d59acf46da67ade2db1eee3aa8cb6b202
Reviewed-on: https://gerrit.instructure.com/27931
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>
2013-12-31 23:52:33 +00:00
Jeremy Stanley 6d22b1f738 fix "invalid byte sequence in US-ASCII" in topic attachment
test plan:
 - create a new discussion
 - attach a non-ASCII file
 - save the discussion
 - it shouldn't explode

Change-Id: I9ada9dbf2bf25e63baab22f6117171436d4808c6
Reviewed-on: https://gerrit.instructure.com/27832
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-12-31 21:30:21 +00:00
James Williams 3d949b9080 integrate sharding_spec_helper with switchman for rails 3
Change-Id: Id2205c4c375c569e88857bb3f24a7f11a9d184af
Reviewed-on: https://gerrit.instructure.com/27960
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-12-31 20:09:46 +00:00
James Williams c72c0e3196 fix active record as_json for rails 3
Change-Id: Ie510ac95f5f15dbda9667fca60ebf32a55b13c61
Reviewed-on: https://gerrit.instructure.com/27900
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>
2013-12-31 19:01:01 +00:00
James Williams 516d5c963e preserve active record error json format in rails 3
Change-Id: I80f27f2259b8d0fa4f17575077871a4f97eb0117
Reviewed-on: https://gerrit.instructure.com/27910
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>
2013-12-31 19:00:47 +00:00
James Williams 381f130366 extend folio pagination to enumerables in rails 3
Change-Id: I95df16e305546da4b1a40cd879769347081034df
Reviewed-on: https://gerrit.instructure.com/27901
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>
2013-12-31 19:00:17 +00:00
James Williams 3332c6d60e i18n and html safety fixes for rails 3
Change-Id: Ibae01f4cd57bffff8d4875f0efdd229564a40a85
Reviewed-on: https://gerrit.instructure.com/27577
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2013-12-31 18:37:12 +00:00
Cody Cutrer 6b02cf91ed fix association callback in ruby 2.0
Change-Id: I53e6caa46a27edcf117e9583b99daf2f39dc7099
Reviewed-on: https://gerrit.instructure.com/26987
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>
2013-12-31 18:06:47 +00:00
Cody Cutrer f114b53cc5 fix callbacks in ruby 2.0
Change-Id: I49aa8b21eb6183a5b71b55e81e775bc0217d65f3
Reviewed-on: https://gerrit.instructure.com/26965
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>
2013-12-31 18:06:35 +00:00
Rob Orton 13bb4b8851 create user merge api
closes CNVS-9084

test plan
 - merge users via api
 - should not be able to merge if you cannot manage
   both users

Change-Id: Id84995925b20ac109977a4f281c9de45a5db5a09
Reviewed-on: https://gerrit.instructure.com/27712
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-12-31 16:54:23 +00:00
Stanley Stuart 5f2089c889 import ActiveModel::Serializers port and convert quizzes api to it
test plan:
  - The quiz api should work like it normally does when you don't pass
    an 'Accept: application/vnd.api+json' header.
  - The quizzes index page and quiz edit page should work like they
    always do.
  - Testing the Quizzes API for "jsonapi" style:
    - For all requests, you MUST have the "Accept" header set to
      "application/vnd.api+json"
    - Test all the endpoints (PUT, POST, GET, INDEX, DELETE) like you
      normally would, except you'll need to format the data according to
      the next few steps:
      - For "POST" and "PUT" (create and update) requests, you should send
        the data like: { "quizzes": [ { id: 1, title: "blah" } ]
      - For all requests (except DELETE), you should get back a response
        that looks like: { "quizzes": [ { quiz you requested } ]
    - For the "delete" action, you should get a "no content" response
      and the request should be successful

Change-Id: Ie91deaeb6772cbe52a0fc46a28ab93a4e3036061
Reviewed-on: https://gerrit.instructure.com/25997
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-12-26 20:32:39 +00:00
Cameron Matheson b088c6beda custom gradebook columns api
closes CNVS-6906, CNVS-6475

Test plan:
  Use the new custom gradebook column apis to create/edit/delete custom
  gradebook columns, and set data for users in a course on those
  columns.

  only teachers/TAs should have permission to use these apis.

Change-Id: I658b8dc02d6104559c98a6b7e1be5c72e775d664
Reviewed-on: https://gerrit.instructure.com/27615
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-12-26 17:45:40 +00:00
Transifreq bd88265e0c Updated es translation 2013-12-26 05:06:43 -07:00
Transifreq 47a926c663 Updated ru translation 2013-12-24 05:08:30 -07:00
Transifreq ae19d233fc Updated es translation 2013-12-24 05:06:51 -07:00
Nathan Mills da0d95520d add api endpoint to list web conferences
fixes: PS-918

test plan:
you should be able to get a list of the web conferences through the API

Change-Id: I4bdfe35acbf4e6407a1fe5bcac67f4cca30aa6a0
Reviewed-on: https://gerrit.instructure.com/27592
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-12-23 22:59:28 +00:00
Cody Cutrer 6ff358abca notification preferences API
closes CNVS-5797

test plan:
 * GET /api/v1/users/self/communication_channels/:id/notification_preferences
   should return your preferences
 * GET .../notification_preferences/<one of the named notifications returned above>
   should return a single preference
 * PUT .../notification_preferences/<notification>?notification_preferences[frequency]=never
   should update it (will return it, and confirm by getting it again
 * PUT .../notification_preferences?notification_preferences[<notification>][frequency]=never&
   notification_preferences[<another notification>][frequency]=never
   should update two preferences at once
 * other allowed frequencies are immediately, daily, and weekly
 * repeat replacing the communication channel's id by email/<email address>
 * repeat by using an actual user id instead of self. users should
   not be able to view or update each other's preferences. admins
   should only be able to view, not update (the update routes only exist for "self",
   so you'll get a 404 instead of a 401 for them)
 * regression test notification preferences UI

Change-Id: I107f68a44cb68ee1675ad50ff7123e26d7765450
Reviewed-on: https://gerrit.instructure.com/26311
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-20 22:44:02 +00:00
James Williams 40ce797f55 session and request fixes for rails 3
primarily switching fullpath in place of request_uri
in preparation for rails 3

Change-Id: If14f2cc2da5120a60f04d4cfdfb05a55482a3695
Reviewed-on: https://gerrit.instructure.com/27162
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2013-12-20 20:56:39 +00:00
Cody Cutrer d1c35ae187 fix deconstruction of joins with aliases
Change-Id: I7b8bc73bd546e08723a0dfdca932e9f617ab36dd
Reviewed-on: https://gerrit.instructure.com/27680
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-20 16:48:29 +00:00
Transifreq 8a45e7c55d Updated de translation 2013-12-20 05:06:49 -07:00
Jeremy Stanley dd441d0269 patch Rack parse_multipart to fix mobile uploads
test plan:
 - have a Canvas instance that uses local file storage (not S3)
 - acquire an Android app that can talk to this instance
   (the Play Store build will not)
 - ensure the app can upload a file (such as a profile picture)
   to the Canvas instance

fixes CNVS-10065

Change-Id: I942cc60c5a408a064955e0c2f629d4a02d366a5e
Reviewed-on: https://gerrit.instructure.com/27698
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2013-12-20 03:15:40 +00:00
Transifreq 836fe0d6be Updated de translation 2013-12-19 05:07:14 -07:00
Ahmad Amireh e3778b529c Quiz Submissions API - Create & Complete
Allows users to start a "quiz-taking session" via the API by creating
a QuizSubmission and later on completing it.

Note that this patch isn't concerned with actually using the QS to
answer questions. That task will be the concern of a new API controller,
QuizSubmissionQuestions.

closes CNVS-8980

TEST PLAN
---- ----

- Create a quiz
- Keep a tab open on the Moderate Quiz (MQ from now) page

Create the quiz submission (ie, start a quiz-taking session):

- Via the API, as a student:
  - POST to /courses/:course_id/quizzes/:quiz_id/submissions
    - Verify that you receive a 200 response with the newly created
      QuizSubmission in the JSON response.
    - Copy the "validation_token" field down, you will need this later
    - Go to the MQ tab and verify that it says the student has started a
      quiz attempt

Complete the quiz submission (ie, finish a quiz-taking session):

- Via the API, as a student, prepare a request with:
  - Method: POST
  - URI: /courses/:course_id/quizzes/:quiz_id/submissions/:id/complete
  - Parameter "validation_token" to what you copied earlier
  - Parameter "attempt" to the current attempt number (starts at 1)
  - Now perform the request, and:
    - Verify that you receive a 200 response
    - Go to the MQ tab and verify that it says the submission has been
      completed (ie, Time column reads "finished in X seconds/minutes")

Other stuff to test (failure scenarios):

The first endpoint (one for starting a quiz attempt) should reject your
request in any of the following cases:

  - The quiz has been locked
  - You are not enrolled in the quiz course
  - The Quiz has an Access Code that you either didn't pass, or passed
    incorrectly
  - The Quiz has an IP filter and you're not in the address range
  - You are already taking the quiz (you've created the submission and
    did not call /complete yet)
  - You are not currently taking the quiz, but you already took it
    earlier and the Quiz does not allow for multiple attempts

The second endpoint (one for completing the quiz attempt) should reject
your request in any of the following cases:

  - You pass in an invalid "validation_token"
  - You already completed that quiz submission (e.g, you called that
    endpoint earlier)

Change-Id: Iff8a47859d7477c210de46ea034544d5e2527fb2
Reviewed-on: https://gerrit.instructure.com/27015
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2013-12-19 06:44:28 +00:00
Zach Pendleton f5ee7dbfc3 remove tinychat code
fixes CNVS-10058

canvas no longer integrates with tinychat; this commit
removes legacy references to it.

test plan:
  * run specs

Change-Id: I4887e901d57ff39f8554af3e4eacd52ec4edd6e5
Reviewed-on: https://gerrit.instructure.com/27621
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-12-18 22:51:45 +00:00
James Williams 2d44a98248 integrate with switchman in preparation for rails 3
Change-Id: Ib2147e2a5c388ba56c1e558b414da9b7ec4c9cd2
Reviewed-on: https://gerrit.instructure.com/27614
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>
2013-12-18 15:42:37 +00:00
Transifreq 36c18374f1 Updated fr translation 2013-12-18 05:06:50 -07:00
Shawn Meredith 4c2250d537 spec: parallel simple_cov
Change-Id: I774ce9a451cb01a6ff49df9e4b2bf4f7d753def3
Reviewed-on: https://gerrit.instructure.com/27608
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Shawn Meredith <shawn@instructure.com>
2013-12-18 07:30:03 +00:00
Nick Cloward e983251c9d add 'links' container to jsonapi-style API objects
fixes: CNVS-9757

Change the authentication log api to return relationships (foreign keys) based
on jsonapi with a links element.  This also changes the page_view object to
also move the relationship (foreign keys) to the links element in the json.

Requires underscore.js 1.5.2.  See g/27313

Test Case:
  Authentication Logs:
    - Create some authentication logs if you don't have any by logging in and out.
    - Test the authentication logs api to make sure its returning in the correct
      format and data.
    - Open the admin tools
    - Search for authentication logs in the logging tab.
    - Search by date.
    - Ensure the page is not broken.

  Page Views:
    - Create page view data.
    - Test the page view api to make sure its returning in the correct
      format and data.
    - Test the analytics page views.
    - Test the user profile page views.
    - Account stats for page views.
    - Generating the CSV's/page views for page views.

  Make sure the API documentation reflects the changes.

Change-Id: Ic8aa9e5da4df58e2816fb348accac62b17ec20d5
Reviewed-on: https://gerrit.instructure.com/26907
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2013-12-17 23:50:27 +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
Rob Orton e8ed4b6531 add index to sis imports api
closes CNVS-9946
closes CNVS-10008
refs CNVS-3680

test plan
 - get https://<canvas>/api/v1/accounts/<account_id>/sis_imports
 - should show a paginated list of past imports for the account
 - run rake doc:api
 - https://<canvas>/doc/api/sis_imports.html should render 
 - it should have the SIS import object

Change-Id: I5d81e0049a2a16455e9acbea5be2effc2c2dd633
Reviewed-on: https://gerrit.instructure.com/27539
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-12-17 19:46:03 +00:00
James Williams df19d5d4df fix folio initialization
railtie initializers are not run after the initialization
process has begun, so 'folio/rails' needs to be required
beforehand

Change-Id: Idcc4d1493dfaa63356b6f7461b7adc24b5ff6fe9
Reviewed-on: https://gerrit.instructure.com/27575
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-12-17 14:38:28 +00:00
Transifreq b6bdcd50cd Updated ja translation 2013-12-17 05:08:29 -07:00
Transifreq c0dbf28d65 Updated pt translation 2013-12-17 05:06:48 -07:00
James Williams 1cddad0ea4 add with_each_shard for rails 3 relations
Change-Id: Ic907525d7ff1a1d3db927de3453475ff972ff516
Reviewed-on: https://gerrit.instructure.com/27540
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>
2013-12-16 16:04:53 +00:00
Landon Wilkins ee58627c64 optimize random group assignment
fixes CNVS-9457

test plan:
* regression testing of random group assignment
* verify that the assignment is much faster

Change-Id: Icfc72f6041f6367e43561d8b8240e6a2ffde4801
Reviewed-on: https://gerrit.instructure.com/26568
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-12-13 22:30:48 +00:00
James Williams 271d9a2eb0 active record extensions for rails 3
Change-Id: I6740be8a35ec7a955d1714b4049527e113ce7a21
Reviewed-on: https://gerrit.instructure.com/27020
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>
2013-12-13 18:49:45 +00:00
Ryan Florence 8350218104 introduced bower to manage js dependencies
also updated ic-ajax

closes CNVS-9979, CNVS-9981

Change-Id: I9cdfa997ea0df8de4b2900eac17c438369f92f2d
Reviewed-on: https://gerrit.instructure.com/27316
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-12-13 17:45:57 +00:00
Transifreq 390587b47f Updated zh translation 2013-12-13 05:05:58 -07:00
Transifreq 04cc45103d Updated pl translation 2013-12-13 05:04:50 -07:00
Aaron Cannon 34c395cfe0 Calendar: Date headings are read properly by screen readers in Agenda view
Dates are no longer abbreviated for screen reader users in date headings

Fixes CNVS-9623

Test plan:
- Open the calendar agenda view.
- Using a screen reader, confirm that the date headings are read with full day
  and month names, and not abbreviated names.
- Confirm that the dates still appear abreviated visually.

Change-Id: Id68b8d3e0486c238db8b78abdce3cabe6eec321a
Reviewed-on: https://gerrit.instructure.com/27309
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Aaron Cannon <acannon@instructure.com>
2013-12-12 23:06:16 +00:00
James Williams efe589541e change i18n template renderer
in preparation for rails 3

Change-Id: I8a5a42b69aca0fd9032bf67adf1ae40b7a5b1da5
Reviewed-on: https://gerrit.instructure.com/26977
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2013-12-12 21:14:24 +00:00
Matthew Irish a4ec80a26e foundation for ember-based screenreader gradebook
this is the initial work on the screenreader interface for gradebook and
is very much a work in progress

at this point all that's expected to work is the initial fetching of
data and the template binding that updates when choosing a student or
assignment from their respective dropdowns

merging to allow work to continue in parallel

closes CNVS-9478

Change-Id: I38db029a86f52b89e0889c7e9189911e5519348b
Reviewed-on: https://gerrit.instructure.com/26938
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Aaron Shafovaloff <ashafovaloff@instructure.com>
Product-Review: Matthew Irish <mirish@instructure.com>
QA-Review: Matthew Irish <mirish@instructure.com>
2013-12-12 19:17:09 +00:00
James Williams df02578fda prevent plugin symlink multi-process race conditions
Change-Id: I33ec10d6f0a90c74ceb45e7f8aa427439553610c
Reviewed-on: https://gerrit.instructure.com/27028
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>
2013-12-12 13:34:37 +00:00
Transifreq 3666cb1237 Updated ar translation 2013-12-12 05:05:27 -07:00
Transifreq a99d24d2fd Updated pl translation 2013-12-12 05:04:21 -07:00
Transifreq d1d8d2966e Updated ja translation 2013-12-11 05:04:30 -07:00
Jon Jensen bebeea6b26 don't wrap invalid fields in a fieldWithErrors div, fixes CNVS-9761
we don't need this default rails behavior anywhere, and it can be used to
harvest usernames on the login page (i.e. a valid vs. invalid usernames
will result in a fieldWithErrors in a different place)

test plan:
1. go to the login page
2. submit a valid username and an invalid password
3. in the js console, $('.fieldWithErrors'), should return []
4. submit an invalid username and any password
5. in the js console, $('.fieldWithErrors'), should return []

Change-Id: Ie434d0e6af70319469625694c060ebd15cf9f67f
Reviewed-on: https://gerrit.instructure.com/27107
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-12-10 23:03:14 +00:00
Jacob Fugal beb81fa1f0 adjust ActiveRecord::Base.all_models for rails3
the old method included Profile but excluded CourseProfile. but in
rails3, Profile.table_name is nil because it's an abstract class;
including it meant trying to truncate table "" in spec_helper.rb, but
excluding it without including CourseProfile meant the "profiles" table
didn't get truncated.

update the model listing to exclude abstract classes (e.g. Profile), but
include direct descendants of abstract classes (e.g. CourseProfile), but
not direct descendants of non-abstract classes (e.g. Announcement).

Change-Id: I4e6a60b302f1c88f4ace0c7d41377e92eeecfaa1
Reviewed-on: https://gerrit.instructure.com/27087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-12-06 22:04:52 +00:00
James Williams 568976fbc7 change encrypted cookie store to fix session timeout plugin
moves the load account and session timeout plugin middleware
 to set the expire_after before the session store is called,
and changes encrypted_cookie_store to use that option so it can
invalidate expired sessions when it unmarshals the data
for the first time.

The reason it seemed to work locally is because it sets
@options[:expire_after] after the first request.
Unfortunately this second time doesn't often happen
in the actual application when distributed amongst several
instances.

test plan:
* set the "Sessions" plugin settings to timeout after
1 minute using the following console commands;

ps = PluginSetting.
find_or_create_by_name_and_account_id("sessions",
Account.default)
ps.settings = {"session_timeout" => "1"}
ps.disabled = false
ps.save!

* (Note: normally this would be done
by going through the plugin settings ui, however, it enforces
a minimum of 20 minutes, which is difficult to test with)

* start the server and log-in
* shut down the server
* wait for 1 minute for the session to time out
* restart the server and try to click a link
* should be redirected to the log-in page

fixes #CNVS-7870

Change-Id: I843b73da7d3c001f7e632b1454c63f9d6c07f73d
Reviewed-on: https://gerrit.instructure.com/26911
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-12-05 21:08:50 +00:00
Jon Jensen f603cee46e reenable i18nema for rails 3, fixes CNVS-9517
this is a partial revert of 89ec8993

i18nema was disabled during some intermediate upgrade work around 3.0, due
to that version of rails needing an older version of the i18n gem

test plan:
1. canvas should fire up
2. you should be able to run i18nema-specific stuff in the console, e.g.
    > I18n.backend.direct_lookup('en', 'date', 'formats', 'default')
   => "%Y-%m-%d"

Change-Id: Ib1f7e03c417cc87fd873a7434a4586969470b58b
Reviewed-on: https://gerrit.instructure.com/26975
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-12-05 17:21:55 +00:00