-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_best_next_activity.php
37 lines (29 loc) · 1.06 KB
/
get_best_next_activity.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
35
36
37
<?php
/**
* Dieses Skript berechnet die beste nächste Lernaktivität und gibt den Wert zurück
*
* @package DASIS->SemanticWeb
* @author Andre Scherl
* @version 1.0 - 17.06.2011
*
* 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/>.
*/
error_reporting(E_ALL);
require_once("../../config.php");
global $DB, $CFG, $SESSION, $USER;
// get last Node to be sure its not the next node
$lastNode = $DB->get_field_sql("SELECT coursemoduleid FROM {ilms_history} WHERE userid={$USER->id} ORDER BY timemodified DESC LIMIT 1,1");
$applianceArray = array();
foreach($SESSION->dasis_iLMS_solutions as $solution){
$applianceArray[$solution->id] = $solution->appliance;
}
unset($applianceArray[$SESSION->dasis_activityId]);
unset($applianceArray[$lastNode]);
if(count($applianceArray) > 0){
echo "{$CFG->wwwroot}/blocks/case_repository/start.php?id=".array_search(max($applianceArray), $applianceArray)."&foreward=true";
} else {
echo "#";
}
?>