This code doesn't bring any new feature or fix any non working feature. It's just code improvement as asked by Eloy in his comment to MDL-35147
So we are only testing there is no regression
All tests should be conducted with developer debugging set to enabled to verify that no error or warning is displayed during imports.
TEST IMPORT OF AN "ASSESSEMENT QTI" .ZIP ARCHIVE WITH SOME IMAGES
Download the testgen_images.ZIP file attached to MDL-25492 tracker issue.
Try to import this file file using the "Blackboard V6+" file format. Verify no warnings are displayed during import. You should also get no notification of missing image.
This file should import 1 MCQ question with name : Describe this image. Verify that both in preview and in editing the question text and each choice display a book image (the right answer is not what you may think first).
Looking at the question text the image src should be a valid draftfile url ending with
ppg__questions with image1127111308__f1q1g1.jpg
|
Looking at the choice with the image that looks the same, the img src should be a valid draftfile url ending with
ppg__questions with image1127111308__f1q1g3.jpg
|
TEST IMPORT OF A "QUESTION POOL" .ZIP ARCHIVE WITH SOME IMAGES
Download the 6.4 greeks.zip file from http://moodle.tccsa.net/tccsa2/mod/resource/view.php?id=635 1072 ko. Try to import this file file using the "Blackboard V6+" file format. Verify no warnings are displayed during import. You should also get no notification of missing image.
This file should import 12 MCQ questions. One of these questions has a name that display as * but is in fact * followed by a non breaking space entity. This name is wierd but is the expected result as we don't want any image included in question's names.
Preview this question, it should diplay an image with some text in the question's text (text in the image begin by atlas), verify it is working as expected, the right answer is Greeks.
Open the same question for editing and look at the html source of the question text. The image src should be a valid draftfile url with
ppg__examview__6-4-greeks__mc009-1.jpg
|
as last part, alt should be just "mc009-1.jpg".
TEST THAT LESSON IMPORT IS STILL WORKING FOR ALL FORMATS
As lesson don't support images import for now we only tests that the sample included in Moodle are correctly imported
I don't think it is necessary to test all these files because if there is a regression, most likely all formats should be broken
Create a lesson and try to import some questions from some of these files :
- try to import the question/format/aiken/tests/fixtures/questions.aiken.txt
- try to import the question/format/blackboard_six/tests/fixtures/sample_blackboard_pool.dat file
- try to import the question/format/blackboard_six/tests/fixtures/sample_blackboard_qti.dat file
- try to import the question/format/examview/tests/fixtures/examview_sample.xml file
- try to import the question/format/gift/tests/fixtures/questions.gift.txt file
TEST THAT QUESTION BANK IMPORT IS STILL WORKING
Try to import questions from some of the files listed in the previous step in a category of the question bank.