Exemplo n.º 1
0
function getsubinfo($items, $parent, $pre)
{
    global $ids, $types, $names;
    foreach ($items as $k => $item) {
        if (is_array($item)) {
            $ids[] = $parent . '-' . ($k + 1);
            $types[] = $pre . "Block";
            $names[] = stripslashes($item['name']);
            getsubinfo($item['items'], $parent . '-' . ($k + 1), $pre . '--');
        } else {
            $ids[] = $item;
            $arr = getiteminfo($item);
            $types[] = $pre . $arr[0];
            $names[] = $arr[1];
        }
    }
}
Exemplo n.º 2
0
function getsubinfo($items, $parent, $pre)
{
    global $ids, $types, $names, $item, $parents;
    foreach ($items as $k => $anitem) {
        if (is_array($anitem)) {
            $ids[] = $parent . '-' . ($k + 1);
            $types[] = $pre . "Block";
            $names[] = stripslashes($anitem['name']);
            $parents[] = $parent;
            getsubinfo($anitem['items'], $parent . '-' . ($k + 1), $pre . '--');
        } else {
            $ids[] = $anitem;
            $parents[] = $parent;
            $types[] = $pre . $item[$anitem]['type'];
            if (isset($item[$anitem]['name'])) {
                $names[] = $item[$anitem]['name'];
            } else {
                $names[] = $item[$anitem]['title'];
            }
        }
    }
}
Exemplo n.º 3
0
     } else {
         header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . rtrim(dirname($_SERVER['PHP_SELF']), '/\\') . "/course.php?cid={$cid}");
         exit;
     }
 } elseif (isset($_GET['action']) && $_GET['action'] == "select") {
     //DATA MANIPULATION FOR second option
     $query = "SELECT itemorder,picicons FROM imas_courses WHERE id='{$_POST['ctc']}'";
     $result = mysql_query($query) or die("Query failed : " . mysql_error());
     list($itemorder, $picicons) = mysql_fetch_row($result);
     $items = unserialize($itemorder);
     $ids = array();
     $types = array();
     $names = array();
     $sums = array();
     $parents = array();
     getsubinfo($items, '0', '', false, ' ');
     $query = "SELECT itemorder FROM imas_courses WHERE id='{$cid}'";
     $result = mysql_query($query) or die("Query failed : " . mysql_error());
     $items = unserialize(mysql_result($result, 0, 0));
     $existblocks = array();
     buildexistblocks($items, '0');
     $i = 0;
     $page_blockSelect = array();
     foreach ($existblocks as $k => $name) {
         $page_blockSelect['val'][$i] = $k;
         $page_blockSelect['label'][$i] = $name;
         $i++;
     }
 } else {
     if (isset($_GET['loadothers'])) {
         $query = "SELECT id,name FROM imas_groups";
Exemplo n.º 4
0
    }
    header('Location: ' . $urlmode . $_SERVER['HTTP_HOST'] . $imasroot . "/course/course.php?cid={$cid}");
    exit;
} else {
    require "../includes/copyiteminc.php";
    $query = "SELECT itemorder FROM imas_courses WHERE id='{$cid}'";
    $result = mysql_query($query) or die("Query failed : " . mysql_error());
    $items = unserialize(mysql_result($result, 0, 0));
    $gitypeids = array();
    $ids = array();
    $types = array();
    $names = array();
    $sums = array();
    $parents = array();
    $agbcats = array();
    getsubinfo($items, '0', '', 'Assessment');
    require "../header.php";
    echo '<h2>Quick-setup conditional release</h2>';
    echo '<p>If an item is checked, the item prior in the course order will be set as the prereq assignment</p>';
    echo '<form method="post" action="makeconditional.php?cid=' . $cid . '">';
    echo '<p>Req <input id="reqdef" value=""/> % <input type="button" onclick="$(\'.req\').val($(\'#reqdef\').val())" value="Copy to all"/></p>';
    echo '<table><tbody>';
    $aids = array();
    for ($i = 0; $i < count($ids); $i++) {
        if (strpos($types[$i], 'Block') !== false) {
            echo '<tr><td colspan="2">' . $names[$i] . '</td></tr>';
        } else {
            echo '<tr><td><input type="checkbox" name="checked[]" value="' . $gitypeids[$i] . '"/> ';
            echo $names[$i] . '</td>';
            echo '<td>Req: <input type="text" name="req' . $gitypeids[$i] . '" class="req" size="3"/> %</td></tr>';
            $aids[] = $gitypeids[$i];
Exemplo n.º 5
0
function getsubinfo($items, $parent, $pre, $itemtypelimit = false, $spacer = '|&nbsp;&nbsp;')
{
    global $ids, $types, $names, $sums, $parents, $gitypeids, $prespace, $CFG;
    if (!isset($gitypeids)) {
        $gitypeids = array();
    }
    foreach ($items as $k => $item) {
        if (is_array($item)) {
            $ids[] = $parent . '-' . ($k + 1);
            $types[] = "Block";
            $names[] = stripslashes($item['name']);
            $prespace[] = $pre;
            $parents[] = $parent;
            $gitypeids[] = '';
            $sums[] = '';
            if (count($item['items']) > 0) {
                getsubinfo($item['items'], $parent . '-' . ($k + 1), $pre . $spacer, $itemtypelimit, $spacer);
            }
        } else {
            if ($item == null || $item == '') {
                continue;
            }
            $arr = getiteminfo($item);
            if ($itemtypelimit !== false && $arr[0] != $itemtypelimit) {
                continue;
            }
            $ids[] = $item;
            $parents[] = $parent;
            $types[] = $arr[0];
            $names[] = $arr[1];
            $prespace[] = $pre;
            $gitypeids[] = $arr[3];
            $arr[2] = strip_tags($arr[2]);
            if (strlen($arr[2]) > 100) {
                $arr[2] = substr($arr[2], 0, 97) . '...';
            }
            $sums[] = $arr[2];
        }
    }
}
Exemplo n.º 6
0
     } else {
         $skippenalty = 0;
     }
 }
 $query = "SELECT itemorder FROM imas_courses WHERE id='{$cid}'";
 $result = mysql_query($query) or die("Query failed : " . mysql_error());
 $items = unserialize(mysql_result($result, 0, 0));
 $gitypeids = array();
 $ids = array();
 $types = array();
 $names = array();
 $sums = array();
 $parents = array();
 $agbcats = array();
 $prespace = array();
 getsubinfo($items, '0', '', 'Assessment', '&nbsp;&nbsp;');
 $query = "SELECT id,name,gbcategory FROM imas_assessments WHERE courseid='{$cid}' ORDER BY name";
 $result = mysql_query($query) or die("Query failed : " . mysql_error());
 if (mysql_num_rows($result) == 0) {
     $page_assessListMsg = "<li>No Assessments to change</li>\n";
 } else {
     $page_assessListMsg = "";
     $i = 0;
     $page_assessSelect = array();
     while ($row = mysql_fetch_row($result)) {
         $page_assessSelect['val'][$i] = $row[0];
         $page_assessSelect['label'][$i] = $row[1];
         $agbcats[$row[0]] = $row[2];
         $i++;
     }
 }