File: mod.html

package info (click to toggle)
moodle 1.4.4.dfsg.1-3sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 57,876 kB
  • ctags: 29,496
  • sloc: php: 271,617; sql: 5,084; xml: 702; perl: 638; sh: 403; java: 283; makefile: 42; pascal: 21
file content (184 lines) | stat: -rw-r--r-- 5,957 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
<!-- define a new instance of lesson -->
<!-- It is used from /course/mod.php.  The whole instance is available as $form. -->
<?php

    require_once("$CFG->dirroot/mod/lesson/lib.php");  // for parameter array
    $nohtmleditorneeded = true;

// set the defaults
    if (empty($form->name)) {
        $form->name = "";
    }
    if (!isset($form->grade)) {
        $form->grade = 0;
    }
    if (!isset($form->usemaxgrade)) {
        $form->usemaxgrade = 0;
    }
    if (!isset($form->maxanswers)) {
        $form->maxanswers = 4;
    }
    if (!isset($form->maxattempts)) {
        $form->maxattempts = 5;
    }
    if (!isset($form->nextpagedefault)) {
        $form->nextpagedefault = 0;
    }
    if (!isset($form->minquestions)) {
        $form->minquestions = 0;
    }
    if (!isset($form->maxpages)) {
        $form->maxpages = 0;
    }
    if (!isset($form->retake)) {
        $form->retake = 1;
    }
    if (!isset($form->available)) {
        $form->available = 0;
    }
    if (!isset($form->deadline)) {
        $form->deadline = 0;
    }

?>

<FORM name="form" method="post" action="mod.php">
<CENTER>
<TABLE cellpadding=5>
<TR valign=top>
    <TD align=right><P><B><?php  print_string("name") ?>:</B></P></TD>
    <TD>
        <INPUT type="text" name="name" size=30 value="<?php  p($form->name) ?>">
    </TD>
</TR>

<tr valign=top>
    <td align=right><P><B><?php  print_string("maximumgrade") ?>:</B></P></TD>
    <td>
        <?php
        for ($i=100; $i>=0; $i--) {
            $grades[$i] = $i;
        }
        choose_from_menu($grades, "grade", "$form->grade", "");
       helpbutton("grade", get_string("maximumgrade", "lesson"), "lesson");
        ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("maximumnumberofanswersbranches", "lesson") ?>:</B></P></TD>
    <td>
        <?php
        for ($i=10; $i>1; $i--) {
            $numbers[$i] = $i;
        }
        choose_from_menu($numbers, "maxanswers", "$form->maxanswers", "");
       helpbutton("maxanswers", get_string("maximumnumberofanswersbranches", "lesson"), "lesson");
        ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("maximumnumberofattempts", "lesson") ?>:</B></P></TD>
    <td>
        <?php
        unset($numbers);
        for ($i=10; $i>0; $i--) {
            $numbers[$i] = $i;
        }
        choose_from_menu($numbers, "maxattempts", "$form->maxattempts", "");
       helpbutton("maxattempts", get_string("maximumnumberofattempts", "lesson"), "lesson");
        ?>
    </td>
</tr>

<tr>
    <td align=right><P><B><?php  print_string("actionaftercorrectanswer", "lesson") ?>:</B></P></TD>
    <td>
    <?PHP 
        choose_from_menu($LESSON_NEXTPAGE_ACTION, "nextpagedefault", $form->nextpagedefault, "");
        helpbutton("nextpageaction", get_string("actionaftercorrectanswer", "lesson"), "lesson");
    ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("minimumnumberofquestions", "lesson") ?>:</B></P></TD>
    <td>
        <?php
        unset($numbers);
        for ($i=100; $i>=0; $i--) {
            $numbers[$i] = $i;
        }
        choose_from_menu($numbers, "minquestions", "$form->minquestions", "");
        helpbutton("minquestions", get_string("minimumnumberofquestions", "lesson"), "lesson");
        ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("numberofpagestoshow", "lesson") ?>:</B></P></TD>
    <td>
        <?php
        unset($numbers);
        for ($i=100; $i>=0; $i--) {
            $numbers[$i] = $i;
        }
        choose_from_menu($numbers, "maxpages", "$form->maxpages", "");
        helpbutton("maxpages", get_string("numberofpagestoshow", "lesson"), "lesson");
        ?>
    </td>
</tr>

<tr>
    <td align=right><P><B><?php  print_string("canretake", "lesson", $course->student) ?>:</B></P></TD>
    <td>
    <?PHP 
        $options[0] = get_string("no"); $options[1] = get_string("yes");
        choose_from_menu($options, "retake", $form->retake, "");
        helpbutton("retake", get_string("canretake", "lesson", $course->student), "lesson");
    ?>
    </td>
</tr>

<tr>
    <td align=right><P><B><?php  print_string("handlingofretakes", "lesson") ?>:</B></P></TD>
    <td>
    <?PHP 
        $options[0] = get_string("usemean", "lesson"); $options[1] = get_string("usemaximum", "lesson");
        choose_from_menu($options, "usemaxgrade", $form->usemaxgrade, "");
        helpbutton("handlingofretakes", get_string("handlingofretakes", "lesson"), "lesson");
    ?>
    </td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("available", "lesson") ?>:</B></td>
    <td><?php
           print_date_selector("availableday", "availablemonth", "availableyear", $form->available);
           echo "&nbsp;-&nbsp;";
           print_time_selector("availablehour", "availableminute", $form->available);
    ?></td>
</tr>

<tr valign=top>
    <td align=right><P><B><?php  print_string("deadline", "lesson") ?>:</B></td>
    <td><?php
           print_date_selector("deadlineday", "deadlinemonth", "deadlineyear", $form->deadline);
           echo "&nbsp;-&nbsp;";
           print_time_selector("deadlinehour", "deadlineminute", $form->deadline);
    ?></td>
</tr>

</TABLE>
<!-- These hidden variables are always the same -->
<INPUT type="hidden" name=course        value="<?php  p($form->course) ?>">
<INPUT type="hidden" name=coursemodule  value="<?php  p($form->coursemodule) ?>">
<INPUT type="hidden" name=section       value="<?php  p($form->section) ?>">
<INPUT type="hidden" name=module        value="<?php  p($form->module) ?>">
<INPUT type="hidden" name=modulename    value="<?php  p($form->modulename) ?>">
<INPUT type="hidden" name=instance      value="<?php  p($form->instance) ?>">
<INPUT type="hidden" name=mode          value="<?php  p($form->mode) ?>">
<INPUT type="submit" value="<?php  print_string("savechanges") ?>">
</CENTER>
</FORM>