qbank_bulkmove/modal_question_bank_bulkmove

Description:
  • Contain the logic for the bulkmove questions modal.

Source:
Author:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Contain the logic for the bulkmove questions modal.

Methods

(async) display(currentBankContextId, currentCategoryId)

Description:
  • Get the content to display and enhance the selects into auto complete fields.

Source:
Parameters:
Name Type Description
currentBankContextId integer
currentCategoryId integer

(async) displayConfirmMove() → {Promise.<void>}

Description:
  • Update the body with a confirmation prompt and set confirm cancel buttons in the footer.

Source:
Returns:
Type
Promise.<void>

(async) enhanceSelects(selects) → {Promise.<Array.<Promise>>}

Description:
  • Take the provided select options and enhance them into auto-complete fields.

Source:
Parameters:
Name Type Description
selects NodeList

Custom select elements to enhance.

Returns:
Type
Promise.<Array.<Promise>>

initSelectedCategoryId(categoryId)

Description:
  • Initialise the category select based on the data passed to the JS or if a filter is applied in the url.

Source:
Parameters:
Name Type Description
categoryId integer

mapCategoryContextIds()

Description:
  • Set a map, so we can determine which bank belongs to which category.

Source:

(async) moveQuestionsAfterConfirm(targetContextId, targetCategoryId) → {Promise.<void>}

Description:
  • Move the selected questions to their new target category.

Source:
Parameters:
Name Type Description
targetContextId integer

the target bank context id.

targetCategoryId integer

the target question category id.

Returns:
Type
Promise.<void>

rebuildOptions(selectedBankContextId, selectedCategoryId)

Description:
  • Dynamically update all enhanced selects options based on what is selected.

Source:
Parameters:
Name Type Description
selectedBankContextId integer
selectedCategoryId integer

registerEnhancedEventListeners()

Description:
  • Register event listeners on the enhanced selects. Must be done after they have been enhanced.

Source:

updateCategorySelectorState(toEnable)

Description:
  • Disable/enable the enhanced category selector field.

Source:
Parameters:
Name Type Description
toEnable boolean

True to enable, false to disable the field.

updateSaveButtonState()

Description:
  • Disable the button if the selected category is the same as the one the questions already belong to. Enable it otherwise.

Source: