| Línea 75... |
Línea 75... |
| 75 |
global $DB;
|
75 |
global $DB;
|
| Línea 76... |
Línea 76... |
| 76 |
|
76 |
|
| 77 |
// Get the course and sequence of the section
|
77 |
// Get the course and sequence of the section
|
| 78 |
$secrec = $DB->get_record('course_sections', array('id' => $sectionid), 'course, sequence');
|
78 |
$secrec = $DB->get_record('course_sections', array('id' => $sectionid), 'course, sequence');
|
| 79 |
$courseid = $secrec->course;
|
- |
|
| Línea 80... |
Línea 79... |
| 80 |
$sequence = $secrec->sequence;
|
79 |
$courseid = $secrec->course;
|
| 81 |
|
80 |
|
| 82 |
// Get the section->sequence contents (it roots the activities order)
|
81 |
// Get the section->sequence contents (it roots the activities order)
|
| 83 |
// Get all course modules belonging to requested section
|
82 |
// Get all course modules belonging to requested section
|
| Línea 87... |
Línea 86... |
| 87 |
FROM {course_modules} cm
|
86 |
FROM {course_modules} cm
|
| 88 |
JOIN {modules} m ON m.id = cm.module
|
87 |
JOIN {modules} m ON m.id = cm.module
|
| 89 |
WHERE cm.course = ?
|
88 |
WHERE cm.course = ?
|
| 90 |
AND cm.section = ?
|
89 |
AND cm.section = ?
|
| 91 |
AND cm.deletioninprogress <> 1", array($courseid, $sectionid));
|
90 |
AND cm.deletioninprogress <> 1", array($courseid, $sectionid));
|
| 92 |
foreach (explode(',', $sequence) as $moduleid) {
|
91 |
foreach (explode(',', (string) $secrec->sequence) as $moduleid) {
|
| 93 |
if (isset($modules[$moduleid])) {
|
92 |
if (isset($modules[$moduleid])) {
|
| 94 |
$module = array('id' => $modules[$moduleid]->id, 'modname' => $modules[$moduleid]->modname);
|
93 |
$module = array('id' => $modules[$moduleid]->id, 'modname' => $modules[$moduleid]->modname);
|
| 95 |
$modulesarr[] = (object)$module;
|
94 |
$modulesarr[] = (object)$module;
|
| 96 |
unset($modules[$moduleid]);
|
95 |
unset($modules[$moduleid]);
|
| 97 |
}
|
96 |
}
|