Skip to content

Commit

Permalink
Functions renamed to avoid name collision
Browse files Browse the repository at this point in the history
  • Loading branch information
juacas committed Jul 24, 2015
1 parent a2dec71 commit 6df05c3
Show file tree
Hide file tree
Showing 23 changed files with 611 additions and 689 deletions.
6 changes: 3 additions & 3 deletions IntuitelProxy.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* this module is provides as-is without any guarantee. Use it as your own risk.
* @package block_intuitel
* @author Juan Pablo de Castro, Elena Verdú.
* @copyright (c) 2014, INTUITEL Consortium
* @copyright (c) 2014, INTUITEL Consortium http://www.intuitel.eu
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
use intuitel\Intuitel;
Expand Down Expand Up @@ -81,7 +81,7 @@
* INTUITEL prefers to not receive LoIDs in this case.
*/
$ignorelo = optional_param('ignoreLo', false, PARAM_BOOL);
$html = intuitel_forward_learner_update_request($cmid, $courseid, $USER->id, $ignorelo);
$html = block_intuitel_forward_learner_update_request($cmid, $courseid, $USER->id, $ignorelo);

// If this is used in a iFrame send Moodle's headers to get styling.
$includeheaders = optional_param('includeHeaders', false, PARAM_BOOL);
Expand Down Expand Up @@ -118,7 +118,7 @@
// TODO: Avoid sending this form in the User Interface but find a way to work without javascript too.
$message = IntuitelController::ProcessTUGResponse($USER->id, $_REQUEST, $courseid);
$log->LogDebug("LMS sends TUG answer: $message");
intuitel_submit_to_intuitel($message);
block_intuitel_submit_to_intuitel($message);
} else {

$mid = required_param('mId', PARAM_ALPHANUMEXT);
Expand Down
4 changes: 2 additions & 2 deletions auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
require_once('locallib.php');
require_once('model/exceptions.php');

intuitel_disable_moodle_page_exception_handler();
$xml = intuitel_get_input_message('POST|GET');
block_intuitel_disable_moodle_page_exception_handler();
$xml = block_intuitel_get_input_message('POST|GET');
list($validated, $useridsvalidated, $response) = IntuitelController::ProcessAuthRequest($xml);
if ($validated) {
$_SESSION['user_validated'] = true;
Expand Down
4 changes: 2 additions & 2 deletions block_intuitel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* this module is provides as-is without any guarantee. Use it as your own risk.
* @package block_intuitel
* @author Juan Pablo de Castro, Elena Verdú.
* @copyright (c) 2014, INTUITEL Consortium
* @copyright (c) 2014, INTUITEL Consortium http://www.intuitel.eu
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
use intuitel\Intuitel;
Expand Down Expand Up @@ -246,7 +246,7 @@ public function generate_iframe_code($url, $query) {

public function generate_inline_code($args) {
global $USER;
$html = intuitel_forward_learner_update_request($args['cmid'], $args['courseid'], $USER->id);
$html = block_intuitel_forward_learner_update_request($args['cmid'], $args['courseid'], $USER->id);

return $html;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/event/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* this module is provides as-is without any guarantee. Use it as your own risk.
* @package block_intuitel
* @author Juan Pablo de Castro, Elena Verdú.
* @copyright (c) 2014, INTUITEL Consortium
* @copyright (c) 2014, INTUITEL Consortium http://www.intuitel.eu
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/
/**
Expand Down
2 changes: 1 addition & 1 deletion edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* this module is provides as-is without any guarantee. Use it as your own risk.
* @package block_intuitel
* @author Juan Pablo de Castro, Elena Verdú.
* @copyright (c) 2014, INTUITEL Consortium
* @copyright (c) 2014, INTUITEL Consortium http://www.intuitel.eu
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
*/

Expand Down
2 changes: 1 addition & 1 deletion impl/moodle/CourseLOFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function getChildren($rawData) {
*/
private function getLang($rawData) {

$lang = intuitel_get_course_lang($rawData);
$lang = block_intuitel_get_course_lang($rawData);
return $lang;
}

Expand Down
6 changes: 3 additions & 3 deletions impl/moodle/ModuleLOFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ function toBeIgnored() {
function createLO(LOId $loId) {
// get the id of the section in Moodle
$id = Intuitel::getIDFactory()->getIdfromLoId($loId);
$cm = intuitel_get_cm($id);
$cm = block_intuitel_get_cm($id);
if ($cm == false) {
throw new UnknownLOException;
} else {
$courseinfo = get_fast_modinfo(intuitel_get_cm($id)->course);
$courseinfo = get_fast_modinfo(block_intuitel_get_cm($id)->course);
$cm_info = $courseinfo->get_cm($id);

//set the data of the object from Moodle internal data
Expand Down Expand Up @@ -188,7 +188,7 @@ private function getFollowingSib($rawData) {

private function getLang($rawData) {
$course_info = $rawData->get_modinfo();
$lang = intuitel_get_course_lang($course_info);
$lang = block_intuitel_get_course_lang($course_info);
return $lang;
}

Expand Down
2 changes: 1 addition & 1 deletion impl/moodle/MoodleIdFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function getType(LOId $loId) {
$id_part = $parts[1];
$startloId = substr($id_part, 0, 2);
if ($startloId == 'CM') {
return intuitel_get_cm_type(substr($id_part, 2));
return block_intuitel_get_cm_type(substr($id_part, 2));
} else if ($startloId == 'SE') {
return 'section';
} else if ($startloId == 'CO') {
Expand Down
6 changes: 3 additions & 3 deletions impl/moodle/SectionLOFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function getFactoryKey()
function createLO(LOId $loId){
// get the id of the section in Moodle
$id=Intuitel::getIDFactory()->getIdfromLoId($loId);
$section_info = intuitel_get_moodle_section($id);
$section_info = block_intuitel_get_moodle_section($id);
if($section_info==false){
throw new UnknownLOException;
}else{
Expand Down Expand Up @@ -272,7 +272,7 @@ private function getMedia($loId){
// get the id of the section in Moodle
$id=Intuitel::getIDFactory()->getIdfromLoId($loId);
$section_info = get_section_info($id);
$media=intuitel_getMediaType($section_info->summary); //array containing the media types contained in the summary of the section
$media=block_intuitel_getMediaType($section_info->summary); //array containing the media types contained in the summary of the section
return $media;
}

Expand All @@ -284,7 +284,7 @@ private function getMedia($loId){
*/
private function getLang($rawData){
$course_info = get_fast_modinfo($rawData->course);
$lang= intuitel_get_course_lang($course_info);
$lang= block_intuitel_get_course_lang($course_info);
return $lang;
}

Expand Down
24 changes: 12 additions & 12 deletions impl/moodle/moodleAdaptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function getLearnerUpdateData(array $onlythisnativeuserids = null, CourseLO $cou
}

if ($filter_offline_users) {//filter out those users who are not currently online
$native_activeuserids = intuitel_get_online_users($native_userids);
$native_activeuserids = block_intuitel_get_online_users($native_userids);
} else {
$native_activeuserids = $native_userids;
}
Expand Down Expand Up @@ -410,7 +410,7 @@ function getINTUITELInteractionsPost2_7(array $native_user_ids = null, CourseLO
}

if ($filter_offline_users) {//filter out those users who are not currently online
$native_activeuserids = intuitel_get_online_users($native_userids);
$native_activeuserids = block_intuitel_get_online_users($native_userids);
} else {
$native_activeuserids = $native_userids;
}
Expand Down Expand Up @@ -473,7 +473,7 @@ function getINTUITELInteractionsPre2_7(array $native_user_ids = null, CourseLO $
}

if ($filter_offline_users) {//filter out those users who are not currently online
$native_activeuserids = intuitel_get_online_users($native_userids);
$native_activeuserids = block_intuitel_get_online_users($native_userids);
} else {
$native_activeuserids = $native_userids;
}
Expand Down Expand Up @@ -671,13 +671,13 @@ public function getUseData($lo, $native_user_id) {
if (get_class($lo) == 'intuitel\SectionLO') {
$courseLOid = $lo->getParent();
$courseid = Intuitel::getIDFactory()->getIdfromLoId($courseLOid);
$useData['accessed'] = intuitel_get_access_status_course($courseid, $native_user_id);
$useData['accessed'] = block_intuitel_get_access_status_course($courseid, $native_user_id);
} else if (get_class($lo) == 'intuitel\CourseLO') { //the lo is the CourseLO, get the completion, accessed and grade data
$loId = $lo->getloId();
$lo_id = Intuitel::getIDFactory()->getIdfromLoId($loId);
$useData['accessed'] = intuitel_get_access_status_course($lo_id, $native_user_id);
$useData['completion'] = intuitel_get_completion_status_course($lo_id, $native_user_id);
intuitel_get_grade_info_course($lo_id, $native_user_id);
$useData['accessed'] = block_intuitel_get_access_status_course($lo_id, $native_user_id);
$useData['completion'] = block_intuitel_get_completion_status_course($lo_id, $native_user_id);
block_intuitel_get_grade_info_course($lo_id, $native_user_id);
} else { //this is a module (activity or resource)
$loId = $lo->getloId();
$lo_id = Intuitel::getIDFactory()->getIdfromLoId($loId);
Expand All @@ -687,10 +687,10 @@ public function getUseData($lo, $native_user_id) {
$coursemodule_info = $course_modinfo->get_cm($lo_id);

//get the completion status from Moodle
$useData['completion'] = intuitel_get_completion_status($coursemodule_info, $native_user_id);
$useData['completion'] = block_intuitel_get_completion_status($coursemodule_info, $native_user_id);

$useData['accessed'] = intuitel_get_access_status($lo_id, $native_user_id);
$grade_info = intuitel_get_grade_info($coursemodule_info, $native_user_id); //grade_info contains info of the grade obtained as well as maximum and minimum grade of the module
$useData['accessed'] = block_intuitel_get_access_status($lo_id, $native_user_id);
$grade_info = block_intuitel_get_grade_info($coursemodule_info, $native_user_id); //grade_info contains info of the grade obtained as well as maximum and minimum grade of the module
if ($grade_info != null) {
$useData['grade'] = $grade_info['grade'];
$useData['grademax'] = $grade_info['grademax'];
Expand All @@ -699,7 +699,7 @@ public function getUseData($lo, $native_user_id) {

if (($lo->media == 'video') || ($lo->media == 'audio')) {

$viewed = intuitel_get_access_status($lo_id, $native_user_id);
$viewed = block_intuitel_get_access_status($lo_id, $native_user_id);
if ($viewed) {
$useData['seenPercentage'] = 100;
} else {
Expand Down Expand Up @@ -845,7 +845,7 @@ public function getLMSProfile() {

public function generateHtmlForTugAndLore(\SimpleXMLElement $doc, $courseid) {
// delegates to locallib.php
return intuitel_generateHtmlForTugAndLore($doc, $courseid);
return block_intuitel_generateHtmlForTugAndLore($doc, $courseid);
}

public function logTugAnswer($courseid, $native_user_id, $mid, $info) {
Expand Down
6 changes: 3 additions & 3 deletions learner.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
require_once('model/serializer.php');
require_once('model/intuitelController.php');

intuitel_disable_moodle_page_exception_handler();
intuitel_check_access();
block_intuitel_disable_moodle_page_exception_handler();
block_intuitel_check_access();
$params=array();

$xml = intuitel_get_input_message();
$xml = block_intuitel_get_input_message();
$response = IntuitelController::ProcessLearnerRequest($xml);
header('Content-type: text/xml');
echo $response;
Expand Down
6 changes: 3 additions & 3 deletions lmsprofile.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
require_once('locallib.php');
require_once('model/exceptions.php');
require_once('model/intuitelController.php');
intuitel_disable_moodle_page_exception_handler();
intuitel_check_access();
block_intuitel_disable_moodle_page_exception_handler();
block_intuitel_check_access();
global $CFG;

$xml = intuitel_get_input_message();
$xml = block_intuitel_get_input_message();
$intuitel_msg = IntuitelController::getIntuitelXML($xml);
$lmsProfile = $intuitel_msg->LmsProfile;
$mid = IntuitelXMLSerializer::get_required_attribute($lmsProfile, 'mId');
Expand Down
Loading

0 comments on commit 6df05c3

Please sign in to comment.