diff --git a/mod/blti/basiclti.js b/mod/blti/basiclti.js index 2d9dfe340a3..5b0673cc7c3 100644 --- a/mod/blti/basiclti.js +++ b/mod/blti/basiclti.js @@ -47,10 +47,12 @@ function basicltiDebugToggle() { var ele = document.getElementById('basicltiDebug'); - if(ele.style.display == ''block') { + if(ele.style.display == 'block') { ele.style.display = 'none'; } else { ele.style.display = 'block'; } } + +alert('a'); \ No newline at end of file diff --git a/mod/blti/edit_form.php b/mod/blti/edit_form.php index 55e07873612..995824d2b89 100644 --- a/mod/blti/edit_form.php +++ b/mod/blti/edit_form.php @@ -83,6 +83,15 @@ class mod_blti_edit_types_form extends moodleform{ $mform->addElement('checkbox', 'lti_coursevisible', ' ', ' ' . get_string('show_in_course', 'blti')); + $launchoptions=array(); + $launchoptions[BLTI_LAUNCH_CONTAINER_EMBED] = get_string('embed', 'blti'); + $launchoptions[BLTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS] = get_string('embed_no_blocks', 'blti'); + $launchoptions[BLTI_LAUNCH_CONTAINER_WINDOW] = get_string('new_window', 'blti'); + + $mform->addElement('select', 'lti_launchcontainer', get_string('default_launch_container', 'blti'), $launchoptions); + $mform->setDefault('lti_launchcontainer', BLTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS); +// $mform->addHelpButton('lti_launchinpopup', 'launchinpopup', 'blti'); + // Add privacy preferences fieldset where users choose whether to send their data $mform->addElement('header', 'privacy', get_string('privacy', 'blti')); @@ -113,27 +122,6 @@ class mod_blti_edit_types_form extends moodleform{ $mform->setDefault('lti_allowroster', '2'); // $mform->addHelpButton('lti_allowroster', 'allowroster', 'blti'); - /* - // Add grading preferences fieldset where the tool is allowed to update settings - $mform->addElement('select', 'lti_allowsetting', get_string('allowsetting', 'blti'), $options); - $mform->setDefault('lti_allowsetting', '0'); -// $mform->addHelpButton('lti_allowsetting', 'allowsetting', 'blti'); - */ - -//------------------------------------------------------------------------------- - // Add launch parameters fieldset - $mform->addElement('header', 'launchoptions', get_string('launchoptions', 'blti')); - - $launchoptions=array(); - $launchoptions[0] = get_string('embed', 'blti'); - $launchoptions[1] = get_string('embed_no_blocks', 'blti'); - $launchoptions[2] = get_string('popup_window', 'blti'); - $launchoptions[3] = get_string('new_window', 'blti'); - - $mform->addElement('select', 'lti_launchinpopup', get_string('launchinpopup', 'blti'), $launchoptions); - $mform->setDefault('lti_launchinpopup', '0'); -// $mform->addHelpButton('lti_launchinpopup', 'launchinpopup', 'blti'); - //------------------------------------------------------------------------------- // Add setup parameters fieldset diff --git a/mod/blti/lang/en/blti.php b/mod/blti/lang/en/blti.php index b13eeb7c591..afc41ef394d 100644 --- a/mod/blti/lang/en/blti.php +++ b/mod/blti/lang/en/blti.php @@ -170,8 +170,8 @@ $string['tool_settings'] = 'Tool Settings'; $string['miscellaneous'] = 'Miscellaneous'; $string['embed'] = 'Embed'; $string['embed_no_blocks'] = 'Embed, without blocks'; -$string['popup_window'] = 'Popup window'; -$string['new_window'] = 'New browser window / tab'; +$string['new_window'] = 'New window'; +$string['default_launch_container'] = 'Default Launch Container'; //New instructor strings $string['display_name'] = 'Display activity name when launched'; @@ -182,4 +182,5 @@ $string['share_name'] = 'Share launcher\'s name with the tool'; $string['share_email'] = 'Share launcher\'s email with the tool'; $string['accept_grades'] = 'Accept grades from the tool'; $string['share_roster'] = 'Allow the tool to access this course\'s roster'; -$string['automatic'] = 'Automatic, based on Launch URL'; \ No newline at end of file +$string['automatic'] = 'Automatic, based on Launch URL'; +$string['default'] = 'Default'; diff --git a/mod/blti/lib.php b/mod/blti/lib.php index 2c13f93a652..214de3cab06 100644 --- a/mod/blti/lib.php +++ b/mod/blti/lib.php @@ -112,6 +112,14 @@ function blti_update_instance($formdata) { $formdata->timemodified = time(); $formdata->id = $formdata->instance; + if(!isset($formdata->showtitle)){ + $formdata->showtitle = 0; + } + + if(!isset($formdata->showdescription)){ + $formdata->showdescription = 0; + } + if ($formdata->instructorchoiceacceptgrades == 1) { $basicltirec = $DB->get_record("blti", array("id" => $formdata->id)); $basicltirec->cmidnumber = $formdata->cmidnumber; diff --git a/mod/blti/locallib.php b/mod/blti/locallib.php index 8e616f1469a..6d32d437e88 100644 --- a/mod/blti/locallib.php +++ b/mod/blti/locallib.php @@ -51,6 +51,11 @@ require_once($CFG->dirroot.'/mod/blti/OAuth.php'); define('BLTI_URL_DOMAIN_REGEX', '/(?:https?:\/\/)?(?:www\.)?([^\/]+)(?:\/|$)/i'); +define('BLTI_LAUNCH_CONTAINER_DEFAULT', 1); +define('BLTI_LAUNCH_CONTAINER_EMBED', 2); +define('BLTI_LAUNCH_CONTAINER_EMBED_NO_BLOCKS', 3); +define('BLTI_LAUNCH_CONTAINER_WINDOW', 4); + /** * Prints a Basic LTI activity * @@ -459,9 +464,6 @@ function blti_get_type_config_from_instance($id) { if (isset($config['toolurl'])) { $type->lti_toolurl = $config['toolurl']; } - if (isset($config['preferheight'])) { - $type->lti_preferheight = $config['preferheight']; - } if (isset($config['instructorchoicesendname'])) { $type->lti_sendname = $config['instructorchoicesendname']; } @@ -474,9 +476,7 @@ function blti_get_type_config_from_instance($id) { if (isset($config['instructorchoiceallowroster'])) { $type->lti_allowroster = $config['instructorchoiceallowroster']; } - if (isset($config['instructorchoiceallowsetting'])) { - $type->lti_allowsetting = $config['instructorchoiceallowsetting']; - } + if (isset($config['instructorcustomparameters'])) { $type->lti_allowsetting = $config['instructorcustomparameters']; } @@ -506,9 +506,7 @@ function blti_get_type_type_config($id) { if (isset($config['password'])) { $type->lti_password = $config['password']; } - if (isset($config['preferheight'])) { - $type->lti_preferheight = $config['preferheight']; - } + if (isset($config['sendname'])) { $type->lti_sendname = $config['sendname']; } @@ -533,18 +531,11 @@ function blti_get_type_type_config($id) { if (isset($config['instructorchoiceallowroster'])){ $type->lti_instructorchoiceallowroster = $config['instructorchoiceallowroster']; } - if (isset($config['allowsetting'])){ - $type->lti_allowsetting = $config['allowsetting']; - } - if (isset($config['instructorchoiceallowsetting'])){ - $type->lti_instructorchoiceallowsetting = $config['instructorchoiceallowsetting']; - } + if (isset($config['customparameters'])) { $type->lti_customparameters = $config['customparameters']; } - if (isset($config['allowinstructorcustom'])) { - $type->lti_allowinstructorcustom = $config['allowinstructorcustom']; - } + if (isset($config['organizationid'])) { $type->lti_organizationid = $config['organizationid']; } @@ -554,8 +545,8 @@ function blti_get_type_type_config($id) { if (isset($config['organizationdescr'])) { $type->lti_organizationdescr = $config['organizationdescr']; } - if (isset($config['launchinpopup'])) { - $type->lti_launchinpopup = $config['launchinpopup']; + if (isset($config['launchcontainer'])) { + $type->lti_launchcontainer = $config['launchcontainer']; } if (isset($config['debuglaunch'])) { $type->lti_debuglaunch = $config['debuglaunch']; @@ -655,11 +646,9 @@ function sign_parameters($oldparms, $endpoint, $method, $oauthconsumerkey, $oaut */ function post_launch_html($newparms, $endpoint, $debug=false, $height=false) { global $lastbasestring; - if ($height) { - $r = "