Commit Graph

3058 Commits

Author SHA1 Message Date
Ahmad Amireh 7df6a55a34 Quiz Stats - don't count Student View submissions
QuizSubmission now supports a new scope "for_students" that will grab
all submissions that are:

  - not a teacher preview
  - not a teacher-initiated "Student View" one
  - submitted by students who really are rolled in a course

Closes CNVS-13694

TEST PLAN
---- ----

  - create a quiz with one question
  - enter Student View via the course settings
    + take the quiz
    + get out of Student View
  - visit the statistics page (or hit the API)
    + verify the attempt is not factored
  - generate the CSV of Item-Analysis to verify that IA does not factor
    these attempts either
  - test the change with Survey quizzes - need to make sure "logged out"
    users are still OK where applicable

Change-Id: Ic58569be31576734eb6e309d548a7415c07e08a7
Reviewed-on: https://gerrit.instructure.com/38174
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-07-29 16:13:44 +00:00
Jon Jensen 5480c8fecd spec: speed up api specs
liberal applicataion of once-ler and bulk_insert helpers, reduce runtime
from 50min -> 25min

Change-Id: I07c1952c4ead0a1c6caafc389de0b9586b27dc68
Reviewed-on: https://gerrit.instructure.com/37794
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2014-07-29 16:11:16 +00:00
James Williams 2b3cfb34aa user submission export
test plan:
* as a student, visit /dashboard/data_exports
* should be able to export a zip file containing
 all of the student's submissions

refs #CNVS-14242

Change-Id: Iaab216e7411c27fa6d259f677e40a75d3de3f5a8
Reviewed-on: https://gerrit.instructure.com/36872
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-07-29 14:56:03 +00:00
Jeremy Stanley a2f61cf748 fix date shifting issues
due to rounding error, a customer's date that should have been
30 days from the new start of the course was placed at
29.999999999999996 days, which was truncated to 29, which was then
shifted back 6 days to fall on the correct day of the week.

also, announcement post delay dates were not getting shifted
at all.

test plan:
follow the scenarios in CNVS-14130 and ensure that
 * announcement post delay dates are shifted
 * some dates don't mysteriously end up a week earlier
   than they should

fixes CNVS-14130

Change-Id: Ice5bd3be0ddee0dec2af7b740c568750dd3c4ab8
Reviewed-on: https://gerrit.instructure.com/38223
Reviewed-by: James Williams  <jamesw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-07-28 22:22:58 +00:00
Michael Nomitch ede8dbf294 Revert "DA - assignments_needing_submitting"
fixes CNVS-14443

This reverts commit 57427343e3.

Change-Id: Ic70da7d96965d368773c2e16c2b49c59f57e5c18
Reviewed-on: https://gerrit.instructure.com/38314
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>
2014-07-28 22:17:35 +00:00
dave 7e6519d586 add api endpoint to post global annoucement
***test plan
  1.  Make a POST like /accounts/1/account_notifications
  2.  Required Parameters:
      1) account_notification[subject]
      2) account_notification[start_at]
      3) account_notification[end_at]
      4) account_notification[message]
  3.  Optional Parameters:
      1) account_notification[icon]
        'warning' | 'information' | 'question' | 'error' | 'calendar'
         note: defaults to warning
      2) account_notification_roles[]
        'StudentEnrollment', 'TeacherEnrollment' etc...
        this defaults to all roles
  4.  Only account admins should be able to make the api call
  5.  Should not be able to create an account notification with an
  end_at < start_at

closes:  PS-1730
closes: PS-1872

Change-Id: Ide86722598ae4a7ab565422f2996015b48cf8910
Reviewed-on: https://gerrit.instructure.com/37477
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Matt Fairbourn <mfairbourn@instructure.com>
Reviewed-by: Brandon Broschinsky <brandonbr@instructure.com>
2014-07-25 22:16:18 +00:00
Simon Williams d7ed7a5911 don't set graded_at in the future for quiz submissions
fixes CNVS-14403

test plan:
- create a quiz with a due date far in the future (and no time limit)
- take the quiz as a student
- look at the grade_history api for that user
- the graded_at for the quiz assignment should be when it was submitted, not
  when it was due (in other words, it should be in the recent past, not the far
  future)

Change-Id: I37754b4be5238e240bbc6a9826ea9d7599c9a61f
Reviewed-on: https://gerrit.instructure.com/38154
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Reviewed-by: Jason Madsen <jmadsen@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2014-07-25 20:12:09 +00:00
Jayce Higgins f3f8b0c428 Adds peer review notification for assigning peer reviewers
Fixes: CNVS-3771

Adds a peer review notification to go out after
a peer reviewer is added to the discussion. This
also resolves the issue with a notification not
being sent if a rubric is not attached.

Test-Plan:
1.) Run bundle exec rake db:migrate in the console
	before doing anything else -- (This sets up your
	db by using notification_types.yml to populate
	notification types in the DB.)
2.) Create a graded discussion with at least 2
     students
3.) Make sure both students have everything
     in their notifications set to ASAP.
4.) Edit the assignment settings and select the
     'Require Peer Reviews' - Choose to manually
     select peer reviewers.
5.) Navigate to discussions as an admin
6.) Select the cog and go to peer reviews.
7.) Assign a peer reviewer and verify that the
     notification was sent out.

Change-Id: I78212cb8043de0fcf809a9ffa56ffca327ffcacc
Reviewed-on: https://gerrit.instructure.com/36646
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-07-25 19:56:57 +00:00
Brian Palmer 8faaf9bca5 fix autoloading of the Importers module
It wasn't following the rails file naming convention

fixes CNVS-14360

Test plan: imports, such as state standards imports, should work even
without class caching

Change-Id: I99ac8448844b7ac852203a5b8127d6fa35ea5f12
Reviewed-on: https://gerrit.instructure.com/38090
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-07-25 19:14:12 +00:00
Cameron Sutter 79f45f569d DA - quiz edit page
fixes CNVS-9766

test plan:
 * turn on the Differentiated Assignments feature flag
 * from the quiz edit page
  - add a due date for some of the sections, but not all
  - save (update quiz)
  > the only_visible_to_overrides flag on the quiz should be true
  > edit the quiz again and there should not be an
    empty due date row for 'Everyone else'
  - add a due date for all the sections
  - update the quiz
  > the only_visible_to_overrides flag should not be there
  - edit the quiz so that there are only due dates
    for some sections but not all
 * on the normal quiz show page and
 * on the new Quiz Statistics show page
  > there should not be a row in the due date area
    for 'Everyone else'
 - turn off the DA flag and make sure the quiz show page works
   with the 'New Quiz Stats page' flag and without it
 - make sure the edit page works with the DA flag off as well

Change-Id: Ifb090a195ff3283d963df12ae7a9eb503f32ee86
Reviewed-on: https://gerrit.instructure.com/34085
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2014-07-23 14:41:24 +00:00
Brian Palmer 1c1455185b log auditor events to the rails log
closes CNVS-14174

test plan: Generate some audit events, such as login/logout and grade
changes. grep your canvas log for AUDITOR lines, which should contain
a json object with the attributes of the audit event.

Change-Id: Icbf67b94120e2e22ba656e673edc04ab30de5945
Reviewed-on: https://gerrit.instructure.com/37572
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-07-23 14:26:25 +00:00
Michael Nomitch 57427343e3 DA - assignments_needing_submitting
fixes CNVS-14137

test plan:
  - In one course with DA off
    - make sure that the To Turn In
      section shows an assignment that is
      due in 1 day and not turned in
  - In one course with DA on
    - make sure that a similar assignment
      that a student cannot see due to
      differentiated assignments doesnt
      show up in that column
  - NOTE: don't use the same course/user
    because there is a cache that only updates
    every 15 minutes

Change-Id: I6cc93b01ba41335ae0c7f6f8682b8798e0604c3e
Reviewed-on: https://gerrit.instructure.com/37020
Reviewed-by: Liz Abinante <labinante@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-23 14:06:34 +00:00
James Williams 7e4749e3f8 use require_dependency instead in importers
Change-Id: Iaa1c085b5ec30d0e9e1d4dd698ceff935c9f604d
Reviewed-on: https://gerrit.instructure.com/37971
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-07-23 13:24:00 +00:00
Jacob Fugal 399f732b82 handle corrupted tombstone auditor events
refs CNVS-13987

after data fixup for CNVS-13987, the audit logs will contain tombstone
records for events that had been lost/corrupted by overwrites. these
records are essentially empty outside of ids, created_ats, and the index
entries pointing at them.

these adaptations prevent these bare events from causing errors during
the API response, and also some display indication in the admin tools
UI.

test-plan:
 - revert a6304f2 to reenable audit logs

 - generate tombstone events (with index entries, so they get found) in
   each of the three audit logs (authentication, grade change, course
   change):

     # user for authentication events, course for the other two
     target_course = Course.find(...)
     target_user = User.find(...)

     streams = [
       [Auditors::Authentication::Stream, :user_index, target_user],
       [Auditors::GradeChange::Stream, :course_index, target_course],
       [Auditors::Course::Stream, :course_index, target_course]
     ]

     streams.each do |stream, index, target|
       index = stream.send(index)

       database = stream.database
       id = CanvasUUID.generate
       created_at = Time.now

       key = index.create_key(index.bucket_for_time(created_at), target.global_id)
       ordered_id = "#{created_at.to_i}/#{id.to_s[0, 8]}"
       ttl_seconds = stream.ttl_seconds(created_at)

       database.batch do
         database.insert_record(stream.table, {stream.id_column => id}, {
           'created_at' => created_at,
           'event_type' => 'corrupted'
         }, ttl_seconds)
         database.update(index.insert_cql, key, ordered_id, id, ttl_seconds)
       end
     end

 - query each of the audit logs for the appropriate target through the
   admin tools UI. the tombstones should show up in the results with the
   correct created_at and an indication that the record was
   corrupted/lost

Change-Id: I690c8a5469228b7815a644010bb4b744c8ea2e9c
Reviewed-on: https://gerrit.instructure.com/37603
Reviewed-by: Nick Cloward <ncloward@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2014-07-22 16:16:06 +00:00
James Williams 9989eaa9a1 retain unpublished state for discussion topics on copy
test plan:
* create an unpublished discussion topic and a
 published one
* copy the course (or export/import it)
* should retain their respective states

closes #CNVS-14201

Change-Id: If7702b67701b50ce4e2a027d1d4b5ab441d86003
Reviewed-on: https://gerrit.instructure.com/37900
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-07-21 17:25:10 +00:00
James Williams e3bb29a0a2 fix content importers without class caching
Change-Id: Ifad2fdbaac327cdaac985a0a10afd09e7c136208
Reviewed-on: https://gerrit.instructure.com/37910
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-07-21 16:58:25 +00:00
Cody Cutrer b7a7cd4951 fix permission checks for available roles
fixes CNVS-13848

test plan:
 * create a role that only has permission to create admins
 * in a subaccount, grant that role an additional permission
 * in the root account, add an admin to the role
 * log in as that admin
 * in both the root account and the subaccount, attempt to create
   an admin - it should only list your role in both cases

Change-Id: If9a2dd4952e432700c59a0d4ad5e76ffa822dd0f
Reviewed-on: https://gerrit.instructure.com/37408
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-21 16:32:23 +00:00
Cody Cutrer 5d2e9c7704 fix overrides in subaccounts changing permissions for parent accounts
refs CNVS-13848

test plan:
 * create a role in a root account that has no permissions
 * create a subaccount
 * grant permission to add new admins to that role in the subaccount
 * add an admin to that role in the root account
 * log in as the admin
 * he should not have permission to add admins to the root account,
   but should be able to in the sub account

ALSO - general permissions regression test

specs still pass, but it's kind of a scary change to the core of
how permissions work

Change-Id: I74fd72d71e9922431e134af94da41815196a2234
Reviewed-on: https://gerrit.instructure.com/37407
Reviewed-by: Jacob Fugal <jacob@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-19 00:42:32 +00:00
Nathan Mills a91d9c09d0 add lti2 models and registration endpoints
fixes PLAT-522 PLAT-429 PLAT-545 PLAT-540 PLAT-498

test-plan
you can register an lti2 tool

Change-Id: If045b694213e1019f8a595b63a7e33ea4ac28e64
Reviewed-on: https://gerrit.instructure.com/37095
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>
Reviewed-by: Brad Humphrey <brad@instructure.com>
2014-07-18 16:42:10 +00:00
Joel Hough 0c80487238 use absolute url for avatar in notifications
fixes CNVS-14251

test plan
- cause a notification with an avatar to be sent (discussion,
 conversation, or submission comment)
- ensure that the avatar image src attribute is an absolute url

Change-Id: I6992de1f4b83ecfdf838725a42e09feb1ca5e1c9
Reviewed-on: https://gerrit.instructure.com/37729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-07-18 14:18:25 +00:00
Michael Nomitch b4840c75cc DA - grade calculation works on backend
fixes CNVS-13715

test plan:
  - create a student who is in one group and not another
  - create an assignment only visible to each group
  - grade the student for both assignments
  - turn DA on
    - as the student and teacher, go to the student grades page
      - both of the assignments should be visible
      - final grade should be correct (factoring in both)
        * final grade = ungraded assignments count too
    - delete one of the grades and return
      - only one of the assignments should be visible
      - final grade should be correct (using just one assignment)
  - turn DA off
    - as the student and teacher, go to the student grades page
      - both assignments are visible
      - final grade should factor in both assignments
  - with DA on and off, ensure that the following work:
    - drop rules
    - never drop rules
    - assignment stats (mean median etc)
    - what if scores

Change-Id: I727aff943b14c91089ccffa6d3b63ba026abbeec
Reviewed-on: https://gerrit.instructure.com/36762
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cameron Sutter <csutter@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-17 21:27:59 +00:00
Rob Orton 5cddb83461 make drop down for admins limit to active accounts
fixes CNVS-13839

test plan
 - create an account
 - create an admin
 - delete the account
 - the admin role should not show in the drop down

Change-Id: I12c3f6cc615deb0646d3b4f2af60bb191f070edc
Reviewed-on: https://gerrit.instructure.com/37076
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-17 18:33:16 +00:00
Michael Nomitch 9c8c42b952 DA - assignment indices
fixes CNVS-13708

test plan:
  - create a student who is in one section and not another
  - create an assignment only visible to each section
    (1 section => 1 assignment)
  - grade the student for both assignments
  - turn DA on
    - as the student, go to the assignment index page
      - both assignments should be visible initially
      - delete the grades for both assignments and return
        - only the overridden assignment should be visible
      - only one of the assignments should be visible
    - as the student, go to the grades page
      - only the overridden assignment should be visible
      - regrade the assignment whose grade you had deleted
        - both assignments should be visible now
      - (fyi: final grade wont be correct)
  - turn DA off
    - as the student, go to the assignment index page
      - both assignments are visible
    - as the student, go to the grades page
      - both assignments are visible
      - final grade should factor in both assignments

Change-Id: I32e3fea4d6fd3db9a512e0d170779b48418f90cf
Reviewed-on: https://gerrit.instructure.com/36728
Reviewed-by: Liz Abinante <labinante@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Mike Nomitch <mnomitch@instructure.com>
2014-07-17 18:23:25 +00:00
Michael Nomitch a60802d00e DA - sql view and shared methods
fixes CNVS-13649

test plan:
  - go to a few pages and make sure no errors occur
    - GB2
    - assignment index
    - student grades page
  - do same with and without DA on

Change-Id: I72f303cf54c36420a57dfbd23635f319f9827bd0
Reviewed-on: https://gerrit.instructure.com/36675
Reviewed-by: Cameron Sutter <csutter@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-07-15 18:03:57 +00:00
Ahmad Amireh 8cf0000fa0 Stop counting teacher previews in results
The scope QuizSubmission#logged_out now excludes teacher previews. This
should solve all occurrences of logged-out users mixing up with teacher
preview submissions.

Closes CNVS-7851

TEST PLAN
---- ----

  - create a quiz
  - preview it, submit your attempt
    - click on the "Show Student Quiz Results" and verify that your
      preview attempt does not show up
  - create a survey quiz and verify that we still get to see the
    "Logged Out User" submissions correctly
  - verify we don't have any regressions on quiz stats with teacher
    previews (a simple API should suffice, they're now configured to
    share the same code, so it should work in both places)

Change-Id: I9803a127dd0be6975504e4fe55ccb2acea13d9af
Reviewed-on: https://gerrit.instructure.com/37622
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-07-15 14:54:18 +00:00
Cameron Sutter d36db868b1 DA - fix course home page
fixes CNVS-13626

test plan:
 * with the Differentiated Assignments feature on
 * as a teacher
 - navigate to a course home page
 > it should load without an error
 - create an assignment with an online submission
 * as a student
 - submit something for that assignment
 * as a teacher again
 - navigate to the course home page
 > it should load without an error

Change-Id: I912f3898b518fff693c5252879e78135ef4d62a7
Reviewed-on: https://gerrit.instructure.com/36426
Reviewed-by: Mike Nomitch <mnomitch@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Cameron Sutter <csutter@instructure.com>
2014-07-15 14:41:58 +00:00
Ahmad Amireh ab0c410b49 Quizzes - Lock down results after first view
Adds an option to Quiz that prevents the students from seeing their
results more than once after their submission.

Closes CNVS-13877

CHANGES
-------

  - New option in quiz settings:
    "Let Student See Their Responses" => "Only Once After Each Attempt"
  - Teacher can always see the student's results
  - Moderate dialog allows teacher to manually reset the result-locking
    flag, allowing the student one more glimpse
  - The flag is reset whenever a new attempt is taken

TEST PLAN
---- ----

  - create a quiz
  - toggle the new option: "Let Student See Their Responses" then "Only
    Once After Each Attempt"

Turn off Ember/quiz stats:

  - take the quiz by a student, turn it in:
    - verify that you see your results
    - reload the page
      - verify that you no longer see the results
  - take the quiz again:
    - verify you see the results once, then not
  - go to the moderate page as the teacher
    - open the moderate dialog for that student
      - check the new option "Let the student see the results one more
        time"
      - click Save
        - reload the page as the student, verify that you see the
          results

Turn on Ember/quiz stats:

  - repeat the process

Other things to test:

  - verify the new field "has_seen_results" is visible in the
    submissions API and is documented
  - verify the new field "one_time_results" is visible in the quizzes
    API and is documented properly
  - verify that the new option has no effect if the Quiz option is not
    set
  - verify that you can always see the student's results as a teacher
    (the setting should not affect teachers)

Change-Id: I6eb4909f777e038acf6afc9ef2823352f5ea78be
Reviewed-on: https://gerrit.instructure.com/37544
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Ahmad Amireh <ahmad@instructure.com>
2014-07-15 09:47:56 +00:00
Joel Hough 506b53702f remove submission comment mark as read notification preference
fixes CNVS-14178

test plan
- view notification preference page
- ensure that checkbox for submission comment 'mark as read'
 setting is not visible
- ensure that submission comment tooltip does not mention the
 checkbox

Change-Id: Ib859aea0fcf5a4e1672e02665725ffa31d99349e
Reviewed-on: https://gerrit.instructure.com/37579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-07-14 22:21:01 +00:00
Cody Cutrer 00c5302221 avoid deadlocks creating submissions
on postgres < 3, lock users before referencing them to
avoid a deadlock

Change-Id: I4dc13c3a0b4d925fa30cbdad4447c4d62d3f75f3
Reviewed-on: https://gerrit.instructure.com/37390
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ben Chobot <bench@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-14 22:17:55 +00:00
Joel Hough ad9f531302 remove &nbsp; from notification preference tooltip
fixes CNVS-14179

note that the &nbsp; in the submission comment tooltip
is being removed by a different commit

test plan
- view 'Grading' tooltip in notification preferences
- ensure that '&nbsp;' does not appear

Change-Id: Id6c571b2f6abe170a4249c729f3af5a91a8b0ba5
Reviewed-on: https://gerrit.instructure.com/37580
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
Tested-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-07-14 21:30:31 +00:00
Braden Anderson c6014471f4 discussions: prevent creation of new group graded discussions
test plan:
  * create a graded discussion
  * using the Assignments API, try to set group_category_id
      on the discussion's linked assignment
  * verify that you get an error message
  * using the Discussion Topics API, set a group_category_id
      on the discussion
  * verify that the discussion becomes a group discussion

Change-Id: Ida1bae1f370a5d5f13a5002b9cdeb40c24dba0b2
Reviewed-on: https://gerrit.instructure.com/35084
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Braden Anderson <braden@instructure.com>
2014-07-14 19:30:13 +00:00
Brad Humphrey 503ecb71c1 add custom role variable substitution
Test Plan:
 - custom variable $Canvas.membership.roles should return all roles
   including custom roles

Change-Id: Ib761d0f034de5431a51fa284401686e3269861e9
Reviewed-on: https://gerrit.instructure.com/37432
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2014-07-14 16:04:17 +00:00
Cody Cutrer 9761d56d53 improve AR::all_models for non-eager-loading
include namespaced models, and move two models to where
they actually belong

Change-Id: I8f5940d927e4d1fb2b05fceeca121c04d4de47d5
Reviewed-on: https://gerrit.instructure.com/37447
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-07-14 15:56:49 +00:00
James Williams cd96f8408e don't show recent feedback for other students to former admins
test plan:
* create a course
* add two teachers (I'll refer to them as
 "New Teacher" and "Old Teacher")
* also enroll a student

* create an assignment requiring submissions
* as the student, make a submission
* now, as the "New Teacher", comment on the submission
* remove the "Old Teacher" from the course as a teacher,
and instead add them again as a student
* confirm that the "Old Teacher"'s recent feedback does not
show the feedback for the other student

fixes #CNVS-13215

Change-Id: Ie03c9036b65c0de93c869818ebc60b059e9a4260
Reviewed-on: https://gerrit.instructure.com/37465
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-07-14 12:38:14 +00:00
Cody Cutrer adf5629772 remove broken conditional in discussion entry replies
fixes CNVS-14139

test plan:
 * run rails 3
 * create a discussion associated with an assignment
 * in the database, change the created_at for the discussion_topic
   to over two weeks ago
 * post multiple replies to a discussion
 * it should not fail or log an error_report

Change-Id: I1e8960b7277f373c818fdcb95a37dba9933f7188
Reviewed-on: https://gerrit.instructure.com/37485
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-11 22:06:26 +00:00
Brad Humphrey 43210117bd add a domain suffix to newly generated lti tool_consumer_instance_guid
Change-Id: I243f56083e0e66fe0a21e415e02d573b9fc8bd76
Reviewed-on: https://gerrit.instructure.com/35148
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
2014-07-11 18:45:21 +00:00
Jacob Fugal d9c6e2a0cd clarify Slug vs. UUID and fix event stream
refs CNVS-13987

what was called CanvasUuid was *not* generating UUIDs. it was generating
slugs. by default, its generate method only creates 4 character slugs.
these should obviously not be used as UUIDs. the misnomer already caused
a bug in EventStream where it used these slugs as UUIDs, causing
collisions. to fix:

 (1) rename canvas_uuid gem to canvas_slug, and rename it's primary
     class CanvasUuid to CanvasSlug
 (2) create new canvas_uuid gem, with class CanvasUUID, extracted from
     lib/uuid_singleton for actual UUID generation
 (3) fix event stream use CanvasUUID, rather than following the rename
     of CanvasUuid to CanvasSlug

test-plan:
 - have cassandra set up for audit logs
 - create an audit log entry (e.g. change a grade)
 - look at the generated audit log entry's id field; it should be a UUID
   value, not a 4 character slug

Change-Id: I19758fff4433cd6cb2e21219217dced19ee05c5a
Reviewed-on: https://gerrit.instructure.com/37506
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: August Thornton <august@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Brian Palmer <brianp@instructure.com>
2014-07-11 16:58:42 +00:00
Cody Cutrer ba00b0154a avoid temp tables in sis batch batch mode
we don't want them in a transaction, and they don't work
through pgbouncer without a transaction

Change-Id: Ia1845085db6cda1d039a91588fff2cb4fd93012f
Reviewed-on: https://gerrit.instructure.com/37554
Reviewed-by: Jacob Fugal <jacob@instructure.com>
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-07-11 16:35:15 +00:00
Jeremy Stanley 0ce96f4808 fix current/past/future course list
test plan:
 on /courses (the "view all courses" link in the menu)
 1. ensure hard-concluded and soft-concluded courses show up
    in the "Past Enrollments" section
 2. ensure rejected enrollments show up in the "Past Enrollments"
    section
 3. ensure courses with no dates, or with a current date range
    (either from the term, or from the course settings with
    "restrict enrollment to these dates" checked) show up
    in "My Courses", regardless of course published status
    or acceptance of invitation
 4. ensure courses whose start date is in the future (whether
    via course settings or enrollment term) show up under
    "Future Enrollments", regardless of published status of the course
    (again, course settings only apply if the restrict-dates
    setting is checked)
   * Yes, students should see the names of unpublished courses
     they are enrolled in, but the links should not be clickable.
     This is the major complaint of the ticket; we want to
     forestall "Dude, where's my course?" support questions.
 5. ensure "Future Enrollments" is empty when the viewer is a student
    or observer and the account settings checks "Restrict students
    from viewing courses before start date"
 6. ensure all three lists are sorted by course name
    with invitations before active courses
    (previously only the current list was sorted; the others were
    in arbitrary database order)

fixes CNVS-13583

Change-Id: I49d36dd32dc04ea507d0a379a2e3491a837fd160
Reviewed-on: https://gerrit.instructure.com/37294
QA-Review: Clare Strong <clare@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-07-11 16:34:37 +00:00
Jeremy Stanley 01401eebd7 update terms-of-use and privacy-policy urls
test plan:
 - terms of use link should go to
   http://www.canvaslms.com/policies/terms-of-use
 - privacy policy link should go to
   http://www.canvaslms.com/policies/privacy-policy

refs CNVS-13942

Change-Id: I7b17e278d295ddc1b2a1508352b76aa7f2d30ace
Reviewed-on: https://gerrit.instructure.com/37450
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2014-07-10 22:32:53 +00:00
James Williams 574fb015e8 importer refactor: yield missing links instead of going through opts
test plan:
* nothing should have changed

Change-Id: I6e7e26dfff5c3239771f4321de91b7d0f28c9845
Reviewed-on: https://gerrit.instructure.com/36487
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-07-10 12:57:23 +00:00
Jeremy Stanley 3fa2e9c3db give content_exports polymorphic context
test plan:
* content export regressions

closes #CNVS-13468

Change-Id: I44dcf077967d4273c0ae9056074b03853d66a5dc
Reviewed-on: https://gerrit.instructure.com/35745
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
2014-07-09 16:34:39 +00:00
Mark Severson 8611d9ce09 add observees page to user profile
test plan:
 * navigate to /profile/observees
 * add new observees (specifying usernames & passwords)
 * new observees should appear in the list

notes:
 - the 'Observing' tab does not appear until at least one observee has
   been added for the user (and the page is refreshed)
 - the observing user should gain Observer enrollments for courses the
   observed user is enrolled in (both present and future)

closes CNVS-13356

Change-Id: Icda0f0d256fc73bcb554523db6436457941d8b58
Reviewed-on: https://gerrit.instructure.com/37283
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-07-09 16:30:20 +00:00
James Williams 09513aea4a run domain substitutions on module item and external tool urls
test plan:
* create a course with external link module items,
and external tools with links pointing to a given
domain (e.g. "http://www.example.com/somewhere")

* in the rails console, manually configure the account settings
as follows, (replacing COURSEID with the id of the course):
 a = Course.find(COURSEID).root_account
 h1 = {"http://www.example.com" => "https://www.not-example.com"}
 h2 = {:domain_substitution_map => h1}
 a.settings[:default_migration_settings] = h2
 a.save!

* copy the course
* the links should all be translated to the new domain
 (e.g. "https://www.not-example.com")

fixes #CNVS-13512

Change-Id: I4472fec4c2633827409967cc76652e7395fb8e0f
Reviewed-on: https://gerrit.instructure.com/37356
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-07-08 19:57:52 +00:00
Ahmad Amireh 0200972541 Quiz Submission Questions - fix serializer lookup
Closes CNVS-14021

TEST PLAN
---- ----

  - create a quiz with a question
  - try answering the quiz using the QSQ API (see docs)
  - verify that your answer is recorded

Change-Id: I667671f639ac0b5c6bc469477b638e70f90f37ff
Reviewed-on: https://gerrit.instructure.com/37372
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2014-07-08 19:55:22 +00:00
Cameron Matheson ed5b8ae452 get rid of weird before_quiz_submission_types attr
Test plan: specs pass

Change-Id: Ibfcaf313345277daa2a1f2f50741b7e3131fc9ec
Reviewed-on: https://gerrit.instructure.com/37365
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
2014-07-08 17:58:06 +00:00
Cody Cutrer 42433fd79f bump switchman
Change-Id: I95163638f9db1fc3ec9447d94f2f86c1ed24468d
Reviewed-on: https://gerrit.instructure.com/37319
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-07-08 15:20:25 +00:00
James Williams 924a4cf832 fix date shifting for re-imported items
(also keep track of other imported items as well)

test plan:
* import a canvas export package (such as the one
referenced in the ticket) with assignments and graded
discussions
* import them into a course
* delete the assignments, etc. from the course
* re-import the package, while shifting the dates
* the re-imported (i.e. undeleted) assignments should
 have their dates shifted

fixes #CNVS-13252

Change-Id: I396059cdcf58fe3386f21cc7cffe62ac8951cd05
Reviewed-on: https://gerrit.instructure.com/36743
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
2014-07-07 21:19:34 +00:00
Jeremy Stanley dd3ce0f911 don't re-invite student view student with "completed" enrollment
make the enrollment "active" instead of "invited", or else
User#can_masquerade? will fail because the "invited" enrollment
will not link the student view user to the course via the
courses association

test plan:
 1. have a teacher in an active course who is not an account admin
 2. enter student view
 3. leave student view
 4. conclude the course
 5. enter student view again. it should work this time.

fixes CNVS-13610

Change-Id: If59683a58ae2fcd425a50eccdab8ca74ac435e07
Reviewed-on: https://gerrit.instructure.com/37215
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
2014-07-07 17:10:31 +00:00
Cody Cutrer c25317cb86 fix quiz question parsing for non-eager loading
fixes CNVS-13791

with non-eagerloading, the constants might not be present, so we just
have to try to get it, instead of checking if we have it

test plan:
 * in development mode, make sure cache_classes is false
 * create a quiz with a fill in multiple answers question
 * save it
 * preview the quiz
 * it should not page error

Change-Id: Iacdebd972e4b0d6f404e8f0a6a91a8adecb77ca8
Reviewed-on: https://gerrit.instructure.com/37172
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ahmad Amireh <ahmad@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2014-07-07 16:55:23 +00:00