Skip to content

Commit

Permalink
issue moodleou#32: move classes around to fix missing file error
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriim committed Feb 28, 2023
1 parent 6fa807b commit a6df497
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\combined;
namespace quiz_answersheets\local\renderer\combined;

use coding_exception;
use html_writer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\gapselect;
namespace quiz_answersheets\local\renderer\gapselect;

use html_writer;
use question_attempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\match;
namespace quiz_answersheets\local\renderer\match;

use html_writer;
use question_attempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\multichoice;
namespace quiz_answersheets\local\renderer\multichoice;

use html_writer;
use question_attempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\oumultiresponse;
namespace quiz_answersheets\local\renderer\oumultiresponse;

use html_writer;
use question_attempt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\pmatch;
namespace quiz_answersheets\local\renderer\pmatch;

defined('MOODLE_INTERNAL') || die();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\randomsamatch;
namespace quiz_answersheets\local\renderer\randomsamatch;

use quiz_answersheets\output\match\qtype_match_override_renderer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\recordrtc;
namespace quiz_answersheets\local\renderer\recordrtc;

defined('MOODLE_INTERNAL') || die();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\stack;
namespace quiz_answersheets\local\renderer\stack;

defined('MOODLE_INTERNAL') || die();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace quiz_answersheets\output\truefalse;
namespace quiz_answersheets\local\renderer\truefalse;

use html_writer;
use question_attempt;
Expand Down
7 changes: 5 additions & 2 deletions classes/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,14 @@ public static function get_question_renderer(moodle_page $page, question_attempt
global $CFG;

$qtypename = $qa->get_question()->get_type_name();
$requirefile = $CFG->dirroot . '/mod/quiz/report/answersheets/classes/output/' . $qtypename . '/renderer.php';
$requirefile = $CFG->dirroot . '/mod/quiz/report/answersheets/classes/local/renderer/' . $qtypename . '/renderer.php';
if (file_exists($requirefile)) {
// Override supported question found.
require_once($requirefile);
$classpath = sprintf('quiz_answersheets\output\\' . $qtypename . '\%s', 'qtype_' . $qtypename . '_override_renderer');
$classpath = sprintf(
'quiz_answersheets\local\renderer\\' . $qtypename . '\%s',
'qtype_' . $qtypename . '_override_renderer'
);
return new $classpath($page, null);
}

Expand Down

0 comments on commit a6df497

Please sign in to comment.