Commit Graph

31 Commits

Author SHA1 Message Date
Landon Wilkins 7ba3ae7960 convert add_assignment js_block to js_bundle
test plan:
* regression on adding assignment

Change-Id: I34b0a7b9ec728bcda2c06aa2635f694c3c7d8d49
Reviewed-on: https://gerrit.instructure.com/29075
Reviewed-by: Jon Jensen <jon@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
2014-02-06 21:41:56 +00:00
James Williams c83069bfcd fix unreliable question creation selenium specs
Change-Id: I93c40f81ca0fd154f608a28c4b2a71631fee734a
Reviewed-on: https://gerrit.instructure.com/29477
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-01-31 15:27:53 +00:00
James Williams d9ae1efd2c spec: replace it_should_behave_like with include_examples
Change-Id: I8a10679218b9a6ff8485b7822a21c704bdfaa398
Reviewed-on: https://gerrit.instructure.com/29213
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Product-Review: James Williams  <jamesw@instructure.com>
QA-Review: James Williams  <jamesw@instructure.com>
2014-01-24 16:02:26 +00:00
Joshua Simpson 1e81ea7caa move quiz into quizzes namespace as a precursor to enginifying
fixes CNVS-10679
this commit refactors quiz into a quizzes namespace. it contains various
shims to facilitate the data migration of polymorphic relationships
('Quiz' -> 'Quizzes::Quiz').  JIRA contains several tickets linked to
the above tickets in regards to removing these shims after the data
migration, as well as the strategies on reverting the shims once the
data migration is complete.
Change-Id: I30c566d60a87af6ee83e9d0041fdcb909ead6a89
Reviewed-on: https://gerrit.instructure.com/28573
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2014-01-24 00:08:46 +00:00
Hannah Bottalla 433878c689 spec: intermittent failure - browser alert
Change-Id: I25d5c111b7beb05d5fc26500f7aeb2dad891a8d2
Reviewed-on: https://gerrit.instructure.com/27855
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Hannah Bottalla <hannah@instructure.com>
Product-Review: Hannah Bottalla <hannah@instructure.com>
QA-Review: Hannah Bottalla <hannah@instructure.com>
Tested-by: Hannah Bottalla <hannah@instructure.com>
2014-01-20 17:04:29 +00:00
Josh Simpson b5b627efa6 Quiz question refactor / api implementation
fixes CNVS-7982
Changes parsing mechanisms for question data, and adds
API for quiz questions.

Change-Id: I483fc9c4718af50e1bed2ee3547905f857de6285
Reviewed-on: https://gerrit.instructure.com/25346
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
Product-Review: Josh Simpson <jsimpson@instructure.com>
2013-11-22 17:03:45 +00:00
Ahmad Amireh 6b8d55a77b Controlling visibility of student quiz scores
Teachers can now control when, and for how long, students get to see the
correct answers to their quiz submissions.

The patchset introduces two new columns to Quiz and a CSS rework of the
quiz options form. See linked references for more info.

Quiz#show_correct_answers should no longer be directly accessed, use
Quiz#show_correct_answers? instead.

== Test plan

CAs stands for Correct Answers.

  - Create a quiz with 3 questions
  - Take the quiz as a student, and:
    - get 2/3 of the questions answered correctly
    - submit it

Case A - Showing CAs the moment the submission goes in:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Leave both date fields empty
    - Save quiz
  - Refresh student view
    - You should see the CAs

Case B - Showing CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should not see the CAs
  - Edit the quiz, and:
    - Set the date to 3-days back
  - Refresh student view:
    - You should see the CAs

Case C - Hiding CAs after some date:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be hidden at
      the date you chose earlier
  - Edit the quiz, and:
    - Set the date to 3-days-back
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should read that the answers stopped being visible as of the
      date you chose earlier

Case D - Creating a time-frame for showing CAs:

  - Edit the quiz, and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show Correct Answers At" to yesterday
    - Set the "Hide Correct Answers At" to 3-days from now
  - Refresh student view:
    - You should see the CAs
    - You should see an alert that tells you the CAs will be visible
      between yesterday and 3 days from now
  - Edit the quiz, and:
    - Set the "Show At" date to tomorrow
  - Refresh student view:
    - You should no longer see the CAs
    - Alert should still tell you that the CAs will be visible starting
      tomorrow until 3 days from now

Case E - Choosing a bad range

  - Edit the quiz and:
    - Tick the 'Let Students See Their Score Points' checkbox
    - Set the "Show at" to tomorrow
    - Set the "Hide at" to today, or tomorrow
    - You should see an error-box

== Notes and really wild things

- http://docs.kodoware.com/canvas/cnvs-8103-take2
- http://docs.kodoware.com/canvas/cnvs-8103 (legacy changes)

refs CNVS-8103, CNVS-9386

Change-Id: Ib241ee5f143b87164105b7541aadac00f38f79ad
Reviewed-on: https://gerrit.instructure.com/25505
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Reviewed-by: Derek DeVries <ddevries@instructure.com>
Product-Review: Derek DeVries <ddevries@instructure.com>
2013-11-20 22:08:21 +00:00
Shawn Meredith ee54a3c71c spec: sel\ff upgrade spec fixes
Change-Id: If43f47cc5f44e2e163ea4b479d252ecbf6aa9493
Reviewed-on: https://gerrit.instructure.com/24393
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2013-09-25 01:57:36 +00:00
Patrick Cox b8a9975044 added quiz regrade tour
added tour popover to quiz edit/questions for teachers
when they edit quiz question on regrade

test plan:
edit a question of a quiz that students have already taken,
change the answer to reveal regrade options and verify popover
exists. Verify that its Ok, got it button works.

Change-Id: I13446746d90e05fb6da3a8632a045871c067e92b
Reviewed-on: https://gerrit.instructure.com/23680
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-09-23 21:56:33 +00:00
Derek DeVries b85c6a81b4 unflag the new quiz question type closes CNVS-6360
Change-Id: I9d02e3d937bdfbd73e7dc6553f9f3f53f2607cb1
Reviewed-on: https://gerrit.instructure.com/21579
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
Product-Review: Stanley Stuart <stanley@instructure.com>
2013-06-25 16:26:27 +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
Bryan Madsen ba3c751a1a Revert "spec: removal and shared specs and spec refactors"
This reverts commit 9c05b51714

Change-Id: Ia8250ef9d71cf70f0bc02208f2f459ed72c239e5
Reviewed-on: https://gerrit.instructure.com/19408
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Bryan Madsen <bryan@instructure.com>
2013-04-08 23:00:02 +00:00
Shawn Meredith 9c05b51714 spec: removal and shared specs and spec refactors
Change-Id: Iaed635190212ff75fed43ebbad3af3a3a791af33
Reviewed-on: https://gerrit.instructure.com/18964
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
Product-Review: Jake Sorce <jake@instructure.com>
QA-Review: Jake Sorce <jake@instructure.com>
2013-04-04 20:38:09 +00:00
Kyle Rosenbaum 8c5dbf5d7f spec: selenium upgrade spec fixes
Change-Id: Ibded76b3091c44b38328409e2f8803c4d4493227
Reviewed-on: https://gerrit.instructure.com/17746
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
2013-03-07 10:32:19 -07:00
Stanley Stuart bb3b65395a add varied due date editor to quiz edit page
test plan:
  - new specs should pass
  - go through and make sure assignment overrides work
    for quizzes by using the editor on the quiz
    edit page.

fixes CNVS-469

Change-Id: I6b647575bb7db34235b2a1742558f6274b2605fc
Reviewed-on: https://gerrit.instructure.com/17437
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Myller de Araujo <myller@instructure.com>
2013-02-28 10:26:06 -07:00
Erik Lyngved 569d368d79 tabbed interface for quiz edit page
Notes:
* Changed the quiz edit page into a tabbed interface
* Quiz settings were moved from the right sidebar to the default
  tab in the main content panel.
* Questions were moved to a second tab behind the quiz settings.
* Selenium specs were modified to interact with the tabs
* Checkboxes that "enable" a text field now place focus on their
  respective text fields when checked
* Admin links ("gear" menu) added with assignment rubric and
  delete options
* Changed bottom form action buttons to Cancel and Save; save
  button now takes user back to quiz show screen
* Publish and preview buttons to be added to quiz show page

closes CNVS-2949

Change-Id: I7d8cd579ef5789e32f91610c290820cb5fd96568
Reviewed-on: https://gerrit.instructure.com/17146
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
QA-Review: Simon Williams <simon@instructure.com>
2013-02-28 10:25:58 -07:00
Simon Williams 4f4c67d928 fix using [answer] as quiz question placeholder text
we were adding the text of the placeholder word directly as a class, and so
using certain words, like 'answer', had the potential to interact strantely
with javascript

fixes #CNVS-2029

text plan:
- create a quiz, with a multiple drop down question
- user [answer] as the placeholder text in the question
- create a few possible answers
- save the question
- re-edit it
- you should not see an extra, blank, correct answer option

Change-Id: I9642a1e820dd18d55f1ba71a7a47693779bc5043
Reviewed-on: https://gerrit.instructure.com/16074
QA-Review: Amber Taniuchi <amber@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stanley Stuart <stanley+gerrit@instructure.com>
2012-12-19 09:25:44 -07:00
Shawn Meredith 44fde8f378 spec: role recontexting and file naming refactor
test:
   1. refactored attribute(class) with have_class
   2. contexted no context specs
   3. split out teachers and student specific specs
   4. refactored have_attribute
   5. refactored eql => ==

Change-Id: I592a063eece8097d5672c164f82a7b1a0c3c8928
Reviewed-on: https://gerrit.instructure.com/13880
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-10-02 12:05:52 -06:00
Jake Sorce 719fce1e63 fix quiz attempts data validation bug, fixes #7211
test plan:
  1. login as a teacher
  2. create a new quiz
  3. click on 'Allow Multiple Attempts'
  4. click on 'Allowed Attempts'
  5. enter a number larger than 3 digits
     and click out of the box
  6. alert should popup with error message
  7. text input should be cleared after alert is dismissed
  8. enter a couple of letters for quiz attempts
     and click out of the box
  9. validate steps 6-7
  10. enter a couple of letters and numbers for quiz attempts
  11. alert should popup with error message
  12. validate steps 6-7
  13. validate you can enter a 3 digit number for
      quiz attempts and the quiz saves fine with
      the correct number of quiz attempts

Change-Id: I9f78871f05dac66dfa757f106a1f85e19a2444f9
Reviewed-on: https://gerrit.instructure.com/13820
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joe Tanner <joe@instructure.com>
2012-09-25 09:32:21 -06:00
Mark Ericksen 9ccaf9e2ff don't display "select correct answer" arrows for fill in multiple blanks. Fixes #10325
Hide the "select correct answer" arrows that display next to
answers but only for "Fill in multiple blanks" question types.
All answers listed are considered correct and it doesn't make
sense to allow selecting a "correct" one. Doing so would
cause the other answers to appear as incorrect (red) but
it would still not treat the answers as incorrect. This change
makes it more consistent with current "fill in the blank" question
types.

Testing Notes:
==========
* Create/edit a quiz
* Create/edit a "Fill in multiple blanks" question
* Verify that the arrows for selecting a correct
   answer no longer appear.
* Verify that the arrows appear for other questions
   that need ability to select correct answers.

Change-Id: Ieadd5667d5a349e9693771f43c01aac36f9327f6
Reviewed-on: https://gerrit.instructure.com/13541
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-09-12 09:38:56 -06:00
Shawn Meredith 07853d4516 spec: refactor selenium specs
test:
  1. removed skip_if_ie usages
  2. changed single line blocks to {} and
     multi-line blocks to do end
  3. replaces .displayed? and !displayed with
     .should .should_not be_displayed
  4. removed some extra selectors
  5. refactored helpers\basics\specs

Change-Id: I35bdc50594ee97774da35703d97a6bbab05654a4
Reviewed-on: https://gerrit.instructure.com/13532
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-09-10 15:53:06 -06:00
Shawn Meredith 07b7c54ddf spec: refactor selenium specs
test:
  1. refactored specs to use f aliases
  2. refactored some link usages
  3. refactored added helper methods

Change-Id: Iaad07a5e1173827cb22e3f67b80bc51666169914
Reviewed-on: https://gerrit.instructure.com/13322
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-08-29 14:09:25 -06:00
Mark Ericksen ef0cc7d662 fix a few quiz behavior problems discovered in QA process. Fixes #10161
The following issues are corrected with this:
 * wasn't showing "You Answered" arrow on incorrect answer
   for multiple-drowpdowns
* The "Correct Answer" arrow was not showing up on the quiz edit
   page when use clicks "Show Question Details" checkbox
* On questions where the correct answer can be selected
   (t/f, multiple checkboxes, etc), it was no longer showing
   the persistent green arrow of the currently specified correct answer.

Testing Plan:
===========
* When editing an existing quiz, click the "Show Question Details" and
   verify that the "Correct Answer(s)" arrow appears and points to the
   answer area.
* Edit a t/f question (for example) and change the "correct" answer.
   After updating, verify that the "Correct Answer" arrow updates to the
   new correct answer.
* Take a quiz (preview or otherwise) and for a multiple dropdown question,
   verify that a blank or incorrect choice shows the red "You Answered"
   arrow and it is surrounded by the red error box.

Change-Id: I004896b9272b69bfe224379f153d577a17e82f66
Reviewed-on: https://gerrit.instructure.com/13280
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
2012-08-28 14:59:14 -06:00
Jake Sorce cb40462a39 spec: split up context modules
also refactored selenium/helper files to include
the selenium common file so any file using a common
file only has to include one file

Change-Id: I133f757da0e15a2f5e31999b45f137567f679ed7
Reviewed-on: https://gerrit.instructure.com/11986
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-07-10 13:52:07 -06:00
Jake Sorce f50cb2f6d5 spec: refactor spec files to use submit_form
Change-Id: Iaa59aea0781d471eaa2f2d7488cc9ff1b4331ab0
Reviewed-on: https://gerrit.instructure.com/11279
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-06-06 18:01:43 -06:00
Jake Sorce 31f3cc059a spec: organize selenium spec files better
Change-Id: Id1825b4effdc4865963e8fbf3faaeca81553acd6
Reviewed-on: https://gerrit.instructure.com/11257
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2012-06-05 14:27:27 -06:00
Bryan Madsen c4c53a33cb spec: use fj for find_with_jquery in selenium tests
Change-Id: I0c05958a048ab89be87cb3a8a847b21dc602fcb4
Reviewed-on: https://gerrit.instructure.com/9530
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
2012-03-23 13:30:15 -06:00
Ryan Florence 25a4379b35 reorder questions in quizzes with drag and drop
fixes #7310

jQueryUI .sortable change event fires before stop,
moved change logic to the stop handler so the dom
is completely updated before sending data back to
the server.

also, we weren't sorting properly on page load
within question groups (even though we were
updating the database properly)

test plan:
1. create a quiz with two questions and one group
2. reorder the items, refresh page, verify order
3. nest questions into the group, refresh, verify
   order
4. reorder items in the group, refresh, verify
5. move one question out of the group, refresh,
   verify

Change-Id: I5624c4ed24c20d3109d4ce1252b048ea9b635e21
Reviewed-on: https://gerrit.instructure.com/9151
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cameron Matheson <cameron@instructure.com>
2012-03-05 15:31:04 -07:00
Ryan Florence 8c61132bef can edit survey questions after reload fixes #6157
test plan:
1. create a quiz
2. change it to a graded survey
3. save settings
4. create and save a question
5. refresh the page
6. edit the question
7. change an answer
8. save the question
9. observe no "you need to pick a correct answer"
   error bubble

Change-Id: I09a49185b94823acd0003eb956dd56b1880eeb59
Reviewed-on: https://gerrit.instructure.com/8984
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
2012-03-01 17:40:35 -07:00
Ryan Florence cfeeb75f89 quiz html answers closes #7176
test plan:
1. edit a quiz
2. add a multiple choice question
3. click the pencil on the first answer
4. add stuff to tiny
5. click done
6. click "update question"
7. reload page, note the HTML answer
8. repeat now that the answer is saved (make sure
   new and existing questions are handled
   identically)
9. Mess around w/ the question types to ensure
   no weird behavior

Change-Id: Idaf741777635fd2b697747a5d331a6b7e34dee8d
Reviewed-on: https://gerrit.instructure.com/8823
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
2012-03-01 15:20:06 -07:00
Jake Sorce d253888f19 spec: cleaning up / breaking up selenium quizzes file
Change-Id: Id4a46829ab1a61273c8305ce0cb1decff877f586
Reviewed-on: https://gerrit.instructure.com/8947
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Bryan Madsen <bryan@instructure.com>
2012-02-24 10:32:23 -07:00