$lastitem = $evaluationitems[count($evaluationitems)-1]; $lastposition = $lastitem->position; } else { $lastposition = 0; } } $lastposition++; //The add_item-form $add_item_form = new evaluation_edit_add_question_form('edit_item.php'); $add_item_form->set_data(array('eid'=>$evaluation->id,'classid'=>$evaluation->classid, 'position'=>$lastposition)); //The use_template-form $use_template_form = new evaluation_edit_use_template_form('use_templ.php'); $use_template_form->set_evaluationdata(array('class' => $evaluation->classid)); $use_template_form->set_form_elements(); $use_template_form->set_data(array('id'=>$id)); //Print the page header. $strevaluations = get_string('modulenameplural', 'local_evaluations'); $strevaluation = get_string('modulename', 'local_evaluations'); $PAGE->set_url('/local/evaluations/edit.php', array('id'=>$id, 'do_show'=>$do_show)); //$PAGE->set_heading(format_string($evaluation->classid->fullname)); $PAGE->set_title(format_string($evaluation->name)); //Adding the javascript localule for the items dragdrop. if (count($evaluationitems) > 1) { if ($do_show == 'edit' and $CFG->enableajax) {