MDL-27490 Implement a manage question behaviours admin page

While doing this, I found various bugs in the manages question types admin page, and so fixed them, and updated the code
there to use $OUTPUT and html_writer.

AMOS BEGIN
 MOV [cannotdeletemissingqtype,admin],[cannotdeletemissingqtype,question]
 MOV [cannotdeleteqtypeinuse,admin],[cannotdeleteqtypeinuse,question]
 MOV [cannotdeleteqtypeneeded,admin],[cannotdeleteqtypeneeded,question]
 MOV [deleteqtypeareyousure,admin],[deleteqtypeareyousure,question]
 MOV [deleteqtypeareyousuremessage,admin],[deleteqtypeareyousuremessage,question]
 MOV [deletingqtype,admin],[deletingqtype,question]
 MOV [numquestions,admin],[numquestions,question]
 MOV [numquestionsandhidden,admin],[numquestionsandhidden,question]
 MOV [qtypedeletefiles,admin],[qtypedeletefiles,question]
 MOV [uninstallqtype,admin],[uninstallqtype,question]
AMOS END
This commit is contained in:
Tim Hunt
2011-06-17 16:21:32 +01:00
parent d037c6bc3c
commit fde4560dae
15 changed files with 549 additions and 130 deletions
@@ -81,16 +81,16 @@ class question_engine_test extends UnitTestCase {
$this->assertIdentical($out, question_engine::sort_behaviours($in, '', 'b1,b2,b3,b4', 'b4'));
$out = array('b6' => 'Behave 6', 'b1' => 'Behave 1', 'b4' => 'Behave 4');
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b6, b1, b4', 'b1, b2, b3, b4, b5', 'b4'));
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b6,b1,b4', 'b2,b3,b4,b5', 'b4'));
$out = array('b6' => 'Behave 6', 'b5' => 'Behave 5', 'b4' => 'Behave 4');
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b6, b5, b4', 'b1, b2, b3', 'b4'));
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b6,b5,b4', 'b1,b2,b3', 'b4'));
$out = array('b1' => 'Behave 1', 'b6' => 'Behave 6', 'b5' => 'Behave 5', 'b4' => 'Behave 4');
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b1, b6, b5', 'b1, b2, b3, b4, b5', 'b4'));
$out = array('b6' => 'Behave 6', 'b5' => 'Behave 5', 'b4' => 'Behave 4');
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b1,b6,b5', 'b1,b2,b3,b4', 'b4'));
$out = array('b2' => 'Behave 2', 'b4' => 'Behave 4', 'b6' => 'Behave 6');
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b2, b4, b6', 'b1, b3, b5', 'b2'));
$this->assertIdentical($out, question_engine::sort_behaviours($in, 'b2,b4,b6', 'b1,b3,b5', 'b2'));
// Ignore unknown input in the order argument.
$this->assertIdentical($in, question_engine::sort_behaviours($in, 'unknown', '', ''));