Exemple #1
0
 public static function instance_config_form($instance)
 {
     global $USER;
     safe_require('artefact', 'survey');
     $configdata = $instance->get('configdata');
     return array('userid' => array('type' => 'hidden', 'value' => $USER->get('id')), 'chartoptions' => array('type' => 'fieldset', 'legend' => get_string('chartoptions', 'artefact.survey'), 'elements' => ArtefactTypeSurvey::get_chart_options_elements($configdata, true, false, true, true, true, true)));
 }
Exemple #2
0
 public static function instance_config_form($instance)
 {
     safe_require('artefact', 'survey');
     $configdata = $instance->get('configdata');
     return array('artefactid' => self::artefactchooser_element(isset($configdata['artefactid']) ? $configdata['artefactid'] : null), 'showresponses' => array('type' => 'checkbox', 'title' => get_string('showresponses', 'blocktype.survey/survey'), 'defaultvalue' => isset($configdata['showresponses']) ? $configdata['showresponses'] : false), 'showresults' => array('type' => 'checkbox', 'title' => get_string('showresults', 'blocktype.survey/survey'), 'defaultvalue' => isset($configdata['showresults']) ? $configdata['showresults'] : true), 'showchart' => array('type' => 'checkbox', 'title' => get_string('showchart', 'blocktype.survey/survey'), 'defaultvalue' => isset($configdata['showchart']) ? $configdata['showchart'] : true), 'chartoptions' => array('type' => 'fieldset', 'legend' => get_string('chartoptions', 'artefact.survey'), 'collapsible' => true, 'collapsed' => true, 'elements' => ArtefactTypeSurvey::get_chart_options_elements($configdata)));
 }
Exemple #3
0
 public static function instance_config_form($instance)
 {
     global $USER;
     safe_require('artefact', 'survey');
     $configdata = $instance->get('configdata');
     log_debug($configdata);
     $options = getoptions_available_surveys();
     return array('userid' => array('type' => 'hidden', 'value' => $USER->get('id')), 'survey' => array('type' => $options ? 'select' : 'html', 'labelhtml' => get_string('surveytitle', 'artefact.survey'), 'defaultvalue' => isset($configdata['survey']) ? $configdata['survey'] : null, 'value' => $options ? null : '<div id="artefactchooser-body"><p class="noartefacts">' . get_string('noartefactstochoosefrom', 'view') . '</p></div>', 'options' => $options), 'steps' => array('type' => 'select', 'labelhtml' => get_string('surveyhistorysteps', 'blocktype.survey/surveyhistory'), 'defaultvalue' => isset($configdata['steps']) ? $configdata['steps'] : 5, 'options' => array(2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9)), 'showchart' => array('type' => 'checkbox', 'title' => get_string('showchart', 'blocktype.survey/surveyhistory'), 'defaultvalue' => isset($configdata['showchart']) ? $configdata['showchart'] : true), 'chartoptions' => array('type' => 'fieldset', 'legend' => get_string('chartoptions', 'artefact.survey'), 'collapsible' => true, 'collapsed' => true, 'elements' => ArtefactTypeSurvey::get_chart_options_elements($configdata)));
 }