Annotation of loncom/html/adm/helper/course.initialization.helper, revision 1.11
1.2 bowersj2 1: <helper title="Course Initialization Helper" requiredpriv='opa'>
2:
3: <exec>
1.5 bowersj2 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);
1.6 bowersj2 15: Apache::lonnet::coursedescription($ENV{'request.course.id'});
1.2 bowersj2 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},
1.6 bowersj2 28: $helper->{DATA}->{CRS});
29: # Try to fix bug 1757
30: Apache::lonnet::coursedescription($ENV{'request.course.id'});
1.2 bowersj2 31: return 1;
32: } else {
33: return 0;
34: }
35: }
36: </exec>
1.1 bowersj2 37:
38: <state name="START" title="Welcome to Your New LON-CAPA Course">
1.5 bowersj2 39: <eval>
40: return $helper->{DATA}->{FIRST_RUN} ?
1.10 matthew 41: 'This Helper will set up your new LON-CAPA course and choose '.
42: 'which features will be active. You can '.
1.5 bowersj2 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 '.
1.10 matthew 46: 'prefer not to use the helper, <a href="/adm/menu">click here</a> to leave.'
1.5 bowersj2 47: :
1.10 matthew 48: 'This helper will set up your LON-CAPA course and choose ' .
49: 'which features will be active.';
1.5 bowersj2 50: </eval>
1.3 bowersj2 51: <message nextstate="COURSE_DESCRIPTION">
1.5 bowersj2 52: <p>All settings which you can change with this Helper can also be changed
53: by going to the PARM screen and clicking on the "Set
1.1 bowersj2 54: course environment" button.</p>
55:
1.10 matthew 56: <p>If you do not have experience coordinating LON-CAPA courses or if you
1.2 bowersj2 57: prefer the Helper interface, please click <nobr><b>Next -></b></nobr>.</p>
1.1 bowersj2 58: </message>
59: </state>
60:
1.5 bowersj2 61: <state name="COURSE_DESCRIPTION" title="Course Description">
1.3 bowersj2 62: <message nextstate="FORBID_DISCUSSION">
63: The "Course Description" is the name of the course that will be
1.10 matthew 64: seen by the students. You may now modify the description and hit
65: <nobr>"<b>Next -></b>"</nobr> to continue.<br />
1.3 bowersj2 66: </message>
67: <string variable='description' size='60' >
68: <defaultvalue>
69: return &{$helper->{DATA}->{GETVAL}}('description');
70: </defaultvalue>
71: <finalcode>
72: if (&{$helper->{DATA}->{SETVAL}}('description', $element->getValue())) {
73: return 'Course description changed to <b>' . $element->getValue() .
74: '</b>.';
75: }
76: </finalcode>
77: </string>
78: </state>
79:
1.1 bowersj2 80: <state name="FORBID_DISCUSSION" title="Discussion Participation">
81: <message nextstate="DISCUSSION_HTML">
1.2 bowersj2 82: LON-CAPA hosts discussions on all resources in a course. By default,
83: all users are allowed to participate in these discussions.
1.1 bowersj2 84:
1.8 bowersj2 85: <p>If you do not wish certain types of users to be able to use the
86: discussion features, select those types below. Note your class
1.2 bowersj2 87: may not have all of these roles; you may safely ignore roles you
88: do not intend to use. (For instance, "Exam Proctor" is
89: generally useful only for large courses.)</p>
1.1 bowersj2 90:
1.8 bowersj2 91: <p>Types of users not allowed to participate in discussion can
1.9 bowersj2 92: still view any discussion that other users post.</p>
1.8 bowersj2 93:
1.1 bowersj2 94: </message>
1.2 bowersj2 95: <choices variable="BANNED_DISCUSSION_ROLES" multichoice="1" allowempty='1'>
1.1 bowersj2 96: <choice computer="st"><b>Students</b> - students will not be able to participate in discussions</choice>
97: <choice computer="ta"><b>Teaching Assistants</b> - teaching assistants will not be able to participate in discussions</choice>
98: <choice computer="in"><b>Instructor</b> - instructors will not be able to participate in discussions</choice>
1.2 bowersj2 99: <defaultvalue>
100: my $denied = &{$helper->{DATA}->{GETVAL}}('pch.roles.denied');
101: $denied =~ s/,/\|\|\|/g;
102: return $denied;
103: </defaultvalue>
104: <finalcode>
105: my $denied = $element->getValue();
106: $denied =~ s/\|\|\|/,/g;
107: if (&{$helper->{DATA}->{SETVAL}}('pch.roles.denied', $denied)) {
108: $denied =~ s/st/ students/;
109: $denied =~ s/in/ instructors/;
110: $denied =~ s/ta/ teaching assistants/;
111: $denied =~ s/ep/ exam proctors/;
112: if ($denied =~ /^[^,]*,[^,]*$/) { # only one comma
113: $denied =~ s/,/ and/g;
114: } else { # add "and" to last comma
115: $denied =~ s/,([^,]*)$/, and\1/;
116: }
117: if ($denied) {
118: $denied = substr($denied, 1) . ' not allowed to participate in discussion.';
119: $denied = ucfirst($denied);
120: } else {
121: $denied = 'Everyone can participate in discussion.';
122: }
123: return $denied;
124: } else {
125: return '';
126: }
127: </finalcode>
1.1 bowersj2 128: </choices>
129: </state>
130:
131: <state name="DISCUSSION_HTML" title="HTML in Discussions">
1.3 bowersj2 132: <message nextstate="FEEDBACK_ADDRESSES">
1.10 matthew 133: <p>HTML can be allowed or banned inside of course discussion.</p>
1.1 bowersj2 134: </message>
135: <choices variable="HTML_ALLOWED">
136: <choice computer=""><b>HTML banned</b>: HTML will not be allowed in discussion postings.</choice>
137: <choice computer="yes"><b>HTML allowed</b>: Discussion participants can use limited HTML in their postings.</choice>
1.3 bowersj2 138: <defaultvalue>
139: return &{$helper->{DATA}->{GETVAL}}('allow_limited_html_in_feedback');
140: </defaultvalue>
141: <finalcode>
142: if (&{$helper->{DATA}->{SETVAL}}('allow_limited_html_in_feedback', $element->getValue())) {
143: if ($element->getValue() eq 'yes') {
144: return 'Limited HTML allowed in feedback.';
145: } else {
146: return 'HTML not allowed in feedback.';
147: }
148: }
149: </finalcode>
1.1 bowersj2 150: </choices>
1.2 bowersj2 151: </state>
152:
1.3 bowersj2 153: <state name="FEEDBACK_ADDRESSES" title="Feedback Addresses for Course Content">
154: <message nextstate="FINAL">
1.10 matthew 155: Course members can provide feedback about the course. You can choose
156: who will receive the feedback, such as a different instructor or a
157: TA. Please enter their LON-CAPA address below, in the
1.3 bowersj2 158: form <b>user:domain</b>, where "user" and "domain"
159: are both the LON-CAPA username and LON-CAPA domain, not an email
160: address.</p>
161: </message>
162: <eval>return '<p>Your current LON-CAPA domain is "<b>'
163: . $helper->{DATA}->{DOM} .
164: '</b>".</p>';
165: </eval>
166: <string variable='feedback_addresses' size='60' >
167: <defaultvalue>
168: return &{$helper->{DATA}->{GETVAL}}('comment.email');
169: </defaultvalue>
170: <finalcode>
171: if (&{$helper->{DATA}->{SETVAL}}('comment.email', $element->getValue())) {
172: return 'Comment address(es) updated to <b>' . $element->getValue() .
173: '</b>.';
174: }
175: </finalcode>
176: </string>
177: <message>
1.10 matthew 178: <p><b>Advanced</b>: You can send the feedback from different sections
179: to different people, by doing the following:</p>
1.3 bowersj2 180:
1.11 ! bowersj2 181: <ul><li>Separate each entry with a comma.</li>
1.3 bowersj2 182: <li>To send feedback to a certain address for different sections,
1.11 ! bowersj2 183: append the section name or names (separated by semi-colons)
1.3 bowersj2 184: in a parenthesized list after the <b>user:domain</b>.</li></ul>
185:
186: <p>For example,</p>
187:
188: <p><b>john102:msu(001;002;003),bob293:msu(004;005;006),madeupname:here(007;008;009)</b></p>
189:
190: <p>will route course feedback to "john102" for sections 1, 2, and 3, to
191: "bob293" for 4, 5, and 6, and to "madeupname:here" for
192: 7, 8, and 9. Note there is no requirement that the addresses be in any
193: particular domain.</p>
194: </message>
195: </state>
1.2 bowersj2 196:
197: <state name="FINAL" title="Completed">
1.3 bowersj2 198: <message>Your course is now set up. Please select the <b>Finish Course
199: Initialization</b> button to re-intialize the course with your chosen
1.7 bowersj2 200: settings.
1.3 bowersj2 201:
202: <p>Remember that all of these settings can be modified in the <b>PARMS</b>
203: screen, by pushing the <b>Course Environment</b> button.</p>
204: </message>
205: <final restartCourse='1' />
1.1 bowersj2 206: </state>
207: </helper>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>