Index: temp_moodle_dev/moodle/mod/lamstwo/tooladapter_choice.php =================================================================== diff -u -r5251d2a62e0e78377219456d6bba613eb2d1fd26 -rd96397c86fe3c3f9de6e5963c9dc0f354b416219 --- temp_moodle_dev/moodle/mod/lamstwo/tooladapter_choice.php (.../tooladapter_choice.php) (revision 5251d2a62e0e78377219456d6bba613eb2d1fd26) +++ temp_moodle_dev/moodle/mod/lamstwo/tooladapter_choice.php (.../tooladapter_choice.php) (revision d96397c86fe3c3f9de6e5963c9dc0f354b416219) @@ -1,7 +1,7 @@ lamstwo_serverid) || ! isset($CFG->lamstwo_serverkey) ) { + if ( ! isset($CFG->lamstwo_serverid) || ! isset($CFG->lamstwo_serverkey) ) { header('HTTP/1.1 401 Unauthenticated'); exit(1); - }*/ + } $plaintext = trim($ts).trim($username).trim($CFG->lamstwo_serverid).trim($CFG->lamstwo_serverkey); $hash = sha1(strtolower($plaintext)); - // - /*if ( $hash != $hs ){ + if ( $hash != $hs ){ header('HTTP/1.1 401 Unauthenticated'); exit(1); - }*/ - $method='clone'; - $sectionid=0; - $courseid=2; - $cmid=997; - - - - /*$method = optional_param('method', '', PARAM_TEXT); + } + $method = optional_param('method', '', PARAM_TEXT); $cmid = optional_param('extToolContentID', 0, PARAM_INT); $sectionid = optional_param('section', 1, PARAM_INT); $courseid = optional_param('cs', 1, PARAM_INT); - $outputname = optional_param('oname', '', PARAM_TEXT);*/ + $outputname = optional_param('oname', '', PARAM_TEXT); $user = get_record('user', 'username', $username); @@ -49,7 +41,7 @@ echo $newcmid; break; case 'export': - quiz_export_instance($cmid); + choice_export_instance($cmid); break; case 'export_portfolio': $text = choice_export_portfolio($cmid, $user->id);