当前位置: 首页>>代码示例>>PHP>>正文


PHP Exercise::format_title_variable方法代码示例

本文整理汇总了PHP中Exercise::format_title_variable方法的典型用法代码示例。如果您正苦于以下问题:PHP Exercise::format_title_variable方法的具体用法?PHP Exercise::format_title_variable怎么用?PHP Exercise::format_title_variable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Exercise的用法示例。


在下文中一共展示了Exercise::format_title_variable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

    if ($is_allowed_to_edit) {
        if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'view' && !isset($_REQUEST['exeId'])) {
            $_REQUEST['action'] = 'build';
        }
        //$_SESSION['studentview'] = null;
    }
}

$action = (!empty($_REQUEST['action']) ? $_REQUEST['action'] : '');

// format title to be displayed correctly if QUIZ
$post_title = "";
if (isset($_POST['title'])) {
    $post_title = Security::remove_XSS($_POST['title']);
    if (isset($_POST['type']) && isset($_POST['title']) && $_POST['type'] == TOOL_QUIZ && !empty($_POST['title'])) {
        $post_title = Exercise::format_title_variable($_POST['title']);
    }
}

switch ($action) {
    case 'add_item':
        if (!$is_allowed_to_edit) {
            api_not_allowed(true);
        }
        if ($debug > 0) error_log('New LP - add item action triggered', 0);

        if (!$lp_found) {
            //check if the learnpath ID was defined, otherwise send back to list
            if ($debug > 0) error_log('New LP - No learnpath given for add item', 0);
            require 'lp_list.php';
        } else {
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:lp_controller.php

示例2: isset

     $folderId = isset($_GET['folder_id']) ? $_GET['folder_id'] : null;
     if (empty($folderId)) {
         exit;
     }
     $lpId = isset($_GET['lp_id']) ? $_GET['lp_id'] : null;
     $url = isset($_GET['url']) ? $_GET['url'] : null;
     echo DocumentManager::get_document_preview($courseInfo, $lpId, null, api_get_session_id(), true, null, $url, true, false, $folderId);
     break;
 case 'add_lp_item':
     if (api_is_allowed_to_edit(null, true)) {
         if ($_SESSION['oLP']) {
             //Updating the lp.modified_on
             $_SESSION['oLP']->set_modified_on();
             $title = $_REQUEST['title'];
             if ($_REQUEST['type'] == TOOL_QUIZ) {
                 $title = Exercise::format_title_variable($title);
             }
             echo $_SESSION['oLP']->add_item($_REQUEST['parent_id'], $_REQUEST['previous_id'], $_REQUEST['type'], $_REQUEST['id'], $title, null);
         }
     }
     break;
 case 'update_lp_item_order':
     if (api_is_allowed_to_edit(null, true)) {
         $new_order = $_POST['new_order'];
         $sections = explode('^', $new_order);
         $new_array = array();
         // We have to update parent_item_id, previous_item_id, next_item_id, display_order in the database
         $LP_item_list = new LP_item_order_list();
         foreach ($sections as $items) {
             if (!empty($items)) {
                 list($id, $parent_id) = explode('|', $items);
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:lp.ajax.php

示例3: processCreation

 /**
  * function which process the creation of exercises
  * @param FormValidator $form
  * @param string
  */
 function processCreation($form, $type = '')
 {
     $this->updateTitle(Exercise::format_title_variable($form->getSubmitValue('exerciseTitle')));
     $this->updateDescription($form->getSubmitValue('exerciseDescription'));
     $this->updateAttempts($form->getSubmitValue('exerciseAttempts'));
     $this->updateFeedbackType($form->getSubmitValue('exerciseFeedbackType'));
     $this->updateType($form->getSubmitValue('exerciseType'));
     $this->setRandom($form->getSubmitValue('randomQuestions'));
     $this->updateRandomAnswers($form->getSubmitValue('randomAnswers'));
     $this->updateResultsDisabled($form->getSubmitValue('results_disabled'));
     $this->updateExpiredTime($form->getSubmitValue('enabletimercontroltotalminutes'));
     $this->updatePropagateNegative($form->getSubmitValue('propagate_neg'));
     $this->updateRandomByCat($form->getSubmitValue('randomByCat'));
     $this->updateTextWhenFinished($form->getSubmitValue('text_when_finished'));
     $this->updateDisplayCategoryName($form->getSubmitValue('display_category_name'));
     $this->updateReviewAnswers($form->getSubmitValue('review_answers'));
     $this->updatePassPercentage($form->getSubmitValue('pass_percentage'));
     if ($form->getSubmitValue('activate_start_date_check') == 1) {
         $start_time = $form->getSubmitValue('start_time');
         $this->start_time = api_get_utc_datetime($start_time);
     } else {
         $this->start_time = '0000-00-00 00:00:00';
     }
     if ($form->getSubmitValue('activate_end_date_check') == 1) {
         $end_time = $form->getSubmitValue('end_time');
         $this->end_time = api_get_utc_datetime($end_time);
     } else {
         $this->end_time = '0000-00-00 00:00:00';
     }
     if ($form->getSubmitValue('enabletimercontrol') == 1) {
         $expired_total_time = $form->getSubmitValue('enabletimercontroltotalminutes');
         if ($this->expired_time == 0) {
             $this->expired_time = $expired_total_time;
         }
     } else {
         $this->expired_time = 0;
     }
     if ($form->getSubmitValue('randomAnswers') == 1) {
         $this->random_answers = 1;
     } else {
         $this->random_answers = 0;
     }
     $this->save($type);
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:49,代码来源:exercise.class.php

示例4: processCreation

 /**
  * function which process the creation of exercises
  * @param FormValidator $form
  * @param string
  */
 public function processCreation($form, $type = '')
 {
     $this->updateTitle(Exercise::format_title_variable($form->getSubmitValue('exerciseTitle')));
     $this->updateDescription($form->getSubmitValue('exerciseDescription'));
     $this->updateAttempts($form->getSubmitValue('exerciseAttempts'));
     $this->updateFeedbackType($form->getSubmitValue('exerciseFeedbackType'));
     $this->updateType($form->getSubmitValue('exerciseType'));
     $this->setRandom($form->getSubmitValue('randomQuestions'));
     $this->updateRandomAnswers($form->getSubmitValue('randomAnswers'));
     $this->updateResultsDisabled($form->getSubmitValue('results_disabled'));
     $this->updateExpiredTime($form->getSubmitValue('enabletimercontroltotalminutes'));
     $this->updatePropagateNegative($form->getSubmitValue('propagate_neg'));
     $this->updateSaveCorrectAnswers($form->getSubmitValue('save_correct_answers'));
     $this->updateRandomByCat($form->getSubmitValue('randomByCat'));
     $this->updateTextWhenFinished($form->getSubmitValue('text_when_finished'));
     $this->updateDisplayCategoryName($form->getSubmitValue('display_category_name'));
     $this->updateReviewAnswers($form->getSubmitValue('review_answers'));
     $this->updatePassPercentage($form->getSubmitValue('pass_percentage'));
     $this->updateCategories($form->getSubmitValue('category'));
     $this->updateEndButton($form->getSubmitValue('end_button'));
     $this->setOnSuccessMessage($form->getSubmitValue('on_success_message'));
     $this->setOnFailedMessage($form->getSubmitValue('on_failed_message'));
     $this->updateEmailNotificationTemplate($form->getSubmitValue('email_notification_template'));
     $this->updateEmailNotificationTemplateToUser($form->getSubmitValue('email_notification_template_to_user'));
     $this->setNotifyUserByEmail($form->getSubmitValue('notify_user_by_email'));
     $this->setModelType($form->getSubmitValue('model_type'));
     $this->setQuestionSelectionType($form->getSubmitValue('question_selection_type'));
     $this->setHideQuestionTitle($form->getSubmitValue('hide_question_title'));
     $this->setQuestionSelectionType($form->getSubmitValue('question_selection_type'));
     $this->setScoreTypeModel($form->getSubmitValue('score_type_model'));
     $this->setGlobalCategoryId($form->getSubmitValue('global_category_id'));
     if ($form->getSubmitValue('activate_start_date_check') == 1) {
         $start_time = $form->getSubmitValue('start_time');
         $this->start_time = api_get_utc_datetime($start_time);
     } else {
         $this->start_time = '0000-00-00 00:00:00';
     }
     if ($form->getSubmitValue('activate_end_date_check') == 1) {
         $end_time = $form->getSubmitValue('end_time');
         $this->end_time = api_get_utc_datetime($end_time);
     } else {
         $this->end_time = '0000-00-00 00:00:00';
     }
     if ($form->getSubmitValue('enabletimercontrol') == 1) {
         $expired_total_time = $form->getSubmitValue('enabletimercontroltotalminutes');
         if ($this->expired_time == 0) {
             $this->expired_time = $expired_total_time;
         }
     } else {
         $this->expired_time = 0;
     }
     if ($form->getSubmitValue('randomAnswers') == 1) {
         $this->random_answers = 1;
     } else {
         $this->random_answers = 0;
     }
     $this->save($type);
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:63,代码来源:exercise.class.php


注:本文中的Exercise::format_title_variable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。