pull/3127/head
parent
693f714ac1
commit
58f99b78cf
@ -0,0 +1,24 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\MigrationMoodle\Loader; |
||||
|
||||
/** |
||||
* Class LessonAnswersMultipleChoiceLoader. |
||||
* |
||||
* Loader to create Unique Answer question comming from Multiple Choice lesson page. |
||||
* |
||||
* @package Chamilo\PluginBundle\MigrationMoodle\Loader |
||||
*/ |
||||
class LessonAnswersMultipleChoiceLoader extends LessonAnswerTrueFalseLoader |
||||
{ |
||||
/** |
||||
* @param array $incomingData |
||||
* |
||||
* @return int |
||||
*/ |
||||
public function load(array $incomingData) |
||||
{ |
||||
return parent::load($incomingData); |
||||
} |
||||
} |
||||
@ -0,0 +1,47 @@ |
||||
<?php |
||||
/* For licensing terms, see /license.txt */ |
||||
|
||||
namespace Chamilo\PluginBundle\MigrationMoodle\Task; |
||||
|
||||
use Chamilo\PluginBundle\MigrationMoodle\Extractor\BaseExtractor; |
||||
use Chamilo\PluginBundle\MigrationMoodle\Loader\LessonAnswersMultipleChoiceLoader; |
||||
use Chamilo\PluginBundle\MigrationMoodle\Transformer\BaseTransformer; |
||||
use Chamilo\PluginBundle\MigrationMoodle\Transformer\Property\LoadedCourseLookup; |
||||
use Chamilo\PluginBundle\MigrationMoodle\Transformer\Property\LoadedLpQuizLookup; |
||||
use Chamilo\PluginBundle\MigrationMoodle\Transformer\Property\LoadedLpQuizQuestionLookup; |
||||
|
||||
/** |
||||
* Class LessonAnswersMultipleChoiceTask |
||||
* |
||||
* Task to convert Multiple Choice answers from a Moodle lesson page in answers for Unique Answer question for Chamilo. |
||||
* |
||||
* @package Chamilo\PluginBundle\MigrationMoodle\Task |
||||
*/ |
||||
class LessonAnswersMultipleChoiceTask extends LessonAnswersTrueFalseTask |
||||
{ |
||||
/** |
||||
* @return array |
||||
*/ |
||||
public function getExtractConfiguration() |
||||
{ |
||||
return [ |
||||
'class' => BaseExtractor::class, |
||||
'query' => 'SELECT la.id, la.pageid, la.score, la.answer, la.response, l.course |
||||
FROM mdl_lesson_answers la |
||||
INNER JOIN mdl_lesson_pages lp ON (la.pageid = lp.id AND la.lessonid = lp.lessonid) |
||||
INNER JOIN mdl_lesson l ON (lp.lessonid = l.id AND la.lessonid = l.id) |
||||
WHERE lp.qtype = 3 AND lp.qoption = 0 |
||||
ORDER BY lp.id', |
||||
]; |
||||
} |
||||
|
||||
/** |
||||
* @return array |
||||
*/ |
||||
public function getLoadConfiguration() |
||||
{ |
||||
return [ |
||||
'class' => LessonAnswersMultipleChoiceLoader::class, |
||||
]; |
||||
} |
||||
} |
||||
Loading…
Reference in new issue