Test plan:
add links to various course files in an assignment's description. The
description returned by graphql should return fully qualifed links
(the description should be the same as the description returned by the
REST api).
closes GQL-7
Change-Id: I189f45160697860201ec8fe6fe1fa2771e18cc35
Reviewed-on: https://gerrit.instructure.com/171990
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes GRADE-84
Test plan:
Note that you can also test this via the /graphiql endpoint on local
Canvas installation once you've logged in (you can use the query
string from the heredoc below).
- Identify a Score object you want to update and its corresponding
Enrollment object
- In a Rails console:
> mutation_str = <<~STR
mutation {
setOverrideScore(input: {
enrollmentId: <the enrollment ID>
gradingPeriodId: <ID of associated grading period if exists>
overrideScore: 123.4567 <or whatever>
}) {
grades {
gradingPeriod {
id
_id
}
overrideScore
}
errors {
attribute
message
}
}
}
STR
> user = User.find(<a user ID with appropriate permissions>)
> CanvasSchema.execute(mutation_str, context: {current_user: user})
- You should get back a response with no errors and a score-like object
(technically a Grades type in GraphQL)
- The properties of the returned object should include the override score
you set and, if you updated a score belonging to a grading period, the
GraphQL and Rails ID fields for the grading period (in the gradingPeriod
attribute)
- Check the Score object with the matching enrollment/grading period to
make sure your call did indeed update it
- Also try the following:
- Excluding the gradingPeriodId field from the input hash (i.e.,
update the score associated with an enrollment and not belonging
to a grading period)
- Passing "null" (without the quotes) for the overrideScore; this
should clear an existing value
- The following should return errors and no score data:
- Passing in malformed values for overrideScore or the ID fields
- Passing in an ID for a non-existent enrollment/grading period
- Running the CanvasSchema.execute command with current_user set to a
user who does not have permissions to modify the score in question
(e.g., a student, or generally someone who's not a teacher in that
course)
Change-Id: I2b5c6a80842a6febdb1e398a41aa71ea37cdb064
Reviewed-on: https://gerrit.instructure.com/172472
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Gary Mei <gmei@instructure.com>
QA-Review: Adrian Packel <apackel@instructure.com>
Product-Review: Keith Garner <kgarner@instructure.com>
user system total real
before: 9.120000 0.020000 9.140000 ( 9.121676)
after: 1.290000 0.000000 1.290000 ( 1.284826)
require 'benchmark'
UrlHelpers = Rails.application.routes.url_helpers
Benchmark.bm do |bm|
bm.report("before:") do
500.times { Class.new { include Rails.application.routes.url_helpers } }
end
bm.report("after: ") do
500.times { Class.new { include UrlHelpers } }
end
end
Test plan: htmlUrl should still work for assignments
closes GQL-14
Change-Id: Icb6efe78b4d807cef046d85d798319047ce25c2a
Reviewed-on: https://gerrit.instructure.com/171989
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
refs GQL-3
test plan:
* create a group in a group set using graphql
Change-Id: I81f3e3c02b19961a31cdd9695adf7a4c11c90693
Reviewed-on: https://gerrit.instructure.com/166125
Tested-by: Jenkins
Reviewed-by: Adrian Packel <apackel@instructure.com>
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
test plan
- specs should pass
Change-Id: Icf80dcb5a6ef865f9078f65832ff00e605982145
Reviewed-on: https://gerrit.instructure.com/171120
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins
Product-Review: Rob Orton <rob@instructure.com>
QA-Review: Rob Orton <rob@instructure.com>
These objects were originally accessible via the node/legacyNode, but
these first-class fields will be a bit more convenient to use.
Test plan:
* retrieve objects from the top-level
course/assignment/assignmentGroup fields
Change-Id: I6f64a0841a36dabd753e8e91aa4145689d56fc1b
Reviewed-on: https://gerrit.instructure.com/167469
Reviewed-by: Carl Kibler <ckibler@instructure.com>
Tested-by: Jenkins
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-746, GQL-2
Test plan:
query for group sets through node, the course, and assignments
Change-Id: Ie362a429172f0096d0852db836fd5a40f7fe2cfe
Reviewed-on: https://gerrit.instructure.com/166124
Tested-by: Jenkins
Reviewed-by: Carl Kibler <ckibler@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
Test plan:
* enable avatars
* don't have an avatar for a user
* the user's avatarUrl should return null in graphql
Change-Id: Ia47942a32eecedc5c99e0bec91f50e58ad3c1025
Reviewed-on: https://gerrit.instructure.com/165602
Tested-by: Jenkins
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
Change-Id: I93080ba369a8b11cb54341e39ac4ede69e1f3b56
Reviewed-on: https://gerrit.instructure.com/165461
Tested-by: Jenkins
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Jeremy Stanley <jeremy@instructure.com>
test plan: go to /graphiql and confirm the useFallback
argument to avatarUrl functions as expected
on a user with no defined avatar
i.e.,
{
legacyNode(_id: 2, type: User) {
... on User {
name
avatar_url:avatarUrl(useFallback:false)
}
}
}
should return null for avatar_url
closes ADMIN-1426
Change-Id: Ic388bd4130fbbb892b37462852be2861d8af5c93
Reviewed-on: https://gerrit.instructure.com/163869
Reviewed-by: Cameron Matheson <cameron@instructure.com>
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Mysti Sadler <mysti@instructure.com>
Tested-by: Jenkins
Product-Review: Jeremy Stanley <jeremy@instructure.com>
closes RECNVS-610
The existing permission basically only allowed users to load themselves,
or admins to load about anyone, but teachers couldn't even load their
own students.
Test plan:
- users should be able to load users they have permission to view via
the top-level node/legacyNode fields
Change-Id: Ib9cfa750d7797253e678b057fc19cc2add4b39e8
Reviewed-on: https://gerrit.instructure.com/163605
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
refs RECNVS-553
Test plan:
* query for grading period on the grades type
Change-Id: I22802e4391fb0e546bbd70182105ff4c4c3b5945
Reviewed-on: https://gerrit.instructure.com/162813
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
refs RECNVS-553
this paves the way for the new type tester
Test plan: specs pass
Change-Id: I0c41ea0b67811f8c00e8130d08451217f9e6d565
Reviewed-on: https://gerrit.instructure.com/161728
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
QA-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-410
this ensures the access to assignments between course and assignment_group
behave the same
Test plan:
* set up a course in a term with grading periods
* make assignments in all of the grading periods
* in graphql, an AssignmentGroup's assignmentsConnection should return
assignments from the curreng grading period
* you can specify a different grading period with the filter argument
to retrieve other assignments
Change-Id: I1a9dbc506db4d0f4fffdae90427f0bdd92cdeea8
Reviewed-on: https://gerrit.instructure.com/154587
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-409
Test plan:
* have assignments in a course locked for the following reasons:
- assignment locked_at
- assignment unlocked_at
- locked quiz
- locked discussion
- locked wiki page
- locked module
* check that the lockInfo object on the assignment accurately reports
if the assignment is locked and references the proper lockedObject
Change-Id: Ifcfa5bb130b16a2f392f1ca05239e085b961fc9c
Reviewed-on: https://gerrit.instructure.com/150245
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-457
Test plan:
* retrieve wiki page(s) using the graphql node or legacyNode field
Change-Id: I43310803cf74139a6527ba10f628d1bc7a8a21c1
Reviewed-on: https://gerrit.instructure.com/150759
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-456
Test plan:
Retrieve modules from the graphql api using the node (or legacyNode)
field
Change-Id: I891b7c0cf5160186db68da0230aed5ffd2a75f13
Reviewed-on: https://gerrit.instructure.com/150530
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
refs RECNVS-411
Test plan:
use the enrollmentStates filter on the Course usersConnection to
filter the set of users that are returned
Change-Id: Ie2faf4a50efdb97db93c24114a112cf5345b00cc
Reviewed-on: https://gerrit.instructure.com/147888
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
closes RECNVS-407
Test plan:
* add lock/unlock dates to assignments (some of these should be
overridden)
* make sure graphql returns the proper data
Change-Id: I3217e5762c7693b9417cf472b39b2139a40d2771
Reviewed-on: https://gerrit.instructure.com/145968
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-278
Test plan:
* set up a course with grading periods
* the Course assignmentsConnection will only return assigments due in
the current grading period by default (you can specify alternate
grading periods with the `filter` argument).
Change-Id: I9a0237bb38ebea0d5ec3405b2ad2769b3bd39ab2
Reviewed-on: https://gerrit.instructure.com/143732
Reviewed-by: Michael Jasper <mjasper@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Tested-by: Jenkins
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-376
Test plan:
* have accounts/courses on multiple shards
* make sure you can retrieve objects from multiple shards in one query
Change-Id: I8428345e741ed5198c29d32fb70d57248ec2aca4
Reviewed-on: https://gerrit.instructure.com/145423
Reviewed-by: Michael Jasper <mjasper@instructure.com>
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
Update: Copyright years now reflect the year that the file was first
committed.
Refs: PLAT-3200
Test Plan: jenkins is still happy and specs pass!!
Change-Id: Ic26463defe41fc52cf4da8020976394c641f51d5
Reviewed-on: https://gerrit.instructure.com/143545
Tested-by: Jenkins
Reviewed-by: Weston Dransfield <wdransfield@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Stewie aka Nicholas Stewart <nstewart@instructure.com>
[ci no-cached-dist]
need to bring these back until we figure out what's wrong with the build
Change-Id: Iaeb4e639f0c1a11e6d540267bfb593c0e83e2089
Reviewed-on: https://gerrit.instructure.com/142733
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jeremy Neander <jneander@instructure.com>
Tested-by: Cameron Matheson <cameron@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-308
Test plan:
* set up assignments with overrides in a variety of situations
* assignment dates should be overridden appropriately
* assignment due dates are *not* overridden when enumerating
assignmentOverrides
Change-Id: Iefec250bbcf095fb40cfb3b204f3521676e0d9f9
Reviewed-on: https://gerrit.instructure.com/142505
Tested-by: Jenkins
Reviewed-by: Keith T. Garner <kgarner@instructure.com>
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-332
Test plan:
* context cards should work (they should not use the REST API)
* graphql should work
Change-Id: I30f273e52a6d5e64dd049c3583211e545605f6e2
Reviewed-on: https://gerrit.instructure.com/141966
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Jonathan Featherstone <jfeatherstone@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-275
Test plan:
* set up a course with a late policy
* turn submissions in late and grade them
* the graphql field *deductedPoints* should correspond to how many
points were subtracted.
* enteredScore/enteredGrade should reflect the scores before late
policy application (score/grade should include late policy
deductions)
Change-Id: I81d89b84c6d847b50373bd47c7f1c70c6f839e07
Reviewed-on: https://gerrit.instructure.com/141119
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Collin Parrish <cparrish@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-277
Test plan:
- set up a course with submissions in a variety of states (graded /
submitted / unsubmitted)
- filter the list of submissions returned in graphql with the new
filter: argument on submissionsConnection
Change-Id: I0c0e8afd7a69e7d6a75b56efbde79265582ed695
Reviewed-on: https://gerrit.instructure.com/140695
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Reviewed-by: Michael Jasper <mjasper@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>
closes RECNVS-270
Test plan:
* fetch enrollments for users in a variety of workflow_states
* the courseId argument is now optional (so make sure it works with
and without)
Change-Id: I0fcb593c78003fba9e7705a869ec3e428482aa16
Reviewed-on: https://gerrit.instructure.com/139647
Tested-by: Jenkins
QA-Review: Collin Parrish <cparrish@instructure.com>
Reviewed-by: Michael Jasper <mjasper@instructure.com>
Product-Review: Cameron Matheson <cameron@instructure.com>