-
Notifications
You must be signed in to change notification settings - Fork 0
/
get_current_case.php
34 lines (28 loc) · 1.03 KB
/
get_current_case.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
/*
* Parse the current case
*
* Copyright (C) 2012, Andre Scherl
* You should have received a copy of the GNU General Public License
* along with DASIS. If not, see <http://www.gnu.org/licenses/>.
*/
require_once('../../config.php');
require_once($CFG->libdir.'/weblib.php');
require_once($CFG->libdir.'/dmllib.php');
require_once($CFG->libdir.'/datalib.php');
require_once("ilms_case_retrieval.php");
// alle Kurse, die in einem beliebigen Bundle enthalten sind werden für die Adaption berücksichtigt
if($SESSION->dasis_selectedBundle > 0){
$sql = "SELECT DISTINCT course_id FROM {dasis_bundle_connections} WHERE bundle_id =".$SESSION->dasis_selectedBundle;
}else{
$sql = "SELECT DISTINCT course_id FROM {dasis_bundle_connections}";
}
$all_bundle_courses = $DB->get_records_sql($sql);
global $COURSE;
$bundle_courses = array($COURSE->id);
foreach($all_bundle_courses as $bc){
$bundle_courses[] = $bc->course_id;
}
$current_case = current_case($bundle_courses);
print(json_encode($current_case));
?>