Exemplo n.º 1
0
 function action_selem()
 {
     $id = required_param('id', PARAM_INT);
     $crs = new course($id);
     $crs->seturl(null, array('s' => 'crs', 'section' => 'curr', 'action' => 'selem'));
     $form = $crs->create_completion_form($this->optional_param('elemid', 0, PARAM_INT));
     if (!$form->is_cancelled()) {
         $elemrecord = new Object();
         $elemrecord->id = cm_get_param('elemid', 0);
         $elemrecord->idnumber = cm_get_param('idnumber', '');
         $elemrecord->name = cm_get_param('name', '');
         $elemrecord->description = cm_get_param('description', '');
         $elemrecord->completion_grade = cm_get_param('completion_grade', 0);
         $elemrecord->required = cm_get_param('required', 0);
         $crs->save_completion_element($elemrecord);
     }
     $this->print_tabs('elem', array('id' => $id));
     echo $this->get_completion_page($id);
 }