~ubuntu-branches/ubuntu/jaunty/moodle/jaunty

« back to all changes in this revision

Viewing changes to question/type/missingtype/edit_missingtype_form.php

  • Committer: Bazaar Package Importer
  • Author(s): Jordan Mantha, Matt Oquist
  • Date: 2009-02-25 15:16:22 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090225151622-0ekt1liwhv2obfza
Tags: 1.9.4.dfsg-0ubuntu1
* Merge with Debian git (Closes LP: #322961, #239481, #334611):
  - use Ubuntu's smarty lib directory for linking
  - use internal yui library 
  - add update-notifier support back in

[Matt Oquist]
  * renamed prerm script
  * significantly rewrote postinst and other maintainer scripts to improve
    user experience and package maintainability
    (Closes LP: #225662, #325450, #327843, #303078, #234609)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * @copyright © 2007 Jamie Pratt
6
6
 * @author Jamie Pratt me@jamiep.org
7
7
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
8
 
 * @package questions
 
8
 * @package questionbank
 
9
 * @subpackage questiontypes
9
10
 */
10
11
 
11
12
/**
24
25
        $repeated[] =& $mform->createElement('header', 'choicehdr', get_string('choiceno', 'qtype_multichoice', '{no}'));
25
26
        $repeated[] =& $mform->createElement('text', 'answer', get_string('answer', 'quiz'));
26
27
        $repeated[] =& $mform->createElement('select', 'fraction', get_string('grade'), $gradeoptions);
27
 
        $repeated[] =& $mform->createElement('htmleditor', 'feedback', get_string('feedback', 'quiz'));
 
28
        $repeated[] =& $mform->createElement('htmleditor', 'feedback', get_string('feedback', 'quiz'),
 
29
                                array('course' => $this->coursefilesid));
28
30
 
29
31
        if (isset($this->question->options)){
30
32
            $countanswers = count($this->question->options->answers);
31
33
        } else {
32
34
            $countanswers = 0;
33
35
        }
34
 
        $repeatsatstart = (QUESTION_NUMANS_START > ($countanswers + QUESTION_NUMANS_ADD))?
35
 
                            QUESTION_NUMANS_START : ($countanswers + QUESTION_NUMANS_ADD);
 
36
        if ($this->question->formoptions->repeatelements){
 
37
            $repeatsatstart = (QUESTION_NUMANS_START > ($countanswers + QUESTION_NUMANS_ADD))?
 
38
                                QUESTION_NUMANS_START : ($countanswers + QUESTION_NUMANS_ADD);
 
39
        } else {
 
40
            $repeatsatstart = $countanswers;
 
41
        }
36
42
        $repeatedoptions = array();
37
43
        $repeatedoptions['fraction']['default'] = 0;
38
44
        $mform->setType('answer', PARAM_NOTAGS);
60
66
        return 'missingtype';
61
67
    }
62
68
 
63
 
    function validation($data){
64
 
        $errors = array();
 
69
    function validation($data, $files) {
 
70
        $errors = parent::validation($data, $files);
65
71
        $answers = $data['answer'];
66
72
        $answercount = 0;
67
73