Check for SCORM/AICC resources
- John Feagans
- Topic Author
- Offline
- Junior Member
-
Less
More
13 years 10 months ago - 13 years 10 months ago #1
by John Feagans
Check for SCORM/AICC resources was created by John Feagans
The code in administrator/components/com_joomdle/helpers/system.php is as follows:
function get_mtype ($mod)
{
$mtype = '';
switch ($mod)
{
case 'resource':
case 'quiz':
case 'page':
case 'forum':
case 'url':
case 'assignment':
case 'label':
case 'folder':
$mtype = $mod;
break;
default:
$mtype = $mod;
break;
}
return $mtype;
}
As you can see there is no case for scorm/aicc. The return value for get mtype is checked for null in the view to decide whether to print resources . The default case returns $mod in any case so there is no check for any validity?
What other code was changed to make $resource be correctly set after .7?
function get_mtype ($mod)
{
$mtype = '';
switch ($mod)
{
case 'resource':
case 'quiz':
case 'page':
case 'forum':
case 'url':
case 'assignment':
case 'label':
case 'folder':
$mtype = $mod;
break;
default:
$mtype = $mod;
break;
}
return $mtype;
}
As you can see there is no case for scorm/aicc. The return value for get mtype is checked for null in the view to decide whether to print resources . The default case returns $mod in any case so there is no check for any validity?
What other code was changed to make $resource be correctly set after .7?
Last edit: 13 years 10 months ago by John Feagans. Reason: typos
Please Log in or Create an account to join the conversation.
- Antonio Durán
-
- Offline
- Moderator
-
Less
More
- Posts: 7902
13 years 10 months ago #2
by Antonio Durán
Replied by Antonio Durán on topic Re: Check for SCORM/AICC resources
As you can see in that code, the default value is taken if there is no match, which is indded the same as the other, so I think resources should show, but I may be overlooking something.
I added a scorm activity in my local installation (moodle 2.0, J2.5) and it showed fine.
I added a scorm activity in my local installation (moodle 2.0, J2.5) and it showed fine.
Please Log in or Create an account to join the conversation.
- John Feagans
- Topic Author
- Offline
- Junior Member
-
13 years 10 months ago #3
by John Feagans
Replied by John Feagans on topic Re: Check for SCORM/AICC resources
Check the place where this function is used. It no longer rejects bogus objects! Especially if you have added module types it doesn't know about.
Please Log in or Create an account to join the conversation.