dirroot . '/mod/nasatlx/lib.php');
require_once($CFG->dirroot . '/mod/nasatlx/locallib.php');
$action = optional_param('action', 'view', PARAM_TEXT);
$ilm_id = optional_param('ilm_id', 0, PARAM_INT);
$ilm_param_id = optional_param('ilm_param_id', 0, PARAM_INT);
$ilm_id_parent = optional_param('ilm_id_parent', 0, PARAM_INT);
$status = optional_param('status', 0, PARAM_INT);
if (!$action && !$ilm_id) {
return; // nothing to be done (it is the Admin entering at the initial administrative section)
}
//D echo "/mod/nasatlx/settings.php: action=$action
";
/*
if ($action == 'visible') {
ilm_settings::visible_ilm($ilm_id, $status);
$action = 'config';
$ilm_id = $ilm_id_parent;
}
else
if ($action == 'visible_param') {
ilm_settings::visible_param($ilm_param_id, $status);
$action = 'config';
}
else
if ($action == 'export') {
ilm_settings::export_ilm($ilm_id);
$action = 'config';
}
*/
$str = '';
//D if (!file_exists($CFG->dirroot . '/blocks/nasatlx_block/version.php')) {
//D $str .= $OUTPUT->box_start();
//D $str .= '
' . $OUTPUT->error_text(get_string('error_check_nasatlx_block', 'nasatlx')) . '';
//D $str .= $OUTPUT->box_end();
//D }
if ($action == 'view') {
// echo "settings.php: action==view
"; exit;
$url_export_all = new moodle_url('/mod/nasatlx/settings_nasatlx_line.php', array('action' => 'export'));
$action_add = new popup_action('click', $url_export_all, 'popup', array('width' => 900, 'height' => 650));
$link_export_all = $OUTPUT->action_link($url_export_all, get_string('export_all_nasatlx', 'nasatlx'), $action_add) . $OUTPUT->help_icon('export_all_nasatlx', 'nasatlx');
//TODO Implement export all questionnaires NASA-TLX/LInE and their associated data (all of them)
//DDD $url_import = new moodle_url('/mod/nasatlx/settings_nasatlx_line.php', array('action' => 'import'));
//DDD $action_import = new popup_action('click', $url_import, 'popup', array('width' => 900, 'height' => 650));
//DDD $link_import = $OUTPUT->action_link($url_import, get_string('export_nasatlx', 'nasatlx'), $action_import) . $OUTPUT->help_icon('export_nasatlx', 'nasatlx');
// First list all iLM from type HTML
// Table '*_nasatlx' : id course name intro introformat timecreated timemodified
// Table '*_nasatlx_resps': id scale1 scale2 scale3 scale4 scale5 calc1 calc2 calc3 calc4 calc5 peso1 peso2 peso3 peso4 peso5 cmid course user created
$nasatlx_list = $DB->get_records_sql("SELECT * FROM {nasatlx} WHERE 1 = 1");
//D foreach ($nasatlx_list as $nasa_item) echo " * " . $nasa_item->id . ", " . $nasa_item->course . ", " . $nasa_item->name . ", " . $nasa_item->intro . "
";
$str .= '' . chr(13);
$str .= '' . $link_export_all . ' | '; // must be implemented in 'settings_nasatlx_line.php'
// $str .= '' . $link_import . ' |
';
if ($nasatlx_list) {
foreach ($nasatlx_list as $item_quest) {
$url_view_quest = new moodle_url('/admin/settings.php', array('section' => 'modsettingnasatlx', 'action' => 'config', 'ilm_id' => $item_quest->id));
//DDD $link_config = $OUTPUT->action_link($url_view_quest, nasatlx_icons::insert('config_ilm'));
$str .= ' ' . chr(13);
$str .= ' ' . chr(13);
$str .= '' . chr(13);
//TODO implement 'search_total_of_answers($id)': return the total of answers in this questionnaire
// $str .= '' . chr(13);
$str .= '
';
} // foreach ($nasatlx_list as $item_quest)
} // if ($nasatlx_list)
$str .= '
';
$settings->add(new admin_setting_heading('nasatlx', get_string('view_nasatlx', 'nasatlx') . $OUTPUT->help_icon('modulename', 'nasatlx'), $str));
} // if ($action == 'view')
else if ($action == 'confirm_upgrade') {
//D print "settings.php: 1 action==confirm_upgrade - to be implemented
";
if (is_debugging()) print "nasatlx: settings.php: action==confirm_upgrade - to be implemented
";
// debugging("settings.php: action==confirm_upgrade - to be implemented
", DEBUG_DEVELOPER);
} // else if ($action == 'confirm_upgrade')
else if ($action == 'config') { // Administration > plugins > NASA-TLX/LInE : after select the iLM reaches this point
//D print "settings.php: action==config - to be implemented
";
//debugging("settings.php: action==config - to be implemented
", DEBUG_DEVELOPER);
//D if (is_debugging()) // declared in 'lib.php' // NOT WORKING!!!!
//D print "
&bnsp;
&bnsp;
&bnsp;
&bnsp;
&bnsp;
&bnsp;
&bnsp;nasatlx: settings.php: action==config - to be implemented
";
}