2 /************************************************************************/
\r
4 /************************************************************************/
\r
5 /* Copyright (c) 2002 - 2009 */
\r
6 /* Inclusive Design Institute */
\r
8 /* This program is free software. You can redistribute it and/or */
\r
9 /* modify it under the terms of the GNU General Public License */
\r
10 /* as published by the Free Software Foundation. */
\r
11 /************************************************************************/
\r
12 // $Id: ims_import.php 10319 2010-10-08 20:43:03Z hwong $
\r
15 * This class contains all the utility functions to set/get/clean progress
\r
18 * @author Cindy Qi Li
\r
20 if (!defined('AT_INCLUDE_PATH')) exit;
\r
22 class StudentToolsUtil {
\r
25 * Return an array of all the student tools for current course.
\r
26 * Return an empty array if no student tools defined.
\r
28 public static function getStudentTools($course_id)
\r
32 $student_tools = array();
\r
33 $sql = "SELECT links FROM ".TABLE_PREFIX."fha_student_tools WHERE course_id=$course_id";
\r
34 $result = mysql_query($sql, $db);
\r
35 if ($row = mysql_fetch_assoc($result)) {
\r
36 $student_tools = explode('|', $row['links']);
\r
38 // removed the empty array value
\r
39 $cleaned_student_tools = array();
\r
41 foreach ($student_tools as $tool) {
\r
42 if (trim($tool) <> '') $cleaned_student_tools[] = $tool;
\r
45 return $cleaned_student_tools;
\r