$view->submissiondate = $submissiondate;
    $view->cm = $assignment->coursemodule;
    $views[] = $view;
}
//===================
// DISPLAY
//===================
$PAGE->set_title($str->assignments);
echo $OUTPUT->header();
foreach ($views as $view) {
    echo $OUTPUT->container_start('clearfix generalbox assignment');
    // info bit
    echo $OUTPUT->heading("{$view->section} - {$view->name}", 3, 'mdl-left');
    if (!empty($view->submitted)) {
        echo '<div class="reportlink">' . $view->submitted . '</div>';
    }
    // description part
    echo '<div class="description">' . $view->description . '</div>';
    //submission part
    echo $OUTPUT->container_start('generalbox submission');
    echo '<div class="submissiondate">' . $view->submissiondate . '</div>';
    //TODO
    //echo "<p class='no-overflow'>$view->submissiontext</p>\n";
    echo "<p>{$view->editlink}</p>\n";
    echo $OUTPUT->container_end();
    // feedback part
    $babeliuminstance = new assignment_babelium($view->cm);
    $babeliuminstance->view_feedback();
    echo $OUTPUT->container_end();
}
echo $OUTPUT->footer();
}
if (!($course = $DB->get_record("course", array("id" => $assignment->course)))) {
    print_error('coursemisconf', 'assignment');
}
if (!($user = $DB->get_record("user", array("id" => $userid)))) {
    print_error('usermisconf', 'assignment');
}
require_login($course->id, false, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
if ($USER->id != $user->id && !has_capability('mod/assignment:grade', $context)) {
    print_error('cannotviewassignment', 'assignment');
}
if ($assignment->assignmenttype != 'babelium') {
    print_error('invalidtype', 'assignment');
}
$assignmentinstance = new assignment_babelium($cm->id, $assignment, $cm, $course);
if ($submission = $assignmentinstance->get_submission($user->id)) {
    $PAGE->set_pagelayout('popup');
    $PAGE->set_title(fullname($user, true) . ': ' . $assignment->name);
    echo $OUTPUT->header();
    echo $OUTPUT->box_start('generalbox boxaligcenter', 'dates');
    echo '<table>';
    if ($assignment->timedue) {
        echo '<tr><td class="c0">' . get_string('duedate', 'assignment') . ':</td>';
        echo '    <td class="c1">' . userdate($assignment->timedue) . '</td></tr>';
    }
    echo '<tr><td class="c0">' . get_string('lastedited') . ':</td>';
    echo '    <td class="c1">' . userdate($submission->timemodified);
    echo '</td></tr></table>';
    echo $OUTPUT->box_end();
    $html_content = '';