Commit Graph

954 Commits

Author SHA1 Message Date
Nathan Mills 8eeb4f5bf0 refactor twitter to not be a mixin
fixes: CNVS-12118

test-plan:
*twitter integration should work

Change-Id: I44a9011eb451aaa8eb196264bb4b65d1635da083
Reviewed-on: https://gerrit.instructure.com/33065
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:17 +00:00
James Williams b9201e13f2 allow subaccount admins to move courses to other accounts
test plan:
* create a subaccount (the "parent" subaccount)
* create more children subaccounts within that parent subaccount
* create an account admin user for the parent subaccount
* create a course beloning to one of the children subaccounts

* as the account admin user, confirm that you can visit
 the course settings page and use the drop-down box to
 change the courses' account to any child account that
 belongs to the parent subaccount
* also confirm that the drop-down box does not show accounts
 outside the parent subaccount (even if they're on the same root
 account)

fixes #CNVS-10501

Change-Id: I1d7cae8a19b926cabb3473ba950d29ab08ad25ce
Reviewed-on: https://gerrit.instructure.com/34009
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-05-05 16:43:00 +00:00
Derek DeVries 1168ed5ab4 make show/moderate/statistics actions redirect to fabulous quizzes when enabled
fixes CNVS-12752, CNVS-12753, CNVS-12754

test plan:
  - turn fabulous quizzes off
  - visit an individual quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the overview tab on fabulous quizzes
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437

  - turn fabulous quizzes off
  - visit the quiz moderate page for a quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the moderate tab on fabulous quizzes
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437/moderate

  - turn fabulous quizzes off
  - visit the quiz statistics page for a quiz with fabulous quizzes turned off
  - switch fabulous quizzes on
  - refresh the page
  - it should redirect to the statistics tab on fabulous quizzes (which is
    currently an empty page)
  - the url should be something like: /courses/1/quizzes/fabulous_quizzes#/437/statistics

  - turn fabulous quizzes on
  - edit a quiz
  - when you save the quiz, it should redirect to the overview tab

  - try other variations which should bring you back to the show/moderate/stats
    pages. They should all bring you to the correct tabs on fabulous now

Change-Id: I85e8b628c0562d72c72a30e4e8340dd2cc0adcac
Reviewed-on: https://gerrit.instructure.com/34112
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-05-03 18:18:56 +00:00
Jeff Belser 9073310d9c canvas help menu links are not being translated to current locale setting
fixes CNVS-5441

Test Plan
  1. Configure your default account to display the 'Help' link across
     the top identity navbar and footer areas
  2. Log in and navigate to a user's settings page: '/profile/settings'
  3. Click the 'Edit Settings' button and then select a new language
     preference from the dropdown. Select something other than english,
     and then click the 'Update Settings' button to confirm
  4. Across the header or footer of the page click the 'Help' link to open
     the modal
  5. Ensure the text displayed is rendered in your currently set
     language preference
  6. Repeat previous steps to confirm that the modal text updates properly
     after selecting a new language preference

Change-Id: I6423ee1598198cf7c21902d0acedd886cae6bfc3
Reviewed-on: https://gerrit.instructure.com/34142
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Michael Ziwisky <mziwisky@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
2014-05-02 19:57:38 +00:00
Nathan Mills 079f2d60cc force navigation tabs cache to invalidate when changing external tools
fixes:PLAT-277

test plan:
1. Go to https://www.eduappcenter.com/apps/redirect
2. Enter criteria for a redirect link configuration URL
3. Access an account in Canvas
4. Add the Redirect External Tool with your configuration URL
5. Observe link is added to your Navigation per your settings
6. Attempt to edit the External Tool in Canvas with a new configuration URL you get from https://www.eduappcenter.com/apps/redirect after putting in new data
7. Observe that changes are reflected in the External Tools tab but the actual link in Navigation menus is changed

Change-Id: I2b233cb89e4b446cd66b6e826ec8de894a02bfdd
Reviewed-on: https://gerrit.instructure.com/33757
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Nathan Mills <nathanm@instructure.com>
2014-05-02 16:49:14 +00:00
Michael Nomitch d7b5b7f09a new assignment index for course homepage
fixes CNVS-10988

test plan:
  - as a teacher with draft state on
    - set the homepage to show assignments
      - the homepage should look like student view
      - it should look good
      - it should function normally
      - you should be able to change the homepage to another view
    - view it as a student
      - it should work normally
  - as a teacher with draft state off
    - the homepage should look like the old one
    - it should function as usual
    - you should be able to swith the homepage
  - the actual DS assignment index page should work normally
  - set multiple due dates for assignments
    - teacher should see multiple dates
    - students should see their date only
    - try to break this somehow
  - on the homepage
    - if you have it full screen, date available until should be there
    - if you shrink the screen to a size where there is overlap AND reload
      - date available until should go away so there is no overlap

  - make a several assignments with different grading types
    - teacher & student homepage grade column should look okay

Change-Id: I4ff101c05d18592a5c92dc2650eee406116ba4c5
Reviewed-on: https://gerrit.instructure.com/31522
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2014-05-02 16:48:14 +00:00
Mark Severson c0480a4dc5 rework module progressions evaluation
test plan:
 * regress module progression workflow for students
   - student progress should always be up-to-date

fixes CNVS-11818

Change-Id: Ib6b4ccf7b93bc490726fe2bf75333d75f1572ee0
Reviewed-on: https://gerrit.instructure.com/31575
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-05-01 16:42:07 +00:00
James Williams 4f8db4801a prevent disallowed users from editing name and title in profile
test plan:
* in the account settings, check "Enable Profiles", and
uncheck "Users can edit display name"
* as a non-admin user, go to your user profile page
 ("/about/:user_id"), and click "Edit Profile"
* should not allow you to edit your name or title

fixes #CNVS-2583

Change-Id: Ib5ade72bcfbcd9bc89070888db46586e687fc812
Reviewed-on: https://gerrit.instructure.com/33987
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-05-01 12:20:23 +00:00
David Julia 12949cb829 Prefer mp3 for audio comments in api_user_content
When preparing user content for public consumption via the API, we were
hardcoding a media_type of mp4, which prevented clients using API
endpoints (specifically the mobile client) from playing audio comments
which only had mp3 sources.

This adds a new path through media_download that prefers mp3 for audio
media but falls back to the old mp4 behavior. We also maintain backwards
compatibility with other callers using the file_extension based
filtering.

NTRS-43

Test Plan:
 - With both a 'wav' and an 'mp3' sample file:
   - Create an announcement and upload an audio file via the RTE
   - Wait for transcoding to complete in Kaltura
   - The file should play properly in the web browser
   - Open the same announcement in the iOS mobile app
   - The audio file should play properly on the phone

Change-Id: I26735096ea4336cf1acc04eb9649d322f68fa515
Signed-off-by: Paul Hinze <paulh@instructure.com>
Reviewed-on: https://gerrit.instructure.com/33318
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2014-04-30 20:00:13 +00:00
Cody Cutrer 109006b549 fix permission checks around pseudonym creation
fixes CNVS-12633

test plan:
 * create an admin in account A
 * create a user in account B
 * admin in A should get permission denied trying to create a pseudonym
   in A for user from B
 * user from B should get permission denied trying to create a
   pseudonym for himself in A

Change-Id: Ie548122be01a4eeb4a2ffaaf85e28a775eb7fe66
Reviewed-on: https://gerrit.instructure.com/33804
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-04-28 17:20:20 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Joel Hough 53db21e37b extract secure-id handling from incoming message processor
fixes CNVS-12147

test plan
- regression test incoming mail

Change-Id: Id3d8a95dda3566bae8d395d1b759c7897ab3c1ee
Reviewed-on: https://gerrit.instructure.com/32671
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:53 +00:00
Joseph Rodriguez d88a31330f convert class methods to instance methods for IncomingMessageProcessor
fixes CNVS-12129

test plan
- regression on incoming mail

Change-Id: Ia9ab3419201c9fdbd89e2483a3fde51f54c7f982
Reviewed-on: https://gerrit.instructure.com/32594
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:04:27 +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
Raphael Weiner c8d7b9f915 Further decoupling of google_docs from models and controllers.
fixes: CNVS-12328

test plan:
  - as admin enable the google_doc plugin
  - as student visit `/profile/settings`
  - click 'Google Docs' under the 'Other Services' section
  - click 'Authorize Google Doc Access' in modal
  - when redirect to google, click 'Allow access'
  - verify success banner displays

Change-Id: I2b45ffa38ac0d1d810fb988335f4cd39154ae2a6
Reviewed-on: https://gerrit.instructure.com/32949
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:34 +00:00
Brian Palmer 1a214eb430 integrate rack-mini-profiler for in-app perf measurements
Only site admins with the "Application Profiling" permission will see
this UI or be able to trigger profilings. The little UI that shows up in
the top left corner contains information on request timings, renderings,
AR queries and timings, and other information about the request.

When Redis is configured, you can share this information with others
(until it drops out of Redis) using a special link given in the UI.

closes CNVS-12563

test plan:

As a full site admin
  * enable the profiling UI by appending ?pp=enable to a request
  * visit canvas pages and verify you can see the new profiling UI

Verify that for all non site admins, the UI doesn't show up and cannot
be enabled with ?pp=enable. It also can't be enabled by other site admin
roles unless permission is given in the site admin permissions UI.

You don't need to do in-depth testing of the UI itself, though do a
quick smoke test to make sure it doesn't interfere with canvas at all or
modify the HTML returned for non-site-admins.

Change-Id: I4e71389af6b56bdff3617170c16b2ee70cea5c6f
Reviewed-on: https://gerrit.instructure.com/33541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-04-25 15:40:44 +00:00
Jeremy Stanley 3c7fd25a9d update attachment#user_id when replacing file content
test plan:
 - have two users in a course that can manage files
   (such as a teacher and a designer)
 - as user A, upload several small text files
 - as user B, on the files page,
   - rename a file
   - move a file to another directory
   - edit the content of a file
 - go to the console and examine the user_id property
   of each of these files.  the one whose content was
   changed should refer to user B; the others should
   remain with user A.

refs CNVS-11219

Change-Id: I8c6b284b3855df52a804f15cd25e514b33be0fb6
Reviewed-on: https://gerrit.instructure.com/33518
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-04-24 20:59:03 +00:00
Joseph Rodriguez e0a5065086 replace usages of Quiz#find_or_create_submission with SubmissionManager#find_or_create_submission
fixes: CNVS-12598

  test plan:
    - create a quiz as an instructor
    - as a student
    - take quiz
    - exercise all paths by which a quiz submission is generated
    - verify that quiz submissions continue to work as before

Change-Id: I9fd71679e6c9a45686861609ff481f5f4250cca1
Reviewed-on: https://gerrit.instructure.com/33735
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>
2014-04-24 19:33:08 +00:00
Michael Nomitch 0a8fa96417 gradebook url changes
fixes CNVS-11966

test plan:
  - with srgb feature flag enabled
    - cant get to gb1
    - /gradebook takes you to your preference
    - switching saves the preference
    - student behavior is normal

  - with srgb feature flag disabled
    - cant get to srgb
    - /gradebook goes to gb1
    - /gradebook2 goes to gb2
    - student behavior is normal

  - make sure all links to the GBs work
  - student grade summary should work as usual
  - with both FF settings, as a teacher checking a
    single student's grade should work as usual
  - courses with 'large rosters' get GB2 not GB1

Change-Id: I2a488fdfb5b3667c1d6cd21dc250ef3c50df101c
Reviewed-on: https://gerrit.instructure.com/33178
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Anna Koalenz <akoalenz@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-23 19:39:21 +00:00
Joseph Rodriguez 32f45d6956 remove #grade_submission from QuizSubmission
fixes: CNVS-12565

test plan:
- as a student take a quiz
- verify that:
  - background submissions are working
  - end of time / date submissions are working
  - manual submsissons are working
- verify various question types are graded correctly
- verify outcomes work as previously defined

Change-Id: Ia85141559e8026993c0e270267947128a5a0466b
Reviewed-on: https://gerrit.instructure.com/33669
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2014-04-23 19:28:03 +00:00
Stanley Stuart b6cbbdc0cd add a private API endpoint for getting quiz submission HTML
Test plan:
  - As a teacher and student, the quiz show page should show the quiz
    show page as usual with submission results at the bottom.

closes CNVS-12452

Change-Id: I5844c9594a769dd1d5204db9a7e841e23b789382
Reviewed-on: https://gerrit.instructure.com/33509
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2014-04-18 22:13:52 +00:00
Nick Houle 28ae67e917 pass user info in custom_dashboard url
fixes CAT-70

test-plan:
* in rails console:
* a = Account.root
* a.settings[:dashboard_url] = "http://www.google.com"
* a.save
* login to canvas
* verify that you are redirected to "http://www.google.com?current_user_id=123"
* where current_user_id equals the id of the user you logged in as

Change-Id: I3074f821fa4454b2a568228d00b1da60324b71a7
Reviewed-on: https://gerrit.instructure.com/33225
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-17 17:05:08 +00:00
Nick Houle decd207481 support for trusted developer keys
fixes CAT-66

Auto-authorize trusted developer keys during without prompting the end-
user. This will allow for more seamless integrations with other in-house
apps.

Also fix remember-me access so it works when you re-auth into canvas
(previously it only worked if you were already authenticated into
canvas)

Expand test coverage around oauth login scenarios

test plan setup:
* set up a web-based oauth integration with canvas
* ensure your app doesn't currently pass force_login=1 during oauth
* ensure your app doesn't currently delete access tokens during logout
* for part 2, ensure your app uses the /auth/userinfo scope (for part
  1 it doesn't matter)
* for part 3, ensure your app does token request flow (not userinfo)

test plan part 1 (trusted keys):
1. in the canvas console, set trusted=true on the app's developer key
2. do an oauth login as and end-user
3. confirm that you are authenticated into the app without being prompted
   to give it canvas access
4. log out of the app (but not canvas)
5. click to log in again
6. confirm that you are automagically logged in without any prompts

test plan part 2 (remember access):
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. check the box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are not prompted to authorize the app
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that you are automagically logged in without any prompts

test plan part 3 (untrusted key, not-userinfo)
1. in the canvas console, set trusted=false on the app's developer key (or
   set up your app to use a different one)
2. do an oauth login as and end-user
3. confirm that you are prompted to authorize the app
4. confirm there is no box to remember access
5. log out of canvas and the app
6. do an oauth login again
7. confirm you are prompted to authorize the app again
8. log out of the app (but not canvas)
9. click to log in again
10. confirm that are prompted to authorize the app again

Change-Id: Ifb2eb29e4da163b595cb070455ebae21a4618ba4
Reviewed-on: https://gerrit.instructure.com/32926
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>
2014-04-16 23:18:19 +00:00
Nick Cloward f1009a38fe canvas kaltura gem
fixes CNVS-10479

test plan:
  - in a course with kaltura enabled
    - go to a discussion and add media
    - upload a video (use right tab, not the webcam)
    - save the video/discussion post
    - the video should be saved properly and viewable
      (this sometimes takes a minute of two)

Change-Id: I40b9174807707dd1fb41125e04705422a8711d5d
Reviewed-on: https://gerrit.instructure.com/32024
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-16 19:39:45 +00:00
Anthus Williams 4050f5e0b3 remove OpenDataExport permissions/routes
the gem will handle the process of including them

Change-Id: I2237b4cad388756f91f67138a716ae5a8472d9df
Reviewed-on: https://gerrit.instructure.com/32586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2014-04-15 15:31:02 +00:00
Raphael Weiner 101cd37bb6 Cleanup google_docs
Change-Id: Iaa8545a3f39cd8708b1ea20a9c27836dcbdacb0a
Reviewed-on: https://gerrit.instructure.com/32860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:32:01 +00:00
Raphael Weiner 7054118441 Refactor google docs to be standalone not mixin.
fixes: CNVS-12096

Change-Id: I6fa7d6d57bfc9063b49334a8e528aaaa9fc7f8c2
Reviewed-on: https://gerrit.instructure.com/32715
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-04-10 17:31:39 +00:00
Michael Ziwisky 7e45a710b9 add option to force re-login for oauth, fixes CAT-68
test plan:
- login to canvas
- do an oauth login from an external app, or with a manual GET request
  according to Step 1 of the "Web Application Flow" at
  https://canvas.instructure.com/doc/api/file.oauth.html,
  and make sure you include the query param force_login=1
- verify that canvas sends you to /login
- verify that without the param force_login=1, canvas still sends you
  directly to /login/oauth2/confirm

Change-Id: I49cd43cc48edf46f192221f5cf8707ee00e0bd8a
Reviewed-on: https://gerrit.instructure.com/32988
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeff Belser <jbelser@instructure.com>
Reviewed-by: Nick Houle <nhoule@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2014-04-09 23:00:54 +00:00
Braden Anderson a4d56a3bd0 discussions: add "move to" option
fixes CNVS-9044; fixes CNVS-12110

test plan:

  * open discussions as a user with moderation permissions
  * click the gear menu on a pinned discussion topic
  * click the "Move To" option
  * select a new position for the discussion topic
  * verify that the discussion topic is moved
  * refresh the page
  * verify that the change persists

Change-Id: If118e41066d224dbb3153113c67372ecdd2b3007
Reviewed-on: https://gerrit.instructure.com/32423
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-04-02 22:50:40 +00:00
Braden Anderson 4f52a5e4c3 outcome gradebook: add export link
fixes CNVS-10638

test plan:
  * open outcome gradebook
  * select a section
  * click on "export report"
  * download and open the export
  * verify that the export format matches the Jira documentation
  * verify that the export data matches the data from your browser

Change-Id: I35bd78719880026b71b30da5794c9afe7dd31868
Reviewed-on: https://gerrit.instructure.com/31774
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-03-28 20:37:03 +00:00
Jeremy Stanley 254272b709 spec: fix race condition in module item cache test
fixes CNVS-11961

Change-Id: I668318ec150b17625187ad01deb09a66567bb34e
Reviewed-on: https://gerrit.instructure.com/32229
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-03-21 17:28:08 +00:00
Jeremy Stanley 95491c53bc cache assignment content tag info independently
test plan:
 - enable draft state in a course
 - create some assignments, quizzes, and graded discussions
   with due dates and points possible
 - add them to a module
 - the due dates and points possible should show up on
   the modules page
 - edit the due date and/or points possible on an assignment
   and return to the modules page
 - the changed information should be reflected on the modules page

fixes CNVS-11850

Change-Id: I7cb7eecc6744ff2df63888ff1ec83633e1e382a3
Reviewed-on: https://gerrit.instructure.com/32087
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Mark Severson <markse@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-03-21 00:57:46 +00:00
Jacob Fugal 1d8e7adf33 specify timezone and locale via ENV
and use them to initialize tz() during the common bundle

Change-Id: I0aa8215d4e83514be3ec2e5e1450df42185b8c83
Reviewed-on: https://gerrit.instructure.com/24674
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
2014-03-09 20:44:22 +00:00
Anthus Williams f37e5739b8 data export api
an API for queueing and retrieving
open_data_export jobs. Conforms to json_api
but does not yet actually schedule a job for
open_data_export

refs CNVS-10567
refs CNVS-10718

Change-Id: If554f7f4db49f1385b89fa810635886d0a7428e5
Reviewed-on: https://gerrit.instructure.com/28716
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-03-07 22:31:43 +00:00
Cody Cutrer 68b7dcc141 make grade passback specs more robust
especially in rails 3

just use stubs instead of starting up a second thread and opening a
connection

Change-Id: I52837c6ff65ed62a225c0a4df61c1a73df2a1526
Reviewed-on: https://gerrit.instructure.com/31320
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-03-06 15:23:50 +00:00
James Williams b272d916f6 spec: fix application controller spec for rails 3
keep it from breaking later integration/controller specs

Change-Id: I56d28459a1c732386c5b0a07fb3d9671ea91cde8
Reviewed-on: https://gerrit.instructure.com/31400
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-03-05 23:08:24 +00:00
Mark Severson 903e349c66 refactor evaluate/deep_evaluate logic
test plan:
 * full regression of all module progression functionality

closes CNVS-11505

Change-Id: I63f542d5d42f950cf9c8117e12ecce4518e2ccf4
Reviewed-on: https://gerrit.instructure.com/30983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-03-04 20:20:27 +00:00
Derek DeVries bee1f5f469 fix module item footer for quizzes
fixes CNVS-11540

when a url was built with the model name it replaced the namespace model
string of "quizzes/quiz" with "quizzes:quiz" so that the slash wouldn't mess
up the url. We need to translate this back before attempting to classify
the quiz string back to the class name.

test plan:
- add a quiz to a module with something before and after it in the module
- navigate to the quiz from the module
- the footer with prev/next links should appear

Change-Id: I559b646fb799f48c6782dc554eb26dca7f6b348b
Reviewed-on: https://gerrit.instructure.com/31215
QA-Review: Myller de Araujo <myller@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-03-04 19:13:24 +00:00
Cameron Sutter 9691cd1242 enable picking srgb as default
fixes CNVS-10403

test plan:
 - turn on srgb in course settings
 - in gb2, click the 'switch gradebooks' link
 - navigate to courses/:id/grades
   - it should load srgb
 - click the 'switch gradebooks' link
 - navigate to courses/:id/grades
   - it should load gb2

Change-Id: I8c41b9763be44c2c968d818ac4d8a909476361a7
Reviewed-on: https://gerrit.instructure.com/29841
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2014-02-28 15:59:10 +00:00
Cody Cutrer 90314aba32 use a single query instead of n queries to fetch latest account reports
refs CNVS-11420

test plan:
 * run an account report
 * refresh the settings page
 * it should show that it ran

Change-Id: Ie60570db1ceaff51a4dadd0c30357c333dcabf1c
Reviewed-on: https://gerrit.instructure.com/30995
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 22:06:53 +00:00
Cody Cutrer dbcf296348 fix several users controllers things for rails 3 specs
Change-Id: I678a8c5a0c5ac1e3e7095ba61671c469e818c76c
Reviewed-on: https://gerrit.instructure.com/30123
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-20 18:04:39 +00:00
Landon Wilkins f04316eb7f fix pseudonym_sessions_controller_spec for rails 3
Change-Id: I54e9874ae78d3f47d4392aefecb8f0668232ef1a
Reviewed-on: https://gerrit.instructure.com/30270
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-19 21:09:27 +00:00
Mark Severson e1e466b69b fix content tag state synchronization
test plan (non-draft-state):
 - as a teacher
   * create each of the following:
     - assignment
     - discussion
     - page (hidden from students)
     - page (not hidden from students)
     - quiz (leaving it unpublished)
   * add each of the above items to a module
   * refresh the modules page
     - each of the above items should be listed
 - as a student
   * navigate to the modules page
     - the hidden page and quiz should not be listed
     - all other items should be listed
   * click on the first item in the module
   * click through each of the 'Next' buttons
     - only items listed in the module should be presented

test plan (draft-state):
 - as a teacher
   * create each of the following:
     - assignment
     - discussion
     - page
     - quiz
   * add each of the above items to a module
   * refresh the modules page
     - each of the above items should be listed
 - as a student
   * navigate to the modules page
     - only published items should be visible
   * click on the first item in the module
   * click through each of the 'Next' buttons
     - only published items should be presented

   * publishing items (as a teacher) should make them available to the
     student in the module progression as well as the modules page

closes CNVS-10831

Change-Id: Ia84e56f42438ff531a4e15784eefaec2ead8ecdd
Reviewed-on: https://gerrit.instructure.com/30312
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
2014-02-19 20:36:59 +00:00
Joshua Simpson ae814421e0 namespace all of quiz into quizzes module
This commit namespaces the rest of quiz related code into a Quizzes
namespace: controllers, views, models, and classes that previously lived
under lib/ that are Quiz-related.

Test plan:

Full regression test on all quiz related items

refs CNVS-10457

Change-Id: If54b61213945056539e03271a936d233abb66188
Reviewed-on: https://gerrit.instructure.com/29351
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-02-18 22:17:13 +00:00
Cody Cutrer 5a37b27bf7 fix gradebooks_controller_spec for rails 3
Change-Id: I927859cd69aecf78c593cc5507144a01fc7340ed
Reviewed-on: https://gerrit.instructure.com/30094
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-02-18 16:24:44 +00:00
Jon Willesen d55a261ffb fix rails3 specs for rubrics_controller_spec
Change-Id: I5d842aa9dbba5c709eea637b8dc136eab787220f
Reviewed-on: https://gerrit.instructure.com/30172
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2014-02-14 23:24:03 +00:00
Derek DeVries 4654c34bef rails3: fix for erubis issues and quizzes controller specs
things fixed:
  - erubis is in actionpack gemspec in rails3, so we don't need it in the gemfile
  - don't directly initialize a SafeBuffer, and instead initialize OutputBuffer
  - Fix comparison of hash with indifferent access in quizzes spec
  - plugins in rails3 aren't loaded in init.rb so rails_xss is still being
    loaded in rails3. However we have parts of the code that actually reference
    rails_xss classes directly so we want to keep the RailsXss::Erubis constant
    defined in erubis.rb. However we don't want to actually monkey patch
    the activesupport or string methods anymore for xss (rails3 takes care of
    this for us)

Change-Id: I327bf042dfa7dcedd39acb463eda1420d3dbd98c
Reviewed-on: https://gerrit.instructure.com/30108
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-14 22:12:31 +00:00
Jon Willesen 39a7266315 remove unused actions in rubric_assessments_controller
the index and show actions are unused. the index view was
removed awhile ago in 91ce600f.

Change-Id: Ib84fc2e9e524aec3143a4395d15f9c1320798648
Reviewed-on: https://gerrit.instructure.com/29983
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2014-02-14 19:50:11 +00:00
Cody Cutrer a389fd18c1 rails 3 doesn't auto-require csv, so require it where necessary
Change-Id: Id76980c82024a082855f5b7b5b60cd7e760730a9
Reviewed-on: https://gerrit.instructure.com/30132
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-14 16:04:34 +00:00
Raphael Weiner 5f52dce2d4 replace Array#once_per extension with #uniq
Change-Id: I49111316d6cbc1f4be111567ed7f5e670d1d948c
Reviewed-on: https://gerrit.instructure.com/30023
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-13 18:53:05 +00:00
Landon Wilkins 2c8175ff2b fix pseudonyms_controller_spec rescue_action_in_public! calls for rails3
Change-Id: I610b1dd45b2554e50370a4a5a90ffb4937fc581e
Reviewed-on: https://gerrit.instructure.com/30073
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-13 17:01:53 +00:00
Landon Wilkins 445fabb60b fix submissions_controller_spec for rails3
Change-Id: I263bd8a98d6542c8fa469198ab2adec056276096
Reviewed-on: https://gerrit.instructure.com/30066
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-12 23:35:11 +00:00
Cody Cutrer dbc1db7daf don't destroy notification policies in Facebook preferences
find the existing policy if there is one, and reset missing ones instead
of destroying them

Change-Id: Iec50b29c5977ac727af1225f6c80260a5ef09d3d
Reviewed-on: https://gerrit.instructure.com/29998
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-12 21:08:14 +00:00
Jon Willesen d304497a36 spec: fix external_tools_controller_spec in rails3
Change-Id: Iab9cdcead5036b18542cb02720057b62ab103cd2
Reviewed-on: https://gerrit.instructure.com/29970
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2014-02-12 17:04:04 +00:00
Landon Wilkins ce49dc7ed9 fix groups_controller_spec for rails 3
Change-Id: Iafbe1ef3a274d3c2c863ff4ca7fbf16cb9d84fcb
Reviewed-on: https://gerrit.instructure.com/29900
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-12 15:49:52 +00:00
Cody Cutrer 0dab99896f fix AuditorApiControllerSpec
Change-Id: Ib9db48b357f8b4f2e0e333d07dbb4ac9533d2660
Reviewed-on: https://gerrit.instructure.com/29797
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-11 17:59:28 +00:00
Cody Cutrer 497dd2f917 fix context_modules_controller_spec for rails 3
Change-Id: I453aa576bad33454b669b6efc4810a15ad7bcdd7
Reviewed-on: https://gerrit.instructure.com/29844
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-02-11 17:08:11 +00:00
Cody Cutrer 17d84120f5 change response.redirected_to to response.should redirect_to for rails 3
Change-Id: I919e9f1eee81c972baa97832a6599fbb340eb82d
Reviewed-on: https://gerrit.instructure.com/29805
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-02-11 16:35:52 +00:00
Cody Cutrer 58d90d0c09 fix calendars_controller_spec for rails 3
Change-Id: If8a0540ff2cb6e5a9b45c36146f6a4fb83a94046
Reviewed-on: https://gerrit.instructure.com/29824
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-11 16:04:54 +00:00
Cody Cutrer de9bd8b898 fix files controller for rails 3 specs
* don't use respond_to if json is the only possible format
 * when filtering scribd_doc, rails 3 serializes as a hash with
   string keys, as opposed to a HashWithIndifferentAccess, so
   delete with string key
 * don't use StringIO as an uploaded file; Rails 3 TestCase will
   call to_param on it
 * don't require the .:format part of the public_url route

Change-Id: I282f529f1ee0941b52a996eefa01647a018f70d3
Reviewed-on: https://gerrit.instructure.com/29930
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-02-11 16:04:43 +00:00
Cody Cutrer d0cd2ec56c fix collaborations_controller_spec for rails 3
Change-Id: Ib6523c256cd9be2532ad969c9c8fa3dd5ed5962f
Reviewed-on: https://gerrit.instructure.com/29826
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-11 16:04:12 +00:00
Cody Cutrer 3584a6ee5c fix discussion topics controller spec for rails 3
Change-Id: Ic41d5a9fc528fab24cd54a23320b1b3a0218f87f
Reviewed-on: https://gerrit.instructure.com/29880
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-10 20:29:49 +00:00
Landon Wilkins dbdb481a46 removes unnecessary js_block from form_question
test plan:
* regression testing of quizzes (form_question)

Change-Id: Id492e23bc414d53370821c87e521552495523b8a
Reviewed-on: https://gerrit.instructure.com/29134
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-10 19:42:21 +00:00
Cody Cutrer bf120a0970 fix calendar events controller spec for rails 3
Change-Id: I70d15336115a118f4d36bf7fa3b0bc2b4f49bf6b
Reviewed-on: https://gerrit.instructure.com/29798
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-10 16:14:51 +00:00
Cody Cutrer cd7b02df17 use assert_status instead of checking response.status directly
since it's not a string in rails 3

Change-Id: Ib1859a3ca241bd64ca0c43b4ccfec94ba801eab6
Reviewed-on: https://gerrit.instructure.com/29780
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>
2014-02-08 14:06:53 +00:00
Derek DeVries 3d52c37671 fix rails3 spec that checks missing referer value
Change-Id: I6c36fd2b5be9cad941f60f852b0124ca8720dd46
Reviewed-on: https://gerrit.instructure.com/29807
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-07 21:18:31 +00:00
Nick Cloward 870bea1528 add course settings to update and created activity logs
refs: CNVS-392 (g/27807)

Since the settings for a course is stored in a hash it was not triggering
that changes were made on create or update.  This fixes it so that course
settings changes are also tracked in the course activity logs.  This also
fixes an issue where indexed was always showing as changed due to its
default value.  This fixes it so it will only set it when required.  Same
as locale.

Test Plan:
  - Change some course settings during create and update.
      hide_final_grade
      hide_distribution_graphs
      allow_student_discussion_topics
      allow_student_discussion_editing
      lock_all_announcements
      large_roster
      public_syllabus

  - Make sure those are included in the course activity log.

Change-Id: I798cfc255d683339ab69a2daba14495c5f15d7e4
Reviewed-on: https://gerrit.instructure.com/29394
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-02-07 20:34:24 +00:00
Ryan Florence 033c264a15 spec: fix ApplicationController specs rails3
- include does not check for "self" anymore
- we don't need complete_request_uri in rails3

Change-Id: Ifee1885056f0b84d80566ed15730a5359e502a51
Reviewed-on: https://gerrit.instructure.com/29772
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2014-02-07 20:14:34 +00:00
Derek DeVries 237e89713a fix specs for rails3 to expect a 404 response instead of catching an exception
Change-Id: I7af57c4fcae02f1ba5c0fe5e446a0b6229bc0ca4
Reviewed-on: https://gerrit.instructure.com/29796
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-07 20:01:34 +00:00
Jeremy Stanley a6446e5e37 allow unpublished module items to be reordered
test plan:
 - have a course with draft state enabled
 - have a bunch of unpublished module items
 - reorder them
 - reload the page and make sure the order sticks

fixes CNVS-10906

Change-Id: I47713b454cce41330803eb742455697b4a26e0b0
Reviewed-on: https://gerrit.instructure.com/29591
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-02-07 18:16:48 +00:00
Cody Cutrer 0fef098577 fix most assignments controller specs in rails 3
Change-Id: Ib96144c0cdd4be1c9599dd722cfaa7d9fcd1cdcf
Reviewed-on: https://gerrit.instructure.com/29778
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-02-07 15:18:00 +00:00
Derek DeVries 2d5ca8af7c rails3 specs for user lists controller
Change-Id: I598012d4e12c755e7d34398bdbf43836dece8563
Reviewed-on: https://gerrit.instructure.com/29770
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-07 03:17:09 +00:00
Derek DeVries 83ad124981 rails3 spec fixes for tokens controller
Change-Id: I132adfbd015504e1c3667d03ab7f9953793b770e
Reviewed-on: https://gerrit.instructure.com/29777
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-07 02:41:44 +00:00
Derek DeVries bfb87df0ad rails3 spec fixes for submission comments controller
Change-Id: Ibb6b4371bcf2716a4056bb4604809a1369441e42
Reviewed-on: https://gerrit.instructure.com/29769
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Derek DeVries <ddevries@instructure.com>
2014-02-07 02:41:34 +00:00
Matthew Irish f5a6f093c9 make never_drop ids string for grade summary ENV
fixes CNVS-10864

test plan
=========

- add drop rules to never drop one or more assignments
- verify that the totals in Gradebook, GB2, and the student grades
  summary page match

Change-Id: I1ac4a31a03b664ac6d3e92bc2cd761c69d2056b5
Reviewed-on: https://gerrit.instructure.com/29619
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-02-06 15:29:07 +00:00
Landon Wilkins 9ed002e411 removes unnecessary js_block in calendars
test plan:
* regression test calendars

Change-Id: Ieaa5ce930d9b35e122d15711d06040b4d4f21436
Reviewed-on: https://gerrit.instructure.com/29169
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-05 00:13:11 +00:00
Joel Hough fad6d771dc conferences that use disabled plugins are not listed
fixes CNVS-10839

test plan
- enable wimba and adobe connect conference plugins
- make a conference
- ensure it is visible on the conference index page
- disable the plugin for the conference
- ensure it is no longer visible on the conference index page

Change-Id: Idc26d306f683fade5bf6d8619dfe9325047bb116
Reviewed-on: https://gerrit.instructure.com/29487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-01-31 22:58:29 +00:00
Cameron Sutter 669ba4ffe9 ensure id is valid in grade summary page
fixes CNVS-1869

test plan:
 - as a teacher, go to a student's grade summary page
 - in the url, replace the student's id with 'banana' or 'lqw'
   (e.g. /courses/1/grades/banana)
 - you should get a Page Not Found error page
 - navigate to /courses/:id/grades and the page should
   redirect you to gradebook

Change-Id: Ic7d2b3de463615957a8d4178544ab19b7e651f60
Reviewed-on: https://gerrit.instructure.com/29215
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-01-30 21:05:23 +00:00
Braden Anderson be4f66b08b Conversations: allow messages to groups in unpublished courses
fixes CNVS-10684

test plan:
  * create an unpublished course
  * invite a student
  * create a group in the course
  * add the student to the group
  * log in as the student
  * open old conversations
  * compose a new message
  * click on the address book icon
  * verify that the recipients list loads

Change-Id: Ic25500a31ef604331d7380e76af226b0c10fd4a1
Reviewed-on: https://gerrit.instructure.com/29244
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
2014-01-24 18:08:42 +00:00
James Williams 0cedba19f8 replace association with association_object in models
having an "association" attribute causes problems in rails 3

Change-Id: I3249a25cd2a6162ff33f548a2e9f4f51a2940ece
Reviewed-on: https://gerrit.instructure.com/29058
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-24 16:35:40 +00:00
James Williams d9ae1efd2c spec: replace it_should_behave_like with include_examples
Change-Id: I8a10679218b9a6ff8485b7822a21c704bdfaa398
Reviewed-on: https://gerrit.instructure.com/29213
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-24 16:02:26 +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
Nick Cloward d6592241a3 use base controller query_params method
refs: CNVS-392

Since all the auditor controllers use this same method it was
moved to the audit api base class.  See CNVS-392(g/27807).
This also adds the grade_change record method to activate the
submissions shard when creating a record which should will
prevent some shard issues with it.

Test Case:
  - Test the API calls for grade changes
  - Test the API calls for authentication events

Change-Id: If89d6b14cb7d328128b3a2275134301014d87ed3
Reviewed-on: https://gerrit.instructure.com/28551
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Nick Cloward <ncloward@instructure.com>
2014-01-23 20:37:33 +00:00
Cody Cutrer e49ddb5adf spec: make accounts controller spec less fragile
Change-Id: I75472193dda09bb1881ebaf099c382622aaf3ddc
Reviewed-on: https://gerrit.instructure.com/29183
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-23 18:12:57 +00:00
Brian Palmer 749da0acfc remove shims from the cassandra gem refactor
Change-Id: I3b3e02525d00e2337835b0b0cc755c558f137619
Reviewed-on: https://gerrit.instructure.com/29130
Tested-by: Brian Palmer <brianp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-01-23 01:21:59 +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
Cody Cutrer 8a27767f4b spec: fix draft state spec
setup comes before before(:all), so Account.default wasn't working
correctly

refs CNVS-7032

Change-Id: Ib14c5247fda27145b7c7f5aace22ce75029cae3e
Reviewed-on: https://gerrit.instructure.com/28788
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-17 21:05:09 +00:00
Cody Cutrer f994831e05 associate with shard when masquerading (for db page views)
test plan:
 * enable db page views
 * as an admin in shard 1, masquerade as a user in shard 2
 * view the user in shard 2; the page views from the admin should
   show up

Change-Id: I3c71ab12d207159d2f2dd0985449f4576bb04b67
Reviewed-on: https://gerrit.instructure.com/28355
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Nick Cloward <ncloward@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-01-17 17:54:06 +00:00
Anthus Williams 40c5c1f5f7 fix for rails3 refactoring of TestUploadedFile
in rails 3, ActionController::TestUploadedFile has
been moved to Rack::Test::UploadedFile. This commit
simply updates uses of TestUploadedFile to work
with this new structure

Change-Id: Ib31159c635f033a13908608dffeea88c8f719086
Reviewed-on: https://gerrit.instructure.com/28234
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-01-17 17:53:18 +00:00
Braden Anderson 4b2c6771bb discussions: use strings for IDs in ENV and materialized view
fixes CNVS-10341

test plan:
  * before applying this commit, if possible:
    * create a discussion
    * add a reply as a student
  * after applying this commit:
    * open the discussion as the student
    * verify that you can edit the reply you added before, but not
        those from other users
    * add a new reply
    * without refreshing, verify that you can edit your new reply
    * refresh the page
    * verify that you can still edit your reply

  * test basic canvas functionality (sorry)

Change-Id: Ifa654f7d853fd167d5bfbaee6184657209d58272
Reviewed-on: https://gerrit.instructure.com/28413
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2014-01-16 17:31:32 +00:00
Mark Severson 0152fa52fa deprecate hide_from_students on wiki pages
hide_from_students is being deprecated in lieu of the workflow states
'active' (published) and 'unpublished'

test plan: (draft state and legacy)
  special attention should be given to areas related to hiding wiki
  pages from students (legacy: hide from students checkbox;
  draft state: published/unpublished items)

  items that are hidden from students or unpublished should show for
  teachers, but should not show for students

 - areas to test:
   - pages api and ui (regression)
     - validate hide_from_students and published values in all api calls
   - course migrations (specifically course copy)
   - wiki sidebar in other parts of canvas

fixes CNVS-10354, CNVS-10366

Change-Id: I70f4d8c07c2be4150163279f0673377bad6e9c48
Reviewed-on: https://gerrit.instructure.com/28375
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-01-15 21:29:06 +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
Simon Williams 5490b92542 hide unpublished assignments from students in old assignments interface
fixes CNVS-10252

test plan:
- create a course with draft state enabled
- create a mix of published and unpublished assignments
- as a student or teacher, go to the assignments tab in the top menu bar
- it should only show published assignments (even for teachers)
- now change your course homepage to be the assignment list
- it should show only published assignments for students
- it should show both published and unpublished for teachers
- finally, check that the course RSS feed contains only published assignments

Change-Id: Ib9494e76d178cba4b6c32722b0c33b1f8e11824c
Reviewed-on: https://gerrit.instructure.com/28055
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-01-08 20:46:02 +00:00
Simon Williams c99bb855f0 ignore scores for unpublished assignments
fixes CNVS-10244

test plan:
- create a new course with a teacher and student
- create two assignments, and publish them
- grade them both
- unpublish one of them
- look at all the places you can see grades, and make sure they all
  consistently show only the grades for the published assignment (the
  unpublished assignment should be completely ignored)
  * GB2 with and without 'treat ungraded as 0'
  * GB1 with and without 'incluce ungraded'
  * GB csv download
  * student grades summary page with and without what-if scores
  * /grades page as a student and as a teacher

Change-Id: I32aca28fe377e59cb2e0c6278b59eb74c87c73b4
Reviewed-on: https://gerrit.instructure.com/28047
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-01-08 18:05:04 +00:00
Michael Nomitch af4315488c graded discussion edit: right assignment_group selected by default
fixes CNVS-6571

assignment group ids are strings (not ints) for both assignments and discussions

test plan:
  - as teacher, create two assignment groups
  - add a discussion to each group
  - ensure: when editing the discussion, the right assignment group is selected by default
  - ensure: other types of assignments default to correct assignment group

Change-Id: I13ec98f28025394cf4a1e6ea1b1d51c87fcc987b
Reviewed-on: https://gerrit.instructure.com/27604
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Irish <mirish@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-12-31 20:58:32 +00:00
Braden Anderson 2f6d00e40b search: handle search strings on invalid contexts
fixes CNVS-10015

test plan:
  * delete a student from a course
  * log in as the student
  * open new conversations and compose a message
  * select the course
  * enter a recipient search term
  * verify that "No results" is presented

Change-Id: I672843486cabda1694627a076e5b2612662e596c
Reviewed-on: https://gerrit.instructure.com/27860
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2013-12-24 04:47:40 +00:00
Bracken Mosbacker bbccc66b80 keep external tool id references for copied module items
When copying a module item for an external tool the reference
to the ET was lost. So when the url didn't match to an ET
config it couldn't launch.

Test Plan:
 * Create module items that use a course external tool and
   ones that use an  account external tool
 * copy the course
 * the module items in the new course should still work

closes CNVS-9242

Change-Id: Id1f11b5cef4fa21867cc3b7907365b11801e7c7f
Reviewed-on: https://gerrit.instructure.com/27679
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2013-12-23 19:13:45 +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
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
Simon Williams 94ad7974db catch invalid user ids in rubric assessments controller
also fixes an issue where the submission detail page broke after assessing
a rubric for the first time (never been assessed before)

fixes CNVS-9953

test plan:
- create a new assignment with a rubric for grading
- go to the submission detail page for a student who has never been graded
  with this rubric before (in other words, this will create a rubric
  assessment for the first time)
- grade them with the rubric
- you should be able to re-open the rubric and grade them again without having
  to refresh the page

Change-Id: I7245650b9527e11ec20b66e852a744ce67fb381d
Reviewed-on: https://gerrit.instructure.com/27541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-12-18 16:19:03 +00:00
Braden Anderson 1d25cfb67e conversations: improve recipient search
fixes CNVS-4806, CNVS-4482

test plan:
  * open conversations
  * compose a new message
  * select a course
  * verify that you can search for a section in the course by name
  * verify that you can search for a group in the course by name
  * verify that you can send a message to an entire group if you have
      permissions to send it to the entire course

  * create a course with two sections
  * add students to the sections and add a TA who can only see
      students in one section
  * masquerade as the TA
  * verify that the other section does not appear in the recipient
      search section list
  * verify that users in the other section do not appear in the
      recipient search student list

  * create a course in a concluded term
  * open new conversations
  * verify that the course is listed in the concluded section of the
      filter list
  * masquerade as a teacher for the course
  * open old conversations
  * verify that the concluded course is present in the filter search
  * verify that the course is not present in the recipient search

Change-Id: I5a4e62de4e182cf0859dc47a3f8ad694f616a3bc
Reviewed-on: https://gerrit.instructure.com/27433
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2013-12-17 21:11:20 +00:00
Simon Williams 6597a2c9f1 show total columsn in GB1 when draft state is enabled
fixes CNVS-9951

test plan:
- enable draft state
- go to gradebook 1
- total columns should be visible

Change-Id: I99b50a04583e84c8762d3b83889e551cae486cd2
Reviewed-on: https://gerrit.instructure.com/27325
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-12-16 17:01:35 +00:00
Jeremy Stanley d01026cf37 decouple grading rights from create/update rights
test plan:
 - create a custom role based on TA
 - deny "Manage (add/edit/delete) assignments and quizzes" to it
 - deny "Manage all other course content" to it
 - keep "Edit grades" and "View all grades" allowed
 - enroll a user with this custom role
 - make sure the user can grade assignments and quizzes
 - make sure the UI elements to create, edit, and delete modules,
   assignments, and quizzes are not shown to this user
   - with draft state disabled
   - with draft state enabled;
   - from the Assignments/Quizzes/Modules page, and also
   - the ability to create an assignment or quiz via module item.
 - make sure that attempts to create, edit, and delete
   quizzes via the API are denied

fixes CNVS-1481

Change-Id: Ic4056f709d48c40b2804aef52a4a1aafc44b5122
Reviewed-on: https://gerrit.instructure.com/27187
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-12 17:56:23 +00:00
James Williams 2cfc286ddf use controller method instead of @controller
in preparation for rails 3

Change-Id: Ib752c02b8eb63093648843dca696f17fcc7f62ef
Reviewed-on: https://gerrit.instructure.com/26976
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-10 21:33:41 +00:00
James Williams 5b20c6077c replace original_id attr_accessor with previous_id
in preparation for rails 3

Change-Id: I048e4f8db97dacf64616ad52ec075516b55f3c0f
Reviewed-on: https://gerrit.instructure.com/26966
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-10 21:33:24 +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
Joel Hough e201063960 discussion draft state backend
fixes CNVS-9263

test plan
be sure to test ungraded discussions, graded discussions, graded
group discussions (root level and group topics), and announcements

with draft state disabled
- ensure publish icons do not appear on discussion index page
- ensure publish button does not appear on discussion show page
- ensure that discussions for delayed posting are not visible to
 students

with draft state enabled
- ensure that publish icons appear on the discussion index page and
 that clicking them toggles the discussion's publish state
- ensure that publish button appears on the discussion show page
 and that clicking it toggles the discusssion's publish state
- ensure that unpublished topics are not visible to students
- ensure that published topics are visible to students, even if
 the topic is for delayed posting
- ensure that topics for delayed posting show a 'This topic will
 open on' message on the topic show page
- ensure that [un]publishing the root topic of a graded group
 discussion changes the group level discussion and vice versa
- ensure that announcements are published when posted and cannot
 be unpublished

test plan for misc frontend fixes
- as a teacher, create a new discussion
- ensure it is unpublished
- as a student, create a new discussion
- ensure that it is published and that no publish button appears
 on the topic show page or the topic index page

- as a teacher, create a new graded group discussion
- navigate to the group level topic
- publish the topic using the button on the show page
- ensure that the button switches to the 'Published' state

- as a teacher, create an announcement
- ensure that it is published

Change-Id: If0c46d232bc25776770012654af23e5cf10bbb45
Reviewed-on: https://gerrit.instructure.com/26654
QA-Review: Joel Hough <joel@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Clare Strong <clare@instructure.com>
2013-12-10 18:10:57 +00:00
Cameron Matheson c7f26b342d warn when converting assignment to group assignment
closes CNVS-9187

Test plan:
  * make two assignments (not group assignments)
  * on assignment number one, submit some homework
  * edit the assignment and try to convert it to a group assignment,
    you should see a warning
  * try to convert assignment 2 to a group assignment.  there should be
    no warning

Change-Id: I196cbad54fbcfe6df4bcbc3b71d3175e92a104fb
Reviewed-on: https://gerrit.instructure.com/26955
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-12-07 02:18:38 +00:00
Anthus Williams 16011eaa32 don't display filename to unauthorized users
Fixes CNVS-5551

Test plan
- As user 1, upload a file and then delete it
- User 1 should see the name of the newly deleted
  file in the notice returned when browsing to
  /users/1/files/[Deleted-File-ID]
- Log in as user 2 and try
  to access /users/2/files/[Deleted-File-ID]
- you should not see the file name but
  rather a simple unauthorized message

Change-Id: Iab277b60c80e599790d76bcc86f3a73181e3b483
Reviewed-on: https://gerrit.instructure.com/26702
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Anthus Williams <awilliams@instructure.com>
2013-12-06 19:21:59 +00:00
Josh Simpson e3859e12fd fix fragile quiz_submission controller spec
fixes CNVS-9869
This commit fixes a spec for QuizSubmission#backup that tests the
time_left parameter returned. Instead of testing for the exact value of
the time_left (when the spec execution time is inevitably variable), we
just check to make sure it's close to original (start) value.

Test Plan
This isn't really testable by QA.  I've looped the execution of the spec
50+ times and am confident it should be less brittle going forward.

Change-Id: I9145441b518daac18b610f0ef6aba123a19845eb
Reviewed-on: https://gerrit.instructure.com/27090
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Josh Simpson <jsimpson@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-12-06 17:58:23 +00:00
Jeremy Stanley 4324cee825 make create-assignment (non-API) endpoint respect draft state
test plan:
 - enable draft state in a course
 - create a module
 - create an assignment via add-module-item
 - the assignment should not be initially published

fixes CNVS-9318

Change-Id: I8bbf14b2ca499b91ff69b83508da21185def88dd
Reviewed-on: https://gerrit.instructure.com/26720
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-12-02 15:54:39 +00:00
Cameron Matheson 187181fc9b Don't query for non-numeric rubric ids
fixes CNVS-5603

Test plan:
  * Go to /courses/NN/rubrics/what_this_isnt_a_rubric_id
  * you should get a 404 response, not a 500

Change-Id: I4eb68818270c7c31a631723501b41413a1430f3a
Reviewed-on: https://gerrit.instructure.com/26735
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-11-27 18:46:52 +00:00
Zach Pendleton 32b4ef475a move google docs domain restriction to feature flag
fixes CNVS-9686

test plan:
  * as a site admin, navigate to a root account's settings
    page, select the feature flags tab, and verify that the
    google docs domain restriction is there;
  * enable the feature;
  * reload the settings page and verify that there is a
    domain text input in the settings form;
  * verify that if set, the google docs restriction
    prevents users with invalid google docs domains from
    submitting assignments;
  * verify that when turned off, users can submit
    assignments on any domain.

Change-Id: I1078c4d0d6d56e04ee882e1d58e6e1c302cf4caa
Reviewed-on: https://gerrit.instructure.com/26657
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-11-27 15:37:01 +00:00
Ahmad Amireh 6fafe23b61 More accurate Access Report scores for Quizzes
This patch makes it that when viewing the Access Report for a course
student, their "Times Viewed" column will reflect the number of times
the student has browsed the quiz or any of its related resources
(like History, or attempt views), but not taken it.

While the "Times Participated" column will reflect the number of times
the student really took the quiz (1:1 mapping with the number of
submissions.)

TEST PLAN
---- ----

In both test cases, you'll need:
  - a course with a student enrolled
  - one browser session with a teacher logged in viewing the Access
    Report of the student
  - one browser session with the student logged

CASE: Normal quizzes

  - Create a quiz with a few questions and unlimited attempts.
  - Refresh the teacher tab, keep an eye on Times "Viewed" and
    "Participated" columns
  - As the student:
    - Go to the quizzes page
    - Go to the quiz page
  - Refresh the teacher tab, and:
    - ONLY the "Times Viewed" score should be incremented by 1
  - As the student:
    - Push the Take the Quiz
  - Refresh the teacher tab, and:
    - ONLY the "Times Participated" score should be incremented by 1
  - As the student:
    - Refresh the quiz page (while taking it)
  - Refresh the teacher tab, and:
    - NEITHER score should be incremented

CASE: OQAAT quizzes

The expected behaviour for OQAAT quizzes is that the entire attempt
counts as 1 participation, just like the normal quizzes.

Follow the same steps as above, but:

  - While taking the quiz, and for every question page:
    - Refresh the teacher tab and make sure that neither score is
      incremented

OBLIGATORY REFERENCES
---------- ----------

  - Acceptance criteria @ http://docs.kodoware.com/canvas/cnvs-5294

refs CNVS-5294

Change-Id: I55883b8edbf417edb42b9fd103e08369e0e9e63c
Reviewed-on: https://gerrit.instructure.com/26543
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-26 23:05:01 +00:00
Derek DeVries 31db7d5bb9 refactor and add api documentation for quizzes#reorder
fixes CNVS-8963

test plan:
- reordering questions in a quiz should continue to work
- reordering of questions within a quiz group should continue to work
- try dragging questions out of a quiz group
- try dragging questions into a quiz group
- Try out the API for reordering questions within a quiz
- Try out the API for reordering questions within a quiz group

Change-Id: Ic2b4a839979f54a4a5d98eaaafd09950f57f17b5
Reviewed-on: https://gerrit.instructure.com/26703
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-11-26 21:12:22 +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
Cameron Matheson ba1b63ec92 don't leak muted assignment scores on grade summary page
fixes CNVS-9633

regression from I2f989c0b0dba9a17c904ba516154adb18ceaaad5

Test plan:
  * mute an assignment in a course
  * load the students grade page as a student
  * grade the assignment for that student
  * refresh the student grades page
  * the assignment group totals should not have changed

Change-Id: I21651cf5be341224910dcca56f02154ef3ab77f4
Reviewed-on: https://gerrit.instructure.com/26666
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-11-25 23:00:12 +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
Stanley Stuart 63000d4944 stop students from viewing unpublished quizzes when viewing by URL
test plan:

  - With Draft State Enabled
    - Call the api as a student for an unpublished quiz. You should get
      a 401 response.
    - Try to view the quiz show page for an unpublished quiz by
      visiting its url. You should get an "Unauthorized" warning
      message.
  - With Draft State Disabled
    It should work exactly as before...:
    - Call the api as a student for a quiz that has not been
      "published." You should not get a 401 error.
    - Visit the page of the unpublished quiz. You should see quiz
      details, but you should not be able to take the quiz. Also the
      yellow "This quiz is unpublished. Students will not be able to.."
      banner should also not appear for the student.

fixes CNVS-9122

Change-Id: I2bd8893ce8f28f919eac0d6b4b8b0f929b818ee3
Reviewed-on: https://gerrit.instructure.com/26294
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-11-22 22:11:08 +00:00
Josh Simpson b5b627efa6 Quiz question refactor / api implementation
fixes CNVS-7982
Changes parsing mechanisms for question data, and adds
API for quiz questions.

Change-Id: I483fc9c4718af50e1bed2ee3547905f857de6285
Reviewed-on: https://gerrit.instructure.com/25346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-22 17:03:45 +00:00
Derek DeVries 80a7ee67a6 refactor and add api to quiz group reorder
fixes CNVS-8815

test plan:
- reordering of questions within a group should continue to work
- try dragging questions out of a quiz group
- try dragging questions into a quiz group
- Try out the API for reordering questions within a group

Change-Id: Ic2ebac87f7e2f5d9612b25cd9b80227cfa533b45
Reviewed-on: https://gerrit.instructure.com/26267
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-21 18:17:48 +00:00
Cody Cutrer f838d142f4 allow oauth clients to provide a purpose to the oauth flow
refs CNVS-5794

test plan:
 * go through the oauth flow, adding purpose=something to the first
   step
 * at the end, when you view the access token in your user profile,
   it should show the purpose you put in

Change-Id: I3f7f55df5540931ef5844c7f265dc720af153372
Reviewed-on: https://gerrit.instructure.com/26249
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-16 20:26:36 +00:00
Brian Whitmer 331449d820 send selected text on LTI launch
test plan:

- Install a tool that uses the rich text editor
- Select some text in the editor
- Launch the tool
- Ensure that canvas sends a "text" param with the selected text

Change-Id: I267b07f3ec5033d84c11e52b873fc36011602198
Reviewed-on: https://gerrit.instructure.com/24909
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-11-14 23:34:50 +00:00
Cody Cutrer b946bb0126 don't allow 'logging in' as pre_registered users
refs gh-323

a pre_registered user may have been added as an admin or otherwise
logged in

test plan:
 * log in as an admin, go to users list for an account
 * create a new user
 * go to settings for the account, and add that user as an admin
   (it should say "existing user")
 * enable self registration on the account
 * log out, and click the link to register for an account
 * register as a teacher, using the e-mail address you used to
   create the user
 * it should say e-mail address already taken

Change-Id: I8187b86b83588ba70d3c1b6a31a96678fc70a910
Reviewed-on: https://gerrit.instructure.com/26223
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-11-13 16:11:26 +00:00
Jason Madsen 69a8460879 create fabulous quiz entry point
closes CNVS-9394

test plan:
  - visit quiz index
  - verify current quiz system displayed
  - enable fabulous quizzes
  - visit quiz index
  - verify ember / fabulous quizzes skeleton displays

Change-Id: Ie0737328b9aaa7bb2f97dc78647107b4ff9a7be2
Reviewed-on: https://gerrit.instructure.com/26204
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2013-11-12 23:08:40 +00:00
Zach Pendleton c064235766 filter conversations with no active messages
fixes CNVS-9325

test plan:
  * as user A in new conversations, send multiple messages
    to user B;
  * as user B in old conversations, delete all of the
    messages inside one of the new threads;
  * reload the page and verify that you can click on each
    of the conversation threads in the left pane and that
    they load as expected.

Change-Id: I531bb4e73c19d0c927dd5a033a46ced76aded512
Reviewed-on: https://gerrit.instructure.com/26059
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-11-12 00:27:44 +00:00
Jason Madsen bb2b9a3c72 unpublished quiz to show in assignment list
fixes CNVS-9181

test plan:
  - create a quiz, but do not publish
  - un published quiz should display in assignment index as unpublished
  - publish the quiz
  - assignment list should be updated to reflect published quiz

Change-Id: I8d365121454203ca4913bba16551e8f220aa1ea3
Reviewed-on: https://gerrit.instructure.com/26060
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Jason Madsen <jmadsen@instructure.com>
2013-11-11 16:44:04 +00:00
Rob Orton e58cca0322 spec fixes intermittent spec failures
closes CNVS-9345

test plan
 * specs should pass

Change-Id: Ica4361b471ae55ece27d328cd92252db42e232f1
Reviewed-on: https://gerrit.instructure.com/26158
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-11-08 21:53:11 +00:00
Brandon Broschinsky 0da5126e96 save attachment user when using s3 file store
attachments are not saving the user when using s3 file store
this is working fine when using local file store

test plan
with canvas configured to use s3 filestore,
upload a file, the attachment should have the user
who performed the upload associated with the attachment.

refs PS-675

Change-Id: I30efb122bc0646f2548e71d3b20fed33e5d3b375
Reviewed-on: https://gerrit.instructure.com/25687
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-11-08 21:37:19 +00:00
Cameron Matheson 97be53eddd Use ActsAsList#update_order in AssignmentGroups#reorder
refs CNVS-8955

Test plan:
  * Try to reorder assignment groups in the assignment index page (old
    one and draft state).
  * Reload the page.
  * The groups should be arranged in your new order.

Change-Id: I61f637202e954575b500411ea2f7da4d962c4cdf
Reviewed-on: https://gerrit.instructure.com/25984
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-11-05 23:40:27 +00:00
Simon Williams f614fa7c30 require assignment group on course creation
fixes CNVS-9038

Change-Id: I0e6997652be27571a98428339d6f9c1cbe12aa89
Reviewed-on: https://gerrit.instructure.com/25793
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-31 14:54:25 +00:00
Jacob Fugal fadf690fe0 require appropriate file for testing uploads
refs CNVS-9166

test-plan: N/A

Change-Id: Ie9ed104579961f0af67b9453ecc43670d48ecbac
Reviewed-on: https://gerrit.instructure.com/25736
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>
2013-10-29 19:02:55 +00:00
Cameron Matheson 26e50b0f11 faster grades summary page
fixes CNVS-8940

Test plan:
  * load the grades page as a student
  * everything should work
  * repeat as a teacher visiting the student grades page

Change-Id: I2f989c0b0dba9a17c904ba516154adb18ceaaad5
Reviewed-on: https://gerrit.instructure.com/25421
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-25 22:09:33 +00:00
Simon Williams 677014789e fix typo in json response
fixes CNVS-8707

test plan:
- with draft state disabled
- as a teacher, create and delete an assignment group
- it should work

Change-Id: If0762c81e6115f8cebe7eb9ebd740b2d03d97ff7
Reviewed-on: https://gerrit.instructure.com/25518
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Irish <mirish@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-10-23 21:40:14 +00:00
Brad Humphrey 4009e41701 adding support for edu-apps version 2
Test plan:
 - Create two accounts
 - Install the old app center (http://www.edu-apps.org/) in one
 - Install the new app center (http://edu-apps.herokuapp.com/) in the other
 - Compare the two app centers and make sure they both work
   * List apps
   * Install apps
   * View reviews
   * Create reviews
   * Update review

Change-Id: I477ac73e255676dd2faa70599aca998c6bfb3a0e
Reviewed-on: https://gerrit.instructure.com/25011
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-10-17 16:05:23 +00:00
Jon Jensen e8416649dc avoid infinte recursion when self-enrolling in another shard
fixes CNVS-8780

test plan:
1. create a user in one shard
2. try to self enroll in a course in another shard
3. it should work, and you should not get a page error

Change-Id: Id856686546499f90c4a77cd64d008b621cdc4158
Reviewed-on: https://gerrit.instructure.com/25257
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-14 19:55:06 +00:00
Zach Pendleton edd5f5d82d remove dimdim plugin
dimdim no longer exists; no need to keep this code
around.

Change-Id: I3b1b360b71eccd7b10fd36c577bdac7b6f81976a
Reviewed-on: https://gerrit.instructure.com/24512
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-10-07 21:56:10 +00:00
James Williams eba436f6a2 prevent encoding errors caused by attachments with null filenames
test plan:

* create two original files (e.g. using a text editor)
 this is to ensure that they will be root attachments

* create a course with a discussion topic

* attach one of the files to the topic ("File #1")

* upload both files to the course through the "Files" page

* edit the discussion topic, clear the attachment, and save

* in html content (e.g. the syllabus body), add a link
to the other file ("File #2") through the wiki sidebar

* return to the "Files" section and delete "File #2"

* return to the html content (e.g. the syllabus page)

* should not receive a page error

refs #CNVS-8449

Change-Id: Ie6f03b7bfbb61f4702a06c1ecaee8eda33bb1463
Reviewed-on: https://gerrit.instructure.com/25012
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
2013-10-05 00:49:47 +00:00
Mark Severson 074151402d allow PUT requests to create wiki pages implicitly
testing note:
  this change affects all wiki page endpoints: api, draft state,
  and non-draft state. basic functionality for all of these
  pages should be verified, specifically when dealing with
  non-existent or deleted pages.

test plan:
 * PUT to /api/v1/courses/:course_id/front_page
   - variations:
     * wiki_page[title] - provided/not provided
     * wiki_page[published] - true/false/not provided
     * wiki_page[hide_from_students] - true/false/not provided
     (hiding/unpublishing the front page is not allowed)
 * PUT to /api/v1/courses/:course_id/pages/non-existent-page
   - same variations as front_page (above)
 * navigating to a non-existent/deleted page (draft state/non-draft state)
   - should redirect teachers to the edit page
   - should redirect students to the index page
     (with an alert message indicating why)
 * navigating to the 'Pages' tab (non-draft state)
   - if the 'Front Page' exists
     - shows the page
   - if the 'Front Page' has been deleted (with draft state enabled)
     - shows the edit page
   - if the 'Front Page' has never existed
     - shows the edit page

 * all other pages functionality should remain unchanged
   - non-draft state UI
     - show page
     - edit page
   - draft state UI
     - index page
     - show page
     - edit page
   - api
     - .../pages
       - GET (index)
       - POST (create page)
     - .../front_page
       - GET (show front page)
       - PUT (create/update front page)
     - .../pages/page-url
       - GET (show page)
       - PUT (create/update page)
       - DELETE (destroy page)

fixes CNVS-8488

Change-Id: I563e6944e1602e0b21ab69c6fe2dcd643c06611d
Reviewed-on: https://gerrit.instructure.com/23590
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-10-04 21:44:29 +00:00
Eric Berry 6e21c3eaa0 Add already installed flag in the app center view page
Also added auto-install for tools that only have the name parameter.

Test Plan:
  - Open the app center for a course or account
  - Add some tools
    * Verify that the tools show up under the installed tab
    * Verify that the tools have an installed banner on the tool page
  - Add a new tool that only has a name param
    * Verify that the tool installs skips the dialog pop-up step
  - Add another instance of the previously installed tool
    * Verify that that the tool allows you to change its name
  - Delete all of the tools
    * Verify that they no longer show up as installed

Change-Id: Ibe978d0be48acc68e9ed0ee35e41249e7e9824e2
Reviewed-on: https://gerrit.instructure.com/24661
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Brad Humphrey <brad@instructure.com>
2013-10-04 21:26:48 +00:00
Cody Cutrer 419877ff9d clean up sorting all over
* use sort_by instead of sort where possible to avoid repeating yourself
 * use new SortFirst/SortLast sentinels to avoid strange magical constants
 * fix a few places of complicated logic for tiered sorting to just use
   an array

Change-Id: I184ef0b4e31fa18294c9beb32770101d383bbea1
Reviewed-on: https://gerrit.instructure.com/24867
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-10-02 21:38:08 +00:00
Cody Cutrer a19b3ef8dd spec: run transaction commit callbacks when down to 1 transaction
removes need for run_transaction_commit_callbacks all over the place

Change-Id: Id878276ed86bb37f625ef34412b16d1f75a63bca
Reviewed-on: https://gerrit.instructure.com/24758
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2013-10-01 23:51:04 +00:00
Brian Palmer 5cd9b153d4 include canvas revision in health_check json response
test plan:

curl -H 'Accept: application/json' http://<domain>/health_check

If you have a VERSION file in your canvas dir it'll report that
version, otherwise "Unknown"

Change-Id: I43c72140541ea441d4ec96a4c179d8db775843b7
Reviewed-on: https://gerrit.instructure.com/24595
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-09-23 19:53:08 +00:00
Brandon Broschinsky e7513df263 enable saml login when multiple non-saml authorization configs
**TEST PLAN**
Create a non saml authorization config
via rails console create a saml authorization config
saml authentiation should work when calling saml_consume endpoint

fixes PS-649

Change-Id: I95c3203056c614c241383d6f11a997def6547a76
Reviewed-on: https://gerrit.instructure.com/24452
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Adam Phillipps <adam@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-09-23 14:00:50 +00:00
Derek DeVries 130735d59c hide scores from students in attempts table for muted submissions
fixes CNVS-8208

test plan:
  - create a new quiz as a teacher
  - mute the quiz in gradebook
  - have a student take the quiz
  - the student score in the attempts table should say "Not yet graded"

Change-Id: Ief963ee17fdf42117ebd0a47bf206493e82dcab1
Reviewed-on: https://gerrit.instructure.com/24540
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Josh Simpson <jsimpson@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-09-20 15:09:26 +00:00
Jacob Fugal e9393c8ee9 strip whitespace around username on login
fixes CNVS-7857

test-plan:
 - try to log in as a user when using extra whitespace around their
   username

Change-Id: Ia230d7caf784562a881f59fed17e393d5c4b4878
Reviewed-on: https://gerrit.instructure.com/24391
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-09-19 16:24:32 +00:00
Jeremy Stanley c1b9934c6c use new wiki ui for course front page
fixes CNVS-8105

test plan:
 - enable draft state for a course
 - set a wiki page to be the course front page
 - confirm you get the new page UI,
   with the toolbar up top with "View All Pages" and the
   gear menu at right
 - confirm the course name is shown in place of the wiki page title
 - confirm the "Published" and "Front Page" markers are not shown
   (they're redundant on the course home page)
 - confirm the module sequence footer is not shown on the course
   home page
 - confirm the gear menu doens't have a "delete" option
   on the front page
 - set a Creative Commons license and ensure it shows up correctly
   on the bottom of the home page
 - view the front page in Pages and confirm that the page shows
   normally there (Published, Front Page, sequence footer present,
   delete is in the gear menu)
 - also make sure the course home page still works properly
   (with the old ui) when draft state is disabled

Change-Id: I28c2ee6a373d1b9b83c42775665ceca058ede2de
Reviewed-on: https://gerrit.instructure.com/24269
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-09-18 21:18:32 +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
James Williams 233538509e draft state - module student progressions page
test plan:
* enable draft state
* visit the new modules progressions page at
"/courses/:course_id/modules/progressions"
* confirm that clicking on students shows their
module progress

closes #CNVS-7694

Change-Id: I95404d88785b6be4997214091e7b63728330bd07
Reviewed-on: https://gerrit.instructure.com/24176
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2013-09-12 20:32:37 +00:00
Mark Severson 2b0a891d80 remove hide_from_students from the new pages UI
test plan:
 - start with draft state disabled
 - for each step, exercise the api (as a teacher) to confirm the
   expected values
 1) create pages with different hide_from_students values
    a) as a teacher
       hidden pages should be visible; the hidden flag should persist
    b) as a student
       hidden pages should not be visible
 2) using the api, update published and hide_from_students
       (together and separately)
    a) the published value should not be affected
    b) the hide_from_students value should be updated when set

 3) enable draft state
    a) as a teacher
       previously hidden pages should be visible, but unpublished
    b) as a student
       previously hidden pages should not be visible
 4) edit a page
    a) ensure the "Hide from students" option is gone
 5) publishing pages should behave as expected
    a) published pages should be visible to students
    b) unpublished pages should not be visible to students
 6) using the api, update published and hide_from_students
       (together and separately)
    a) the hide_from_students value should not be affected
    b) the published value should be updated when set

 7) create new pages with different published states
    a) as a teacher
       unpublished pages should be visible, but unpublished
    b) as a student
       unpublished pages should not be visible
 8) disable draft state
    a) as a teacher
       previously unpublished pages should be marked hidden
    b) as a student
       previously unpublished pages should not be visible

fixes CNVS-7617

Change-Id: I395e0b2639543a64d9e2bc8d9377c78cf36f42d6
Reviewed-on: https://gerrit.instructure.com/23618
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-09-04 22:22:21 +00:00
Cameron Matheson e89849cea8 speedgrader setting for beta quiz nav
closes CNVS-7318

Test plan:
  * Open a quiz in speedgrader
  * Click the settings link and enable beta quiz navigation
  * You should see a quiz navigation bar at the top
  * the beta nav setting should only display for quizzes

Change-Id: I546c6032680bdef4fd56c9fed9e8fd79454e3f42
Reviewed-on: https://gerrit.instructure.com/23834
Reviewed-by: Simon Williams <simon@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-31 21:47:00 +00:00
Josh Simpson ee1837fc74 fix system time exploitation of quiz timing
fixes CNVS-6858
Adds Submission#time_left and implements it within
QuizSubmissionController#backup. JavaScript syncs with server
timer.

test plan:
1. Take timed quiz
2. Note that time left timer is working
3. Change system time
 - time left timer shouldn't change

Change-Id: I3d67cb2a983dfb8f7bf762a6c980b35bb12657fc
Reviewed-on: https://gerrit.instructure.com/23879
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-08-30 22:45:17 +00:00
Simon Williams a8fb912d02 update all rubric associations when data changes
fixes CNVS-7745

test plan:
- create a rubric with and outcome and add it to an assignment
- verify that both the rubric and assignment are aligned to the outcome
- from the course rubrics page, remove the outcome from the rubric
- verify that both the rubric and assignment alignments were removed
- quick regression around delete rubrics from different contexts

Change-Id: Ibfca5df68423a5a81e1ef2c73920d2e932c463d6
Reviewed-on: https://gerrit.instructure.com/23871
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-08-30 21:28:25 +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
Simon Williams 9e34af2981 fix fragile specs
fixes CNVS-7719

Change-Id: I4e73c6cb1937e0cbb53df26d73de3394bb9a417e
Reviewed-on: https://gerrit.instructure.com/23760
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-27 16:23:20 +00:00
Cody Cutrer 7493176a19 don't leave dangling references to attachments that are deleted
test plan:
 * update a discussion topic changing the attachment

Change-Id: I242c85fbe258eadd76c90a3a4d0fd0009d47b2b7
Reviewed-on: https://gerrit.instructure.com/23703
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2013-08-25 02:26:49 +00:00
Mark Severson cbd3641281 change pages to allow context-based draft state
test plan:
 - with draft state disabled and allow draft enabled for the account
   - account.settings[:enable_draft] = false
   - account.settings[:allow_draft] = true
 * enable draft state for the course
   - course.enable_draft = true
 * click on the 'Pages' tab in the course
   - the new pages UI should be shown
 * disable draft state for the course
   - course.enable_draft = false
 * click on the 'Pages' tab in the course
   - the legacy pages UI should be shown

Change-Id: If5d180e18451ec559d12b18784263b4ff92a754d
Reviewed-on: https://gerrit.instructure.com/23581
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-08-22 21:18:49 +00:00
Simon Williams 147d171aa1 correctly maintain assignment/rubric <-> outcome links
There are a few old LearningOutcomeResults that have a nil artifact, and
many that have a Submission as an artifact.  We want to get rid of these
because they come from bad data, and step 1 toward that goal is to stop
creating them and hide them in the UI.

The LORs with a nil artifact are very old and I believe came from a very
early incarnation of outcomes.  The LORs with a Submission as an artifact
came from a combination of two code problems.  The first was old code
that allowed an assignment that was aligned with an outcome but did not
have a rubric to create LORs directly based on it's submission.  The
second was a bug that prevented the assignment <-> outcome link from
being destroyed when a rubric with an outcome was removed from an
assignment.

fixes CNVS-7495
fixes CNVS-7498

test plan:
- try different combinations of adding a rubric with an outcome to an
  assignment.
- when you grade the assignment, the grade create a learning outcome result
  (which can be seen on the outcome show page, or in the account outcome
  report) if the rubric+outcome are currently attached to the assignment.
- so for example, add a rubric with an outcome, check, remove just the outcome
  row, check, add a new outcome row, check, remove the whole rubric, check.
- be sure to check both the show page and the outcome report

TODO:
- datafix migration

Change-Id: I37700e3e5c08fc6cfb8fcf1cac42ea6693fcaba3
Reviewed-on: https://gerrit.instructure.com/23303
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-08-20 22:40:01 +00:00
Cody Cutrer 5254bfc09d clean up some rubric assessment requests stuff
refs CNVS-7414

first, start at RubricsController#assessments. there is no route for it,
so remove the action and it's view. The rubric_association partial was
only used from that view, so remove it as well. Then in
RubricAssessmentController and RubricAssociationsController #create,
note that nothing ever provides an invitations param, so remove that,
and cascade down to removing or simplifying a few other methods
(particularly RubricAssociation#invite_assessors, which created users
in a bad way, and RubricAssociation#invite_assessor, which never
assigned assessor_asset, which will shortly be non-null, and is
obviously never used cause that column is never null in production).

Finally, fix some specs to properly create rubric assessments since
the (bad) helper methods are now gone.

test plan:
 * specs
 * basic regression test around using rubrics for grading and
   peer reviews

Change-Id: Ibd7713d9fc1f847d49c47b95d8c51ce28fa41e92
Reviewed-on: https://gerrit.instructure.com/23412
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-08-20 17:34:36 +00:00
Stanley Stuart 9b76539a3e add the ability to regrade a quiz
This commit gives teachers the ability to regrade quizzes by using
different options per quiz question:

* Current Correct Only
* Full Credit (regardless of answer choice)
* Previous and Current Correct
* No Point change (for updating the display of a question)

Test Plan:
  You'll want to run through each question regrade option making sure
  scores change appropriately.

"I seldom end up where I wanted to go, but almost always end up where I
need to be." - Douglas Adams

Change-Id: I9dbb88154cd3ac630bf59dbf3e997a87f75649dc
Reviewed-on: https://gerrit.instructure.com/22018
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-08-19 17:29:26 +00:00
Brian Palmer 0c54f56e5d request blacklist based on user id, access token, or ip
refs CNVS-7008

This middleware reads and caches a blacklist from a Setting, then
compares it against the request (access token || user id) and the
request IP address.

You can change the blacklist and SIGHUP the rails process to reload it
without restarting rails.

Note that because of the limitations of middleware in rails 2.3 apps,
this doesn't look at the access token if it's given in a POST params
body, rather than the HTTP header or query string params.

test plan:

* By default this middleware won't block anybody. Verify that you don't
  get 403 errors making canvas requests.
* The blacklist is a comma-separated list of identifiers. To set it:
  Setting.set('request_throttle.blacklist', '1234') and then reload
  Canvas.
* Add your user global_id to the blacklist, verify you are blocked in
  web ui requests.
* Add an access token to the blacklist and use it, verify you are
  blocked.
* Add your IP to the blacklist (likely "127.0.0.1" for local dev envs),
  and verify you are blocked.
* Verify others are not blocked after these adds.

Change-Id: I4a1c7ef4bab70c586d603dc01f3ca440d211f11d
Reviewed-on: https://gerrit.instructure.com/23293
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-08-16 22:08:18 +00:00
Jeremy Stanley ef58360d2a in legacy UI, set "Front Page" as front page if there isn't one
test plan:
 1. work in an account where draft state is disabled
    (account.settings[:enable_draft] = false)
 2. create a new course
 3. create a wiki page in the course
    (will appear as the front page, mostly)
 4. create another wiki page, view it, and copy its URL
 5. delete the page created in step 3. you'll be redirected to
    the "front page" created in step 3.
 6. paste the URL copied in step 4. ensure you are notified
    that the page was deleted, and you are redirected to
    the front page.

fixes CNVS-7574

Change-Id: Ic88b1c66d4ec58c14aa5c169cf1abc180b89597e
Reviewed-on: https://gerrit.instructure.com/23386
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-16 19:40:56 +00:00
Jeremy Stanley 7626a625a0 don't resurrect deleted pages on show
test plan:
 - create and view a wiki page
 - copy the url
 - delete the wiki page
 - navigate back to the url
 - you should see a message stating the page has been deleted
   (and not the contents of the deleted page)

fixes CNVS-7564

Change-Id: I83e3919eaa038b57b1a1ef61856c7321ff6817b0
Reviewed-on: https://gerrit.instructure.com/23377
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-16 19:40:35 +00:00
Joel Hough 9c7ef4600c multiple filters for new conversations ui
fixes CNVS-7354

test plan
- from the new conversations ui, filter by a course and by
 entering a user in the search box
- ensure that only conversations from that course involving that
 user are displayed

Change-Id: I174f62624ebbb21a4fc80e698d629d3be0ff174c
Reviewed-on: https://gerrit.instructure.com/23260
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-08-16 19:25:11 +00:00
Joel Hough cbc34c0092 add conversation context to tags
refs CNVS-7354

test plan
- make a conversation with a context
- ensure that the context ends up in the conversation's tags
- make a conversation with a group as a context
- ensure that the group and the group's context end up in the
 conversation's tags

Change-Id: Ife13eb261fe6a6c7064b6045aed8232e097a015c
Reviewed-on: https://gerrit.instructure.com/23259
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-08-16 18:02:36 +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
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
Zach Pendleton 4ad728e411 fix permissions on imported announcements.
fixes CNVS-7467

test plan:
  * create an announcement without a user ID (by running
    DiscussionTopic.update_all('user_id = NULL', id: ID)
    where 'ID' is the ID of the announcement;
  * without logging in, navigate to the announcement's url;
  * verify that you are asked to log in;
  * make the course public and verify that the announcement
    is visible without a log in.

Change-Id: I79062535da8266384bb32c43732c7f25b0036675
Reviewed-on: https://gerrit.instructure.com/23227
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Zach Pendleton <zachp@instructure.com>
2013-08-13 02:18:55 +00:00
Jon Jensen e04b052d87 require terms by default, fixes CNVS-7330
they were required prior to our new settings refactors. this way we don't
need to go set it in prod

test plan:
1. terms should be required when registering at /register
2. terms should be required when activing an account (via course
   invitation email)
3. in the console, do Setting.set('terms_required', 'false')
4. terms should no longer be required on those pages

Change-Id: Idb13727839b847845cd4dacde4797e4e1571b42f
Reviewed-on: https://gerrit.instructure.com/22988
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-12 15:57:51 +00:00
Mark Severson da1c9dd97b add new page functionality to pages
test plan (course wiki and group wiki):
 - ensure that enable_draft is set for the account
 - navigate to the pages index
 * click the add Page button
   - ensure the page behaves as expected
   * editing permissions defaults to the course's setting
   * enter key (invokes the Save button, unless editing the body)
   * Save button (creates and navigates to the page)
   * Cancel button (navigates back to the index, hiding the sidebar)

fixes #CNVS-7167

Change-Id: Ib72f4c60e77420197d6e53efbe21ec46d4caf51f
Reviewed-on: https://gerrit.instructure.com/22701
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-08-09 17:04:32 +00:00
Mark Severson 4c913efc2e change new pages to show/hide elements correctly
test plan (in the course and group wikis):
 * enable draft state for the account (enable_draft)
 - general
   * Pages course tab navigates to new pages
     - front page
     - index page (if no front page is set)
   * Pages breadcrumb (in pages) navigates to new pages index
 - index page
   * New Page button is hidden unless user has create rights
   * Publish icon & settings cog hidden unless user is a teacher or admin
 - show page
   * Published button is hidden unless user is a teacher or admin
   * Published button functions properly (publishes and unpublishes)
   * Edit button is hidden unless user has edit rights to the page
   * Settings cog/Delete button is hidden unless the user has delete rights to the page
   * Page content is restricted if the page is locked by a module
 - edit page
   * Published indicator is hidden unless user is a teacher or admin
   * Settings cog/Delete button is hidden unless the user has delete rights to the page
   * Title field is hidden unless user has full edit rights (course setting)
   * Hide this page from students is hidden unless user is a teacher or admin
   * ... can edit this page is hidden unless user has full edit rights (course setting)
   * Unauthorized error if page is locked by a module
 - pages api
   * Unauthorized error when updating page if page is locked by a module

fixes #CNVS-6859

Change-Id: I12239e58a5f267c43fd2bcb912c7b485693de2c1
Reviewed-on: https://gerrit.instructure.com/22677
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Sterling Cobb <sterling@instructure.com>
Product-Review: Matt Goodwin <mattg@instructure.com>
2013-08-09 17:04:18 +00:00
Joel Hough adab2705df new conversations user opt-in
fixes CNVS-7134

test plan
- from the old conversations interface, ensure that the
 conversations intro can be brought up from the help
 menu
- from the old conversations interface, ensure that
 clicking 'Try New Conversations' from the help menu redirects to
 the new conversations interface
- ensure that navigating to /conversations redirects to the new
 conversations interface after the user has switched to new
 conversations
- from the new conversations interface, ensure that
 clicking 'Switch Back to Old Conversations' from the help menu
 redirects to the old conversations interface
- ensure that navigating to /conversations redirects to the old
 conversations interface after the user has switched back to old
 conversations

Change-Id: Ib8db233ebb56f915d0d183b704615de4bbe6539a
Reviewed-on: https://gerrit.instructure.com/23041
QA-Review: Cam Theriault <cam@instructure.com>
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-08-08 23:06:11 +00:00
Stanley Stuart a040b94cfa re-include logged out submissions for quiz statistics page
Fixes a regression where an error would be thrown if trying to access a
user's submission from the quiz submission data if the user had been
logged out when submitting the quiz (aka, a temporary user).

Test Plan:
  - As a student, take a quiz, but before you submit it, log yourself
    out in another tab.
  - As the teacher in the course, go to the quiz statistics page for
    that quiz. You should not get a page error.

fixes CNVS-7320

Change-Id: Ie75ed9af46accb92755f7a1a9d32dd6b1f3e50b8
Reviewed-on: https://gerrit.instructure.com/23164
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-08-08 20:04:38 +00:00
Braden Anderson 87c5d3d394 conversations: conversation subjects
fixes CNVS-7131

test plan:
  * verify that the conversations API docs include subject
  * verify that you can create a new conversation through
      the API with a subject
  * verify that you can create a new conversation through
      the API with a subject to multiple recipients
  * verify that conversations API responses include subjects
  * open conversations beta interface
  * verify that the conversation list includes subjects
  * select a conversation
  * verify that the subject is displayed above the messages

Change-Id: Ib4f32dc8348d08c10db42ddbe2022565de88dd9d
Reviewed-on: https://gerrit.instructure.com/22754
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Product-Review: Braden Anderson <banderson@instructure.com>
2013-08-02 22:24:08 +00:00
Jon Jensen 19fb1fbba0 make terms-of-use enforcement configurable
also fix issue around communication_channels/confirm not giving a visual
indication that the terms must be accepted if you forget to check the box

fixes CNVS-7189

test plan:
1. go to /register
2. you should not need to agree to the terms on any form, but you should
   see a link to the privacy policy
3. invite a user to a course
4. the user should not need to agree to the terms when setting a password
5. in the console, do Setting.set('terms_required', true)
6. go to /register
7. you should need to agree to the terms on all the forms
8. invite a user to a course
9. the user should need to agree to the terms when setting a password

Change-Id: I54857d7aaef1b528c6033a3464701abeae4ce14f
Reviewed-on: https://gerrit.instructure.com/22770
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-08-01 21:06:22 +00:00
Mark Ericksen c8414e19ee add root account setting for custom terms/privacy
fixes CNVS-6888

testing steps:
* from a console, set a custom privacy and terms url
  Setting.set('privacy_policy_url', 'http://custom.example.com/privacy')
  Setting.set('terms_of_use_url', 'http://custom.example.com/terms')
* verify the following location all display the new links:
  * <canvas>/enroll/<join_code> - with self_enrollments enabled for
    the course and currently logged out
    * when self registration is disabled at the root account,
      will be prompted to authenticate, "View Privacy Policy"
    * when self registration is enabled at the root account,
      will be prompted to authenticate or register, "View Privacy Policy"
    * when logged in as a teacher, prompted to confirm enrollment
      "View Privacy Policy"
  * <canvas>/register_from_website  - when logged out
    * page footer links for "Terms of Use" and "Privacy Policy"
    * "I'm a teacher", both links at bottom of dialog
    * "I'm a student", both links at bottom of dialog
    * "Parents sign up here", both links at bottom of dialog
  * <canvas>/accounts/<id>/users - click "Add a New User" from
    the right sidebar. "View Privacy Policy" in modal dialog.

Change-Id: Ic80c369dcea8483c93fb8adfcd9a80c1d6d3ad6a
Reviewed-on: https://gerrit.instructure.com/22712
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-07-31 18:26:54 +00:00
Brandon Broschinsky 530edcb631 additional partner data on kaltura upload
--test plan
upload or record file via tinyMCE media widget
additional partner_data should be available on kaltura
should include sis_course_id, sis_user_id where applicable
and also a context_source including where media uploaded from
fixes PS-321

Change-Id: Id32a0c72ef93e41991e8ee8b6234d36d5c02893a
Reviewed-on: https://gerrit.instructure.com/22607
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brandon Broschinsky <brandonbr@instructure.com>
2013-07-31 15:49:28 +00:00
Simon Williams b18d89c641 assignment publishing ui
closes CNVS-5686

test plan:
- click the cloud icon on the new assignment index page to publish and
  unpublish an assignment.
- click the publish button on the assignment show page to publish and unpublish
  an assignment.
- make sure that no other assignment fields (especially overrides and turniting
  settings) change when an assignment is published.
- try all the above a few times in a row without a page reload.
- check the assignment show page without the enable_draft? flag set and make
  sure the publish button doesn't show up.

Change-Id: I14cfd7145a9a58f18165a4242a492de0335e0187
Reviewed-on: https://gerrit.instructure.com/22466
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-26 18:33:46 +00:00
Jon Jensen 5a6311d286 group category API refactor
refs CNVS-6659

* move validation logic into model
* standardize api error messages
* deprecate split_group_count
* document group_limit
* actually require name (since that's what the api says)
* disallow setting self_signup when editing account categories since it
  shouldn't be an option (and is totally broken)

test plan:
1. run specs
2. regression of creating/editing categories on group management page

Change-Id: Iccdd4e2e98978943f0562aad5c8ac055048d204d
Reviewed-on: https://gerrit.instructure.com/22493
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-07-26 17:03:27 +00:00
Cody Cutrer 8e6b3fd57c return time zone in user profile api
fixes CNVS-6280

refactors User#time_zone and Account#default_time_zone to return actual
time zone objects instead of strings.
Assignments to the fields accept both forms; reading the field prefers
to return a Rails friendly name, but the IANA name is easily accessible
from that object. Continue to use Rails names for the UI, but use
IANA names for the API.

test plan:
 * in the UI, ensure that you can change timezones and it persists
   correctly in the following locations:
   * user profile as the user
   * root account settings
   * user page as an admin
 * check the API responses for /api/v1/users/self/profile and
   /api/v1/accounts/self; the time zone should be listed as an
   IANA name (i.e. America/Denver, not Mountain Time)
 * Update an account (PUT /api/v1/accounts/self) to change the
   default time zone; ensure both friendly names and IANA names
   are accepted on input, but on output the IANA name is returned

Change-Id: Ib976e7e1b2dde2639ff6fd478a59b38fdb0d07c0
Reviewed-on: https://gerrit.instructure.com/22563
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-25 16:46:32 +00:00
Jeremy Stanley ecf04171cd verify attachment belongs to submission in public_url
test plan:
 - have an assignment that accepts file uploads
 - as a student, submit the assignment with a file type
   previewable in Google Docs
 - as a teacher in the course (who is *not* an admin),
   enable the browser's network monitor and
   view the submission in SpeedGrader.

you should see a URL like this:

http://<canvas>/files/X/public_url.json?submission_id=Y

stick that in your browser's URL bar (while still
logged in as the teacher), and you should see a blob
of JSON containing a URL where the submitted file can
be downloaded.

now, change X to the id of some other file (not in
submission Y). run that, and you should get a
"status": "unauthorized" response.

fixes CNVS-7011

Change-Id: I6fe8ebba065fdc49f568d4d9e168811657da7b2c
Reviewed-on: https://gerrit.instructure.com/22525
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-07-19 23:41:18 +00:00
Jeremy Stanley b216585323 resubmit to scribd on inline view
test plan:
 1. have an environment with scribd and google doc previews enabled
 2. create a document, in a format compatible with both scribd
    and google docs (it needs to be a new document that isn't in
    scribd yet)
 3. upload this document to a course
 4. give a few minutes for scribd to process it
 5. make sure the scribd preview works in the files tab
 6. delete the file from the course
 7. undelete the file (use /courses/X/undelete)
 8. preview the file in the files tab; it should use google docs
    since the scribd doc was deleted
 9. wait a few minutes (canvas noticed the file was scribdable
    but had no scribd doc when you previewed in the last step,
    and resubmitted it to scribd) and then reload the page
10. a subsequent preview should show up in scribd
11. in addition to the files tab, also test
  a. documents embedded in rich text via wiki sidebar
  b. student submissions in SpeedGrader (probably requires the
     console, because there's no undelete for user files)

fixes CNVS-6774

Change-Id: Ic9fa5d43ef16522e1bd7a12d45f1f5dc7efbfe6f
Reviewed-on: https://gerrit.instructure.com/22378
QA-Review: August Thornton <august@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-07-19 21:43:03 +00:00
Derek DeVries 2d52c85430 quiz index page redesign for draft state
fixes CNVS-5674

changes
  1. implement redesign of quizzes index with publish icon
  2. adds header toggler to styleguide for item groups and condensed item groups
  3. refactor publish button code to fix onmouseleave event issue

test plan:
  in styleguide
  1. check that item group headers toggle open/closed

  on quizzes#show with :enable_draft = true
  1. publish button continues to publish/unpublish and remember state
  2. disabled the publish button when there are student submissions

  on quizzes#index :enable_draft = false
  1. make sure quizzes index page functions the same as before draft state features

  on quizzes#index as a teacher with :enable_draft = true
  1. shows 'no quizzes' message when there are no assignment or open quizzes
  2. greys out unpublished quizzes
  3. can publish and unpublish with the new publish icon in each row
  4. disables the publish icon on the row when there are student submissions
  5. editing/deleting quizzes works (and deleting prompts to confirm)
  6. the 'search for quiz' widget filters the quizzes as you type

  on quizzes#index as a student with :enable_draft = true
  1. unpublished quizzes are not visible
  2. publish icon or edit/delete links are not visible

Change-Id: Ida140d5e30761a520b118d0c62fb45bcf1a3a008
Reviewed-on: https://gerrit.instructure.com/22121
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-07-18 22:33:20 +00:00
Stanley Stuart cb05d5f034 filter inactive inherited assessment question banks
test plan:
  - create a quizquestion bank at the account level
  - delete it
  - go to a quiz, click the "Questions" tab, click the "Find Questions"
    button. This should bring up a dialog with a list of question banks
    on the left side. The question bank you deleted should not be there.

fixes CNVS-6866
fixes CNVS-5872

Change-Id: I24015cd4e21cc03b5b13bc7fc05b4a36d50ef487
Reviewed-on: https://gerrit.instructure.com/22442
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-07-18 19:59:23 +00:00
Cody Cutrer c0db2aed53 don't allow re-use of one time passwords
test plan:
 * configure MFA for a user
 * login with that user, but don't remember this computer
 * within 30 seconds, log out and log back in with the same code
 * it should say your code is invalid
 * enter your new code
 * you should be able to log in

Change-Id: I943d985b392b9117ed4c77634d8af2f27cd4e5f9
Reviewed-on: https://gerrit.instructure.com/21613
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-07-16 16:25:58 +00:00
Jon Jensen 35960a6431 spec: fix half-broken spec
broke with g/22210 ... these are always ordered by name now (previously
the order was arbitrary, though arbitrarily the same in the spec and the
controller)

Change-Id: I1a7a52409d6d7f38087a3d4964b5447b4bd336cc
Reviewed-on: https://gerrit.instructure.com/22316
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-07-15 18:33:50 +00:00
Jon Willesen 26de44c74e add published flag to discussion topic api
fixes CNVS-6737, CNVS-6746

test plan:
 - check the discussion topic api documentation for the
   published flag.
 - use the create and update api to twiddle the published flag
   as a teacher. this should change the student visibility of
   the topic and change the value of the published flag
   returned by the api.
 - use the create and update api to twiddle the published flag
   as a student. Trying to set the published flag to false as a
   student should result in an error in both create and update,
   and the topic should remain published.
 - create a topic and and add a post to it. try to use the
   update api to set published to false. this should result in
   an error and the topic should remain published.
 - you should not be able to create a draft state announcement
 - you should not be able to update an announcement to be draft
   state, even if it has no posts.
 - generally test creating and editing discussions to make sure
   nothing has broken, especially locking, unlocking, and the
   "available from" and "until" dates (see CNVS-6762).
   - make sure when editing a topic, it retains the available
   from and until dates when you don't specifically edit them.

Change-Id: Ie1591f380bff45f6ad6a7d7c83bc1d55947293a0
Reviewed-on: https://gerrit.instructure.com/22123
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
2013-07-12 23:25:12 +00:00
Jon Jensen 931276caf5 normalize group sorting, add SimpleBookmarker for common case
refs CNVS-6219

what's different in this change:
1. /groups now sorts by name. previously there was no guaranteed order.
2. /api/v1/users/self/groups should now sort by name (was id).
3. /api/v1/group_categories/:group_category_id/groups now sorts groups.
   previously there was no guaranteed order, making pagination unreliable.
4. /api/v1/accounts/:account_id/groups and /api/v1/courses/:course_id/groups
   are no longer case-sensitive, and sort by id in the event of a tie.

test plan:
* see specs
* ensure groups are sorted alphabetically (case insensitive) in the
  following places:
  1. /groups page
  2. /api/v1/users/self/groups
  3. /api/v1/accounts/:account_id/groups
  4. /api/v1/courses/:course_id/groups
  5. /api/v1/group_categories/:group_category_id/groups

Change-Id: I9c4cb34ead05f72640db43d40a67dcef97643de0
Reviewed-on: https://gerrit.instructure.com/22210
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
2013-07-12 23:09:50 +00:00
Jon Willesen 8dbbb0a622 preserve discussion dates when locked state is unchanged
editing a discussion topic would clear the lock dates because
the view passes the current lock state to the controller
action. so we don't want to clear the dates unconditionally
when the lock state is passed in, only if it's changed.

fixes CNVS-6841

test plan:
 - create a discussion with available from and until dates in
   the future.
 - edit the discussion and change the body, but do not change
   the dates.
 - click edit again and make sure the available from and until
   daates have not been cleared
 - make sure CNVS-6762 is still fixed

Change-Id: Ic83fec7d65223c94ee6c99da630c9ae41b4b4393
Reviewed-on: https://gerrit.instructure.com/22274
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-07-12 21:31:13 +00:00
James Williams 251e1fce4f add account-level external tool resource_selection route
test plan:
* add an account-level external tool that adds an
editor button (e.g. 'Youtube', 'Trello')
* use the tinymce editor in an account-level context
(e.g. edit an account-level outcome description)
* click the editor button
* should not get a 'Page not found' error

fixes #CNVS-6714

Change-Id: I505963e61fc8180646dd829aaa2a5b9003b35ab0
Reviewed-on: https://gerrit.instructure.com/22106
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>
2013-07-12 17:11:43 +00:00
Jacob Fugal 59737086e7 Auditors::Authentication
fixes CNVS-390

stores and allows querying by user/account/pseudonym of login/logout
events.

test-plan:
  [setup]
    - set up an 'auditors' keyspace in cassandra and run migrations
    - have shardX and shardY on one database server, and shardZ on a
      different database server
    - have accountW and accountX on shardX
    - have accountY and accountZ on shardY and shardZ, respectively
    - have userA on shardX with pseudonymAW in accountW and pseudonymAX in
      accountX (cross-account, single-shard user)
    - have userB on shardY with pseudonymBY in accountY and pseudonymBX in
      accountX (cross-shard user)
    - have userC on shardZ with pseudonymCZ in accountZ and pseudonymCX in
      accountX (cross-db-server user)
    - log in and out of each pseudonym above multiple times

  [index isolation]
    - /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should
      include logins and logouts from pseudonymAX only
    - /api/v1/audit/authentication/accounts/<accountX> should include
      logins and logouts from pseudonymAX, pseudonymBX, and pseudonymCX
      but not pseudonymAW
    - /api/v1/audit/authentication/users/<userA> should include logins
      and logouts from both pseudonymAW and pseudonymAX but not
      pseudonymBX or pseudonymCX

  [permission isolation]
    (in each of these, either :view_statistics or :manage_user_logins on
    an account qualifies as "having permission")
    - /api/v1/audit/authentication/pseudonyms/<pseudonymAX> should be
      unauthorized if the current user doesn't have permission on
      accountX
    - /api/v1/audit/authentication/accounts/<accountX> should be
      unauthorized if the current user doesn't have permission on
      accountX
    - /api/v1/audit/authentication/users/<userA> should be unauthorized
      if the current user doesn't have permission on either of accountW
      or accountX
    - /api/v1/audit/authentication/users/<userA> should include logins
      and logouts from accountW but not from accountX if the current
      user has permission on accountW but not on accountX

  [sharding]
    - /api/v1/audit/authentication/users/<userB> should include logins
      and logouts from both pseudonymBY and pseudonymBX
    - /api/v1/audit/authentication/users/<userB> should not include
      duplicate logins and logouts from either pseudonymBY and
      pseudonymBX (potential for bug due to both pseudonyms' shards
      being on the same database server)
    - /api/v1/audit/authentication/users/<userC> should include logins
      and logouts from both pseudonymCZ and pseudonymCX

Change-Id: I74b1573b346935f733fe5b07919d2d450cf07592
Reviewed-on: https://gerrit.instructure.com/21829
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-07-12 16:10:33 +00:00
Landon Wilkins 261d7725dc adds api endpoint for randomly assigning unassigned members in a group category
fixes CNVS-6696

test plan:
1) use postman to make a request to this new endpoint for a group category that
   has unassigned members
   --asynchronous example:
   POST http://localhost:3000/api/v1/group_categories/<group_category_id>/assign_unassigned_members
   --synchronous example:
   POST http://localhost:3000/api/v1/group_categories/<group_category_id> \
   /assign_unassigned_members?sync=true
2) verify that the group category's unassigned members have now been assigned
   among the available groups
   --NOTE: this may take a minute depending on the number of unassigned members
3) verify the api documentation for Group Categories - "Assign unassigned members" makes sense
4) verify that an asychronous request returns a Progress JSON
   (see api documentation for example)
5) verify that a synchronous request returns an array of Group Memberships
   (see documentation for example)

NOTE: I've made some tweaks to the current Groups page such that you can
  still randomly assign students. However, this shouldn't matter because
  it's all getting replaced anyway.

Change-Id: I894ff2b1e11c7919a110b5159710683869caedc4
Reviewed-on: https://gerrit.instructure.com/22044
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-07-11 15:09:34 +00:00
Zach Pendleton 71450c6c41 properly unlock locked discussions with a lock_at time.
fixes CNVS-6762

test plan:
  * create a discussion with a lock_at in the past;
  * navigate to the discussion index page and drag the
    discussion from "closed for comments" to "discussions;"
  * refresh the page and verify that the topic remains
    unlocked.

Change-Id: I35c819895d41e6f0f70a76c0e8805b963ff41a9e
Reviewed-on: https://gerrit.instructure.com/22111
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
Product-Review: Mark Ericksen <marke@instructure.com>
2013-07-10 14:57:24 +00:00
Derek DeVries 510113826c remove extra publish button on quiz show page, add feature flag for draft state
fixes CNVS-6415, CNVS-6594

various adjustments to make the quizzes show page look closer to the ui design.
1. lighten up the publish cloud icon on the publish button's unpublished state.
2. publish button disabled state shows correct tooltip and is not 'depressed'
3. consolidate all buttons in the header bar to match the ui changes.
4. Fix issue where questions would not appear after publishing a quiz

test plan:
  with :enable_draft = false
  1. make sure publishing functions the same as before draft state features

  with :enable_draft = true
  1. visit an individual quiz page.
  2. the buttons should now all be consolidated on the top header bar
  3. the "this quiz is unpublished" message should display underneath the bar if
     the quiz is unpublished
  4. publish a quiz and then start the quiz to make sure the questions are shown
  5. submit quiz as student and ensure the published button disables
  6. make sure the disabled state of the publish button looks correct

Change-Id: I27766a88950878cb4ba9b88400f8b326b7f46b5f
Reviewed-on: https://gerrit.instructure.com/21874
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-07-09 17:08:39 +00:00
Simon Williams d733314354 configurable turnitin api endpoint
closes CNVS-5992

test plan:
- make sure existing turnitin still works
- go to account settings, leave turnitin host blank, save
- it should still work
- change it to api.turnitin.com
- it should still work
- change it to another valid turnitin endpoint
- it should still work

Change-Id: I442871d35f3a8440f49485252cf88dd4cd441ec2
Reviewed-on: https://gerrit.instructure.com/21969
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-08 20:25:41 +00:00
Cameron Sutter 5667d38099 include logged_out quiz submissions in quiz statistics
fixes CNVS-1399

test plan:
- as a teacher in a public course, create a survey
- as a user who is not logged in, take the survey
- as the teacher again look at the quiz results and statistics
- the anonymous quiz submission should show up

Change-Id: I77fa94303f32c95870baa8fe8ab81f5b834e2f7e
Reviewed-on: https://gerrit.instructure.com/20428
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-07-08 19:48:29 +00:00
Cody Cutrer 56b4d73b7e CAS single sign out
fixes CNVS-6343

test plan:
 * without Redis
 * normal CAS logins should work (rubycas-server is easiest to test
   with)
 * do a POST to /login/cas (with CURL)
 * it should 404
 * enable Redis, restart server
 * normal CAS logins should work
 * enable single sign out on the CAS server (if not already enabled;
   it's a separate setting for rubycas-server)
 * log in to Canvas via CAS
 * in another tab, sign out on the CAS server
   (just go to /logout with rubycas-server; there's no link to it)
 * refresh the page in Canvas; it should redirect you to the CAS
   server
 * log in to Canvas via CAS
 * clear your Redis database
 * refresh the page in Canvas; you should still be logged in
 * in another tab, sign out on the CAS server
 * refresh the page in Canvas; it should redirect you to the CAS
   server

Change-Id: Ie3bc286f1284886cf211c4ecce14c3dbf5e4deb7
Reviewed-on: https://gerrit.instructure.com/21496
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-29 01:07:08 +00:00
Jacob Fugal 868d9a85e5 ignore bad file ids
if a file_id is given to show_relative in addition to a file_path, but
that file_id is invalid, treat is just like as if they'd given an
incorrect-but-valid id (i.e. doesn't match the path).

fixes CNVS-6148

test-plan:
  - create a file
  - get a link to the file that includes both the file_id and file_path
  - change the file id to an invalid string
  - should still load the file
  - should not generate a page error

Change-Id: Ifed3fbd9ef9fe2c5a4fd951f2de5facdf38e28d0
Reviewed-on: https://gerrit.instructure.com/21556
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-06-28 22:08:06 +00:00
Stanley Stuart 0ee2cd2a3d do not allow assignment groups with frozen assignments to be deleted
This restores previous behavior for the Assignment Property Freezer
plugin:

Teacher are not allowed to delete a an assignment group in a copied
course if an assignment in that group has been "frozen" when it was
copied.

The previous behavior allowed teachers to delete a group if and only if the
assignment group id was not frozen. Now, if any properties are allowed
through the Assignment Freezer Plugin, the teacher may not delete the
assignment.

test plan:
  - As an administrator, enable the Assignment Property Freezer by going
    to Site Admin -> Plugins (on the left). Enable a few properties such
    as "description" and hit "Apply".
  - As a teacher, create a new assignment group. Create an assignment
    within that assignment group. Click "More Options" or go to the
    assignment's edit page. Under "More Options" on the edit page, check
    the box that says "Lock Properties When Copied".
  - As an administrator, copy the course by going to the Course's
    "Settings" tab and clicking "Copy This Course" on the right hand
    side. Follow the wizard, then enroll a teacher by using the "People"
    tab on the left in the new course.
  - As a teacher (very important you are NOT an administrator), go to
    the assignments index page (/courses/new_course_id/assignments), and
    you should see the new assignment group and assignment you set up.
    Hover over the assignment group's box and click the "x" icon to
    start deleting the assignment group. When you click "Delete Group"
    as the teacher, you should get a flash error message telling you you
    cannot delete a locked assignment.

fixes CNVS-6224

Change-Id: I76c72be9941b32a13303f166c48e2e7a021d379f
Reviewed-on: https://gerrit.instructure.com/21634
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-06-25 19:49:27 +00:00
Brian Palmer cd4f95e209 survey notification support
Special survey account notifications (announcements) can be set up on the
site_admin account. These survey notifications will only appear for
accounts that have the "Account Surveys" setting enabled in their
account settings, and they'll only show up for 1/N users in
those accounts each month. N is configurable, defaults to 9.

closes CNVS-6036

test plan:
* On a regular account, create an announcement in account settings.
  There shouldn't be any options related to surveys available.
* On the site admin account, create an announcement. Select to make it a
  survey. You can leave N at 9 or change it.
  * Verify that the survey doesn't show up for any users on accounts
    that don't have "Account Surveys" enabled.
  * Enable the "Account Surveys" setting on an account. Verify that the
    survey shows up for (roughly) 1 out of every N users in the account,
    on their dashboard. Change the time on the computer running canvas
    to another month. Verify that the survey shows up for a different
    set of 1/N users in the account.

Change-Id: If11467d2153acee24a010ba45d516b0b320a4634
Reviewed-on: https://gerrit.instructure.com/21432
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-06-17 16:58:39 +00:00
Cody Cutrer f0a0ec6741 allow inferring authenticity token from upload policy even if a session exits
Chrome and Firefox send the session from Flash, Safari does not. So allow
inferring the authenticity token whether a session exists or not

Also, the JS no longer needs to worry about if uploading to local or remote
and adding/filtering the authenticity token - just do the same every time.

test plan:
 * use local storage
 * upload a file by clicking "Upload Files"
 * it should work in Safari, Firefox, Chrome, and IE

Change-Id: Ia46bde6ab042f21cd0643d4f5a1dbd2f7f9cee66
Reviewed-on: https://gerrit.instructure.com/21100
Reviewed-by: Jon Jensen <jon@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-06-14 14:43:00 +00:00
Joe Tanner b1839d2c53 assign_unassigned_members progress api support CNVS-6256
GroupsController#assign_unassigned_members now renders progress_json
and starts a job to do the assignment.

test plan: see specs

Change-Id: I6844644bfb48fd613577b308778b283652373220
Reviewed-on: https://gerrit.instructure.com/21409
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-06-13 15:56:00 +00:00
Joel Hough fcfadd9e48 fix cross-shard context bug in CalendarController::show2
fixes CNVS-6150

some context lookups were being done with shard-local ids on a
shard that they didn't live on. this meant that either the wrong
context object was being looked up or no context was found, causing
a broken calendar

test plan
you will need:
- two shards (called Shard 1 and Shard 2 from now on)
- a course on Shard 2 with an id that does not correspond to a
 course on Shard 1. i.e. if the course has an id of 2~5 there must
 not be a course with an id of 1~5. one way to make such a course
 would be to make more courses on Shard 2 than there are on Shard 1
- a user on Shard 1 that is in the course on Shard 2
- a calendar event in the course

with all this in place:
- as the user, ensure that the calendar page shows the calendar
 event without error

Change-Id: Ie2a73c4aa775dfc249943318e5d72731542ca6a5
Reviewed-on: https://gerrit.instructure.com/21226
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-06-12 21:36:32 +00:00
James Williams 94d1f2ee97 add default_group_storage_quota setting to accounts
test plan:
* in account settings - quotas tab,
 set the default group storage quota
* attempt to upload files to a new group (without a set
quota) until the quota is hit or exceeded, confirming
that the set default is in effect

refs #CNVS-271

Change-Id: Ia4cbd84da19eb07d188dcc85c81c6b45bc2fa7ce
Reviewed-on: https://gerrit.instructure.com/21191
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-06-07 21:11:57 +00:00
Brian Palmer 6c0636fb86 add support for account services that are only enable-able by some users
For instance, this allows for account services that can only be enabled
in the UI by site admins, that kind of thing.

closes CNVS-6140

test plan: specs, this doesn't add any new services yet

Change-Id: Ie330c79b75a0cf4b755d73bba57dffc64c5e6447
Reviewed-on: https://gerrit.instructure.com/21262
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-06-06 22:27:16 +00:00
Joe Tanner 649c5cb85b Mobile oauth confirmation page, closes CNVS-5455
Mobile styling of oauth confirmation page.
Also refactors mobile login page to use boostrap.

test plan:
1. go to Site Admin > Developer Keys
2. add or use existing key to fill out this URL:
    /login/oauth2/auth?client_id=<ID>&response_type=code&redirect_uri=<URI>
    (URI should be encoded)
3. in a Chrome tab change the User Agent to a mobile device
4. in that same tab go to the url in step 2
    (you may be redirected to login)
5. the oauth confirmation page should look decent
6. click Log In, you should be redirected to URI + ?code=<long code>

Change-Id: I32a4d0638838dd23667ceaf40c02a5be84434f08
Reviewed-on: https://gerrit.instructure.com/21220
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-06-06 21:20:21 +00:00
Cameron Sutter e7c24b05eb assignment groups API
fixes CNVS-6064

test plan
- using the API, create, get, and update an assignment group
- using the API, delete an assignment group with and without assignments
and both specify an assignment group to move the assignments to
and don't specify an assignment group
- it should throw an error if there are no other active assignment groups

Change-Id: I0d637d73255115258dc42e73541146c889a68afc
Reviewed-on: https://gerrit.instructure.com/20993
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-06-03 18:02:46 +00:00
Joe Tanner 5c9b83f826 Allow users to resurrect a retired email, closes #CNVS-6045
Really resurrect retired communication channels.
Fixes some callbacks that should've returned true.

test plan:
1) in rails console:
    u = User.find(<some user id>)
    cc = u.communication_channels.detect{|cc| cc.path_type == 'email'}
    cc.bounce_count = 5
    cc.workflow_state = 'retired'
    cc.save
2) take note of the email on the cc
3) start up the server and go to /about/<user id>
4) click 'Add Email Address' and enter the email noted in #2
5) it should be successful

Change-Id: I0b4572545859eacd823a46b326303860069b00f1
Reviewed-on: https://gerrit.instructure.com/21102
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
2013-06-03 17:13:37 +00:00
Simon Williams 6494940a64 fix announcements for logged out users in public courses
fixes CNVS-6133

test plan:
- in a public course, make an announcement
- view it as a logged out user
- it should work

Change-Id: Ic887760066b58745e2d541194a72da6874b69bcc
Reviewed-on: https://gerrit.instructure.com/21134
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
2013-06-03 15:05:42 +00:00
Cody Cutrer 7716f4129e don't reference conversations table when not needed
and not necessarily there

Change-Id: I8895cefd2343d98384a666584c9c872bf6281bd9
Reviewed-on: https://gerrit.instructure.com/21132
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
2013-06-01 15:09:40 +00:00
Cody Cutrer 696a5e8015 create attachment's from the association
fixes CNVS-6100

test plan:
 * merge a user together from multiple shards
 * from a domain on the non-home shard, upload file to the user's
   files
 * it should preview and/or download
 * reload files
 * it should not disappear

Change-Id: I0d10ce83fbad6672921aee93620f87f20b91c7ba
Reviewed-on: https://gerrit.instructure.com/21094
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-05-31 19:37:14 +00:00
Jeremy Stanley 3c2a49bd94 look at prerequisites when evaluating modules in api
fixes CNVS-5770

test plan:
 - have a teacher and student enrolled in a course
 - as the teacher, create a module with no prerequisites
 - as the student, view the module in the API (make sure not to
   view the module from the web site beforehand)
 - verify that the module is "unlocked" (or "completed", if
   it's empty), not "locked"

Change-Id: I1f4ab4701601be1ed0f353e73e984877bc720ea0
Reviewed-on: https://gerrit.instructure.com/20954
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-30 16:40:11 +00:00
James Williams d71b258ed2 allow any wiki page to be set as front page
test plan:
* confirm that wiki pages can be created and updated
with the parameter wiki_page[front_page]
 * if true, this will set the wiki page as the
 front page for the context (assuming the page is
 not hidden to students)
 * if false, this will unset the page as the front page
 (assuming it was the front page to begin with)

* confirm that /courses/:course_id/front_page acts
as a proper endpoint for show/update/destroy and
acts just as /courses/:course_id/pages/:url
for whichever page is set as the front page

* confirm that none of the above page breaks
normal wiki functionality

closes #CNVS-5528

Change-Id: I3f51d740e90ff0a5a39f2aafc988a1a33947ca18
Reviewed-on: https://gerrit.instructure.com/20938
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>
2013-05-30 02:51:35 +00:00
Jeremy Stanley b498f26e45 limit the length of media comment titles to 255 chars
test plan:
 - record a video or audio comment, and enter a long title.
   it should prevent you from entering more than 255 chars
   (rather than failing to save the media comment)

fixes CNVS-4446

Change-Id: Iec4d022bba3b33f5bf678ed7ca37c366a337b3f1
Reviewed-on: https://gerrit.instructure.com/20944
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-29 19:29:00 +00:00
James Williams cca7214861 remove unpublished module items from active scope
keep module items in the 'unpublished' state from
being viewed by students or factoring into progressions, etc

test plan:
* create an unpublished module item
* ensure that as a student:
 * the module item is not viewable, either through the site
 or through the api
 * that it is not factored into the progression for the module

* also confirm that the unpublished module item carries over
on course copy

closes #CNVS-5491

Change-Id: I60e19ea49386e0e6c60c4a86b1a34979b4c0664d
Reviewed-on: https://gerrit.instructure.com/20834
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-05-29 19:22:39 +00:00
Cameron Sutter 3193391ae7 hides quiz statistics for large_roster but loads the page
fixes CNVS-4886

test plan:
- as a teacher, create a MOOC with a quiz
- view the statistics page for that quiz
- it should not redirect to the quiz show page
- it should show you a message that the page is disabled

Change-Id: I7563b2d5a55850ac7b196cd389082bc5652b1690
Reviewed-on: https://gerrit.instructure.com/20772
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-24 15:26:03 +00:00
Jeremy Stanley aa120ecd78 record last_inline_view time for attachments
to collect data about when scribd (or crocodoc) documents
are not being used and can be purged from third party servers
to save money

fixes CNVS-5310

note: this data is not yet exposed; it can only be queried
from the database manually for now

test plan:  make sure the last_inline_view attribute for an
Attachment is updated whenever the attachment is viewed via
scribd or crocodoc. this can be done in several ways:
 - via the preview icon that appears next to a document link
   in rich text
 - on the files page
 - for student submissions on SpeedGrader

the easiest way to check this is in the Rails console.
get the attachment id from the canvas url, then,
in the console (after switching to the correct shard),
do

  Attachment.find(id).last_inline_view

Change-Id: I137ab631ad4eefdf4d9af353dd11191b7f2ca140
Reviewed-on: https://gerrit.instructure.com/20810
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-24 14:56:40 +00:00
Ryan Florence 534d92b5b3 added tour guide libs
closes CNVS-5736

test plan:
1. see specs

Change-Id: I1edbd4062d3c1a25394bdaaf028fa8198609a881
Reviewed-on: https://gerrit.instructure.com/17312
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-05-22 19:30:13 +00:00
Simon Williams 1d20e4a2bd round student_entered_grade to two decimal places
also fixes a few other student grades page bugs

fixes CNVS-4816

test plan (main):
- as a student, go to the course grades page
- enter some ridiculously small scores, like
  '0.0000000000000000000000000000000000000000000000000000000000000000
   000000000000000000000000000000000000000000000000000000000000000000
   000000000000000000000000000000000000000000000000000000000000000000
   000000000000000000000000000000000000000000000000000000000000000000
   00000000000000000000000000000000000000000000020'
- it should round to two decimal places (0 in this case)

test plan (other fixes):
- as a student on the course grades page
- if you enter only 0's as what-if grades, and refresh the page, you should
  have a 'see saved what-if scores' button
- entering a what-if grade on an assignment that you don't have a score for
  should not throw a javascript error
- it should round what-if scores in UI to 2 decimal places
- entering a what-if score in a row that doesn't have a score should populate
  the text entry box with '0' instead of 'NaN'

Change-Id: I37dba44b3845bd40424f0c2ae88d9b04f9f887e9
Reviewed-on: https://gerrit.instructure.com/20482
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-20 16:02:54 +00:00
Stanley Stuart 5ad43c33bd add ability to download all file uploads for a quiz as a zip
test plan:
  - as a few different students, take a quiz with at least two questions
    that are file upload questions. Answer each question as each
    student.
  - as the teacher, you should see a "Download All Files" button on the
    right on the Quiz Show Page next to "Quiz Stastics" and "Moderate
    This Quiz".
  - You should get a pop up that successfully downloads all the zips
    (make sure you have delayed jobs running!). Make sure all the files
    you submitted as the students are there, with the student's name,
    user id, question number, and attachment display name in the
    filename of each file.

closes CNVS-3048

Change-Id: I23cb2d4262bb0446476eeac4fdcb356e604e6a05
Reviewed-on: https://gerrit.instructure.com/20495
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-16 21:14:19 +00:00
Stanley Stuart d0a28cf9df fix changing an ungraded survey to a graded quiz
test plan:
  - as a teacher, create a graded quiz and save the quiz
  - edit the quiz again, and change the type to ungraded quiz
  - edit the quiz AGAIN and chang the type back to graded quiz
  - You should get redirected like you did in all the other edits, and
    you shouldn't get stuck on the quiz edit page with "Saving..." stuck
    on the button.

fixes CNVS-5643

Change-Id: Icd0ed4609e9eeeb5e3e565eaa07628367bb71f0a
Reviewed-on: https://gerrit.instructure.com/20645
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Eric Berry <ericb@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-16 03:13:27 +00:00
Brad Humphrey be800d1e1f adding additional api support for the app center
Reworked how the calls were passed through to take advantage of the
app center pagination.  Also added an endpoint for retrieving app reviews.

The following canvas api calls should work, after configuring the app center plugin
 - /api/v1/accounts/:account_id/app_center/apps
 - /api/v1/accounts/:account_id/app_center/apps/:app_id/reviews
 - /api/v1/courses/:course_id/app_center/apps
 - /api/v1/courses/:course_id/app_center/apps/:app_id/reviews

These should also accept a page and per_page params

Change-Id: I15fe1225c01d04bc2ad6efa1736013b88e541c51
Reviewed-on: https://gerrit.instructure.com/20455
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Brian Whitmer <brian@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-05-15 17:22:31 +00:00
Stanley Stuart 14cca9620b limit course enrollments when option is checked on "People" page
test plan:
  - if you don't already have one, create a course with users in
    multiple course sections
  - as a teacher/person who can add enrollments to a course, go to the
    "People" tab on the left.
  - Add a new teacher to the class using the "Add People" button. When
    you create the teacher, make sure to check the "Can grade students
    in their section only."
  - Follow the dialog all the way through, then create a login for the
    new teacher you created and login as that teacher.
  - go back to the "People" tab. You should only see students in the
    teacher's section.

fixes CNVS-5763

Change-Id: I95ec3a660928f6f498d50b504fd8b024d3b0d1cd
Reviewed-on: https://gerrit.instructure.com/20505
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-10 01:52:41 +00:00
Jon Jensen a07b2ee772 async quiz report generation UI, fixes CNVS-4512
add button to create item analysis report, and make student analysis
creation async. make both buttons show a progress indicator, and auto-
download the file when it's ready (or not, if you refresh the page)

test plan:
1. make sure delayed jobs are running
2. create a quiz that allows multiple submissions
3. have some students take the quiz
4. go to the quiz statistics page
5. click "Generate Item Analysis"
6. it should be generated and prompt you to download
7. the data should be useful/correct
8. click "Generate Student Analysis
9. it should be generated and prompt you to download
10. the data should be useful/correct
11. have another student take the quiz
12. you should be able to regenerate both reports
13. have a student retake the quiz
14. you should get the link to view stats for all submissions
15. you should be able to download a different "Student Analysis" report
    for all submissions vs latest submission
16. the "Item Analysis" report should be the same for all submissions and
    latest submissions

Change-Id: Ib6bfa259f386a6660a41cd7e093d3a6eb0119eda
Reviewed-on: https://gerrit.instructure.com/20137
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
2013-05-08 23:11:52 +00:00
James Williams 748a26b566 don't include concluded course groups in calendar
test plan:
* create a course with a group
* soft-conclude the course
* as a user of that group, should not continue
to see the group calendar on the calendar page

fixes #CNVS-2776

Change-Id: Ie1c7ad722ced6bfb95a65c31faccfc989328ce18
Reviewed-on: https://gerrit.instructure.com/20394
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
2013-05-08 22:34:55 +00:00
Eric Berry ac76eaf598 added auto lock discussions on specified date
fixes CNVS-4106

test steps:
- go to create a discussion topic and ensure that you can toggle between
  the 'Graded' and non-graded availability dates. If the Graded is not
  checked, you should see the Available From/Until.
- create a discussion topic with a past from and past until. ensure that
  the discussion is locked for a student
- create a discussion topic with a future from and future until. ensure
  the discussion cannot be seen by the student
- update the above created discussion topic and switch it to be graded
  and set a future due, from, until date. ensure that the student cannot
  see the discussion.
- edit the discussion and ensure that the graded checkbox is checked and
  the group assignment fields are showing
- update the assignment with a past due, from, until and make sure the
  discussion is locked for the student.
- do all above with current dates (from in past, until in future) and
  make sure the student can see and reply to them.
- create an announcement and ensure that the functionality and forms are
  the same as before
- verify that you are able to lock and unlock discussion topics on the
  show view by using the gear drop-down

Change-Id: I99c9d54763fe3a74aa8a4bb37c22f09d4765d41e
Reviewed-on: https://gerrit.instructure.com/20339
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-05-08 17:49:11 +00:00
Brad Humphrey 5e109f4434 show validation errors when configuring external tools
fixes #9725, fixes #9776, fixes #7311,
Test plan:
* go to the 'external tools' tab on the 'course settings' page
* create and edit some external tools
- make sure to omit fields or input invalid data and make sure you
get sensible error messages back

Change-Id: I88a7d5e439a27a599cbcfcfbd576434386949d35
Reviewed-on: https://gerrit.instructure.com/13332
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-05-08 15:44:44 +00:00
Stanley Stuart 552dae8070 implemented ui for quiz file upload question type
test plan:
  - enable the quiz file upload feature for your account.
  - make sure you have s3 credentials for your Canvas installation
  - as a teacher, create a quiz with some file upload questions
  - as a student, take the quiz, making sure the following works:
    - you should get a warning if you leave any questions unanswered
    - you should see your file in the right spot if you refresh the page
  - when you finish the quiz, make sure a link to the file shows up on
    the quiz show page and the display name for that file is the same
    name of the file you uploaded
  - take the quiz again and make sure files you uploaded for hte
    previous submission don't show up when you first take the quiz.

closes CNVS-1153
closes CNVS-5331

Change-Id: Id3f8706e87cef9876946b52fd564caf31f31e4b5
Reviewed-on: https://gerrit.instructure.com/20174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-05-07 17:34:03 +00:00
Brian Palmer 31f33164b5 remove 1.8 compatibility shims
- update the Gemfile to be 1.9 only, and raise an exception on wrong
  ruby version
- remove RUBY_VERSION checks, replacing with the applicable code
- remove the FasterCSV compatibility shim, just use CSV now

test plan: trying to bundle install on ruby 1.8 or 2.0 should raise an
exception, specs should pass, canvas should work as normal on 1.9

Change-Id: I49088e9d227c59c6d5d5acb417c2df971129474a
Reviewed-on: https://gerrit.instructure.com/19806
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-05-03 01:43:52 +00:00
Simon Williams 7311db8b62 add a per quiz submission token and validate against it
this is necessary since csrf protection is disabled for certain quiz submission
actions.

closes CNVS-3986

test plan:
- make sure taking a quiz and submitting still works normally
- make sure previewing a quiz still works normally
- create a new quiz
- start a quiz with one user, answer a few questions
- in a separate tab, log out and log in as another user
- if you change anything, you will get the "logged out" message
- if you try to quickly submit, the answers won't count for you

Change-Id: I2222975ea0cc6ecb346d03dc2077dc411e759084
Reviewed-on: https://gerrit.instructure.com/20051
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-05-01 16:26:07 +00:00
Brad Humphrey 45f3bb468b lti configuration refactor
this commit is to help make canvas extensions more robust by
allowing tool level defaults and allowing both tool domains and launch
urls. Also added some helper methods for getting the correct properties,
and refactored to use the new helper methods.

Test Plan:
- Add a tool with both a domain and an launch url
- It should not give an error

- Add a tool configured with defaults for for canvas extensions
(such as icon_url, url, selection_height, selection_width, etc)
- Add a canvas launch (resource_selection, editor_button, course_navigation, etc)
with minimal configuration
- The canvas launch should inherit the properties from the extensions default
- Add an launch that has its own properties
- The launch should prefer its properties over the defaults

* should test that all launch types are accepting defaults

closes #CNVS-4498

Change-Id: I0dd4e78efb54db9c0cd1204383934db50f402674
Reviewed-on: https://gerrit.instructure.com/17715
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-29 21:05:58 +00:00
Cody Cutrer 4ffcfe0721 get assignments and submissions from all shards
fixes CNVS-4959

(note that this does not cover the cross-shard links
from these assignments working correctly; that is a
separate issue)

test plan:
 * enroll a user in courses in multiple shards
 * assignments from all courses should show up in
   /assignments regardless of current shard

Change-Id: Ic46711a31ddc573f124cad3ed2bc5abefd4646a9
Reviewed-on: https://gerrit.instructure.com/19234
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-29 16:00:31 +00:00
Joe Tanner 5fea28ce02 async json API to generate quiz stats reports
closes #CNVS-4511

refactor of some of the QuizStatistics model so it can be used with multiple report types

test plan:
just ensure the current quiz stats page and csv report still work,
the item analysis UI commit will have a more comprehensive test plan

Change-Id: I2973a2e3aa572bc272c59b4b97015c7f93d756d7
Reviewed-on: https://gerrit.instructure.com/20057
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Joe Tanner <joe@instructure.com>
QA-Review: Joe Tanner <joe@instructure.com>
2013-04-29 15:05:47 +00:00
Mark Ericksen 569d7a2b06 fix sharding issue with inbox
fixes CNVS-5478

Testing Notes:
================
* with a user that has conversations in their Inbox
  that are spread across multiple shards, a JSON
  request to /conversations.json should return
  a hash with :conversations and :conversation_ids.

  The list of IDs uses the "pluck" command which is
  not currently working across shards with the way
  associations were being included for this query.

  With this fix, the :conversation_ids list should
  include the IDs of at least all of the
  conversations JSON objects returned.

Change-Id: I718e9ea1e714f9a931ebf28a26389746e093a425
Reviewed-on: https://gerrit.instructure.com/20040
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:49:36 +00:00
Jon Willesen d8efd3e805 improve robustness of incoming message processor
replaced the mailman gem with custom code with more error
handling. this will allow the incoming message processor to
continue processing messages after encountering a message with
an encoding or parsing error. the broken messages will be moved
aside to a separate folder for later inspection.

fixes CNVS-4970

test plan:
 - read up on the new incoming_mail.yml configuration settings.
 - configure incoming_mail.yml with the test imap accounts
   using legacy settings and check for regressions.
 - reconfigure incoming_mail.yml to read from a directory.
 - copy some testing email files into the configured directory.
   test files should be a mix of:
   - emails with encoding errors
   - emails with syntax errors
   - normal emails
 - all of the normal emails should be processed normally
 - all of the error emails should be moved into the error
   subdirectory

Change-Id: I0f946a56b41492f007db2775aa6da3cdfa4fdd3f
Reviewed-on: https://gerrit.instructure.com/19729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:47:09 +00:00
Simon Williams 105026bf21 redirect to referrer after unauthorized post/put
fixes CNVS-5248

test plan:
- start taking a one-question-at-a-time quiz
- log out in another tab
- hit the next or previous button
- re-login
- you should land back in the quiz

Change-Id: I578d6803bd6deb90ec3c82153d999b478e42a199
Reviewed-on: https://gerrit.instructure.com/19539
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-22 16:19:13 +00:00
Simon Williams dfd6f86bf9 support persistent headless state for quizzes
also supporting forcing the quiz show page to require a user even in a public
course.

closes CNVS-5250

test plan (api):
- make sure the quiz api returns a mobile_url that sets these parameters

test plan (headless):
- go to a one question at a time quiz
- add ?headless=1 to the url
- notice that the quiz loads without top/side bars
- start the quiz
- the top/side bars are back
- now go back to the show page and add ?persist_headless=1
- start the quiz
- the top/side bars should still be gone

test plan (force user):
- as a logged-out user, go to a quiz show page in a public course
- it should work
- now add ?force_user=1 to the url of the show page
- it should redirect to the login page
- after logging in, you should end up back at the show page

note: please also check that getting notified when logged out of a quiz still
work, as that code was refactored slightly.

Change-Id: Id17ce336f8d12a6f4dd0f4d1324e7b4dd5cca1d0
Reviewed-on: https://gerrit.instructure.com/19597
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-21 00:03:02 +00:00
Duane Johnson 48d8360fcf remove Test Student from user search and users list
The Test Student should not appear in the search results list for
courses. In some cases, it may be useful to call the API and include
the Test Student. In these cases, include=test_student will do so.

Test Plan:
 - As a teacher, go in to the "student view" for a course
 - As a teacher or student of the same course, list students in
   the course. There should not be a Test Student in the list.

Fixes CNVS-5335

Change-Id: I7ce5805a795ef2a5d20e002e1e8dcafaabc49390
Reviewed-on: https://gerrit.instructure.com/19745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
2013-04-19 19:19:00 +00:00
Simon Williams c7e1fcf934 fix taking public non-graded quiz while logged out
fixes CNVS-4562

test plan:
- in a public course, create a practice quiz
- log out
- take the quiz
- it should work

Change-Id: I0e98d6d165622ee58ddc63896d71bad57075a3cd
Reviewed-on: https://gerrit.instructure.com/19602
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-18 22:08:06 +00:00
Cameron Matheson 14fa60402d groundwork for background generation of quiz stats
This actually did do the stats generation in the background, but that
has been disabled temporarily since we don't have a front-end UI yet.

Test plan:
  make sure you can still download quiz stats csv

closes CNVS-4887

Change-Id: Ia84af0c8392396a054ceba2f6edbcaf7c8c40c90
Reviewed-on: https://gerrit.instructure.com/19397
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-04-18 21:54:10 +00:00
Zach Pendleton dddbe43ff7 always send quiz due date changed notifications.
fixes CNVS-5102, CNVS-5255

when a quiz due date has changed, always send notifications
to affected users; don't require the editor to check the
"notify users this quiz has changed" checkbox.

test plan:
  * as a teacher, change the due date of an existing quiz
    and save the change without checking the "notify users
    that this quiz has changed" checkbox;
  * verify that affected students with ASAP notifications
    receive a message.
  * verify that these notifications also work as expected
    for quizzes with multiple due dates.

Change-Id: Iba4bc32c2eb7629fd475201938ba7adb345c0e6a
Reviewed-on: https://gerrit.instructure.com/19609
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-04-18 16:57:47 +00:00
Cameron Matheson 1daa706def put statistics.csv in an attachment
refs CNVS-4887

Test plan:
  Make sure you can still download quiz statistics csv

Change-Id: I1dea60ce3465e4b536620f1dc6d515f4badf18e0
Reviewed-on: https://gerrit.instructure.com/19061
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-04-17 17:22:56 +00:00
Mark Ericksen 828b42ce30 ui enabling admins to search notifications
adds account setting and new user permission

fixes CNVS-4726

Testing Notes:
============
* To enable...
  * Account Settings, check Feature
    "Admins can view notifications"
  * Account permission under "Account Roles"
    becomes available under "Admin Tools"
    group. Check "View notifications"
  * appears under account "Admin Tools"
    sidebar area on "View Notifications"
    tab.
    (EX: /accounts/[account_id]/admin_tools)
* Verify "View Notifications" tab does not
  appear if either account setting or user
  permission is disabled. (For AccountAdmins)
* Verify a SiteAdmin is able to access the
  feature.
* Verify that notifications are returned
  and displayed for a selected user
  and date range.
* Verify it displays "No messages found"
  when user doesn't exist or the user
  exists but the date range doesn't
  return data.
* Verify that the user_id is required when
  searching
* Verify that the "To Date" cannot be before
  the "From Date".
* Verify an invalid date like the word "couch"
  gets ignored and the actually used date/time
  is displayed in the overview text description.
* Verify searching by dates when either or both
  are left blank and when both are used.
* Verify that the messages automatically
  fetch more when you scroll down.
* Verify that before the results, it displays
  the user's name and the dates used for the
  results.

Change-Id: I9d2689b4760af57bbc2d15fd7d50610dcf593a7e
Reviewed-on: https://gerrit.instructure.com/18629
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
2013-04-16 22:11:16 +00:00
Jon Jensen 2f17a059e7 account-level password policy support, fixes CNVS-4211
test plan:
1. set up a new password policy via the console, e.g.
   a = Account.default
   a.settings[:password_policy] = {:min_length=>6, :max_sequence=>3, :max_repeats=>3, :disallow_common_passwords=>true}
   a.save!
2. go to /register and sign up as a student
3. make sure the password policy is enforced, i.e.
   1. confirm that the password must be at least 6 chars
   2. confirm that the password cannot be a common one (e.g. football)
   3. confirm that the password cannot contain a run of 4 or more chars
      (e.g. abc123lol is ok, abcd1234 is not)
   4. confirm that the password cannot have the same char repeated 4 or
      more times (e.g. aaa000bb is ok aaaabbbb is not)
4. verify the password policy is enforced when changing your password as
   an existing user (via user profile/settings)
5. verify the password policy is enforced when adding a login for a user
6. verify the password policy is enforced when resetting your password
   (via forgot password on login page)
7. invite a new user into a course, and as that user verify the password
   policy is enforced when you set up your account

Change-Id: Ie619fc255dc940249676bf5e510ce68eaf17441c
Reviewed-on: https://gerrit.instructure.com/19104
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jon Jensen <jon@instructure.com>
QA-Review: Cam Theriault <cam@instructure.com>
2013-04-05 20:13:26 +00:00
Brad Humphrey a1f136267c passes the requestor's state through when it is provided
Change-Id: I55c7f3b3608ebd68323b73637c612e170f5130b8
Reviewed-on: https://gerrit.instructure.com/19047
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2013-04-05 14:23:40 +00:00
Bracken Mosbacker 9bb10561cd show student progression on module page for large_roster
The module progressions for individual users were removed
for courses with large_roster set. Only the teacher's call
that loads all the progressions for the whole class should
be blocked while still allowing individual's info to load.

Test Plan:
 * on a course with large roster set:
 * create a module with a completion requirement
 * when a student fulfills that requirement, the module page
   should show the green checkmark indicating it is done

closes 	CNVS-5055

Change-Id: Id493459a77c32a7d2a99b19376a822f058896912
Reviewed-on: https://gerrit.instructure.com/19319
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-03 15:26:38 +00:00
Stanley Stuart 5ead920ad9 show quiz results at top of quiz show page
This commit also moves the quiz results (who has/hasn't taken a quiz or
survey) to a table with the styleguide in place.

test plan:
  - As a teacher, create a quiz with an essay question.
  - While the quiz is stil unpublished, go to the quiz show page. it
    should look like it did before this patchset (e.g. dates visible,
    you can still find the edit/manage buttons, etc)
  - have some students in the course take the quiz, but make sure some
    students in the course haven't taken the quiz.
  - Click "Show Student Quiz Results" from the cog menu.
  - The list should look good, and display students under Taken/Haven't
    Taken when the list loads asynchronously.
  - Try different combinations of have/haven't taken including all taken and
    non taken
  - Try with an anonymous survey as well.

fixes CNVS-4381

Change-Id: Ida743125abaf836da5038fc7bc5f376597f47534
Reviewed-on: https://gerrit.instructure.com/18454
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-02 06:15:31 +00:00
James Williams de2ce63ee0 raise error for unescaped ampersands in external tool urls
test plan:
* Create an external tool "by xml", with a "launch_url" tag
(or any custom property of name "url"),
that includes an unescaped ampersand:
 (e.g. "www.example.com?a=1&b=2")
* Confirm that an error is raised indicating
the ampersand needs to be escaped
 (e.g. "www.example.com?a=1&amp;b=2")

fixes #CNVS-1324

Change-Id: Id90d216e2d9039187e8a8f4327e2413d07164b04
Reviewed-on: https://gerrit.instructure.com/18872
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
Reviewed-by: Brad Humphrey <brad@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-01 20:28:27 +00:00
Cody Cutrer a7cc18e524 clean up error report error handling
test plan:
 * try to abuse the javascript record_error endpoint (send garbage
   data for the id, try to do other stuff to make it fail)
 * it should record ever so slightly more useful information

Change-Id: Ibe83fdab3a77175ef1ab73b6c5210ac7265644ae
Reviewed-on: https://gerrit.instructure.com/19041
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 16:20:09 +00:00