Moodle
  1. Moodle
  2. MDL-28155

Can't implement "download all submissions" feature in non-standard assignment type

    Details

    • Testing Instructions:
      Hide
      1. Create an online assignment (Assignment 2.2 in Moodle > 2.2)
      2. Login as a student make a submission to the assignment
      3. As a teacher / admin, go to the assignment and click "View N submitted assignments" you SHOULD see the 'Download submissions' link
      4. Create an offline assignment (Assignment 2.2 in Moodle > 2.2)
      5. As a teacher / admin, go to the assignment and click "View assignment grades and feedback" you SHOULD NOT see the 'Download all assignments' link
      6. Create an extension of the online assignment type
        1. cp -r mod/assignment/type/online mod/assignment/type/onlinetest
        2. Edit mod/assignment/type/onlinetest/version.php changing plugin->component to 'assignment_onlinetest'
        3. Edit mod/assignment/type/onlinetest/assignment.class.php changing the classes names to 'assignment_onlinetest' and 'mod_assignment_onlinetest_edit_form', and the call to 'mod_assignment_online_edit_form' to 'mod_assignment_onlinetest_edit_form'
        4. Click notifications to install the plugin
      7. Create a new onlinetest assignment, there will be missing text strings, it's a test
      8. Login as a student and add a submission
      9. As a teacher / admin, go to the assignment and click "View N submitted assignments" you SHOULD see the "Download all assignments" link
      Show
      Create an online assignment (Assignment 2.2 in Moodle > 2.2) Login as a student make a submission to the assignment As a teacher / admin, go to the assignment and click "View N submitted assignments" you SHOULD see the 'Download submissions' link Create an offline assignment (Assignment 2.2 in Moodle > 2.2) As a teacher / admin, go to the assignment and click "View assignment grades and feedback" you SHOULD NOT see the 'Download all assignments' link Create an extension of the online assignment type cp -r mod/assignment/type/online mod/assignment/type/onlinetest Edit mod/assignment/type/onlinetest/version.php changing plugin->component to 'assignment_onlinetest' Edit mod/assignment/type/onlinetest/assignment.class.php changing the classes names to 'assignment_onlinetest' and 'mod_assignment_onlinetest_edit_form', and the call to 'mod_assignment_online_edit_form' to 'mod_assignment_onlinetest_edit_form' Click notifications to install the plugin Create a new onlinetest assignment, there will be missing text strings, it's a test Login as a student and add a submission As a teacher / admin, go to the assignment and click "View N submitted assignments" you SHOULD see the "Download all assignments" link
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-28155_master
    • Rank:
      17773

      Description

      Skodak has point out it in the code with a TODO comment:

      if ($hassubmission && ($this->assignment->assignmenttype=='upload' || $this->assignment->assignmenttype=='online' || $this->assignment->assignmenttype=='uploadsingle')) { //TODO: this is an ugly hack, where is the plugin spirit? (skodak)

      I'm making a new assignment type and meet this bug. So I made this patch

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this and for providing a solution.

        I've put it on our backlog and we'll look at it as soon as we can.

        Show
        Michael de Raadt added a comment - Thanks for reporting this and for providing a solution. I've put it on our backlog and we'll look at it as soon as we can.
        Hide
        David Monllaó added a comment -

        Hi Sunner,

        Thanks for the patch Sunner. Adding testing instructions, rebasing to the latest stable versions and updating pull branches.

        There is a new assignment module from Moodle 2.3, so I don't know what kind of support will the assignment 2.2 have

        Show
        David Monllaó added a comment - Hi Sunner, Thanks for the patch Sunner. Adding testing instructions, rebasing to the latest stable versions and updating pull branches. There is a new assignment module from Moodle 2.3, so I don't know what kind of support will the assignment 2.2 have
        Hide
        Rajesh Taneja added a comment -

        Thanks Sunner and David,

        Patch looks good, but you should consider using object ($this) and not classname which is currently using hard-coded prefix.

        Either way is fine, if you don't plan to change it then please feel free to push it for integration review.

        Show
        Rajesh Taneja added a comment - Thanks Sunner and David, Patch looks good, but you should consider using object ($this) and not classname which is currently using hard-coded prefix. Either way is fine, if you don't plan to change it then please feel free to push it for integration review.
        Hide
        David Monllaó added a comment -

        Thanks for reviewing and for the comments Rajesh, I applied the proposed change to use the self instance instead of the string.

        I've updated both master, 2.3 and 2.2 branches, but I've doubts if it's going to be integrated into master and 2.3 because of the new assignment module. Pushing for integration review

        Show
        David Monllaó added a comment - Thanks for reviewing and for the comments Rajesh, I applied the proposed change to use the self instance instead of the string. I've updated both master, 2.3 and 2.2 branches, but I've doubts if it's going to be integrated into master and 2.3 because of the new assignment module. Pushing for integration review
        Hide
        Dan Poltawski 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
        Dan Poltawski 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 -

        Changes look spot on thanks David! has been integrated now

        Show
        Sam Hemelryk added a comment - Changes look spot on thanks David! has been integrated now
        Hide
        Tim Barker added a comment -

        Grats David tested on 2.2 and 2.3 and this works perfectly!!

        Show
        Tim Barker added a comment - Grats David tested on 2.2 and 2.3 and this works perfectly!!
        Hide
        Dan Poltawski added a comment -

        *Notice*: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26

        Congratulations

        {tracker.user.name}

        !

        You've made into Moodle

        {tracker.fixversion-1}

        +

        I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world.

        cheers!

        {tracker.friendlyintegrator}
        Show
        Dan Poltawski added a comment - * Notice *: Undefined variable: friendlyintegrator in /Users/danp/git/tokenintegrationthanks.php on line 26 Congratulations {tracker.user.name} ! You've made into Moodle {tracker.fixversion-1} + I would like to personally thank you for this contribution on behalf of all Moodle users throughout the world. cheers! {tracker.friendlyintegrator}

          People

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

            Dates

            • Created:
              Updated:
              Resolved: