public function process_essay($quest, &$questions) {

        $question = $this->process_common($quest);
        $question->qtype = 'essay';

        $question->feedback = array();
        // Not sure where to get the correct answer from?
        foreach ($quest->feedback as $feedback) {
            // Added this code to put the possible solution that the
            // instructor gives as the Moodle answer for an essay question.
            if ($feedback->ident == 'solution') {
                $question->graderinfo = $this->cleaned_text_field($feedback->text);
            }
        }
        // Added because essay/questiontype.php:save_question_option is expecting a
        // fraction property - CT 8/10/06.
        $question->fraction[] = 1;
        $question->defaultmark = 1;
        $question->responseformat = 'editor';
        $question->responserequired = 1;
        $question->responsefieldlines = 15;
        $question->attachments = 0;
        $question->attachmentsrequired = 0;
        $question->responsetemplate = $this->text_field('');

        $questions[] = $question;
    }
public function process_essay($quest, &$questions) {

        $question = $this->process_common($quest);
        $question->qtype = 'essay';

        $question->feedback = array();
        // Not sure where to get the correct answer from?
        foreach ($quest->feedback as $feedback) {
            // Added this code to put the possible solution that the
            // instructor gives as the Moodle answer for an essay question.
            if ($feedback->ident == 'solution') {
                $question->graderinfo = $this->cleaned_text_field($feedback->text);
            }
        }
        // Added because essay/questiontype.php:save_question_option is expecting a
        // fraction property - CT 8/10/06.
        $question->fraction[] = 1;
        $question->defaultmark = 1;
        $question->responseformat = 'editor';
        $question->responserequired = 1;
        $question->responsefieldlines = 15;
        $question->attachments = 0;
        $question->attachmentsrequired = 0;
        $question->responsetemplate = $this->text_field('');

        $questions[] = $question;
    }
public function process_essay ( $ quest , & $ questions ) { $ question = $ this -> process_common ( $ quest ) ; $ question -> qtype = 'essay' ; $ question -> feedback = array ( ) ; // Not sure where to get the correct answer from? foreach ( $ quest -> feedback as $ feedback ) { // Added this code to put the possible solution that the // instructor gives as the Moodle answer for an essay question. if ( $ feedback -> ident == 'solution' ) { $ question -> graderinfo = $ this -> cleaned_text_field ( $ feedback -> text ) ; } } // Added because essay/questiontype.php:save_question_option is expecting a // fraction property - CT 8/10/06. $ question -> fraction [ ] = 1 ; $ question -> defaultmark = 1 ; $ question -> responseformat = 'editor' ; $ question -> responserequired = 1 ; $ question -> responsefieldlines = 15 ; $ question -> attachments = 0 ; $ question -> attachmentsrequired = 0 ; $ question -> responsetemplate = $ this -> text_field ( '' ) ; $ questions [ ] = $ question ; }
Process Essay Questions
Parse an essay rawquestion and add the result
to the array of questions already parsed.
@param object $quest rawquestion
@param array $questions array of Moodle questions already done.
Process Essay Questions Parse an essay rawquestion and add the result to the array of questions already parsed .