Moodle
  1. Moodle
  2. MDL-20992

Missing reset for workshop module

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Workshop
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The workshop module does not has the reset implemented. The attached patch should be able to implement the reset.

      The patch is created against 1.9.7 and we tested it on testing environments.

        Gliffy Diagrams

        1. lib.patch
          2 kB
          Andrea Bicciolo

          Issue Links

            Activity

            Hide
            Andrea Bicciolo added a comment -

            Forgot to mention it is needed to add the following language string in workshop.php: $string['resetworkshopall'] ='Delete all workshop elements';

            Show
            Andrea Bicciolo added a comment - Forgot to mention it is needed to add the following language string in workshop.php: $string ['resetworkshopall'] ='Delete all workshop elements';
            Hide
            David Mudrak added a comment -

            There are some issues with the patch:

            • it defines reset_certificate_all form field instead of reset_workshop_all - the provided version could not work actually - fixing
            • is uses subselects where not actually needed - I am fixing to preload the workshop ids once and re-use the list
            • it removes assessment forms definition. Which is IMO wrong because the reset should remove just students' participation info (submissions, grades etc) but the assessment forms which are part of the workshop settings - fixing

            Anyway, thanks a lot for the patch. Committing soon

            Show
            David Mudrak added a comment - There are some issues with the patch: it defines reset_certificate_all form field instead of reset_workshop_all - the provided version could not work actually - fixing is uses subselects where not actually needed - I am fixing to preload the workshop ids once and re-use the list it removes assessment forms definition. Which is IMO wrong because the reset should remove just students' participation info (submissions, grades etc) but the assessment forms which are part of the workshop settings - fixing Anyway, thanks a lot for the patch. Committing soon
            Hide
            David Mudrak added a comment -

            Also, the order of the tables clean up matters. We can't remove, for example, assessments before comments as comments depend on assessments (referential integrity)

            Show
            David Mudrak added a comment - Also, the order of the tables clean up matters. We can't remove, for example, assessments before comments as comments depend on assessments (referential integrity)
            Hide
            David Mudrak added a comment - - edited

            After reset, workshop_elements table values will be set to:

            • stdev to 0 (zero) - should be NULL but can't be because of the DB definition
            • totalassessments to 0 (zero)
            Show
            David Mudrak added a comment - - edited After reset, workshop_elements table values will be set to: stdev to 0 (zero) - should be NULL but can't be because of the DB definition totalassessments to 0 (zero)
            Hide
            David Mudrak added a comment -

            Committed into MOODLE_19_STABLE. Thanks for providing the patch.

            Show
            David Mudrak added a comment - Committed into MOODLE_19_STABLE. Thanks for providing the patch.
            Hide
            Andrea Bicciolo added a comment -

            Thanks to you for examining and refining the patch!

            Show
            Andrea Bicciolo added a comment - Thanks to you for examining and refining the patch!
            Hide
            Andrew Davis added a comment -

            I was able to successfully reset a workshop. Closing.

            Show
            Andrew Davis added a comment - I was able to successfully reset a workshop. Closing.

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: