Ejemplo n.º 1
0
function output_cas_text($title, $intro, $castext)
{
    global $OUTPUT;
    echo $OUTPUT->heading($title, 3);
    echo html_writer::tag('p', $intro);
    echo html_writer::tag('pre', s($castext));
    $ct = new stack_cas_text($castext, null, 0, 't');
    echo html_writer::tag('p', format_text(stack_ouput_castext($ct->get_display_castext())));
    echo output_debug(stack_string('errors'), $ct->get_errors());
    echo output_debug(stack_string('debuginfo'), $ct->get_debuginfo());
}
Ejemplo n.º 2
0
}
if ($string) {
    $options = new stack_options();
    $options->set_site_defaults();
    $options->set_option('simplify', $simp);
    $session = new stack_cas_session(null, $options);
    if ($vars) {
        $keyvals = new stack_cas_keyval($vars, $options, 0, 't');
        $session = $keyvals->get_session();
        $varerrs = $keyvals->get_errors();
    }
    if (!$varerrs) {
        $ct = new stack_cas_text($string, $session, 0, 't');
        $displaytext = $ct->get_display_castext();
        $errs = $ct->get_errors();
        $debuginfo = $ct->get_debuginfo();
    }
}
echo $OUTPUT->header();
echo $OUTPUT->heading($title);
echo html_writer::tag('p', stack_string('chatintro'));
// If we are editing the General Feedback from a question it is very helpful to see the question text.
if ($questionid) {
    echo $OUTPUT->heading(stack_string('questiontext'), 3);
    echo html_writer::tag('pre', $question->questiontext, array('class' => 'questiontext'));
}
if (!$varerrs) {
    if ($string) {
        echo $OUTPUT->box(stack_ouput_castext($displaytext));
    }
}