File:
[LON-CAPA] /
loncom /
html /
adm /
helper /
course.initialization.helper
Revision
1.26:
download - view:
text,
annotated -
select for diffs
Mon Jun 15 11:18:06 2009 UTC (15 years, 2 months ago) by
bisitz
Branches:
MAIN
CVS tags:
bz5969,
HEAD,
BZ5971-printing-apage
Parametrization, last helper step:
- Corrected unbalanced HTML tags (added </p> and </ul>)
- Prepared previous button (currently not fully functional, see comments)
- Added info style to info message about confirmation of correctness
- Replaced button text "Finish Helper" by "Save" to stress that a click on the button is needed to save the settings
(This was reported by CCs to be confusing)
- Removed deprecated <center> tag
Course Initialization, last helper step:
- Consistent Wording: button text "Save"
- Removed deprecated <center> tag; consistent button alignment
- Adjusted and updated translation phrases and added some missing phrases
(de.pm, zh.pm)
1: <helper title="Course Initialization Helper" requiredpriv='opa'>
2:
3: <exec>
4: my $courseid = $env{'request.course.id'};
5: my $crsdom = $env{'course.'.$courseid.'.domain'};
6: my $crsnum = $env{'course.'.$courseid.'.num'};
7: $helper->{DATA}->{DOM} = $crsdom;
8: $helper->{DATA}->{CRS} = $crsnum;
9:
10: $helper->{DATA}->{FIRST_RUN} = $env{'course.'.$crsnum.
11: '.course.intialization.not.run'};
12: # Delete the 'course.initialization.not.run' course environment
13: Apache::lonnet::put('environment', {'course.helper.not.run' => 0},
14: $crsdom, $crsnum);
15: Apache::lonnet::coursedescription($env{'request.course.id'});
16:
17: $helper->{DATA}->{GETVAL} = sub {
18: my @resultlist = &Apache::lonnet::get('environment', [shift()],
19: $helper->{DATA}->{DOM},
20: $helper->{DATA}->{CRS});
21: return $resultlist[1]; };
22: $helper->{DATA}->{SETVAL} = sub {
23: my $name = shift;
24: my $val = shift;
25: if (&{$helper->{DATA}->{GETVAL}}($name) ne $val) {
26: &Apache::lonnet::put('environment', {$name=>$val},
27: $helper->{DATA}->{DOM},
28: $helper->{DATA}->{CRS});
29: # Try to fix bug 1757
30: Apache::lonnet::coursedescription($env{'request.course.id'});
31: return 1;
32: } else {
33: return 0;
34: }
35: }
36: </exec>
37:
38: <state name="START" title="Welcome to Your New LON-CAPA Course">
39: <eval>
40: return $helper->{DATA}->{FIRST_RUN} ?
41: 'This Helper will set up your new LON-CAPA course and choose '.
42: 'which features will be active. You can '.
43: 're-visit it later to change settings in your course.' .
44:
45: '<p>If you have previous experience with coordinating LON-CAPA courses and '.
46: 'prefer not to use the helper, <a href="/adm/menu">click here</a> to leave.'
47: :
48: &mt('This helper will set up your LON-CAPA course and choose which features will be active.');
49: </eval>
50: <message nextstate="COURSE_DESCRIPTION">
51: <p>All settings which you can change with this Helper can also be changed
52: by going to the PARM screen and clicking on the "Set
53: course environment" button.</p>
54:
55: <p>If you do not have experience coordinating LON-CAPA courses or if you
56: prefer the Helper interface, please click <nobr><b>Next -></b></nobr>.</p>
57: </message>
58: </state>
59:
60: <state name="COURSE_DESCRIPTION" title="Course Title">
61: <message nextstate="FORBID_CHAT">
62: The "Course Title" is the name of the course that will be
63: seen by the students. You may now modify the description and hit
64: <nobr>"<b>Next -></b>"</nobr> to continue.<br />
65: </message>
66: <string variable='description' size='60' >
67: <defaultvalue>
68: return &{$helper->{DATA}->{GETVAL}}('description');
69: </defaultvalue>
70: <finalcode>
71: if (&{$helper->{DATA}->{SETVAL}}('description', $element->getValue())) {
72: return 'Course description changed to <b>' . $element->getValue() .
73: '</b>.';
74: }
75: </finalcode>
76: </string>
77: </state>
78:
79: <state name="FORBID_CHAT" title="Chat Room Participation">
80: <message nextstate="FORBID_DISCUSSION">
81: <p>LON-CAPA has chat room functionality. This course will receive
82: its own chat room. You may deny students, TAs, or instructors
83: the right to access the chat room.</p>
84: </message>
85: <choices variable="BANNED_CHAT_ROLES" multichoice="1" allowempty='1'>
86: <choice computer="st"><b>Students</b> - students will not be able to use or view the chat room.</choice>
87: <choice computer="ta"><b>Teaching Assistants</b> - teaching assistants will not be able use or view the chat room</choice>
88: <choice computer="in"><b>Instructor</b> - instructors will not be able to use or view the chat room</choice>
89: <defaultvalue>
90: my $denied = &{$helper->{DATA}->{GETVAL}}('plc.roles.denied');
91: $denied =~ s/,/\|\|\|/g;
92: return $denied;
93: </defaultvalue>
94: <finalcode>
95: my $denied = $element->getValue();
96: $denied =~ s/\|\|\|/,/g;
97: if (&{$helper->{DATA}->{SETVAL}}('plc.roles.denied', $denied)) {
98: $denied =~ s/st/ students/;
99: $denied =~ s/in/ instructors/;
100: $denied =~ s/ta/ teaching assistants/;
101: $denied =~ s/ep/ exam proctors/;
102: if ($denied =~ /^[^,]*,[^,]*$/) { # only one comma
103: $denied =~ s/,/ and/g;
104: } else { # add "and" to last comma
105: $denied =~ s/,([^,]*)$/, and\1/;
106: }
107: if ($denied) {
108: $denied = substr($denied, 1) . ' not allowed to participate in chat room.';
109: $denied = ucfirst($denied);
110: } else {
111: $denied = 'Everyone can participate in chat room.';
112: }
113: return $denied;
114: } else {
115: return '';
116: }
117: </finalcode>
118: </choices>
119: </state>
120:
121: <state name="FORBID_DISCUSSION" title="Discussion Participation">
122: <message nextstate="DISCUSSION_HTML">
123: LON-CAPA hosts discussions on all resources in a course. By default,
124: all users are allowed to participate in these discussions.
125:
126: <p>If you do not wish certain types of users to be able to use the
127: discussion features, select those types below. Note your class
128: may not have all of these roles; you may safely ignore roles you
129: do not intend to use. (For instance, "Exam Proctor" is
130: generally useful only for large courses.)</p>
131:
132: <p>Types of users not allowed to participate in discussion can
133: still view any discussion that other users post.</p>
134:
135: </message>
136: <choices variable="BANNED_DISCUSSION_ROLES" multichoice="1" allowempty='1'>
137: <choice computer="st"><b>Students</b> - students will not be able to participate in discussions</choice>
138: <choice computer="ta"><b>Teaching Assistants</b> - teaching assistants will not be able to participate in discussions</choice>
139: <choice computer="in"><b>Instructor</b> - instructors will not be able to participate in discussions</choice>
140: <defaultvalue>
141: my $denied = &{$helper->{DATA}->{GETVAL}}('pch.roles.denied');
142: $denied =~ s/,/\|\|\|/g;
143: return $denied;
144: </defaultvalue>
145: <finalcode>
146: my $denied = $element->getValue();
147: $denied =~ s/\|\|\|/,/g;
148: if (&{$helper->{DATA}->{SETVAL}}('pch.roles.denied', $denied)) {
149: $denied =~ s/st/ students/;
150: $denied =~ s/in/ instructors/;
151: $denied =~ s/ta/ teaching assistants/;
152: $denied =~ s/ep/ exam proctors/;
153: if ($denied =~ /^[^,]*,[^,]*$/) { # only one comma
154: $denied =~ s/,/ and/g;
155: } else { # add "and" to last comma
156: $denied =~ s/,([^,]*)$/, and\1/;
157: }
158: if ($denied) {
159: $denied = substr($denied, 1) . ' not allowed to participate in discussion.';
160: $denied = ucfirst($denied);
161: } else {
162: $denied = 'Everyone can participate in discussion.';
163: }
164: return $denied;
165: } else {
166: return '';
167: }
168: </finalcode>
169: </choices>
170: </state>
171:
172: <state name="DISCUSSION_HTML" title="HTML in Discussions">
173: <message nextstate="FEEDBACK_ADDRESSES">
174: <p>HTML can be allowed or banned inside of course discussion.</p>
175: </message>
176: <choices variable="HTML_ALLOWED">
177: <choice computer=""><b>HTML banned</b>: HTML will not be allowed in discussion postings.</choice>
178: <choice computer="yes"><b>HTML allowed</b>: Discussion participants can use limited HTML in their postings.</choice>
179: <defaultvalue>
180: return &{$helper->{DATA}->{GETVAL}}('allow_limited_html_in_feedback');
181: </defaultvalue>
182: <finalcode>
183: if (&{$helper->{DATA}->{SETVAL}}('allow_limited_html_in_feedback', $element->getValue())) {
184: if ($element->getValue() eq 'yes') {
185: return 'Limited HTML allowed in feedback.';
186: } else {
187: return 'HTML not allowed in feedback.';
188: }
189: }
190: </finalcode>
191: </choices>
192: </state>
193:
194: <state name="FEEDBACK_ADDRESSES" title="Feedback Addresses for Course Content">
195: <message nextstate="USERS_ALLOWED_TO_CLONE">
196: Course members can provide feedback about the course. You can choose
197: who will receive the feedback, such as a different instructor or a
198: TA. Please enter their LON-CAPA address below, in the
199: form <b>user:domain</b>, where "user" and "domain"
200: are both the LON-CAPA username and LON-CAPA domain, not an e-mail
201: address.</p>
202: </message>
203: <eval>return &mt('<p>Your current LON-CAPA domain is "<b>[_1]</b>".</p>',"$helper->{DATA}->{DOM}");
204: </eval>
205: <string variable='feedback_addresses' size='60' >
206: <defaultvalue>
207: return &{$helper->{DATA}->{GETVAL}}('comment.email');
208: </defaultvalue>
209: <finalcode>
210: if (&{$helper->{DATA}->{SETVAL}}('comment.email', $element->getValue())) {
211: return 'Comment address(es) updated to <b>' . $element->getValue() .
212: '</b>.';
213: }
214: </finalcode>
215: </string>
216: <message>
217: <p><b>Advanced</b>: You can send the feedback from different sections
218: to different people, by doing the following:</p>
219:
220: <ul><li>Separate each entry with a comma.</li>
221: <li>To send feedback to a certain address for different sections,
222: append the section name or names (separated by semi-colons)
223: in a parenthesized list after the <b>user:domain</b>.</li></ul>
224:
225: <p>For example,</p>
226:
227: <p><b>john102:msu(001;002;003),bob293:msu(004;005;006),madeupname:here(007;008;009)</b></p>
228:
229: <p>will route course feedback to "john102" for sections 1, 2, and 3, to
230: "bob293" for 4, 5, and 6, and to "madeupname:here" for
231: 7, 8, and 9. Note there is no requirement that the addresses be in any
232: particular domain.</p>
233: </message>
234: </state>
235:
236: <state name="USERS_ALLOWED_TO_CLONE" title="Granting permission to clone course">
237: <message nextstate="FINAL">
238: Existing courses can be cloned when creating new courses.<br />Cloning will copy the course structure, contents, and most parameters (automatically advancing any date parameters by six months).<br /><br />
239: Names of owners of other courses permitted to clone this course:<br />
240: </message>
241: <string variable='can_clone' size='60' >
242: <defaultvalue>
243: return &{$helper->{DATA}->{GETVAL}}('cloners');
244: </defaultvalue>
245: <validator>
246: my ($output,@cloners,%disallowed);
247: my $match_dom = $LONCAPA::match_domain;
248: my $match_uname = $LONCAPA::match_username;
249: if ($val =~ /,/) {
250: @cloners = split(/,/,$val);
251: } else {
252: $cloners[0] = $val;
253: }
254: foreach my $item (@cloners) {
255: next if ($item =~ /^\s*$/);
256: next if ($item eq '*');
257:
258: my ($clname,$cldom) = split(/:/,$item);
259: if ($clname eq '*') {
260: if ($cldom =~ /^$match_dom$/) {
261: if (!&Apache::lonnet::domain($cldom)) {
262: $disallowed{'domain'} .= $item.',';
263: }
264: } else {
265: $disallowed{'format'} .= $item.',';
266: }
267: } elsif ($item !~/^($match_uname)\:($match_dom)$/) {
268: $disallowed{'format'} .= $item.',';
269: } else {
270: if (!&Apache::lonnet::domain($cldom)) {
271: $disallowed{'domain'} .= $item.',';
272: } elsif (&Apache::lonnet::homeserver($clname,$cldom) eq 'no_host') {
273: $disallowed{'newuser'} .= $item.',';
274: }
275: }
276: }
277: foreach my $key (keys(%disallowed)) {
278: $disallowed{$key} =~ s/,$//;
279: }
280: if (keys(%disallowed) > 0) {
281: $output.= 'Your input contained the following errors:<ul>';
282: if (defined($disallowed{'format'})) {
283: $output .= '<li>Invalid format: '.
284: '<b>'.$disallowed{'format'}.'</b></li>';
285: }
286: if (defined($disallowed{'domain'})) {
287: $output .= '<li>Domain(s) do(es) not exist: '.
288: '<b>'.$disallowed{'domain'}.'</b></li>';
289: }
290: if (defined($disallowed{'newuser'})) {
291: $output .= '<li>LON-CAPA user(s) do(es) not exist: '.
292: '<b>'.$disallowed{'newuser'}.'</b></li>';
293: }
294: $output .= '</ul>';
295: }
296: return $output;
297: </validator>
298: <finalcode>
299: if (&{$helper->{DATA}->{SETVAL}}('cloners', $element->getValue())) {
300:
301:
302: return 'Users allowed to clone course updated to <b>' . $element->getValue() .
303: '</b>.';
304: }
305: </finalcode>
306: </string>
307: <message>
308: <br />(Course Coordinators automatically have the right to clone their own courses.)
309: <ul>
310: <li>Format: <b>user:domain</b>, where "user" and "domain"
311: are the LON-CAPA username and domain of the user.</li><li>Separate different users with a comma.</li><li>Use *:domain to allow course to be cloned by any course owner in the specified domain.</li><li>Use * to allow unrestricted cloning by all course owners in all domains.</li></ul>
312: </message>
313: </state>
314: <state name="FINAL" title="Completed">
315: <message>Your course is now set up. Please select the <b>Save</b>
316: button to re-intialize the course with your chosen
317: settings.
318:
319: <p>Remember that all of these settings can be modified in the <b>PARMS</b>
320: screen (<b>Course Configuration</b>).</p>
321: </message>
322: <condition>
323: <clause>$env{'course.'.$env{'request.course.id'}.'.clonedfrom'}</clause>
324: <message>After you select <b>Finish Course Initialization</b>,
325: you will be taken to the Parameter Overview screen to
326: update the dates for this cloned course.</message>
327: </condition>
328: <final restartCourse='1' />
329: </state>
330: </helper>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>