Commit Graph

1931 Commits

Author SHA1 Message Date
Jon Jensen d9f5c589da use RailsXss::Erubis for html email templates, fixes CNVS-5414
prevent malicious or accidental html content from getting through (e.g.
via translations or interpolated user content).

slight refactor in message.rb to make it more easily testable

test plan:
1. spot check html emails, make sure they look ok
2. ensure you can't get arbitrary html into an email, e.g.
   1. change your name in canvas to "<b>ZOMG</b>"
   2. send someone a message in canvasations
   3. check the html email that got sent to them. your name should appear
      as "<b>ZOMG</b>", and not "ZOMG" in bold text

Change-Id: Ie638a0d3d28427f25c0fa1ce89c10533802b0c6b
Reviewed-on: https://gerrit.instructure.com/19827
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-23 16:56:53 +00:00
Simon Williams 67d0c8d318 fix no_enrollments_can_create_courses flag
fixes CNVS-5462

test plan:
- enable 'no enrollments can create courses' at the root acount level
- create a new user with no enrollments
- they should have a 'create course' button on the dashboard

Change-Id: Ic1c272c7e949b25365141c04c65b3cff5b47a6ed
Reviewed-on: https://gerrit.instructure.com/19944
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-04-23 15:54:39 +00:00
Jon Jensen b420729e61 quiz item analysis generation, closes CNVS-3421
report generator to do quiz item analysis

usage:

quiz = Quiz.find(<id>)
summary = QuizStatistics::ItemAnalysis::Summary.new(quiz)
summary.each do |item|
  puts item.question_text
  puts "respondents: #{item.num_respondents}"
  puts "correct: #{item.num_respondents(:correct)}"
  puts "standard deviation: #{item.standard_deviation}"
  ...
  puts "----------------"
end

test plan:
N/A, see specs

Change-Id: Id36e4ef404af089f526cf9243a14d42eb52064a6
Reviewed-on: https://gerrit.instructure.com/18494
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2013-04-23 15:50:36 +00:00
Cody Cutrer 068004873c don't include "DESC" in the select when ordering by sortable name
fixes CNVS-5432

Change-Id: I461ddc459976726586797d6ec705a0d97d95fc17
Reviewed-on: https://gerrit.instructure.com/19856
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-04-22 17:49:22 +00:00
James Williams 10bfe71e8a include attribute to exclude permissions based on plugins
specifically links the visibility of the permission
:manage_frozen_assignments to whether or not
the plugin :assignment_freezer is enabled

test plan:
* enable the assignment_freezer plugin
* confirm that ""Manage (edit / delete) frozen assignments"
 is shown in the list of account permissions

* disable the plugin
* confirm that the permission no longer is shown

closes #CNVS-5207

Change-Id: I4cd308531a057356bd335e134348c63b92868775
Reviewed-on: https://gerrit.instructure.com/19788
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-22 16:36:24 +00:00
Simon Williams e7a0d952ea more i18n fixes
fixes CNVS-3187

test plan:
- make sure student show page 'submission types' heading still works
- make sure masquerading still works

Change-Id: Id177d3266b42caa7bd7b83354ec3ad400ce3ce8d
Reviewed-on: https://gerrit.instructure.com/19774
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2013-04-22 15:34:18 +00:00
Simon Williams 7ceec48881 don't stomp a variable in quiz stats
fixes CNVS-5427

test plan:
- in a quiz with a 'multiple fill in the blank' question
- take it with a couple users, and as one, answer incorrectly
- run quiz stats on the quiz
- it should work

Change-Id: Icaad597e6d401651bc3625bf0a5f2f75f31185fa
Reviewed-on: https://gerrit.instructure.com/19848
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
2013-04-21 06:48:51 +00:00
Simon Williams db84fc774b add ability to create file upload quiz questions
this will be based on an account setting the defaults to false until this
functionality is fully implemented

closes CNVS-1152

test plan:
- first ensure that you cannot add a file upload quiz question by default
- then, in a test account, run the following:
  # where ACCOUNT_ID is the id of your root testing account
  acct = Account.find(ACCOUNT_ID)
  settings = { :file_upload_quiz_questions => true }
  acct.save
- then go to add a quiz question again.
- file upload should be a question type.
- make sure creating the quiz works with that question type, comments work,
  switching between this question type and others works, etc.

Change-Id: I9b154028290551583cd44a059a5d1c23e247bbf6
Reviewed-on: https://gerrit.instructure.com/19616
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-04-20 23:59:21 +00:00
Jacob Fugal 6465b20ec0 populate submission versions
back-populate submission_versions from existing versions for
submissions, and insert new index rows when new versions for submissions
are created.

refs CNVS-2802

test-plan:
  migration:
    - have at least two submission with at least one submission with
      multiple versions in your database before introduction of this
      code
    - run the migration
    - for every existing submission version record, there should now be
      a submission_versions record
    - the submission_versions records should have the correct metadata
      for the submission version
  trigger:
    - create a new submission
    - should create a new submission_versions record
    - modify the submission in a way that triggers a new version
    - should create a new submission_versions record

Change-Id: I9c4c39fa60926b037142abf3f01572c9deaa0643
Reviewed-on: https://gerrit.instructure.com/19605
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Duane Johnson <duane@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2013-04-20 13:20:47 +00:00
Duane Johnson 9c55ed33f9 simplify SimplyVersioned option storage and add callbacks
SimplyVersioned plugin needs callbacks for the addition of the
submission_versions index table. Whenever a submission version is
saved, we will want to add an entry to the submission_versions table
in addition to the versions table. This patch provides hooks for
those callbacks.

Test Plan:
- Versioned anything should still work

Refs CNVS-2802

Change-Id: I02a862c5894a98ece8a586330f264680751ab52f
Reviewed-on: https://gerrit.instructure.com/19520
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jacob Fugal <jacob@instructure.com>
Reviewed-by: Duane Johnson <duane@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-20 13:20:29 +00:00
Jeremy Stanley bd5c66011a use 'unpublished' (not 'created' or 'claimed') in courses api
test plan:
 - courses api should return 'unpublished' workflow_state for
   courses in 'created' or 'claimed' state

Change-Id: I927cd6d4b66556c1d0762ad16433f69764d6a050
Reviewed-on: https://gerrit.instructure.com/19574
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-20 01:36:23 +00:00
Simon Williams ff85faf46a basic support for file upload quiz question type
note: this currently just adds all the necessary hooks for a new question type,
and is currently disabled while the specific file upload functionality is
implemented.

closes CNVS-1150

test plan:
- should see no change with adding quiz questions, taking a quiz, or viewing
  statistics

Change-Id: I3360f00055d1d0c4f9c9703d70590e888cd636d7
Reviewed-on: https://gerrit.instructure.com/19560
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-04-19 21:42:13 +00:00
Simon Williams 3cb64d7c2b i18n fixes
fixes CNVS-3124
fixes CNVS-3137
fixes CNVS-3141
fixes CNVS-3155
fixes CNVS-3157

test plan:
* rubrics
  - check title of rubrics index page for course/user/account
  - check create/update rubric button on individual rubric page

* quizzes
  - check that the right sidebar still works while taking a quiz
  - check that the 'pick x question, y pts per question' works in view and edit
    mode when adding a question group to a quiz.
  - check that creating fill in multiple blank questions still works

* grades
  - make sure the print grades button still works
  - make sure the "Showing: <section" dropdown in gradebook still works

Change-Id: I14379e1b8a4a21327d3db720da0a4e128fda9524
Reviewed-on: https://gerrit.instructure.com/19695
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-04-19 19:14:10 +00:00
Jacob Fugal 45aec302c4 EventStream abstraction
fixes CNVS-4159

Change-Id: I8a1ce45bd8d50bd767dfaaa6ca51dff6a0bdffd5
Reviewed-on: https://gerrit.instructure.com/19103
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-04-19 19:05:14 +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
Cameron Matheson 343922a99d track quiz_statistics.csv progress
refs CNVS-4887

Test plan:
  This isn't exposed anywhere in the UI yet, but if you really wanted to
  test this, you could download quiz stats csv for a large course and
  watch the progress attached to the quiz_statistics model increase
  while the csv was being generated

Change-Id: I0f1d703df38c2525a412414ce767505a6caf157d
Reviewed-on: https://gerrit.instructure.com/19323
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
2013-04-18 21:54:00 +00:00
Ryan Florence b18af81c24 add users from courses/:id/users page
test plan:
1. go to /courses/:id/users
2. click 'add users'
3. should work much like the add users UI in
   the course settings -> users tab, but look
   a little different

Change-Id: Icec24a41385e595d8b79dc5a7232545f0aff926e
Reviewed-on: https://gerrit.instructure.com/18888
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
QA-Review: Ryan Florence <ryanf@instructure.com>
2013-04-18 19:43:54 +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
Cody Cutrer 6e9c843b3d switch to Shackles gem
extracted out of canvas-lms

refs CNVS-4713

test plan:
 * actions that use a slave should still work (dashboard render)
 * you should be able to switch envs and users in console

Change-Id: I07dda8057cf94383bc4579f1ef6b5a4b3ffc20b5
Reviewed-on: https://gerrit.instructure.com/19287
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-04-17 16:25:06 +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
Bracken Mosbacker 7c4a35b80d allow content migrations to be hidden in the ui
There are some migration systems that aren't for course
content but they still show up in the course content
migration drop-down. So with this you can flag a system
to not show up for users

Test Plan:
 * On the "Import Content from Another System" page there
   shouldn't be a blank option.

closes CNVS-5327

Change-Id: Icb6e7b6e84b80613bc231488cc9f6b16b6ebfe24
Reviewed-on: https://gerrit.instructure.com/19608
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
2013-04-16 21:48:31 +00:00
Bracken Mosbacker 7798719bac create draft state flag
most course objects will be getting draft state implementations
soon, but we don't want to show publishing stuff until it's
implemented everywhere.

Test Plan:
 * N/A

closes #CNVS-5280

Change-Id: Ie5500b35f9e912d8ae6b5845ce0a238fb9a72927
Reviewed-on: https://gerrit.instructure.com/19589
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-16 19:44:54 +00:00
Duane Johnson f1fb1fdb4d add computed_(current|final)_grade to users for courses api
also add computed_current_grade to the my-courses api

Adds tests for both the computed scores on the course listings as well
as the computed scores on the users listing for the course. Also adds
API documentation.

Test Plan:
- An api call to /api/v1/courses/N/users?include[]=enrollments will
  include 'grades' key with 'current_score', 'current_grade',
  'final_score', and 'final_grade'

fixes CNVS-5101

Change-Id: I26e3cb069e3a9ce9a80c966017251e627a7b30d1
Reviewed-on: https://gerrit.instructure.com/19466
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-15 23:19:26 +00:00
Zach Pendleton 2befece7ff allow apostrophes in pseudonym unique_id field.
fixes CNVS-1808

test plan:
  * create a new user with a unique_id that has an
    apostrophe in it;
  * verify that it saves correctly and that the user
    can log in with it.

Change-Id: Idf46086b7ec6513eb4c2293686e4e92491e47fbc
Reviewed-on: https://gerrit.instructure.com/19564
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-04-15 16:49:16 +00:00
Mark Severson 19757eebba allow public access to the syllabus page on a non-public course
also cleaned up the calendar events api specs to make them a
little less error prone

test plan:
 * syllabus page:
   note: please verify against published courses
   * standard access (calendar events, assignments, appointment groups)
   * public course (calendar events, assignments)
   * public syllabus (calendar events, assignments)
 * courses api:
   * create w/public_syllabus
   * update w/public_syllabus
   * get w/include[]=public_syllabus
 * calendar events api (for public courses/public syllabus courses):
   * calendar events and assignments

fixes #CNVS-4811

Change-Id: I17e9f260117c031af008592a470b6e17df93c1d5
Reviewed-on: https://gerrit.instructure.com/19376
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-15 15:42:33 +00:00
Cody Cutrer 45290c37a8 fix Converstation#delete_for_all to work for multi-shard conversations
fixes CNVS-4626

test plan:
 * create a conversation between users on two shards
 * use the delete_for_all api to delete it
 * it should not show up for either user anymore,
   either on the dashboard or in the inbox

Change-Id: Iad779febabbc80daeeaeebc49f2fbe23ab04a975
Reviewed-on: https://gerrit.instructure.com/19459
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-12 19:26:42 +00:00
Jon Willesen 495db783d5 Add API for admins to access user messages
There are three parts to this:
 - API access for site admins and account admins. Account
   admins can only see messages for their account.
 - Includes start and end time parameters for basic searching
 - Summary notification are gathered up per account now, so
   account admins will not see a summary notification from
   multiple accounts.

fixes CNVS-3695

test plan:
 - Verify Admin Access:
   - Have a user enrolled in two courses in separate root
     accounts.
   - Send the user ASAP notification from each account.
   - Go to /users/:id/messages (the old interface) and verify
     the messages appear there.
   - As a site admin, get /api/v1/comm_messages for the user
     (see documentation for the api).
   - Verify that data for both messages are returned.
   - Use the console to give an account admin on one of the
     accounts :read_messages permissions.
   - As the account admin, get /api/v1/comm_messages for the
     user.
   - Verify that only the message for the admin's account is
     returned.
 - Verify start_time and end_time parameters
   - Use the console to modify the created_at field for the
     user's messages
   - As a site admin, get /api/v1/comm_messages for the user,
     specifying various combinations of start_time and
     end_time, and make sure the appropriate messages are
     returned.
 - Verify account based summaries
   - Set the notification policies for the user to a summary
     setting (daily or weekly)
   - Send multiple notifications to the user from each account.
   - Use the console to run the
     SummaryMessageConsolidator::process function.
   - View /messages for the user and verify that separate
     summaries are sent for each account.

Change-Id: Ie33ec02cc2033a1cc2f1fcbe538b76792aab0e6c
Reviewed-on: https://gerrit.instructure.com/18586
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Ericksen <marke@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
2013-04-11 19:38:02 +00:00
James Williams 21d1788f22 add migration warnings for missing references in html content
adds migration warnings when links and other references point
to missing or unknown internal content

test plan:
* upload a content migration with missing relative links
 (an example is attached in the ticket)
* import all the content
* view previous migrations for the course
 (at "/courses/:id/imports/list")
* confirm that warning messages are shown
* the ui in in progress, but the warnings should
 have links associated with them that point to the
 content with missing links. to see them, use the
 migration issues API

closes #CNVS-134

Change-Id: I1d0a9217fe0c1678968410be8b2eba5b990b8305
Reviewed-on: https://gerrit.instructure.com/19367
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-11 18:28:59 +00:00
Stanley Stuart 5aa85aa901 show correct todo items for students in dashboard
Fixes #assignments_needing_submitting for the User model by expanding the range
of assignments to include assignments that have an override where the
due date is overridden and meets the date criteria.

test plan:
  - as a teacher, create a new assignment with multiple due dates. Don't
    select an "Everyone Else" section, but do have a due date for each
    section that is within 1 week of now.
  - as a student in one of the overridden sections, view your dashboard.
  - the assignment should show up under the student's "todo" items on
    the right side.

fixes CNVS-5088

Change-Id: Ie81beb32556006aff8707467660c67552e8b72c4
Reviewed-on: https://gerrit.instructure.com/19452
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-04-10 15:58:27 +00:00
Cameron Matheson 7a3b4ec1c4 make quiz_statistics model
refs CNVS-4887

This probably should have happened anyway, but the intermediate model
will be necessary to handle attachments for the downloadable
quiz_statistics.csv

Test plan:
  * make sure the quiz statistics page still works
  * make sure downloading quiz statistics csv still works

Change-Id: I9562a731d171dae24329fc52782a4f9efa4cf8bd
Reviewed-on: https://gerrit.instructure.com/18977
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-09 23:21:09 +00:00
Jon Willesen 97e02359b1 When restoring a discussion topic, restore its child topics
fixes CNVS-4954

test plan:
 - create a group discussion topic assignment
 - delete the group discussion topic
 - go to /courses/:id/undelete and restore the topic
 - go back to the topic and verify the linked child topics were
   also restored.

Change-Id: Ia01ce855ff92110c3fb6b227234a42ba8edad5bf
Reviewed-on: https://gerrit.instructure.com/19285
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-04-09 15:05:25 +00:00
Joel Hough 525c1e9111 speed up scheduler
fixes CNVS-4561

removed some duplicate work
memoized a couple of methods
now bails early when there are no slots signed up for
added a couple of indices

test plan
- make sure scheduler works the same as it used to

Change-Id: I9bea3daa5706eb5dba83d8112ea2ef8229ca0e0e
Reviewed-on: https://gerrit.instructure.com/19192
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2013-04-05 23:03:53 +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
Eric Berry ffd0fe56c3 HTMLify the outbound email messages and update the /messages UI
All of the outbound email notifications have been updated to have
a matching HTML version of the email in order for us to send multi-
part emails. There has also been some tweaking of the other email
messages (summary, plain text, etc) with a better looking layout

fixes CNVS-4728
fixes CNVS-4795

test steps:
- generate email messages for each template and review the results
  in the users message list view (/users/1/messages)

Change-Id: I1fd9cf2b134209e42c8d174f19b50963e6502f6a
Reviewed-on: https://gerrit.instructure.com/18942
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
2013-04-03 20:03:34 +00:00
Erik Lyngved 5adc503432 multiple due date summary tooltip
Notes:
* On index pages, assignments and quizzes with multiple due dates
  now show a summary of due dates in a tooltip when hovering over
  "Multiple Due Dates"
* The tooltip shows a max of 10 dates, and if there are more, it
  ends with "and # more..." showing how many dates are not shown
* The ticket requested that the "and # more..." links to the
  assignment page, but that would be hard to click since leaving
  the anchor link makes the hover disappear; instead the actual
  "Multiple Due Dates" anchor link will link to the show page
* Tooltip appears for teachers on the following pages:
  - Global assignments page
  - Course assignments page
  - Course quizzes page
  - Course modules page

Test Plan:
* Create assignments and quizzes with multiple due dates
* Navigate to the pages above and verify that there are tooltips for
  items with multiple due dates
* Verify that the section names and dates are correct for each item
* Verify that when there are more than 10 due dates, the tooltip only
  shows 10 dates and ends with "and x more..." with the number of
  dates not shown

fixes CNVS-2646

Change-Id: I96d12b25d6690393c942c90b8e121da6e20191e0
Reviewed-on: https://gerrit.instructure.com/18769
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Reviewed-by: Stanley Stuart <stanley@instructure.com>
2013-04-02 18:47:35 +00:00
Jeremy Stanley cbe0907fb4 don't disallow deleting a section due to StudentViewEnrollments
fixes CNVS-2623

test plan:
 - create a course
 - create a section
 - use student view
 - delete the empty section
 - it should not give you a snarky message about you can't
   delete a section with enrollments

Change-Id: Ieabf6dfa6c25eed7f637d529cd755490bde5635a
Reviewed-on: https://gerrit.instructure.com/19120
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2013-04-02 15:02:58 +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
Cody Cutrer 8c94e53dc7 arel-ify scopes
s/named_scope/scope/g

refs CNVS-4707

Change-Id: I930d229fc9985c7c0096a0f4888933addd4f3aee
Reviewed-on: https://gerrit.instructure.com/18834
Reviewed-by: Duane Johnson <duane@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 21:57:16 +00:00
James Williams 64ec546d20 fix future enrollments scope
include root_account, rather than join

refs #CNVS-4813

Change-Id: I81f08d8256c0efee701b02caafee476dd022332c
Reviewed-on: https://gerrit.instructure.com/19193
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Bracken Mosbacker <bracken@instructure.com>
2013-04-01 20:18:43 +00:00
James Williams 68ba7c7b46 don't import all files in migration if copy[:files] is missing
fixes a problem where having the copy[:files] value missing
(as opposed to an empty hash) in the migration settings
would cause every attachment to be imported in

test plan:
* import a migration
* on the "choose content" screen, make sure that
none of the boxes under "Files" are checked.
* confirm that the import did not copy every file
(files that are linked to in other imported content
will be implicitly imported)

fixes #CNVS-4817

Change-Id: I53c736bdc8cf6835e4460c0a43349be1c7b04959
Reviewed-on: https://gerrit.instructure.com/19161
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
2013-04-01 19:27:44 +00:00
Cody Cutrer 5ffbcbeb05 arel-ify lib
excluding api_find, which needs more work

refs CNVS-4706

Change-Id: I013d0660ff2b8dbe2abf6a5c973bd1203f432f99
Reviewed-on: https://gerrit.instructure.com/18921
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 19:12:22 +00:00
Cody Cutrer d9111f5414 arel-ify models
closes CNVS-4707

Change-Id: I32c8ec5a53525f89cf232890eaac790fbc2b4744
Reviewed-on: https://gerrit.instructure.com/18745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2013-04-01 18:42:38 +00:00
Brian Palmer 9b7ac7570c fix logging parameter filtering in rails 3.1+
filter_parameter_logging is deprecated in 3.0 and removed in 3.1

test plan: when logging in, your password should still be filtered from
the log file in both rails 2 and rails 3

Change-Id: I697d5a4aca1a7501fe84a52c0097f8ae81074a0a
Reviewed-on: https://gerrit.instructure.com/19085
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Hetherington <clare@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2013-04-01 18:41:08 +00:00
Eric Berry 6bae3b971d admin masquerading as user can view all messages
fixes CNVS-4223

test steps:
1. Send a message to a whole class
2. As an account level admin (not a siteadmin), masquerade as one of the
   users who received the message
3. Ensure that you can see the message
4. As a different user, send a message directly to the student.
5. Masquerade as the student again and notice that you can see the
   message.

Change-Id: I56e82edfd8900c3192ad9461f0844663ba05d6d4
Reviewed-on: https://gerrit.instructure.com/19014
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Jensen <jon@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
Product-Review: Eric Berry <ericb@instructure.com>
2013-03-29 22:50:31 +00:00
Cameron Matheson c604e0f79a clean up stats_for_questions
refs CNVS-4698

Aside from moving stuff out of stats_for_question (and into
QuizQuestion::QuestionType), this involves almost no refactoring (just
cosmetic stuff like inserting linebreaks and getting rid of silly uses
of each_with_index)

Test plan:
  * make a quiz with every question type
  * take the quiz with some students
  * make sure the quiz statistics page looks the same with this patch
    and without

Change-Id: Ibadf40f76936aeeb8fec3a82d2d9edce10586457
Reviewed-on: https://gerrit.instructure.com/18918
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
2013-03-29 20:07:20 +00:00
James Williams 846df225be add account setting to allow/block future course view
adds a root account setting :restrict_student_future_view
that restricts students from viewing a course in which they
have a future enrollment

test plan:
* invite a student into a course that is unpublished
or is set to a future date (and restricted to those
dates)
* turn the restriction setting is on
* confirm that as that student, the course does not
appear in the list of future enrollments
on the courses index
* confirm that the student cannot visit the course
directly (i.e. through /courses/1)
* confirm the opposte if the restriction is unset

fixes #CNVS-4813

Change-Id: I4352a2919514a5c0da768a7f8aa79447dd3a948c
Reviewed-on: https://gerrit.instructure.com/18958
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:47:54 +00:00
Jeremy Stanley f2e5c59acf add ability to set/retrieve storage quota to groups API
fixes CNVS-4782

note that setting quotas requires the manage_storage_quotas
permission; not everybody who can create a group has the
right to set the storage quota for that group

test plan:
 * view the API documentation and notice the new
   'storage_quota_mb' field, which represents the group's
   storage quota, in megabytes
 * as an account admin,
  - retrieve a group via the API; verify the storage_quota_mb
    field is returned
  - create a group via the API, setting storage_quota_mb;
    verify the value was set properly
  - update a group via the API, setting storage_quota_mb;
    verify the value was set properly
 * as a teacher,
  - retrieve a group via the API; verify the storage_quota_mb
    field is returned
  - create a group via the API, setting storage_quota_mb;
    verify the value was ignored (but the other values
    were accepted)
  - update a group via the API, setting storage_quota_mb;
    verify the value was ignored (but the other values
    were accepted)

Change-Id: Ia0c6c2ac2cbe85289a2e18d16589e4fe04b08a30
Reviewed-on: https://gerrit.instructure.com/18919
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:27:46 +00:00
Jeremy Stanley aafadc431f add :manage_storage_quotas permission
refs CNVS-4782

test plan:
 - BEFORE applying database migrations, create two account
   roles, one that enables "Manage account level settings",
   and one that disables it.
 - ... apply database migrations ...
 - an account setting "Manage storage quotas" should appear
   and should be enabled for roles that have "Manage account
   level settings", and disabled otherwise
 - ensure the following values cannot be changed
   (are not editable on the web forms) if
   "Manage storage quotas" permission is revoked:
  in Account Settings:
   - Default Course File Quota
   - Default User File Quota
  in Course Settings:
   - File Storage
 - also ensure that a user lacking this permission
   cannot set a course quota via the courses API
   (creating or updating a course). the value should
   be ignored if the user does not have permission
   to set it.

NOTE: This permission applies to accounts and courses.
      There are also quotas for entire sites (for users,
      course files, and media files), but these are managed
      by a plugin and are not affected by this commit.

Change-Id: I4a3b0b332a5a4e74596f167360db37e2653eab70
Reviewed-on: https://gerrit.instructure.com/18887
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:27:39 +00:00
James Williams 2c97618f78 create separate permission for managing rubrics
creates new permission :manage_rubrics, which was
previously a subset of the rights in :manage_grades

test plan:
* confirm that a new permission for
outcomes and rubrics is available in the ui
* confirm that this permission restricts the
creation and editing of rubrics

fixes #CNVS-266

Change-Id: I40d108b53e2771890d8fdbb108e1de24364aa055
Reviewed-on: https://gerrit.instructure.com/17763
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2013-03-29 18:27:21 +00:00