Annotation of loncom/html/adm/helper/course.initialization.helper, revision 1.14

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>
1.14    ! sakharuk   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.14    ! sakharuk   48:         &mt('This helper will set up your LON-CAPA course and choose which features will be active.');
1.5       bowersj2   49:       </eval>
1.3       bowersj2   50:     <message nextstate="COURSE_DESCRIPTION">
1.5       bowersj2   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 &quot;Set
1.1       bowersj2   53:          course environment&quot; button.</p>
                     54: 
1.10      matthew    55:       <p>If you do not have experience coordinating LON-CAPA courses or if you
1.2       bowersj2   56:          prefer the Helper interface, please click <nobr><b>Next -&gt;</b></nobr>.</p>
1.1       bowersj2   57:       </message>
                     58:     </state>
                     59: 
1.5       bowersj2   60:   <state name="COURSE_DESCRIPTION" title="Course Description">
1.12      matthew    61:     <message nextstate="FORBID_CHAT">
1.3       bowersj2   62:       The &quot;Course Description&quot; is the name of the course that will be
1.10      matthew    63:       seen by the students.  You may now modify the description and hit 
                     64:       <nobr>&quot;<b>Next -&gt;</b>&quot;</nobr> to continue.<br />
1.3       bowersj2   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>
1.12      matthew    77:     </state>
                     78: 
                     79:   <state name="FORBID_CHAT" title="Chat Participation">
                     80:     <message nextstate="FORBID_DISCUSSION">
                     81:       <p>LON-CAPA has live chat 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}}('plch.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 discussion.';
                    109:                 $denied = ucfirst($denied);
                    110:             } else {
                    111:                 $denied = 'Everyone can participate in discussion.';
                    112:             }
                    113:             return $denied;
                    114:         } else {
                    115:             return '';
                    116:         }
                    117:       </finalcode>
                    118:       </choices>
1.3       bowersj2  119:     </state>
                    120: 
1.1       bowersj2  121:   <state name="FORBID_DISCUSSION" title="Discussion Participation">
                    122:     <message nextstate="DISCUSSION_HTML">
1.2       bowersj2  123:          LON-CAPA hosts discussions on all resources in a course. By default,
                    124:          all users are allowed to participate in these discussions.
1.1       bowersj2  125: 
1.8       bowersj2  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
1.2       bowersj2  128:          may not have all of these roles; you may safely ignore roles you
                    129:          do not intend to use. (For instance, &quot;Exam Proctor&quot; is
                    130:          generally useful only for large courses.)</p>
1.1       bowersj2  131: 
1.8       bowersj2  132:       <p>Types of users not allowed to participate in discussion can
1.9       bowersj2  133:          still view any discussion that other users post.</p>
1.8       bowersj2  134: 
1.1       bowersj2  135:       </message>
1.2       bowersj2  136:     <choices variable="BANNED_DISCUSSION_ROLES" multichoice="1" allowempty='1'>
1.1       bowersj2  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>
1.2       bowersj2  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>
1.1       bowersj2  169:       </choices>
                    170:     </state>
                    171: 
                    172:   <state name="DISCUSSION_HTML" title="HTML in Discussions">
1.3       bowersj2  173:     <message nextstate="FEEDBACK_ADDRESSES">
1.10      matthew   174:       <p>HTML can be allowed or banned inside of course discussion.</p>
1.1       bowersj2  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>
1.3       bowersj2  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>
1.1       bowersj2  191:       </choices>
1.2       bowersj2  192:     </state>
                    193: 
1.3       bowersj2  194:   <state name="FEEDBACK_ADDRESSES" title="Feedback Addresses for Course Content">
                    195:     <message nextstate="FINAL">
1.10      matthew   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
1.3       bowersj2  199:       form <b>user:domain</b>, where &quot;user&quot; and &quot;domain&quot;
                    200:       are both the LON-CAPA username and LON-CAPA domain, not an email
                    201:       address.</p> 
                    202:       </message>
1.14    ! sakharuk  203:     <eval>return &mt('<p>Your current LON-CAPA domain is &quot;<b>[_1]</b>&quot;.</p>',"$helper->{DATA}->{DOM}"); 
1.3       bowersj2  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>
1.10      matthew   217:       <p><b>Advanced</b>: You can send the feedback from different sections
                    218:          to different people, by doing the following:</p>
1.3       bowersj2  219: 
1.11      bowersj2  220:       <ul><li>Separate each entry with a comma.</li>
1.3       bowersj2  221:           <li>To send feedback to a certain address for different sections,
1.11      bowersj2  222:               append the section name or names (separated by semi-colons)
1.3       bowersj2  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 &quot;john102&quot; for sections 1, 2, and 3, to
                    230:          &quot;bob293&quot; for 4, 5, and 6, and to &quot;madeupname:here&quot; 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>
1.2       bowersj2  235: 
                    236:   <state name="FINAL" title="Completed">
1.3       bowersj2  237:     <message>Your course is now set up. Please select the <b>Finish Course 
                    238:       Initialization</b> button to re-intialize the course with your chosen
1.7       bowersj2  239:       settings.
1.3       bowersj2  240: 
                    241:       <p>Remember that all of these settings can be modified in the <b>PARMS</b>
                    242:          screen, by pushing the <b>Course Environment</b> button.</p>
                    243:       </message>
1.13      bowersj2  244:     <condition>
                    245:       <clause>$ENV{'course.'.$ENV{'request.course.id'}.'.clonedfrom'}</clause>
                    246:       <message>After you select <b>Finish Course Initialization</b>,
                    247:                you will be taken to the Parameter Overview screen to
                    248:                update the dates for this cloned course.</message>
                    249:     </condition>
1.3       bowersj2  250:     <final restartCourse='1' />
1.1       bowersj2  251:     </state>
                    252:   </helper>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>