$strvoiceshadow = get_string('modulename', 'voiceshadow');
$PAGE->set_url('/mod/voiceshadow/viewhistory.php', array('id' => $id));
$title = $course->shortname . ': ' . format_string(get_string('modulename', 'voiceshadow'));
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
require_once 'tabs.php';
$coursestudents = get_enrolled_users($contextcourse);
$studentssort = array();
foreach ($coursestudents as $key => $coursestudent) {
    $studentssort[$key] = fullname($coursestudent);
}
asort($studentssort);
if ($orderby == "DESC" && $sort == "username") {
    $studentssort = array_reverse($studentssort, true);
}
$table = new html_table();
$titlesarray = array(get_string("cell1::student", "voiceshadow") => 'username');
//$table->head  = array(get_string("cell1::student", "voiceshadow"));
$table->head = voiceshadow_make_table_headers($titlesarray, $orderby, $sort, '?id=' . $id . '&a=' . $a);
$table->align = array("left");
$table->width = "100%";
foreach ($studentssort as $stid => $stname) {
    $cell = new html_table_cell(html_writer::link(new moodle_url('/mod/voiceshadow/viewhistory.php', array("id" => $id, "ids" => $coursestudents[$stid]->id, 'a' => 'history')), fullname($coursestudents[$stid])));
    $cells = array($cell);
    $row = new html_table_row($cells);
    $table->data[] = $row;
}
echo html_writer::table($table);
/// Finish the page
echo $OUTPUT->footer();
Example #2
0
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
/// Print the main part of the page
require_once 'tabs.php';
if ($a == "list") {
    voiceshadow_view_dates();
    $table = new html_table();
    $table->width = "100%";
    if ($voiceshadow->grademethod == "like") {
        $peertext = get_string("cell3::peerfeedback", "voiceshadow") . html_writer::empty_tag("br") . html_writer::empty_tag("img", array("src" => new moodle_url('/mod/voiceshadow/img/flike.png'), "alt" => get_string("likethis", "voiceshadow"), "title" => get_string("dislike", "voiceshadow"), "class" => "vs-like"));
    } else {
        $peertext = get_string("cell3::peer", "voiceshadow");
    }
    if (!voiceshadow_is_ios()) {
        $titlesarray = array(get_string("cell1::student", "voiceshadow") => 'username', get_string("cell2::", "voiceshadow") => '', $peertext => '', get_string("cell4::teacher", "voiceshadow") => '');
        $table->head = voiceshadow_make_table_headers($titlesarray, $orderby, $sort, 'view.php?id=' . $id);
        //$table->head  = array(get_string("cell1::student", "voiceshadow"), get_string("cell2::", "voiceshadow"), get_string("cell3::peer", "voiceshadow"), get_string("cell4::teacher", "voiceshadow"));
        $table->align = array("left", "center", "center", "center");
    }
    //$alluserslist  = $DB->get_records("user", array(), $sort." ".$orderby);
    //foreach($alluserslist as $k => $v) {
    $lists = $DB->get_records("voiceshadow_files", array("instance" => $id), 'time DESC');
    foreach ($lists as $list) {
        $name = "var" . $list->var . "text";
        $userdata = $DB->get_record("user", array("id" => $list->userid));
        $picture = $OUTPUT->user_picture($userdata, array('popup' => true));
        $own = $DB->get_record("voiceshadow_ratings", array("fileid" => $list->id, "userid" => $list->userid));
        if (@empty($own->ratingrhythm)) {
            @($own->ratingrhythm = get_string('norateyet', 'voiceshadow'));
        }
        if (empty($own->ratingclear)) {