Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command QuestionImport: Questions in XML file cannot be imported in Moodle 4.1 #499

Open
minhduchoang195 opened this issue Sep 11, 2024 · 0 comments

Comments

@minhduchoang195
Copy link

  • moosh version: 1.21
  • moodle version: 4.1.6 (Build: 20231009)
    • database: PostgreSQL 13.5 on x86_64-redhat-linux-gnu
  • php version: 7.4.33
  • operating system: Red Hat Enterprise Linux 8.3 (Ootpa)

Actual behaviour

The latest module for "QuestionImport" belongs to Moodle39. And this module calls some deprecated functions in Moodle 4. Therefore, this import could not be carried out successfully so far with the following error messages.

++ Class 'question_edit_contexts' has been renamed for the autoloader and is now deprecated. Please use 'core_question\local\bank\question_edit_contexts' instead. ++
* line 143 of /lib/classes/component.php: call to debugging()
* line ? of unknownfile: call to core_component::classloader()
* line 40 of /usr/local/moosh/1.21-fix-472/Moosh/Command/Moodle39/Question/QuestionImport.php: call to spl_autoload_call()
* line 363 of /usr/local/moosh/1.21-fix-472/moosh.php: call to Moosh\Command\Moodle39\Question\QuestionImport->execute()
++ Parsing questions from import file. ++
!! Cannot read import file (or file is empty) !!
++ The function print_error() is deprecated. Please throw a new moodle_exception instance instead. ++
* line 3664 of /lib/deprecatedlib.php: call to debugging()
* line 71 of /usr/local/moosh/1.21-fix-472/Moosh/Command/Moodle39/Question/QuestionImport.php: call to print_error()
* line 363 of /usr/local/moosh/1.21-fix-472/moosh.php: call to Moosh\Command\Moodle39\Question\QuestionImport->execute()
Default exception handler: Import error Debug:
Error code: cannotimport
* line 3665 of /lib/deprecatedlib.php: moodle_exception thrown
* line 71 of /usr/local/moosh/1.21-fix-472/Moosh/Command/Moodle39/Question/QuestionImport.php: call to print_error()
* line 363 of /usr/local/moosh/1.21-fix-472/moosh.php: call to Moosh\Command\Moodle39\Question\QuestionImport->execute()

!!! Import error !!!
!!
Error code: cannotimport !!
!! Stack trace: * line 3665 of /lib/deprecatedlib.php: moodle_exception thrown
* line 71 of /usr/local/moosh/1.21-fix-472/Moosh/Command/Moodle39/Question/QuestionImport.php: call to print_error()
* line 363 of /usr/local/moosh/1.21-fix-472/moosh.php: call to Moosh\Command\Moodle39\Question\QuestionImport->execute()
 !!

Expected behaviour

To adapt to Moodle 4.1, a new module for question import should be created.

Steps to reproduce

Use the question-import command to import questions from an XML file into a quiz in Moodle 4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant