Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-9785 Improve Flexibility of Question Category Sharing and Permissions
  3. MDL-10899

Moving questions by using a call to a qtype->movingtocategory() function

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • STABLE backlog
    • 1.9
    • Questions
    • None
    • MOODLE_19_STABLE

      Actually (as in older version) moving a question in another category is done by modifying the question->category parameter as in
      line 486 of question/editlib.php
      //move question
      if (!set_field('question', 'category', $tocategory->id, 'id', $questionid))

      { error('Could not update category field'); }

      Calculated question can use category shared dataitems sets and just changing the category is not sufficient.
      I suggest that a moving_to_category() function being created in questiontype and that the default function could be the one used.
      I let you create the function and I will work on a specific one for calculated question.
      I suggest that the entire list i.e. $questionids be passed to the function because if you move all or part of the calculated questions that are in a category, the moving process is different.

        1. question_type_questiontype_diff.zip
          2 kB
        2. category_edit.jpg
          category_edit.jpg
          86 kB
        3. category_delete.jpg
          category_delete.jpg
          87 kB
        4. moving_associated_data_with_questions.patch.txt
          5 kB
        5. movecategory.zip
          4 kB
        6. calculatedquestiontype.php.patch
          18 kB
        7. calculatedsimplequestiontype.php.patch
          0.6 kB
        8. questionlib.php.patch
          3 kB
        9. questiontype.php.patch
          2 kB

            Unassigned Unassigned
            ppichet Pierre Pichet (Inactive)
            Pierre Pichet Pierre Pichet (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.