File: mod.html

package info (click to toggle)
moodle 1.6.3-2%2Betch3
  • links: PTS
  • area: main
  • in suites: etch
  • size: 37,172 kB
  • ctags: 51,688
  • sloc: php: 231,916; sql: 5,631; xml: 2,688; sh: 1,185; perl: 638; makefile: 48; pascal: 36
file content (177 lines) | stat: -rw-r--r-- 6,247 bytes parent folder | download | duplicates (2)
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
<?php
    require_once("$CFG->dirroot/mod/assignment/lib.php");

    if (empty($form->name)) {
        $form->name = "";
    }
    if (empty($form->description)) {
        $form->description = "";
    }
    if (empty($form->format)) {
        $form->format = "";
    }
    if (empty($form->assignmenttype)) {
        $form->assignmenttype = "uploadsingle";
    }
    if (!isset($form->grade)) {
        $form->grade = 100;
    }
    if (!isset($form->timedue)) {
        $form->timedue = time()+7*24*3600;
    }
    if (!isset($form->timeavailable)) {
        $form->timeavailable = time();
    }
    if (!isset($form->preventlate)) {
        $form->preventlate = 0;
    }
    if (empty($form->maxbytes)) {
        $form->maxbytes = $CFG->assignment_maxbytes;
    }

?>
<script type="text/javascript" language="javascript">
    var dueitems = ['dueday','duemonth','dueyear','duehour', 'dueminute', 'preventlate'];
    var availableitems = ['availableday','availablemonth','availableyear','availablehour', 'availableminute'];
</script>

<form name="form" method="post" action="../mod/assignment/details.php">	
<table cellpadding="5">
<tr valign="top">
    <td align="right"><b><?php print_string("assignmentname", "assignment") ?>:</b></td>
    <td>
        <input type="text" name="name" size=60 value="<?php p($form->name) ?>">
    </td>
</tr>
<tr valign="top">
    <td align="right"><b><?php print_string("description", "assignment") ?>:</b>
     <br /><br />
     <?php
        helpbutton("writing", get_string("helpwriting"), "moodle", true, true);
        echo "<br />";
        helpbutton("questions", get_string("helpquestions"), "moodle", true, true);
        echo "<br />";
        if ($usehtmleditor) {
           helpbutton("richtext", get_string("helprichtext"), "moodle", true, true);
        } else {
           emoticonhelpbutton("form", "description");
        } 
      ?>
    </td>
    <td>
    <?php
       print_textarea($usehtmleditor, 20, 60, 680, 400, "description", $form->description);
    
       if ($usehtmleditor) {
           echo '<input type="hidden" name="format" value="'.FORMAT_HTML.'" />';
       } else {
           echo '<div align="right">';
           helpbutton("textformat", get_string("formattexttype"));
           print_string("formattexttype");
           echo ':&nbsp;';
           if (!$form->format) {
               $form->format = $defaultformat;
           }
           choose_from_menu(format_text_menu(), "format", $form->format, ""); 
           echo '</div>';
       }
    ?>
    </td>
</tr>
<tr valign=top>
<td align="right"><b><?php print_string("grade") ?>:</b></td>
    <td>
        <?php
        print_grade_menu($course->id, "grade", "$form->grade");
        ?>
    </td>
</tr>

<tr valign=top>
   <td align="right"><b><?php print_string("availabledate","assignment") ?>:</b></td>
    <td>
        <input name="availableenable" type="checkbox" value="1" alt="<?php print_string('availabledate', 'assignment') ?>" onclick="return lockoptions('form', 'availableenable', availableitems)" <?php if ($form->timeavailable) echo 'checked="checked"' ?> />
    <?php
           print_date_selector("availableday", "availablemonth", "availableyear", $form->timeavailable);
           echo "&nbsp;-&nbsp;";
           print_time_selector("availablehour", "availableminute", $form->timeavailable);
    ?>
        <input type="hidden" name="havailableday"    value="0" />
        <input type="hidden" name="havailablemonth"  value="0" />
        <input type="hidden" name="havailableyear"   value="0" />
        <input type="hidden" name="havailablehour"   value="0" />
        <input type="hidden" name="havailableminute" value="0" />
    </td>
</tr>

<tr valign=top>
    <td align="right"><b><?php print_string("duedate", "assignment") ?>:</b></td>
    <td>
        <input name="dueenable" type="checkbox" value="1" alt="<?php print_string('duedate', 'assignment') ?>" onclick="return lockoptions('form', 'dueenable', dueitems)" <?php if ($form->timedue) echo 'checked="checked"' ?> />
    <?php
           print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
           echo "&nbsp;-&nbsp;";
           print_time_selector("duehour", "dueminute", $form->timedue);
    ?>
        <input type="hidden" name="hdueday"    value="0" />
        <input type="hidden" name="hduemonth"  value="0" />
        <input type="hidden" name="hdueyear"   value="0" />
        <input type="hidden" name="hduehour"   value="0" />
        <input type="hidden" name="hdueminute" value="0" />
    </td>
</tr>

<tr valign="top">
    <td>&nbsp;</td>
    <td><?php print_string('preventlate', 'assignment') ?>:
    <?php 
        $options[0] = get_string('no'); $options[1] = get_string('yes');
        choose_from_menu($options, 'preventlate', $form->preventlate, '');
    ?>
    <input type="hidden" name="hpreventlate" value="0" />
    </td>
</tr>

<tr valign="top">
    <td colspan="2">&nbsp;</td>
</tr>

<tr valign="top">
    <td align="right"><b><?php print_string("assignmenttype", "assignment") ?>:</b></td>
    <td>
    <?php
       $ASSIGNMENT_TYPES = assignment_types();
       choose_from_menu($ASSIGNMENT_TYPES, 'assignmenttype', $form->assignmenttype, '');
       helpbutton('types', get_string('assignmenttype', 'assignment'), 'assignment');
    ?>
    </td>
</tr>

<?php print_standard_coursemodule_settings($form); ?>

</table>
<br />
<center>
<?php
   // Add hidden fields for all the ones not defined on this page
   $assvars = array('course','coursemodule','section','module','modulename','instance','mode',
                    'resubmit','emailteachers','maxbytes', 'var1','var2','var3','var4','var5');

   foreach ($assvars as $assname) {
       if (isset($form->$assname)) {
           echo '<input type="hidden" name="'.$assname.'" value="'.s($form->$assname).'" />'."\n";
       }
   }
?>
<input type="submit" value="<?php print_string('next') ?> &raquo;" />
<input type="submit" name="cancel" value="<?php print_string('cancel') ?>" />
</center>
</form>

<script type="text/javascript">
<?php 
    if (!$form->timedue) echo "lockoptions('form','dueenable', dueitems);";
    if (!$form->timeavailable) echo "lockoptions('form','availableenable', availableitems);";
?>
</script>