[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 5109 - (download) (as text) (annotate)
Sun Jul 1 20:44:13 2007 UTC (12 years, 7 months ago) by mleventi
File size: 2268 byte(s)
Refactoring of some comments, Added Language Files, Quote Optimizations

    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             $this->add_action_buttons();
   23             $this->standard_hidden_coursemodule_elements();
   24             return;
   25         }
   26         $mform->addElement('link','instructor_page_link',get_string('instructor_page_link_desc','wwassignment'),wwassignment_instructor_page_link(),get_string('instructor_page_link_name','wwassignment'));
   27         if($this->_instance == "") {
   28             //doing an addition
   29             $mform->addElement("header",'set_initialization',get_string('set_initialization','wwassignment'));
   30             $options = $webworkclient->options_set($coursemapped);
   31             $mform->addElement('select','webwork_set',get_string('webwork_set','wwassignment'),$options);
   32             $mform->setHelpButton('webwork_set', array('webwork_set', get_string('webwork_set', 'wwassignment'), 'wwassignment'));
   33             $this->add_action_buttons();
   34             $this->standard_hidden_coursemodule_elements();
   35             return;
   36         } else {
   37             //doing an update
   38             //$this->standard_hidden_coursemodule_elements();
   39             $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'));
   40             //$this->add_action_buttons(false);
   41         }
   42         return;
   43     }
   44 };
   45 
   46 ?>

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9