Commit Graph

281 Commits

Author SHA1 Message Date
Anthus Williams 828981e72c define exportable attributes/associations on models
instead of passing an :exportable option to
ActiveRecord::Associations, simply define a constant
on the class containing exportable associations and
attributes. This is due to :exportable breaking
ActiveRecord, and we can't simply monkey-patch in
config/initializers because models are included in
migrations before the initializers are run

Change-Id: I11f1a6b4570c397d8e01010c517bc6efdac7afca
Reviewed-on: https://gerrit.instructure.com/33235
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-05-06 23:54:24 +00:00
Joseph Rodriguez 2d9cfc5ac4 moved Facebook code into gem
fixes: CNVS-12120

test plan:
- regression test facebook functionality

Change-Id: I041e726ee12f9eca8fc27ccdd049422073d1af15
Reviewed-on: https://gerrit.instructure.com/33595
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 22:32:15 +00:00
Raphael Weiner a13f85e0ed move twitter to gem
fixes: CNVS-12492

test-plan:
* Test that all things Twitter related still work

Change-Id: Ib656c5bfcb2dc8490a6fa6f214b0f6dce25ad181
Reviewed-on: https://gerrit.instructure.com/33193
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-05-05 20:08:27 +00:00
James Williams 7692af009a move all importing methods into models/importers
test plan:
* migration regressions

Change-Id: Ibed8d4820c05b9c69101b215932af32055c3e006
Reviewed-on: https://gerrit.instructure.com/33728
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-05-02 17:31:15 +00:00
Jacob Fugal ec8dc289f9 default subaccount time zone to root account tz
refs CNVS-9312

we don't ever look at the default time zone on a subaccount (or
at least shouldn't). but if we happen to, default to the root account's
default time zone, rather than going straight to Mountain. but if we
happen to look at this field for a subaccount that has set it (rare, can
only be achieved through API, UI disallows it, and it's probably wrong
to do), go ahead and honor it. we may remove that in the future

test-plan:
 - have a root account with Eastern as default time zone
 - create a sub account under that root account
 - in script/console, check value of subaccount.default_time_zone; it
   should match be Eastern
 - set subaccount.default_time_zone to 'America/New_York'
 - reload and check value; should still be 'America/New_York'
 - clear default_time_zone on both subaccount and root account (e.g.
   assign nil to the field)
 - check subaccount.default_time_zone; should be Mountain

Change-Id: Ib32932159db926a9a92dd889ae60c9c12e0a94d9
Reviewed-on: https://gerrit.instructure.com/32789
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-05-01 14:09:58 +00:00
Derek DeVries d7228c4edf force draft state enabled to see fabulous quizzes
the new ember quizzes ui isn't going to work pre draft state, but will be
released before draft state is the default interface for everyone. This change
is to make sure that enabling the new quiz interface forces draft state to
be enabled. It also adds logic so that when we remove the enable fabulous
quizzes flag that we still ensure that draft state is enabled to see it.

fixes CNVS-12614

test plan:
  - disable draft state
  - enable fabulous quizzes
  - draft state should be enabled automatically

Change-Id: If2d2f3fecad1f72746cc17350abf018de5a9c79d
Reviewed-on: https://gerrit.instructure.com/34066
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-04-30 22:28:00 +00:00
Raphael Weiner 8be0ae37d7 Move google_docs code into a gem
fixes: CNVS-12329

Change-Id: I044725c93582cbca39a61e036bb5f0385e069c1e
Reviewed-on: https://gerrit.instructure.com/32990
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-25 21:50:43 +00:00
Jon Jensen d4b4129950 customize "Canvas" in registration confirmation email, fixes CAT-128
add a product_name account setting to allow schools to customize the
registration confirmation email. ostensibly this setting could be used
throughout canvas to allow greater customization, but let's not get ahead
of ourselves

test plan:
1. on your root account, set settings[:product_name] to something
2. /register as a new user
3. confirm that the "set a password" email uses that product name in the
   header and body

Change-Id: I6e0d5aa8ad80c4cda40e2aac1367364293843627
Reviewed-on: https://gerrit.instructure.com/33846
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-25 18:51:23 +00:00
Eric Adams 933bff25d3 Add integration Ids to API
fixes SIS-135
fixes SIS-136

Change-Id: Ide2f51765c76a50f09d54d2865357b5ff38bc360
Reviewed-on: https://gerrit.instructure.com/28587
Reviewed-by: Duane Johnson <duane@instructure.com>
Tested-by: Duane Johnson <duane@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Eric Adams <eadams@instructure.com>
2014-04-24 20:43:45 +00:00
Raphael Weiner 732d4991e5 extract linkedin into a gem and add tests
fixes: CNVS-12119

test plan:
regression test linkedin functionality

Change-Id: I9cec121d641db37d4c8f6a04966e766e9f8b293e
Reviewed-on: https://gerrit.instructure.com/33473
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 20:23:55 +00:00
Sterling Cobb 01fbc15817 add translations to account settings
The account settings were not being translated. It should now be
translated.

Test Plan
1. Go to the account settings page.
2. Ensure that the account settings page is translated properly.

fixes CNVS-9804

Change-Id: Ib2768302fb9745b59be311244ed4f080bb6448ee
Reviewed-on: https://gerrit.instructure.com/28404
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-04-22 16:27:24 +00:00
Anthus Williams c0bde16e77 export account using open_data_export
open_data_export adds an option called exportable
to AR associations. If set to a truthy value, that
association is included in exports. This commit sets
this value (inside a CANVAS_RAILS2 guard) for
associations we want open_data_export to include

Change-Id: Idf8163f3139aafbf34e4e78b94dea6be87bd1cd2
Reviewed-on: https://gerrit.instructure.com/30308
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
QA-Review: Anthus Williams <awilliams@instructure.com>
2014-04-04 22:41:04 +00:00
Joseph Rodriguez ccd8b38d6a Extract canvas_http into seperate gem.
Change-Id: Ib90c12b99d30853a0a1a0235c9aa1b5dd645f614
fixes: CNVS-11949
Reviewed-on: https://gerrit.instructure.com/32176
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: August Thornton <august@instructure.com>
2014-04-02 17:22:38 +00:00
Michael Ziwisky 311738d5b3 add dashboard_url setting to root accounts
fixes CAT-13

test plan:
- in rails console (for canvas):
-- a = Account.default
-- a.settings[:dashboard_url] = 'http://www.hackaday.com'
-- a.save
- visit canvas root url
-- if already logged in, you'll be redirected to hackaday.com
-- else, log in, then you'll be redirected to hackaday.com

Change-Id: Ib6e48ae9c3be3761810f0e859b441dcc2edd1f23
Reviewed-on: https://gerrit.instructure.com/32011
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-03-24 16:22:22 +00:00
Cody Cutrer 14a41e2f38 fix accounts_api_spec for rails 3
Change-Id: Idef90849f31744c692563b68c73a9713915177de
Reviewed-on: https://gerrit.instructure.com/31617
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-03-10 16:51:27 +00:00
Jason Madsen fc78d7a0b1 add js kaltura uploader
closes CNVS-6506

test plan:
  - enable kaltura plugin as site admin
  - enable js_kaltura_uploader on Account.default.settings
  - go to assignment that has kaltura record / upload enabled as student
  - upload a file via the RCE
    - experience should mimic existing flash uploader
    - verify that audio and video recording continue working as before
  - disable js_kaltura_uploader on Account.default.settings
  - as student attempt to upload to assignment
    - verify that it continues to work as before

Change-Id: I1f4ba5ac5df5e023f74046f33d7c623cac924ee3
Reviewed-on: https://gerrit.instructure.com/30340
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-03-05 22:48:54 +00:00
Cody Cutrer 0b04882f17 query the account's shard for enrollments in account policy block
refs CNVS-11420

Change-Id: Iedd7d6b97b19fa636d6cdd536ca7e5914ef12743
Reviewed-on: https://gerrit.instructure.com/31001
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-02-27 23:13:55 +00:00
Michael Ziwisky edd51164af add control of self-enrollment type thru admin ui
fixes CNVS-10911

test plan:
- Navigate to /accounts/:id_of_root_acct/settings
- Toggle the 'Self Registration' feature -- when its checked, you should
  get a radio group to pick "All Account Types" or "Observer Accounts Only"
- In another tab, navigate to /login. It should render as follows:
  - Self Registration disabled : no banner
  - Self Registration enabled and
    - All Account Types chosen : "Need a Canvas Account?" banner
    - Observer Accounts Only chosen : "Parent of a Canvas User?" banner

Change-Id: Ie14e611f19afc00dfe363e765972b9959a2a34b0
Reviewed-on: https://gerrit.instructure.com/30620
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-02-25 20:40:39 +00:00
Raphael Weiner 644b29d12f extract auto_handle to new canvas_uuid gem
Change-Id: Ic226e61e900532cc3acf08444b316b6e2bb6b368
Reviewed-on: https://gerrit.instructure.com/30049
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-02-25 19:30:59 +00:00
James Williams 492c8480c5 use user id instead of user as key for @account_users_cache
Change-Id: I9cecab385e101a1fc035455ff98d7e30defc27be
Reviewed-on: https://gerrit.instructure.com/29463
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:02:22 +00:00
Rob Orton 2e646c7902 add method to find account by domain
test plan
 - specs should pass

Change-Id: I7b2f6bea30afd791b256fed14ea2d693ced66410
Reviewed-on: https://gerrit.instructure.com/27862
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Anthus Williams <awilliams@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-12-26 22:58:31 +00:00
Derek DeVries 6d657305e4 add ability to restrict students from viewing quiz questions after course conclusion
closes CNVS-9849

test plan:
  story 1:
  - as a site admin
    - go to the account settings page and view the "Account settings" section
    - check "Restrict students from viewing quiz questions after course end date"

  - as a teacher
    - create a quiz for a course
    - allow the student to see their quiz questions and answers

  - as a student
    - take the quiz
    - you should be able to see the quiz questions and answers

  - as a teacher
    - conclude the course that contains this quiz

  - as a student
    - you should no longer be able to see the questions and answers

  story 2:
  - as a site admin
    - go to the account settings page and view the "Account settings" section
    - uncheck "Restrict students from viewing quiz questions after course end date"

  - as a teacher
    - create a quiz for a course
    - allow the student to see their quiz questions and answers

  - as a student
    - take the quiz
    - you should be able to see the quiz questions and answers

  - as a teacher
    - conclude the course that contains this quiz

  - as a student
    - you should still be able to see the questions and answers after course conclusion

Change-Id: I8aa932c79cbd9fe1288ee7f2a49fb3c143430cab
Reviewed-on: https://gerrit.instructure.com/27749
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-12-20 22:05:21 +00:00
Cody Cutrer f6aaf35cb2 fix cache invalidation of all site admin users
fixes CNVS-10007

it's only invalidated on the default shard, so only cache it on the default shard

test plan:
 * as a site admin, visit a second shard
 * go back to site admin, and add a new user
 * log in as that user
 * try to visit the second shard
 * it should work immediately

Change-Id: I5a0dc6fde72e9171ee5e49d8221961ec02d35ebb
Reviewed-on: https://gerrit.instructure.com/27602
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-12-18 21:54:19 +00:00
Michael Ziwisky 130a150625 Add optional parent coenrolment banner on /login page
fixes CNVS-9350

test plan:
1. Enable the parent coenrolment banner through script/console with:
    a = Account.default;
    a.settings[:self_registration] = true;
    a.settings[:self_registration_type] = 'observer'
    a.save;
2. Verify that /login shows "click here for a parent account" banner.
3. Click that banner.
4. Verify that clicking "Start Participating" without filling out the
   form pops up all of the "Required field" error messages.
5. Verify that submitting bad info (e.g. an email address without an @
   sign) pops up appropriate error messages as well.
6. Enter good info (using a student account you previously registered)
   and verify that you get the the /?registration_success=1 page.

Change-Id: I9920f8599beafee584d574f4f6748d8a298a8bd2
Reviewed-on: https://gerrit.instructure.com/26680
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-12-10 18:22:33 +00:00
Jon Jensen 095a7ee6e2 turn on new groups by default, closes CNVS-9878
test plan:
1. go into an account that doesn't have the enable_manage_groups2 setting
   set yet.
2. you should see the new group management ui
3. set it to true
4. you should still see the new ui
5. set it to false
6. you should see the old ui again

Change-Id: Ifdf5a75423370013be8e4747e1cb512e69db8ecb
Reviewed-on: https://gerrit.instructure.com/27116
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-12-09 17:18:58 +00:00
Jacob Fugal 34893f80bd remove uses of memoize
fixes CNVS-9331

instead, as appropriate, use one of (or a combination of, if necessary):

 * instance variable caching
 * Rails.cache
 * query caching (implicit)

also:

 * remove the buggy cc.active_pseudonyms (didn't account for
   sharding) in favor of cc.user.all_active_pseudonyms
 * streamline assignments in the menu to not need to construct method
   names

test-plan: N/A

Change-Id: Id0dec60464a283985e39493b90711b32cb5cca82
Reviewed-on: https://gerrit.instructure.com/26936
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2013-12-06 22:03:24 +00:00
Zach Pendleton 52442f70c2 remove agenda flag account setting
fixes CNVS-9847

test plan:
  * verify that you can successfully view agenda view
    as any user and that it behaves as expected.

Change-Id: I7534bff4904e62ac17582e7652fcf178b3f72332
Reviewed-on: https://gerrit.instructure.com/27018
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-12-05 23:52:27 +00:00
Jeremy Stanley dcf3df456b move draft state under feature flag umbrella
fixes CNVS-9496

test plan:
 - draft state feature should show up in site admin feature
   flags, or root account feature flags when called as site
   admin
 - when site admin hits "allow" for the feature, it should
   appear in the root account administrator's settings
   in "Off" state
 - the root account admin should be able to "Allow" the setting
   which allows a sub-account or course to turn it on
 - when the feature is turned on via the Feature Settings tab
   or features API, draft state functionality should appear
   in the course wiki pages and elsewhere

Change-Id: Id7403f2a8371b0a7bfebffbb8f29330fff5c94c5
Reviewed-on: https://gerrit.instructure.com/26308
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2013-11-26 20:43:49 +00:00
Paul Hinze ecbf218f10 remove legacy comment; add explicative comment
Change-Id: I7a70ec391d1c17e070b8d0e8714dddfc22a45bd3
Reviewed-on: https://gerrit.instructure.com/26714
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
2013-11-26 16:57:09 +00:00
Jacob Fugal cd892fe723 clean up context.users_not_in_group
for rails3 and folio

fixes CNVS-8790

test-plan:
 - validate pagination of unassigned group members both for course
   groups and account groups

Change-Id: Ic9e842abdbfba714829a123ca0dee4f93e5a1fdc
Reviewed-on: https://gerrit.instructure.com/26534
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-25 16:37:50 +00:00
Zach Pendleton 557a3dae9e restrict google doc submissions by domain
fixes CNVS-8949

test plan:
  * from a rails console, run the following:

    account = Account.default
    account.settings[:google_docs_domain] = 'example.com'
    account.save!

  * as a student, configure your google docs integration
    from your profile page;
  * attempt to submit an assignment that allows file
    uploads using the "google docs" tab of the submissions
    box;
  * verify that a message is displayed informing you that
    cannot use a google doc because your domain is
    incorrect;
  * as another user who shares a course with the first
    student, create a google doc collaboration and add
    the first student to it;
  * verify that the first student cannot join the
    collaboration;
  * change the account :gmail_domain setting to 'gmail.com'
    and verify that both assignment submissions and
    collaborations work as expected;
  * verify that if you delete the gmail domain account
    setting, both google doc submissions and collaborations
    work as expected for users with google docs integration
    configured.

note: users added to a collaboration without a valid google
docs address will receive a notification about the
collaboration, but will not be able to join it. this is
pre-existing behavior.

Change-Id: I26f164f253710819214ccf5f2250b74b91a6774b
Reviewed-on: https://gerrit.instructure.com/26436
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-11-23 17:10:31 +00:00
Jeremy Stanley 0e075a24b4 feature flags infrastructure and API
test plan:
 - install the test_features plugin (since no real features exist yet)
 - render and consult the feature flags documentation
 - have a test environment with a root account,
   sub-account, course in sub-account, and user

 - Use the "list features" endpoint as a root account admin
   (with no site admin privileges), on the root account context, and
   confirm that hidden features do not show up
 - Use the "list features" endpoint as a site admin user,
   on the root account context, and confirm that hidden features
   show up
 - Use the "list features" endpoint on the site admin account
   and confirm the hidden features show up

 - Use the "set feature flag" endpoint on a hidden feature on site
   admin and ensure the feature becomes visible in all root accounts
 - Use the "set feature flag endpoint" on a hidden feature on a
   single root account, and ensure the feature becomes visible to
   that root account and not others

 - Confirm that root_opt_in features appear "Off" by default
   in root accounts, after being "Allowed" in code or site admin

 - Confirm a feature flag that is set to "on" or "off" (vs. "allowed")
   cannot be overridden in a lower context (and the API returns
   locked=true for them)

 - Confirm that setting locking_account_id requires admin rights
   in the locking account
 - Confirm that a feature flag with locking_account_id cannot be
   changed without admin rights in the locking account (e.g.,
   set a feature flag on a course, locked with the root account's id,
   and make sure a teacher who is not an account admin can't change it)

 - Confirm feature flags can be deleted with the "remove feature flag"
   endpoint (and they are only deleted where they are defined, not
   when called on an object that inherits a flag)

Change-Id: I3e12e23b4454889b6e8b263f1315e82d8f2ada52
Reviewed-on: https://gerrit.instructure.com/25502
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2013-11-19 20:50:03 +00:00
Jacob Fugal 16ff9df28a fix API pagination in AccountsController#index
refs CNVS-8958

@current_user.all_accounts was a fully instantiated collection;
paginating it did no real good besides spreading the results over
multiple requests while still loading the full collection for each page.

instead, use bookmarked with_each_shard pagination on the uninstantiated
scope. needs to be a method on User to parallel User#all_accounts in case a
plugin wants to augment User#all_accounts -- it should have somewhere to
hook to augment the paginatable version as well.

test-plan:
 - /api/v1/accounts API still works when logged in
 - the next page links change to bookmark page values, but otherwise
   still give the same page contents
 - the queries on the accounts table executed in the DB for the API call
   have LIMIT clauses

Change-Id: I38a466d28b277fff4611b9d268c3d209bf6a1dfe
Reviewed-on: https://gerrit.instructure.com/25878
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-05 16:11:56 +00:00
Jason Madsen 44766218ae remove feature flag for quiz regrade
closes CNVS-9075

test plan:
- create a quiz with at least one question
- take quiz as a student
- edit quiz as instructor and choose different correct answer
- verify that quiz regrade options display for all instructor accounts

Change-Id: I1e44de97994010d4491bf395a00b6d4a250d9ab6
Reviewed-on: https://gerrit.instructure.com/25850
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2013-10-31 20:53:46 +00:00
Rob Orton 9cae25c185 record when a quiz or user gets deleted
also force deleted_at to be utc

test plan
 - delete a user
 - the user should have deleted_at populated
 - delete a quiz
 - the quiz should have deleted_at populated

Change-Id: Ibf3442b832f648d754ac9959f053570bc8c06a19
Reviewed-on: https://gerrit.instructure.com/25585
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
2013-10-29 23:07:12 +00:00
Cody Cutrer d1cf76c786 add "none" scope
forward compatible with Rails 4 where it's actually implemented
efficiently

Change-Id: I037b5dafbc26e0bf143c84831339fa36faba60be
Reviewed-on: https://gerrit.instructure.com/25682
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-29 20:25:45 +00:00
Jon Jensen a9d44ffd50 restyle new group management ui, fixes CNVS-8123
refer to mockups

test plan:
1. the UI should work
2. user/group counts and info should update correctly as you do stuff
3. the UI should look like the mockups

Change-Id: Ifbf90abadf00885790328b4338eb51a4ca4b8b6c
Reviewed-on: https://gerrit.instructure.com/24556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-10-25 19:28:07 +00:00
Stanley Stuart 8133df715d account setting for new quiz front end
test plan:
  - specs pass.

Fixes CNVS-8812

Change-Id: I2b0ac73e645cd87c51e6cf68ed0334d28aaacc87
Reviewed-on: https://gerrit.instructure.com/25475
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
QA-Review: Stanley Stuart <stanley@instructure.com>
2013-10-21 20:58:28 +00:00
Cody Cutrer d935ab98b1 deprecate Setting.get_cached
now that we have SIGHUP, we were changing everything to it anyway,
so just let caching in-proc be the default

Change-Id: Id1b44722522ac9693b17695da7107c99a359d5ac
Reviewed-on: https://gerrit.instructure.com/25020
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-10 00:42:52 +00:00
Cody Cutrer 0c82bd3f3b remove some cache expirations for things that are properly invalidated
Change-Id: Ie9d903b791a96f24faabeccf399c59c26338a893
Reviewed-on: https://gerrit.instructure.com/25022
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-09 23:38:49 +00:00
Zach Pendleton 86f371f9d8 add agenda view setting to root accounts
fixes CNVS-8676

test plan:
  * from the console, enable the "agenda_view" setting
    on your root account;
  * verify that it works.

Change-Id: I5b20773ce8fc9496a5c5cd07c628ce2638b29d89
Reviewed-on: https://gerrit.instructure.com/25071
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-10-07 23:00:27 +00:00
Jon Jensen 67c29b7660 group category create/edit dialogs, fixes CNVS-6659
feature parity with the old UI

also add account setting to enable the new UI

reorg some code so we can more easily rip out all the old stuff once we
are done

sass->scss since it's the new hotness

add reorder() method to CollectionView for when things change

test plan:
1. in the console, set the enable_manage_groups2 setting to true on your
   account
2. run delayed_jobs
3. go to the manage groups page
4. you should see the new groups UI
5. you should be able to add a new group set
6. you should be able to edit a group set
7. the tabs should be alphabetical (adding/updating a set should put it in
   the correct spot)
8. auto-creating/splitting groups should work when creating a set

Change-Id: I55f9e7785a0114954a3583257a78f71e78f47b5f
Reviewed-on: https://gerrit.instructure.com/22458
Reviewed-by: Mark Ericksen <marke@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-09-18 19:43:49 +00:00
Stanley Stuart 41e27ec77a put quiz regrade behind a flag
test plan:
  - As a teacher, create a quiz with a few questions.
  - As a student, take the quiz.
  - As a teacher in an account without the :enable_quiz_regrade setting,
    you should not see quiz regrade options when editing the answer
    for a quiz question.
  - Enable quiz regrading by calling Account.all.each(&:enable_quiz_regrade!)
  - As the teacher, you should now be able to set a quiz regrade option
    when changing the answer to a quiz question.

fixes CNVS-8136

Change-Id: Ic19893441d3a111cd4824c99a9a4b9ba1985505d
Reviewed-on: https://gerrit.instructure.com/24341
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-09-13 20:17:42 +00:00
Cody Cutrer d3f0b18684 validate nullness in the db on a bunch of columns
fixes CNVS-7414

Change-Id: I60978f66d88d916dc5736dbb975715172bd1e14b
Reviewed-on: https://gerrit.instructure.com/23141
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-09-12 22:20:39 +00:00
Stanley Stuart dfb665fc03 don't show speedgrader for unpublished assignments and quizzes
Hides SpeedGrader links and redirects to the show page for an assignment
or quiz that is "unpublished" and its context is draft state enabled.

test plan:
  - Make sure you have draft state enabled for your account.
  - Create an assignment and a quiz. Ensure the following:
    - The SpeedGrader link is not visible on page load when the item is
      unpublished.
    - The SpeedGrader link is visible on page load when the item is
      published.
  - For the assignment show page only:
    - Toggling the item's published state using the publish button
      should show/hide the SpeedGrader link appropriately.
  - Republish the quiz and assignment. Save their SpeedGrader urls
    somewhere handy. Now unpublish both of them again. Try to visit each
    url. You should be redirected back to the item's show page with a
    friendly flash message indicating that SpeedGrader is only available
    for published assignments.
  - Create a discussion topic that can be graded.
    - Unpublish it from the assignments index page.
    - On its show page, you should not see a link to speedgrader under
      admin links.
    - Republish it.
    - On its show page, you should see a link to speedgrader under
      admin links.
  - Clicking "publish" on the assignments index page should toggle the
    published status on the quiz show page, and vice versa.

Also creates a useful "enable_draft!" method on the Account model for
an easy way to enable draft state on an account rather than repeating
the setup code over and over again in various places.

fixes CNVS-7194

Change-Id: If3880c0439f3a6e63f59417c55e0e0f617c3c5ce
Reviewed-on: https://gerrit.instructure.com/23805
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-08-28 21:58:11 +00:00
Cody Cutrer a8596e9b68 cache some settings
we can SIGHUP if we ever change them

Change-Id: I0e7d0fa63ce0e368e890eb7ea8d5e657fa3820a1
Reviewed-on: https://gerrit.instructure.com/23729
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
2013-08-26 17:54:56 +00:00
Mark Ericksen 314e1423a4 add model and javascript validations for accounts
fixes CNVS-3047

testing steps:
- create a new account
- edit the account and remove the "Account Name"
  try to save and verify an error displays
- edit the account name and make it longer than 255
  and verify it displays it is too long

Change-Id: I9437a16ea5f897a7ee214dcdb3b453599f99c1f7
Reviewed-on: https://gerrit.instructure.com/23465
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-08-22 17:40:06 +00:00
Jon Jensen d72b73b217 Revert "ensures all users accept terms of use"
Turns our we *do* want to grandfather in existing users :P

This reverts commit ae6d9033ac.

Change-Id: I7b109375a4844ef0291f0f72d89028b39d2289a0
Reviewed-on: https://gerrit.instructure.com/23384
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-08-16 16:44:40 +00:00
Zach Pendleton a7dd148274 create context-level enable_draft option.
test plan:
  * enable "enable_draft" on an account and verify that
    draft-state changes appear on its courses;
  * disable "enable_draft" on the account, enable
    "allow_draft" on the account, and enable "enable_draft"
    on a course and verify that draft-state changes appear
    for that course, but not for other courses in the
    account;
  * disable "allow_draft" on the account and verify that
    draft-state changes are disabled for all courses on the
    account, even if they have enable_draft set.
  * verify that draft_state changes are enabled/disabled on
    groups given the criteria above.

Change-Id: I6a28dea356c2c0af5bf04de2f20efaedfb17ab2c
Reviewed-on: https://gerrit.instructure.com/22136
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-08-16 15:19:39 +00:00
Landon Wilkins ae6d9033ac ensures all users accept terms of use
fixes CNVS-7385

test plan:
1) in a console:
  # grab a user of your choice
  u = User.find(5)
  # make it seem as if they have never accepted the terms before
  u.preferences[:accepted_terms] = nil
  u.save!
2) log in as that user
3) verify that you are required to accept the terms of use

Change-Id: Ibc314040f35d3d7418a3b31c7280188db86a552b
Reviewed-on: https://gerrit.instructure.com/23110
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-08-13 19:33:46 +00:00