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


PHP Exercise::getModelType方法代码示例

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


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

示例1: display_type_menu

 /**
  * Displays the menu of question types
  * @param Exercise $objExercise
  */
 public static function display_type_menu(Exercise $objExercise)
 {
     $feedback_type = $objExercise->feedback_type;
     $exerciseId = $objExercise->id;
     // 1. by default we show all the question types
     $question_type_custom_list = self::get_question_type_list();
     if (!isset($feedback_type)) {
         $feedback_type = 0;
     }
     if ($feedback_type == 1) {
         //2. but if it is a feedback DIRECT we only show the UNIQUE_ANSWER type that is currently available
         $question_type_custom_list = array(UNIQUE_ANSWER => self::$questionTypes[UNIQUE_ANSWER], HOT_SPOT_DELINEATION => self::$questionTypes[HOT_SPOT_DELINEATION]);
     } else {
         unset($question_type_custom_list[HOT_SPOT_DELINEATION]);
     }
     echo '<div class="actionsbig">';
     echo '<ul class="question_menu">';
     $modelType = $objExercise->getModelType();
     foreach ($question_type_custom_list as $i => $a_type) {
         if ($modelType == EXERCISE_MODEL_TYPE_COMMITTEE) {
             if ($a_type[1] != 'FreeAnswer') {
                 continue;
             }
         }
         // include the class of the type
         require_once $a_type[0];
         // get the picture of the type and the langvar which describes it
         $img = $explanation = '';
         eval('$img = ' . $a_type[1] . '::$typePicture;');
         eval('$explanation = get_lang(' . $a_type[1] . '::$explanationLangVar);');
         echo '<li>';
         echo '<div class="icon_image_content">';
         if ($objExercise->exercise_was_added_in_lp == true) {
             $img = pathinfo($img);
             $img = $img['filename'] . '_na.' . $img['extension'];
             echo Display::return_icon($img, $explanation, array(), ICON_SIZE_BIG);
         } else {
             echo '<a href="admin.php?' . api_get_cidreq() . '&newQuestion=yes&answerType=' . $i . '&exerciseId=' . $exerciseId . '">' . Display::return_icon($img, $explanation, array(), ICON_SIZE_BIG) . '</a>';
         }
         echo '</div>';
         echo '</li>';
     }
     echo '<li>';
     echo '<div class="icon_image_content">';
     if ($objExercise->exercise_was_added_in_lp == true) {
         echo Display::return_icon('database_na.png', get_lang('GetExistingQuestion'));
     } else {
         if ($feedback_type == 1) {
             //echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">';
         } else {
             //echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';
         }
         echo $url = '<a href="' . api_get_path(WEB_PUBLIC_PATH) . 'courses/' . api_get_course_path() . '/' . api_get_session_id() . '/exercise/' . $exerciseId . '/question-pool">';
         echo Display::return_icon('database.png', get_lang('GetExistingQuestion'));
     }
     echo '</a>';
     echo '</div></li>';
     echo '</ul>';
     echo '</div>';
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:64,代码来源:question.class.php

示例2: FormValidator

         echo '<div id="question_feedback">' . $comnt . '</div>';
     }
     echo '</div>';
     $arrid[] = $questionId;
     echo '<div id="' . $name . '" style="display:none">';
     $feedback_form = new FormValidator('frmcomments' . $questionId, 'post', '');
     $feedback_form->addElement('html', '<br>');
     $renderer =& $feedback_form->defaultRenderer();
     $renderer->setFormTemplate('<form{attributes}><div align="left">{content}</div></form>');
     $renderer->setElementTemplate('<div align="left">{element}</div>');
     $comnt = get_comments($id, $questionId);
     $default = array('comments_' . $questionId => $comnt);
     $feedback_form->addElement('html_editor', 'comments_' . $questionId, null, null, array('ToolbarSet' => 'TestAnswerFeedback', 'Width' => '100%', 'Height' => '120'));
     $feedback_form->addElement('html', '<br>');
     $feedback_form->setDefaults($default);
     $modelType = $objExercise->getModelType();
     if ($modelType == EXERCISE_MODEL_TYPE_COMMITTEE) {
         //$app['orm']->getRepository()
     }
     $feedback_form->display();
     echo '</div>';
 } else {
     $comnt = get_comments($id, $questionId);
     echo '<br />';
     if (!empty($comnt)) {
         echo '<b>' . get_lang('Feedback') . '</b>';
         echo '<div id="question_feedback">' . $comnt . '</div>';
     }
 }
 if ($is_allowedToEdit) {
     if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION))) {
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:exercise_show.php


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