[system] / trunk / wwmoodle / wwassignment / mod_form.php Repository:
ViewVC logotype

View of /trunk/wwmoodle/wwassignment/mod_form.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5058 - (download) (as text) (annotate)
Thu Jun 28 20:09:32 2007 UTC (5 years, 10 months ago) by mleventi
File size: 2604 byte(s)
Added php4 support.

    1 <?php
    2 require_once ('moodleform_mod.php');
    3 require_once ('lib.php');
    4 
    5 class mod_wwassignment_mod_form extends moodleform_mod {
    6 
    7     function definition() {
    8         global $COURSE;
    9         $mform =& $this->_form;
   10         //Is this particular course mapped to a course in WeBWorK
   11 
   12         $webworkclient =& new webwork_client();
   13         $coursemapped = _wwassignment_mapped_course($COURSE->id);
   14         if($coursemapped == -1) {
   15 
   16             //define the mapping
   17             $mform->addElement('header', 'course_initialization',get_string('course_initialization','wwassignment'));
   18 
   19             $options = $webworkclient->options_course();
   20             $mform->addElement('select', 'webwork_course', get_string('webwork_course', 'wwassignment'), $options);
   21             $mform->setHelpButton('webwork_course', array('webwork_course', get_string('webwork_course', 'wwassignment'), 'wwassignment'));
   22 
   23             $mform->addElement('checkbox','auto_enroll_course',get_string('auto_enroll_course','wwassignment'),get_string('auto_enroll_course_desc','wwassignment'));
   24             $this->add_action_buttons();
   25             $this->standard_hidden_coursemodule_elements();
   26             return;
   27         }
   28         $mform->addElement('link','instructor_page_link',get_string('instructor_page_link_desc','wwassignment'),wwassignment_instructor_page_link(),get_string('instructor_page_link_name','wwassignment'));
   29         if($this->_instance == "") {
   30             //doing an addition
   31             $mform->addElement("header",'set_initialization',get_string('set_initialization','wwassignment'));
   32             $options = $webworkclient->options_set($coursemapped);
   33             $mform->addElement('select','webwork_set',get_string('webwork_set','wwassignment'),$options);
   34             $mform->setHelpButton('webwork_set', array('webwork_set', get_string('webwork_set', 'wwassignment'), 'wwassignment'));
   35             $mform->addElement('checkbox','auto_enroll_set',get_string('auto_enroll_set','wwassignment'),get_string('auto_enroll_set_desc','wwassignment'));
   36             $this->add_action_buttons();
   37             $this->standard_hidden_coursemodule_elements();
   38             return;
   39         } else {
   40             //doing an update
   41             //$this->standard_hidden_coursemodule_elements();
   42             $mform->addElement('link','edit_set',get_string('edit_set_link_desc','wwassignment'),wwassignment_edit_set_link($this->_instance),get_string('edit_set_link_name','wwassignment'));
   43             //$this->add_action_buttons(false);
   44         }
   45         return;
   46     }
   47 };
   48 
   49 ?>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9