mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 18:36:42 +02:00
merge the items dropdown, radio and check to multiplechoice item
merge the items dropdownrated, radiorated to multiplechoicerated item the creating or editing of an item now use the formslib
This commit is contained in:
parent
13b31d6f9d
commit
6ee09cfe8b
25 changed files with 1342 additions and 1708 deletions
18
mod/feedback/item/label/label_form.php
Normal file
18
mod/feedback/item/label/label_form.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
require_once $CFG->libdir.'/formslib.php';
|
||||
|
||||
class feedback_label_form extends moodleform {
|
||||
var $type = "label";
|
||||
var $area;
|
||||
|
||||
function definition() {
|
||||
$mform =& $this->_form;
|
||||
|
||||
$mform->addElement('header', 'general', get_string($this->type, 'feedback'));
|
||||
|
||||
$mform->addElement('hidden', 'itemname', $this->type);
|
||||
$this->area = $mform->addElement('htmleditor', 'presentation', '', array('rows'=>20));
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -8,16 +8,17 @@ class feedback_item_label extends feedback_item_base {
|
|||
|
||||
}
|
||||
|
||||
function show_edit($item, $usehtmleditor = false) {
|
||||
$item->presentation=isset($item->presentation)?$item->presentation:'';
|
||||
print_string('label', 'feedback');
|
||||
echo '<br />';
|
||||
print_textarea($usehtmleditor, 20, 0, 0, 0, "presentation", $item->presentation);
|
||||
echo '<input type="hidden" id="itemname" name="itemname" value="label" />';
|
||||
|
||||
if ($usehtmleditor) {
|
||||
use_html_editor();
|
||||
}
|
||||
function show_edit($item) {
|
||||
global $CFG;
|
||||
|
||||
require_once('label_form.php');
|
||||
|
||||
$item_form = new feedback_label_form();
|
||||
|
||||
$item->presentation = isset($item->presentation) ? $item->presentation : '';
|
||||
|
||||
$item_form->area->setValue($item->presentation);
|
||||
return $item_form;
|
||||
}
|
||||
function print_item($item){
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue