MigrationMoodle: Separete task about user questions - refs BT#15992

pull/3127/head
Angel Fernando Quiroz Campos 6 years ago
parent 90d8d6cd2c
commit 1c0da8b469
  1. 4
      plugin/migrationmoodle/admin.php
  2. 4
      plugin/migrationmoodle/lang/english.php
  3. 22
      plugin/migrationmoodle/src/Task/UserQuestionAttemptsGapselectTask.php
  4. 22
      plugin/migrationmoodle/src/Task/UserQuestionAttemptsShortanswerTask.php
  5. 5
      plugin/migrationmoodle/src/Task/UserQuestionAttemptsTask.php
  6. 22
      plugin/migrationmoodle/src/Task/UserQuestionAttemptsTruefalseTask.php

@ -109,7 +109,9 @@ $menu = [
],
'users_learn_paths_quizzes' => [
'users_quizzes_attempts',
'user_question_attempts',
'user_question_attempts_shortanswer',
'user_question_attempts_gapselect',
'user_question_attempts_truefalse',
],
];

@ -65,4 +65,6 @@ $strings['UsersLearnPathsLessonBranchTask'] = 'Lesson branch to total time in le
$strings['UsersLearnPathsLessonAttemptsTask'] = 'Lesson attempts to total time in learn paths quizzes';
$strings['UsersLearnPathsQuizzesTask'] = 'Quizzes attempts to learn paths quizzes attempts';
$strings['UsersQuizzesAttemptsTask'] = 'Quiz attempts of users';
$strings['UserQuestionAttemptsTask'] = 'Question attempts of users';
$strings['UserQuestionAttemptsShortanswerTask'] = 'Question attempts of users for shortanswer';
$strings['UserQuestionAttemptsGapselectTask'] = 'Question attempts of users for gapselect';
$strings['UserQuestionAttemptsTruefalseTask'] = 'Question attempts of users for truefalse';

@ -0,0 +1,22 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\MigrationMoodle\Task;
/**
* Class UserQuestionAttemptsGapselectTask.
*
* @package Chamilo\PluginBundle\MigrationMoodle\Task
*/
class UserQuestionAttemptsGapselectTask extends UserQuestionAttemptsTask
{
/**
* @inheritDoc
*/
public function getExtractConfiguration()
{
$this->questionType = 'gapselect';
return parent::getExtractConfiguration();
}
}

@ -0,0 +1,22 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\MigrationMoodle\Task;
/**
* Class UserQuestionAttemptsShortanswerTask.
*
* @package Chamilo\PluginBundle\MigrationMoodle\Task
*/
class UserQuestionAttemptsShortanswerTask extends UserQuestionAttemptsTask
{
/**
* @inheritDoc
*/
public function getExtractConfiguration()
{
$this->questionType = 'shortanswer';
return parent::getExtractConfiguration();
}
}

@ -19,8 +19,10 @@ use Chamilo\PluginBundle\MigrationMoodle\Transformer\Property\UserQuestionAnswer
*
* @package Chamilo\PluginBundle\MigrationMoodle\Task
*/
class UserQuestionAttemptsTask extends BaseTask
abstract class UserQuestionAttemptsTask extends BaseTask
{
protected $questionType;
/**
* @inheritDoc
*/
@ -55,6 +57,7 @@ class UserQuestionAttemptsTask extends BaseTask
INNER JOIN mdl_user u ON (qqas.userid = u.id)
WHERE qqas.state NOT IN ('todo', 'complete')
AND (qqasd.name = '-finish' AND qqasd.value = 1)
AND qq.qtype = '{$this->questionType}'
$userFilterCondition
ORDER BY qa.userid, qa.quiz, qqa.slot",
];

@ -0,0 +1,22 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\PluginBundle\MigrationMoodle\Task;
/**
* Class UserQuestionAttemptsTruefalseTask.
*
* @package Chamilo\PluginBundle\MigrationMoodle\Task
*/
class UserQuestionAttemptsTruefalseTask extends UserQuestionAttemptsTask
{
/**
* @inheritDoc
*/
public function getExtractConfiguration()
{
$this->questionType = 'truefalse';
return parent::getExtractConfiguration();
}
}
Loading…
Cancel
Save