mirror of
https://github.com/moodle/moodle.git
synced 2025-03-15 05:00:06 +01:00
MDL-14967 Upgrade all code using DML - fixed missing changes in scorm_get_scoes
This commit is contained in:
parent
b748c9718e
commit
b44c704f05
@ -206,15 +206,18 @@ function scorm_get_sco($id,$what=SCO_ALL) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
function scorm_get_scoes($id,$organisation=false) {
|
function scorm_get_scoes($id,$organisation=false) {
|
||||||
|
global $DB;
|
||||||
|
|
||||||
$organizationsql = '';
|
$organizationsql = '';
|
||||||
|
$queryarray = array('scorm'=>$id);
|
||||||
if (!empty($organisation)) {
|
if (!empty($organisation)) {
|
||||||
$organizationsql = "AND organization='$organisation'";
|
$queryarray['organization'] = $organisation;
|
||||||
}
|
}
|
||||||
if ($scoes = $DB->get_records_select('scorm_scoes',"scorm='$id' $organizationsql order by id ASC")) {
|
if ($scoes = $DB->get_records('scorm_scoes', $queryarray, 'id ASC')) {
|
||||||
// drop keys so that it is a simple array as expected
|
// drop keys so that it is a simple array as expected
|
||||||
$scoes = array_values($scoes);
|
$scoes = array_values($scoes);
|
||||||
foreach ($scoes as $sco) {
|
foreach ($scoes as $sco) {
|
||||||
if ($scodatas = $DB->get_records('scorm_scoes_data','scoid',$sco->id)) {
|
if ($scodatas = $DB->get_records('scorm_scoes_data',array('scoid'=>$sco->id))) {
|
||||||
foreach ($scodatas as $scodata) {
|
foreach ($scodatas as $scodata) {
|
||||||
$sco->{$scodata->name} = stripslashes_safe($scodata->value);
|
$sco->{$scodata->name} = stripslashes_safe($scodata->value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user