Moodle
  1. Moodle
  2. MDL-34757

Lesson activity can't use the blackboard_six plugin to import questions

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Not a bug
    • Affects Version/s: 2.2.4, 2.3.1
    • Fix Version/s: STABLE backlog
    • Component/s: Lesson
    • Labels:
    • Rank:
      43238

      Description

      This is because the blackboard_six qformat plugin needs the realfilename of the imported file and the qformat_default class in mod/lesson/import.php is missing the realfilename variable.

      So what would be needed is to add var $realfilename = ''; in that class, create a method similar to public function setRealfilename($realfilename) { (see in question/format.php line 177) and use this method in mod/lesson/import.php in a similar way to what is done in question/import.php to populate this field.

        Issue Links

          Activity

          Hide
          Jean-Michel Vedrine added a comment -

          I am currently working on repairing and refactoring the blackboard_six plugin so this is why I noticed this problem and created this issue so that it don't get lost.
          I am not really interested in solving it as my main goal is only to improve question bank import formats.
          But if somebody wants to take care of correcting the lesson code, I can test if the import is working or not and provide guidance to solve remaining problems if any. Thanks

          Show
          Jean-Michel Vedrine added a comment - I am currently working on repairing and refactoring the blackboard_six plugin so this is why I noticed this problem and created this issue so that it don't get lost. I am not really interested in solving it as my main goal is only to improve question bank import formats. But if somebody wants to take care of correcting the lesson code, I can test if the import is working or not and provide guidance to solve remaining problems if any. Thanks
          Hide
          Michael de Raadt added a comment -

          Thanks for reporting that and suggesting a direction towards a solution.

          Thanks also for offering to assist in reviewing a fix.

          Show
          Michael de Raadt added a comment - Thanks for reporting that and suggesting a direction towards a solution. Thanks also for offering to assist in reviewing a fix.
          Hide
          Jean-Michel Vedrine added a comment -

          I think MDL-34757 can't be solved before MDL-25492 is fixed and closed because as blackboard_six import format is currently broken in all Moodle versions starting from 2.0.x the developper would have no mean to test that lesson can import files or not.

          Show
          Jean-Michel Vedrine added a comment - I think MDL-34757 can't be solved before MDL-25492 is fixed and closed because as blackboard_six import format is currently broken in all Moodle versions starting from 2.0.x the developper would have no mean to test that lesson can import files or not.
          Hide
          Jean-Michel Vedrine added a comment -

          Hello Rossiani, here are the small adjustments needed so that the lesson activity mod is able to import blackboard zip files containing questions using the blackboard_six plugin wich is now fixed in master, 22_STABLE and 23_STABLE branches.
          If you agree I can make the other branches, and write some testing instructions.
          But there are some things I am unsure :

          • I have tried to adapt the questions code to the rather outdated lesson code but not sure all is OK
          • I left the setRealfilename function name with upercase as it is in question/format.php for consistency as this is just a copy/paste but not sure if it is what should be done
          Show
          Jean-Michel Vedrine added a comment - Hello Rossiani, here are the small adjustments needed so that the lesson activity mod is able to import blackboard zip files containing questions using the blackboard_six plugin wich is now fixed in master, 22_STABLE and 23_STABLE branches. If you agree I can make the other branches, and write some testing instructions. But there are some things I am unsure : I have tried to adapt the questions code to the rather outdated lesson code but not sure all is OK I left the setRealfilename function name with upercase as it is in question/format.php for consistency as this is just a copy/paste but not sure if it is what should be done
          Hide
          Rossiani Wijaya added a comment -

          Hi Jean,

          Thank you for working on this issue.

          Could you kindly provide a sample of Blackboard question file?

          Thanks
          Rosie

          Show
          Rossiani Wijaya added a comment - Hi Jean, Thank you for working on this issue. Could you kindly provide a sample of Blackboard question file? Thanks Rosie
          Hide
          Jean-Michel Vedrine added a comment -

          Hello Rossiani, here are 2 Blackboard sample files. 285 ws5 MCx is a Blackboard QTI file with 10 multichoice questions and bio ch9 is a Blackboard Pool file with 6 multichoice questions. Both should import fine. These files are part of the ones I used in testing instructions of MDL-25492 when I fixed the blackboard_six plugin.

          Show
          Jean-Michel Vedrine added a comment - Hello Rossiani, here are 2 Blackboard sample files. 285 ws5 MCx is a Blackboard QTI file with 10 multichoice questions and bio ch9 is a Blackboard Pool file with 6 multichoice questions. Both should import fine. These files are part of the ones I used in testing instructions of MDL-25492 when I fixed the blackboard_six plugin.
          Hide
          Rossiani Wijaya added a comment -

          Great! Thank you Jean!

          I will review it now.

          Show
          Rossiani Wijaya added a comment - Great! Thank you Jean! I will review it now.
          Hide
          Rossiani Wijaya added a comment -

          Hi Jean,

          I tested this issue without using your patch, the questions get imported without error.

          This is the steps to replicate:

          1. create new lesson
          2. import the zip file from your attachment with 'File format' set to 'Blackboard V6+'
            The questions are imported without any error.

          Did I miss any steps on testing this?

          Show
          Rossiani Wijaya added a comment - Hi Jean, I tested this issue without using your patch, the questions get imported without error. This is the steps to replicate: create new lesson import the zip file from your attachment with 'File format' set to 'Blackboard V6+' The questions are imported without any error. Did I miss any steps on testing this?
          Hide
          Jean-Michel Vedrine added a comment -

          Hello Rossiani
          Sorry to not have answered your question, but I forgot about it.
          Rebasing my local branchs on the weekly update reminded me about this issue.
          I am quite sure my fix is good but I need to understand how it can work without it !
          I will test and report.

          Show
          Jean-Michel Vedrine added a comment - Hello Rossiani Sorry to not have answered your question, but I forgot about it. Rebasing my local branchs on the weekly update reminded me about this issue. I am quite sure my fix is good but I need to understand how it can work without it ! I will test and report.
          Hide
          Jean-Michel Vedrine added a comment -

          Hello Rossiani,
          You are right, realfilename is no more used in the blackboard_six code (or any other import format code).
          I looked at the code before I rewrote blackboard_six last summer and realfilename was in fact just used to extract the file extension (in a wrong way) by the code $ext = substr($this->realfilename, strpos($this->realfilename,'.'), strlen($this->realfilename)-1);
          So I removed this code and I used pathinfo($filename, PATHINFO_EXTENSION).
          So you can close this issue because as you said lesson is able to use the blackboard_six format without any change !
          Sorry for not remembering I changed the code during my work.

          Show
          Jean-Michel Vedrine added a comment - Hello Rossiani, You are right, realfilename is no more used in the blackboard_six code (or any other import format code). I looked at the code before I rewrote blackboard_six last summer and realfilename was in fact just used to extract the file extension (in a wrong way) by the code $ext = substr($this->realfilename, strpos($this->realfilename,'.'), strlen($this->realfilename)-1); So I removed this code and I used pathinfo($filename, PATHINFO_EXTENSION). So you can close this issue because as you said lesson is able to use the blackboard_six format without any change ! Sorry for not remembering I changed the code during my work.
          Hide
          Rossiani Wijaya added a comment -

          Hi Jean-Michel,

          Thank you for working on this issue. Your effort is much appreciated.

          Closing this issue as not a bug.

          Show
          Rossiani Wijaya added a comment - Hi Jean-Michel, Thank you for working on this issue. Your effort is much appreciated. Closing this issue as not a bug.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: