XMLWordPrintable

Details

    • Sub-task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3
    • 2.3
    • Backup, Web Services
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • MDL-32233-core_course_duplicate_course-usersdata
    • Hide

      For testing this new webservice:

      Use this client:
      https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php

      functionname
      core_course_duplicate_course

      /// PARAMETERS
      $params = array(
      'courseid' => 4, // Course to be duplicated idnumber // CHANGE IT FOR AN EXISTING COURSE ID
      'fullname' => 'Nuevo curso', // New course full name
      'shortname' => 'NuevoCurso'.rand(), // New course shortname
      'categoryid' => 1, // New course category id
      'visible' => 1, // Make the course visible after duplicating
      'options' => array(array('name'=>'blocks', 'value'=>1), array('name'=>'activities', 'value'=>1), array('name'=>'filters', 'value'=>1)) // Backup options
      );

      Show
      For testing this new webservice: Use this client: https://github.com/moodlehq/sample-ws-clients/blob/master/PHP-REST/client.php functionname core_course_duplicate_course /// PARAMETERS $params = array( 'courseid' => 4, // Course to be duplicated idnumber // CHANGE IT FOR AN EXISTING COURSE ID 'fullname' => 'Nuevo curso', // New course full name 'shortname' => 'NuevoCurso'.rand(), // New course shortname 'categoryid' => 1, // New course category id 'visible' => 1, // Make the course visible after duplicating 'options' => array(array('name'=>'blocks', 'value'=>1), array('name'=>'activities', 'value'=>1), array('name'=>'filters', 'value'=>1)) // Backup options );

    Description

      This web service function will duplicate a course creating a new one.
      It will perform a backup of an existing course and a restore to a new one

      Parameters:
      ----------

      course id - int The course id to duplicate
      fullname - string The new course (duplicated) fullname
      shortname - string The new course shortname
      category id - int The category id of the new course - Optional, default to Miscellaneous
      backup settings - struct of backup settings:
      'users' => 'Default to true',
      'role_assignments' => 'Default to true',
      'user_files' => 'Default to true',
      'activities' => 'Default to true',
      'blocks' => 'Default to true',
      'filters' => 'Default to true',
      'comments' => 'Default to true',
      'completion_information' => 'Default to true',
      'logs' => 'Default to true',
      'histories' => 'Default to true'

      Return value:
      -----------
      The new course created

      struct{
      course struct [id, fullname, shortname, timemodified]
      }

      Note:
      I don't know who is the core_course maintainer (moodle.com ?)
      This functionality is currently not present in Moodle, the most similar is duplicate activity at course level

      Attachments

        Issue Links

          Activity

            People

              jleyva Juan Leyva
              jleyva Juan Leyva
              Jérôme Mouneyrac Jérôme Mouneyrac
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Ankit Agarwal Ankit Agarwal
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Juan Leyva, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Jun/12