Esempio n. 1
0
 if (isset($currentUser->coreAccess['skillgaptests']) && $currentUser->coreAccess['skillgaptests'] != 'change') {
     eF_redirect("" . basename($_SERVER['PHP_SELF']) . "?ctg=control_panel&message=" . urlencode(_UNAUTHORIZEDACCESS) . "&message_type=failure");
     exit;
 }
 $form = new HTML_QuickForm("question_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=tests&add_test=1&create_quick_test=1", "", null, true);
 $form->registerRule('checkParameter', 'callback', 'eF_checkParameter');
 //Register this rule for checking user input with our function, eF_checkParameter
 $form->addElement('text', 'name', null, 'class = "inputText" id= "testName"');
 // Creating select for directions-courses-lessons
 $directionsTree = new EfrontDirectionsTree();
 $selectArray = $directionsTree->toSelect(true, true, true);
 //return in HTML coloured format with SKILLGAPTESTS option and including questions number
 $smarty->assign("T_QUICKFORM_LESSON_COURSES_SELECT", $selectArray);
 if (G_VERSIONTYPE == 'enterprise') {
     #cpp#ifdef ENTERPRISE
     $skillsTree = EfrontSkill::getSkillTree();
     $smarty->assign("T_QUICKFORM_SKILLS_SELECT", $skillsTree);
     $end = strpos($skillsTree, ")");
     $ignore_first_par = substr($skillsTree, $end + 1);
     $start = strpos($ignore_first_par, "(") + 1;
     $end = strpos($ignore_first_par, ")");
     $init_skill_questions_max = (int) substr($ignore_first_par, $start, $end);
     $skill_questions = array();
     for ($i = 1; $i <= $init_skill_questions_max; $i++) {
         $skill_questions[$i] = $i;
     }
     $form->addElement('select', 'skill_questions_count_row', null, $skill_questions, 'class = "inputText" id="skill_questions_row"');
 }
 #cpp#endif
 //$form -> addElement('select', 'lesson_courses_row' , null, $selectArray ,'id="lesson_courses_row"');
 //$form -> addElement('select', 'system_avatar' , _ORSELECTONEFROMLIST, $systemAvatars, "id = 'select_avatar'");