File:  [LON-CAPA] / loncom / html / adm / helper / course.initialization.helper
Revision 1.5: download - view: text, annotated - select for diffs
Thu Jun 5 13:01:32 2003 UTC (21 years, 1 month ago) by bowersj2
Branches: MAIN
CVS tags: version_0_99_2, HEAD
When they run the course.initialization helper the first time, don't run
it again. What an idea!

    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: 
   16:     $helper->{DATA}->{GETVAL} = sub {
   17:         my @resultlist = &Apache::lonnet::get('environment', [shift()], 
   18:                                               $helper->{DATA}->{DOM},
   19:                                               $helper->{DATA}->{CRS}); 
   20:         return $resultlist[1]; };
   21:     $helper->{DATA}->{SETVAL} = sub {
   22:         my $name = shift;
   23:         my $val = shift;
   24:         if (&{$helper->{DATA}->{GETVAL}}($name) ne $val) {
   25:             &Apache::lonnet::put('environment', {$name=>$val}, 
   26:                                  $helper->{DATA}->{DOM},
   27:                                  $helper->{DATA}->{CRS}); 
   28:             return 1;
   29:         } else {
   30:             return 0;
   31:         }
   32:     }
   33:   </exec>
   34: 
   35:   <state name="START" title="Welcome to Your New LON-CAPA Course">
   36:     <eval>
   37:       return $helper->{DATA}->{FIRST_RUN} ?
   38:         'This Helper will help you set up your new LON-CAPA course and choose '.
   39:         'which LON-CAPA features will be active in your new course. You can '.
   40:         're-visit it later to change settings in your course.' .
   41: 
   42:         '<p>If you have previous experience with coordinating LON-CAPA courses and '.
   43:         'prefer not to use the helper, <a href="/adm/menu">click here</a> to leave '.
   44:         'this helper.' 
   45:         :
   46:         'This helper will help you set up your LON-CAPA course and choose ' .
   47:         'which LON-CAPA features will be active in your course.';
   48:       </eval>
   49:     <message nextstate="COURSE_DESCRIPTION">
   50:       <p>All settings which you can change with this Helper can also be changed
   51:          by going to the PARM screen and clicking on the &quot;Set
   52:          course environment&quot; button.</p>
   53: 
   54:       <p>If you do not have experience coordinating LON-CAPA courses, or if you
   55:          prefer the Helper interface, please click <nobr><b>Next -&gt;</b></nobr>.</p>
   56:       </message>
   57:     </state>
   58: 
   59:   <state name="COURSE_DESCRIPTION" title="Course Description">
   60:     <message nextstate="FORBID_DISCUSSION">
   61:       The &quot;Course Description&quot; is the name of the course that will be
   62:       seen by the students. This should have been set up correctly when the
   63:       course was created, but please confirm that it is correct, or change it
   64:       if neccessary. Hit a <nobr>&quot;<b>Next -&gt;</b>&quot;</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_DISCUSSION" title="Discussion Participation">
   80:     <message nextstate="DISCUSSION_HTML">
   81:          LON-CAPA hosts discussions on all resources in a course. By default,
   82:          all users are allowed to participate in these discussions.
   83: 
   84:       <p>For more information about discussion and the abilities available
   85:          to you as a course coordinator, such as banning abusive users or
   86:          hiding discussion postings, please see <b>link</b>.</p>
   87: 
   88:       <p>If you do not wish certain classes of users to be able to use the 
   89:          discussion features, select those classes below. Note your class
   90:          may not have all of these roles; you may safely ignore roles you
   91:          do not intend to use. (For instance, &quot;Exam Proctor&quot; is
   92:          generally useful only for large courses.)</p>
   93: 
   94:       <p><b>Question: Does inability to use discussion mean they simply can't
   95:             post, or that they can't see the discussion at all?</b></p>
   96:       </message>
   97:     <choices variable="BANNED_DISCUSSION_ROLES" multichoice="1" allowempty='1'>
   98:       <choice computer="st"><b>Students</b> - students will not be able to participate in discussions</choice>
   99:       <choice computer="ta"><b>Teaching Assistants</b> - teaching assistants will not be able to participate in discussions</choice>
  100:       <choice computer="in"><b>Instructor</b> - instructors will not be able to participate in discussions</choice>
  101:       <choice computer="ep"><b>Exam Proctor</b> - exam proctors will not be able to participate in discussions</choice>
  102:       <defaultvalue>
  103:         my $denied = &{$helper->{DATA}->{GETVAL}}('pch.roles.denied');
  104:         $denied =~ s/,/\|\|\|/g;
  105:         return $denied;
  106:       </defaultvalue>
  107:       <finalcode>
  108:         my $denied = $element->getValue();
  109:         $denied =~ s/\|\|\|/,/g;
  110:         if (&{$helper->{DATA}->{SETVAL}}('pch.roles.denied', $denied)) {
  111:             $denied =~ s/st/ students/;
  112:             $denied =~ s/in/ instructors/;
  113:             $denied =~ s/ta/ teaching assistants/;
  114:             $denied =~ s/ep/ exam proctors/;
  115:             if ($denied =~ /^[^,]*,[^,]*$/) { # only one comma
  116:                 $denied =~ s/,/ and/g;
  117:             } else { # add "and" to last comma
  118:                 $denied =~ s/,([^,]*)$/, and\1/;
  119:             }
  120:             if ($denied) {
  121:                 $denied = substr($denied, 1) . ' not allowed to participate in discussion.';
  122:                 $denied = ucfirst($denied);
  123:             } else {
  124:                 $denied = 'Everyone can participate in discussion.';
  125:             }
  126:             return $denied;
  127:         } else {
  128:             return '';
  129:         }
  130:       </finalcode>
  131:       </choices>
  132:     </state>
  133: 
  134:   <state name="DISCUSSION_HTML" title="HTML in Discussions">
  135:     <message nextstate="FEEDBACK_ADDRESSES">
  136:       <p>If you like, limited HTML can be allowed in the course discussions.</p>
  137:       </message>
  138:     <choices variable="HTML_ALLOWED">
  139:       <choice computer=""><b>HTML banned</b>: HTML will not be allowed in discussion postings.</choice>
  140:       <choice computer="yes"><b>HTML allowed</b>: Discussion participants can use limited HTML in their postings.</choice>
  141:       <defaultvalue>
  142:         return &{$helper->{DATA}->{GETVAL}}('allow_limited_html_in_feedback');
  143:       </defaultvalue>
  144:       <finalcode>
  145:         if (&{$helper->{DATA}->{SETVAL}}('allow_limited_html_in_feedback', $element->getValue())) {
  146:           if ($element->getValue() eq 'yes') {
  147:             return 'Limited HTML allowed in feedback.';
  148:           } else {
  149:             return 'HTML not allowed in feedback.';
  150:           }
  151:         }
  152:         </finalcode>
  153:       </choices>
  154:     </state>
  155: 
  156:   <state name="FEEDBACK_ADDRESSES" title="Feedback Addresses for Course Content">
  157:     <message nextstate="FINAL">
  158:       People in the course can provide feedback about the resources used in
  159:       the course by using the <b>FDBK</b> button while viewing a resource. If
  160:       the user labels the feedback as a &quot;question about course content&quot;,
  161:       it is sent to the course coordinator of that course.
  162: 
  163:       <p>If you'd like that feedback to be sent to someone else, such as a
  164:       different instructor, please enter their LON-CAPA address below, in the
  165:       form <b>user:domain</b>, where &quot;user&quot; and &quot;domain&quot;
  166:       are both the LON-CAPA username and LON-CAPA domain, not an email
  167:       address.</p> 
  168:       </message>
  169:     <eval>return '<p>Your current LON-CAPA domain is &quot;<b>' 
  170:                  . $helper->{DATA}->{DOM} .
  171:                  '</b>&quot;.</p>';
  172:       </eval>
  173:     <string variable='feedback_addresses' size='60' >
  174:       <defaultvalue>
  175:         return &{$helper->{DATA}->{GETVAL}}('comment.email');
  176:       </defaultvalue>
  177:       <finalcode>
  178:         if (&{$helper->{DATA}->{SETVAL}}('comment.email', $element->getValue())) {
  179:           return 'Comment address(es) updated to <b>' . $element->getValue() . 
  180:                  '</b>.';
  181:         }
  182:         </finalcode>
  183:       </string>
  184:     <message>
  185:       <p><b>Advanced Functionality</b>: If you'd like to redirect different 
  186:          section's feedback to different people, you can enter it as follows:</p>
  187: 
  188:       <ul><li>Seperate each entry with a comma.</li>
  189:           <li>To send feedback to a certain address for different sections,
  190:               append the section name or names (seperated by semi-colons)
  191:               in a parenthesized list after the <b>user:domain</b>.</li></ul>
  192: 
  193:       <p>For example,</p>
  194: 
  195:       <p><b>john102:msu(001;002;003),bob293:msu(004;005;006),madeupname:here(007;008;009)</b></p>
  196: 
  197:       <p>will route course feedback to &quot;john102&quot; for sections 1, 2, and 3, to
  198:          &quot;bob293&quot; for 4, 5, and 6, and to &quot;madeupname:here&quot; for
  199:          7, 8, and 9. Note there is no requirement that the addresses be in any
  200:          particular domain.</p>
  201:       </message>
  202:     </state>
  203: 
  204:   <state name="FINAL" title="Completed">
  205:     <message>Your course is now set up. Please select the <b>Finish Course 
  206:       Initialization</b> button to re-intialize the course with your chosen
  207:       settings. You will be taken to the <b>NAV</b> screen for your course.
  208: 
  209:       <p>Remember that all of these settings can be modified in the <b>PARMS</b>
  210:          screen, by pushing the <b>Course Environment</b> button.</p>
  211:       </message>
  212:     <final restartCourse='1' />
  213:     </state>
  214:   </helper>

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