Ejemplo n.º 1
0
function booking_user_complete($course, $user, $mod, $booking)
{
    global $DB;
    if ($answer = $DB->get_record('booking_answers', array("bookingid" => $booking->id, "userid" => $user->id))) {
        $result = new stdClass();
        $result->info = "'" . format_string(booking_get_option_text($booking, $answer->optionid)) . "'";
        $result->time = $answer->timemodified;
        echo get_string("answered", "booking") . ": {$result->info}. " . get_string("updated", '', userdate($result->time));
    } else {
        print_string("notanswered", "booking");
    }
}
Ejemplo n.º 2
0
        $table->head = array(get_string("topic"), get_string("question"), get_string("answer"));
        $table->align = array("center", "left", "left");
    } else {
        $table->head = array(get_string("question"), get_string("answer"));
        $table->align = array("left", "left");
    }
}
$currentsection = "";
foreach ($bookings as $booking) {
    if (!empty($answers[$booking->id])) {
        $answer = $answers[$booking->id];
    } else {
        $answer = "";
    }
    if (!empty($answer->optionid)) {
        $aa = format_string(booking_get_option_text($booking, $answer->optionid));
    } else {
        $aa = "";
    }
    $printsection = "";
    if ($booking->section !== $currentsection) {
        if ($booking->section) {
            $printsection = $booking->section;
        }
        if ($currentsection !== "") {
            $table->data[] = 'hr';
        }
        $currentsection = $booking->section;
    }
    //Calculate the href
    if (!$booking->visible) {