Exemple #1
0
     $laststu = $line['userid'];
 }
 echo '<div class="block">';
 if ($line['parent'] != 0) {
     echo '<span style="color:green;">';
 }
 echo '<span class="right">';
 if ($haspoints) {
     if ($caneditscore) {
         echo "<input type=text size=2 name=\"score[{$line['id']}]\" id=\"score{$line['id']}\" onkeypress=\"return onenter(event,this)\" onkeyup=\"onarrow(event,this)\" value=\"";
         if (isset($scores[$line['id']])) {
             echo $scores[$line['id']];
         }
         echo "\"/> Pts ";
         if ($rubric != 0) {
             echo printrubriclink($rubric, $pointspos, "score{$line['id']}", "feedback{$line['id']}") . ' ';
         }
     } else {
         if (($line['ownerid'] == $userid || $canviewscore) && isset($scores[$line['id']])) {
             echo "<span class=red>{$scores[$line['id']]} pts</span> ";
         }
     }
 }
 echo "<a href=\"posts.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}\">Thread</a> ";
 if ($isteacher || $line['ownerid'] == $userid && $allowmod) {
     echo "<a href=\"postsbyname.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}&modify={$line['id']}\">Modify</a> \n";
 }
 if ($isteacher || $allowdel && $line['ownerid'] == $userid) {
     echo "<a href=\"postsbyname.php?cid={$cid}&forum={$forumid}&thread={$line['threadid']}&remove={$line['id']}\">Remove</a> \n";
 }
 if ($line['posttype'] != 2 && $myrights > 5 && $allowreply) {
Exemple #2
0
 if ($canedit && $parts == '') {
     echo "<input type=text size=4 id=\"scorebox{$i}\" name=\"{$i}\" value=\"{$pt}\">";
     if ($rubric[$questions[$i]] != 0) {
         echo printrubriclink($rubric[$questions[$i]], $pts[$questions[$i]], "scorebox{$i}", "feedback", $i + 1);
     }
 } else {
     echo $pt;
 }
 if ($parts != '') {
     if ($canedit) {
         echo " (parts: ";
         $prts = explode(', ', $parts);
         for ($j = 0; $j < count($prts); $j++) {
             echo "<input type=text size=2 id=\"scorebox{$i}-{$j}\" name=\"{$i}-{$j}\" value=\"{$prts[$j]}\">";
             if ($rubric[$questions[$i]] != 0) {
                 echo printrubriclink($rubric[$questions[$i]], $answeights[$questions[$i]][$j], "scorebox{$i}-{$j}", "feedback", $i + 1 . ' pt ' . ($j + 1));
             }
             echo ' ';
         }
         echo ")";
     } else {
         echo " (parts: {$parts})";
     }
 }
 echo " out of {$pts[$questions[$i]]} ";
 if ($parts != '') {
     echo '(parts: ';
     for ($j = 0; $j < count($answeights[$questions[$i]]); $j++) {
         if ($j > 0) {
             echo ', ';
         }
Exemple #3
0
 function printchildren($base, $restricttoowner = false)
 {
     $curdir = rtrim(dirname(__FILE__), '/\\');
     global $children, $date, $subject, $message, $poster, $email, $forumid, $threadid, $isteacher, $cid, $userid, $ownerid, $points;
     global $feedback, $posttype, $lastview, $bcnt, $icnt, $myrights, $allowreply, $allowmod, $allowdel, $allowlikes, $view, $page, $allowmsg;
     global $haspoints, $imasroot, $postby, $replyby, $files, $CFG, $rubric, $pointsposs, $hasuserimg, $urlmode, $likes, $mylikes, $section;
     global $canviewall, $caneditscore, $canviewscore;
     if (!isset($CFG['CPS']['itemicons'])) {
         $itemicons = array('web' => 'web.png', 'doc' => 'doc.png', 'wiki' => 'wiki.png', 'html' => 'html.png', 'forum' => 'forum.png', 'pdf' => 'pdf.png', 'ppt' => 'ppt.png', 'zip' => 'zip.png', 'png' => 'image.png', 'xls' => 'xls.png', 'gif' => 'image.png', 'jpg' => 'image.png', 'bmp' => 'image.png', 'mp3' => 'sound.png', 'wav' => 'sound.png', 'wma' => 'sound.png', 'swf' => 'video.png', 'avi' => 'video.png', 'mpg' => 'video.png', 'nb' => 'mathnb.png', 'mws' => 'maple.png', 'mw' => 'maple.png');
     } else {
         $itemicons = $CFG['CPS']['itemicons'];
     }
     foreach ($children[$base] as $child) {
         if ($restricttoowner && $ownerid[$child] != $userid) {
             continue;
         }
         echo "<div class=block> ";
         echo '<span class="leftbtns">';
         if (isset($children[$child])) {
             if ($view == 1) {
                 $lbl = '+';
                 $img = "expand";
             } else {
                 $lbl = '-';
                 $img = "collapse";
             }
             //echo "<input type=button id=\"butb$bcnt\" value=\"$lbl\" onClick=\"toggleshow($bcnt)\"> ";
             echo "<img class=\"pointer\" id=\"butb{$bcnt}\" src=\"{$imasroot}/img/{$img}.gif\" onClick=\"toggleshow({$bcnt})\"/> ";
         }
         if ($hasuserimg[$child] == 1) {
             if (isset($GLOBALS['CFG']['GEN']['AWSforcoursefiles']) && $GLOBALS['CFG']['GEN']['AWSforcoursefiles'] == true) {
                 echo "<img src=\"{$urlmode}s3.amazonaws.com/{$GLOBALS['AWSbucket']}/cfiles/userimg_sm{$ownerid[$child]}.jpg\"  onclick=\"togglepic(this)\" />";
             } else {
                 echo "<img src=\"{$imasroot}/course/files/userimg_sm{$ownerid[$child]}.jpg\"  onclick=\"togglepic(this)\" />";
             }
         }
         echo '</span>';
         echo "<span class=right>";
         if ($view == 2) {
             echo "<input type=button id=\"buti{$icnt}\" value=\"Show\" onClick=\"toggleitem({$icnt})\">\n";
         } else {
             echo "<input type=button id=\"buti{$icnt}\" value=\"Hide\" onClick=\"toggleitem({$icnt})\">\n";
         }
         if ($isteacher) {
             echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&move={$child}\">Move</a> \n";
         }
         if ($isteacher || $ownerid[$child] == $userid && $allowmod) {
             if ($base == 0 && time() < $postby || $base > 0 && time() < $replyby || $isteacher) {
                 echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&modify={$child}\">Modify</a> \n";
             }
         }
         if ($isteacher || $allowdel && $ownerid[$child] == $userid && !isset($children[$child])) {
             echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&remove={$child}\">Remove</a> \n";
         }
         if ($posttype[$child] != 2 && $myrights > 5 && $allowreply) {
             echo "<a href=\"posts.php?view={$view}&cid={$cid}&forum={$forumid}&thread={$threadid}&page={$page}&modify=reply&replyto={$child}\">Reply</a>";
         }
         echo "</span>\n";
         echo '<span style="float:left">';
         echo "<b>{$subject[$child]}</b><br/>Posted by: ";
         //if ($isteacher && $ownerid[$child]!=0) {
         //	echo "<a href=\"mailto:{$email[$child]}\">";
         //} else if ($allowmsg && $ownerid[$child]!=0) {
         if (($isteacher || $allowmsg) && $ownerid[$child] != 0) {
             echo "<a href=\"../msgs/msglist.php?cid={$cid}&add=new&to={$ownerid[$child]}\" ";
             if ($section[$child] != '') {
                 echo 'title="Section: ' . $section[$child] . '"';
             }
             echo ">";
         }
         echo $poster[$child];
         if (($isteacher || $allowmsg) && $ownerid[$child] != 0) {
             echo "</a>";
         }
         if ($isteacher && $ownerid[$child] != 0 && $ownerid[$child] != $userid) {
             echo " <a class=\"small\" href=\"{$imasroot}/course/gradebook.php?cid={$cid}&stu={$ownerid[$child]}\" target=\"_popoutgradebook\">[GB]</a>";
             if ($base == 0 && preg_match('/Question\\s+about\\s+#(\\d+)\\s+in\\s+(.*)\\s*$/', $subject[$child], $matches)) {
                 $query = "SELECT ias.id FROM imas_assessment_sessions AS ias JOIN imas_assessments AS ia ON ia.id=ias.assessmentid ";
                 $aname = addslashes($matches[2]);
                 $query .= "WHERE ia.name='{$aname}' AND ias.userid=" . intval($ownerid[$child]);
                 $result = mysql_query($query) or die("Query failed : {$query} " . mysql_error());
                 if (mysql_num_rows($result) > 0) {
                     $r = mysql_fetch_row($result);
                     echo " <a class=\"small\" href=\"{$imasroot}/course/gb-viewasid.php?cid={$cid}&uid={$ownerid[$child]}&asid={$r[0]}\" target=\"_popoutgradebook\">[assignment]</a>";
                 }
             }
         }
         echo ', ';
         echo tzdate("D, M j, Y, g:i a", $date[$child]);
         if ($date[$child] > $lastview) {
             echo " <span style=\"color:red;\">New</span>\n";
         }
         echo '</span>';
         if ($allowlikes) {
             $icon = in_array($child, $mylikes) ? 'liked' : 'likedgray';
             $likemsg = 'Liked by ';
             $likecnt = 0;
             $likeclass = '';
             if ($likes[$child][0] > 0) {
                 $likeclass = ' liked';
                 $likemsg .= $likes[$child][0] . ' ' . ($likes[$child][0] == 1 ? 'student' : 'students');
                 $likecnt += $likes[$child][0];
             }
             if ($likes[$child][1] > 0 || $likes[$child][2] > 0) {
                 $likeclass = ' likedt';
                 $n = $likes[$child][1] + $likes[$child][2];
                 if ($likes[$child][0] > 0) {
                     $likemsg .= ' and ';
                 }
                 $likemsg .= $n . ' ';
                 if ($likes[$child][2] > 0) {
                     $likemsg .= $n == 1 ? 'teacher' : 'teachers';
                     if ($likes[$child][1] > 0) {
                         $likemsg .= '/tutors/TAs';
                     }
                 } else {
                     if ($likes[$child][1] > 0) {
                         $likemsg .= $n == 1 ? 'tutor/TA' : 'tutors/TAs';
                     }
                 }
                 $likecnt += $n;
             }
             if ($likemsg == 'Liked by ') {
                 $likemsg = '';
             } else {
                 $likemsg .= '.';
             }
             if ($icon == 'liked') {
                 $likemsg = 'You like this. ' . $likemsg;
             } else {
                 $likemsg = 'Click to like this post. ' . $likemsg;
             }
             echo '<div class="likewrap">';
             echo "<img id=\"likeicon{$child}\" class=\"likeicon{$likeclass}\" src=\"{$imasroot}/img/{$icon}.png\" title=\"{$likemsg}\" onclick=\"savelike(this)\">";
             echo " <span class=\"pointer\" id=\"likecnt{$child}\" onclick=\"GB_show('" . _('Post Likes') . "','listlikes.php?cid={$cid}&amp;post={$child}',500,500);\">" . ($likecnt > 0 ? $likecnt : '') . ' </span> ';
             echo '</div>';
         }
         echo '<div class="clear"></div>';
         echo "</div>\n";
         if ($view == 2) {
             echo "<div class=hidden id=\"item{$icnt}\">";
         } else {
             echo "<div class=blockitems id=\"item{$icnt}\" style=\"clear:all\">";
         }
         if (isset($files[$child]) && $files[$child] != '') {
             $fl = explode('@@', $files[$child]);
             if (count($fl) > 2) {
                 echo '<p><b>Files:</b> ';
                 //<ul class="nomark">';
             } else {
                 echo '<p><b>File:</b> ';
             }
             for ($i = 0; $i < count($fl) / 2; $i++) {
                 //if (count($fl)>2) {echo '<li>';}
                 echo '<a href="' . getuserfileurl('ffiles/' . $child . '/' . $fl[2 * $i + 1]) . '" target="_blank">';
                 $extension = ltrim(strtolower(strrchr($fl[2 * $i + 1], ".")), '.');
                 if (isset($itemicons[$extension])) {
                     echo "<img alt=\"{$extension}\" src=\"{$imasroot}/img/{$itemicons[$extension]}\" class=\"mida\"/> ";
                 } else {
                     echo "<img alt=\"doc\" src=\"{$imasroot}/img/doc.png\" class=\"mida\"/> ";
                 }
                 echo $fl[2 * $i] . '</a> ';
                 //if (count($fl)>2) {echo '</li>';}
             }
             //if (count($fl)>2) {echo '</ul>';}
             echo '</p>';
         }
         echo filter($message[$child]);
         if ($haspoints) {
             if ($caneditscore && $ownerid[$child] != $userid) {
                 echo '<hr/>';
                 echo "Score: <input type=text size=2 name=\"score[{$child}]\" id=\"scorebox{$child}\" value=\"";
                 if ($points[$child] !== null) {
                     echo $points[$child];
                 }
                 echo "\"/> ";
                 if ($rubric != 0) {
                     echo printrubriclink($rubric, $pointsposs, "scorebox{$child}", "feedback{$child}");
                 }
                 echo " Private Feedback: <textarea cols=\"50\" rows=\"2\" name=\"feedback[{$child}]\" id=\"feedback{$child}\">";
                 if ($feedback[$child] !== null) {
                     echo $feedback[$child];
                 }
                 echo "</textarea>";
             } else {
                 if (($ownerid[$child] == $userid || $canviewscore) && $points[$child] !== null) {
                     echo '<div class="signup">Score: ';
                     echo "<span class=red>{$points[$child]} points</span><br/> ";
                     if ($feedback[$child] !== null && $feedback[$child] != '') {
                         echo 'Private Feedback: ';
                         echo $feedback[$child];
                     }
                     echo '</div>';
                 }
             }
         }
         echo "<div class=\"clear\"></div></div>\n";
         $icnt++;
         if (isset($children[$child])) {
             //if has children
             echo "<div class=";
             if ($view == 0 || $view == 2) {
                 echo '"forumgrp"';
             } else {
                 if ($view == 1) {
                     echo '"hidden"';
                 }
             }
             echo " id=\"block{$bcnt}\">\n";
             $bcnt++;
             printchildren($child, $posttype[$child] == 3 && !$isteacher);
             echo "</div>\n";
         }
         //}
     }
 }
Exemple #4
0
        echo '<tr><td>';
    }
    echo "{$row[1]}, {$row[2]}";
    echo '</td>';
    if ($hassection) {
        echo "<td>{$row[3]}</td>";
    }
    if (isset($score[$row[0]])) {
        echo "<td><input type=\"text\" size=\"3\" autocomplete=\"off\" name=\"score[{$row[0]}]\" id=\"score{$row[0]}\" value=\"";
        echo $score[$row[0]];
    } else {
        echo "<td><input type=\"text\" size=\"3\" autocomplete=\"off\" name=\"newscore[{$row[0]}]\" id=\"score{$row[0]}\" value=\"";
    }
    echo "\" onkeypress=\"return onenter(event,this)\" onkeyup=\"onarrow(event,this)\" onblur=\"this.value = doonblur(this.value);\" />";
    if ($rubric != 0) {
        echo printrubriclink($rubric, $points, "score{$row[0]}", "feedback{$row[0]}");
    }
    echo "</td>";
    echo "<td><textarea cols=60 rows=1 id=\"feedback{$row[0]}\" name=\"feedback[{$row[0]}]\">{$feedback[$row[0]]}</textarea></td>";
    echo "</tr>";
}
echo "</tbody></table>";
if ($hassection) {
    echo "<script> initSortTable('myTable',Array('S','S',false,false),false);</script>";
}
?>
<div class=submit><input type=submit value="Submit"></div></div>
</form>

<?php 
$placeinfooter = '<div id="autosuggest"><ul></ul></div>';
Exemple #5
0
     }
     echo "<input type=text size=4 id=\"ud-{$line['id']}-{$loc}\" name=\"ud-{$line['id']}-{$loc}\" value=\"{$pt}\">";
     if ($rubric != 0) {
         echo printrubriclink($rubric, $points, "ud-{$line['id']}-{$loc}", "feedback-{$line['id']}", $loc + 1);
     }
 }
 if ($parts != '') {
     echo " Parts: ";
     $prts = explode(', ', $parts);
     for ($j = 0; $j < count($prts); $j++) {
         if ($prts[$j] == -1) {
             $prts[$j] = 'N/A';
         }
         echo "<input type=text size=2 id=\"ud-{$line['id']}-{$loc}-{$j}\" name=\"ud-{$line['id']}-{$loc}-{$j}\" value=\"{$prts[$j]}\">";
         if ($rubric != 0) {
             echo printrubriclink($rubric, $answeights[$j], "ud-{$line['id']}-{$loc}-{$j}", "feedback-{$line['id']}", $loc + 1 . ' pt ' . ($j + 1));
         }
         echo ' ';
     }
 }
 echo " out of {$points} ";
 if ($parts != '') {
     $answeights = implode(', ', $answeights);
     echo "(parts: {$answeights}) ";
 }
 echo "in {$attempts[$loc]} attempt(s)\n";
 if ($parts != '') {
     $togr = array();
     foreach ($qtypes as $k => $t) {
         if ($t == 'essay' || $t == 'file') {
             $togr[] = $k;