Moodle
  1. Moodle
  2. MDL-32638

Review and finish file API support in workshop

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: Workshop
    • Labels:
    • Testing Instructions:
      Hide

      Testing difficulty: easy, although can be a bit time consuming

      1. Prepare a course with at least one teacher and two students enrolled
      2. Prepare a new workshop instance (no need to define the assessment form). Embed some image into the workshop description (introduction) field, instructions for authors field and instructions for reviewers field. Switch the workshop into the submission phase.
      3. Log in as student #1 and submit their work. Use some embedded images in the submission text and attach some files to the submission.
      4. Log in as student #2 and let them submit their work including files, too.
      5. Log in as the teacher, invoke the filepicker somewhere in the course (eg. edit a section summary)
      6. TEST: Make sure that Server files repository provides access for the teacher to all files in the workshop (in intro, both instruction fields and the submissions)
      7. Copy the URL of the image embedded into the text submitted by student #1 (something like http://site/pluginfile.php?file=/42/mod_workshop/etc/etc)
      8. Log in as the student #2
      9. TEST: Paste the image URL into the address bar and make sure that the file is not loaded (file not found screen or something like that should appear)
      10. Log in as the teacher again. Using the manual allocation method, make the student #2 be the reviewer of the submission by student #1
      11. Log in as the student #2
      12. TEST: Repeat the TEST from the step 9 - paste the URL of the file into the address bar again. The file should be served normally as the logged in user is the reviewer of the submission now.

      This is enough to test to pass the issue. If you are interested, you can try other scenarios as a bonus:

      • Users with the capability "View all submissions" in the workshop should be able to see files from all submissions in the no groups and visible groups mode.
      • Users with the capability "View all submissions" and "Access all groups" should be able to see files from all submissions in the separate groups mode.
      • In the separate groups mode, users with the capability "View all submissions" that do not have access to all groups should be able to see files only from those submissions, where they share at least one group with the author of the submission.
      Show
      Testing difficulty: easy, although can be a bit time consuming 1. Prepare a course with at least one teacher and two students enrolled 2. Prepare a new workshop instance (no need to define the assessment form). Embed some image into the workshop description (introduction) field, instructions for authors field and instructions for reviewers field. Switch the workshop into the submission phase. 3. Log in as student #1 and submit their work. Use some embedded images in the submission text and attach some files to the submission. 4. Log in as student #2 and let them submit their work including files, too. 5. Log in as the teacher, invoke the filepicker somewhere in the course (eg. edit a section summary) 6. TEST: Make sure that Server files repository provides access for the teacher to all files in the workshop (in intro, both instruction fields and the submissions) 7. Copy the URL of the image embedded into the text submitted by student #1 (something like http://site/pluginfile.php?file=/42/mod_workshop/etc/etc ) 8. Log in as the student #2 9. TEST: Paste the image URL into the address bar and make sure that the file is not loaded (file not found screen or something like that should appear) 10. Log in as the teacher again. Using the manual allocation method, make the student #2 be the reviewer of the submission by student #1 11. Log in as the student #2 12. TEST: Repeat the TEST from the step 9 - paste the URL of the file into the address bar again. The file should be served normally as the logged in user is the reviewer of the submission now. This is enough to test to pass the issue. If you are interested, you can try other scenarios as a bonus: Users with the capability "View all submissions" in the workshop should be able to see files from all submissions in the no groups and visible groups mode. Users with the capability "View all submissions" and "Access all groups" should be able to see files from all submissions in the separate groups mode. In the separate groups mode, users with the capability "View all submissions" that do not have access to all groups should be able to see files only from those submissions, where they share at least one group with the author of the submission.
    • Affected Branches:
      MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-32638-workshop-files
    • Rank:
      39570

      Description

      The File API support in workshop 2.x has some todos left and thing to fix:

      • files access control (at the moment, we do not check if the user is allowed to get the file which is pretty critical)
      • file browsing support (this used to work in 2.0dev but then some changes in the core made it non-working again)

        Activity

        Hide
        David Mudrak added a comment -

        Submitting for integration.

        Show
        David Mudrak added a comment - Submitting for integration.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

        TIA and ciao

        Show
        Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
        Hide
        Sam Hemelryk added a comment -

        Thanks David, this has been integrated now

        Show
        Sam Hemelryk added a comment - Thanks David, this has been integrated now
        Hide
        David Mudrak added a comment -

        Ooops, sorry! During massive rebasing, I somehow missed the most critical commit for this branch. I just added it on top of the branch and it should be integrated, too (otherwise, the testing will fail).

        Integrators, please either re-emerge the branch or just cherry pick f08c15685bbf1e3506c8393b536861c49fcaae16 into master. Thanks in advance.

        Show
        David Mudrak added a comment - Ooops, sorry! During massive rebasing, I somehow missed the most critical commit for this branch. I just added it on top of the branch and it should be integrated, too (otherwise, the testing will fail). Integrators, please either re-emerge the branch or just cherry pick f08c15685bbf1e3506c8393b536861c49fcaae16 into master. Thanks in advance.
        Hide
        Dan Poltawski added a comment -

        Done

        Show
        Dan Poltawski added a comment - Done
        Hide
        Adrian Greeve added a comment -

        Tested in master. Permission to view attachments in students submissions works as explained.
        Thanks.

        Show
        Adrian Greeve added a comment - Tested in master. Permission to view attachments in students submissions works as explained. Thanks.
        Hide
        Eloy Lafuente (stronk7) added a comment -
        UPDATE tracker_issues
           SET status = 'Closed',
              comment = 'Thanks!'
        WHEN participants = 'Did a gorgeous work'
        

        This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

        Show
        Eloy Lafuente (stronk7) added a comment - UPDATE tracker_issues SET status = 'Closed', comment = 'Thanks!' WHEN participants = 'Did a gorgeous work' This landed upstream some hours ago (some - me - developer fell slept in the sofa yesterday before spamming this).

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: