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


PHP Exercise::isInList方法代码示例

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


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

示例1: get_action_icon_for_question

/**
   Return the <a> html code for delete, add, clone, edit a question
   in_action = the code of the action triggered by the button
   from_exercice = the id of the current exercice from which we click on question pool
   in_questionid = the id of the current question
   in_questiontype = the code of the type of the current question
   in_questionname = the name of the question
   in_selected_course = the if of the course chosen in the FILTERING MENU
   in_courseCategoryId = the id of the category chosen in the FILTERING MENU
   in_exerciseLevel = the level of the exercice chosen in the FILTERING MENU
   in_answerType = the code of the type of the question chosen in the FILTERING MENU
   in_session_id = the id of the session_id chosen in the FILTERING MENU
   in_exercice_id = the id of the exercice chosen in the FILTERING MENU
*/
function get_action_icon_for_question($in_action, $from_exercice, $in_questionid, $in_questiontype, $in_questionname, $in_selected_course, $in_courseCategoryId, $in_exerciseLevel, $in_answerType, $in_session_id, $in_exercice_id)
{
    $res = "";
    $getParams = "&selected_course={$in_selected_course}&courseCategoryId={$in_courseCategoryId}&exerciseId={$in_exercice_id}&exerciseLevel={$in_exerciseLevel}&answerType={$in_answerType}&session_id={$in_session_id}";
    switch ($in_action) {
        case "delete":
            $res = "<a href='" . api_get_self() . "?" . api_get_cidreq() . $getParams . "&delete={$in_questionid}' onclick='return confirm_your_choice()'>";
            $res .= Display::return_icon("delete.png", get_lang('Delete'));
            $res .= "</a>";
            break;
        case "edit":
            $res = get_a_tag_for_question(1, $from_exercice, $in_questionid, $in_questiontype, Display::return_icon("edit.png", get_lang('Modify')), $in_session_id);
            break;
        case "add":
            // add if question is not already in test
            $myObjEx = new Exercise();
            $myObjEx->read($from_exercice);
            if (!$myObjEx->isInList($in_questionid)) {
                $res = "<a href='" . api_get_self() . "?" . api_get_cidreq() . $getParams . "&recup={$in_questionid}&fromExercise={$from_exercice}'>";
                $res .= Display::return_icon("view_more_stats.gif", get_lang('InsertALinkToThisQuestionInTheExercise'));
                $res .= "</a>";
            } else {
                $res = "-";
            }
            unset($myObjEx);
            break;
        case "clone":
            $url = api_get_self() . "?" . api_get_cidreq() . $getParams . "&amp;copy_question={$in_questionid}&amp;course_id={$in_selected_course}&amp;fromExercise={$from_exercice}";
            $res = Display::url(Display::return_icon('cd.gif', get_lang('ReUseACopyInCurrentTest')), $url);
            break;
        default:
            $res = $in_action;
            break;
    }
    return $res;
}
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:50,代码来源:question_pool.php

示例2: header

 }
 if (isset($_GET['exportIMSQTI'])) {
     $result = Database::get()->queryArray($result_query, $result_query_vars);
     header('Content-type: text/xml');
     header('Content-Disposition: attachment; filename="exportQTI.xml"');
     exportIMSQTI($result);
     exit;
 } else {
     //END OF BUILDING QUERIES AND QUERY VARS
     $result = Database::get()->queryArray($result_query, $result_query_vars);
     $total_questions = Database::get()->querySingle($total_query, $total_query_vars)->total;
     $nbrQuestions = count($result);
     $tool_content .= "\n\t<tr>\n\t  <th>{$langQuesList}</th>\n          <th class='text-center'>" . icon('fa-gears') . "</th>\n        </tr>";
     foreach ($result as $row) {
         $exercise_ids = Database::get()->queryArray("SELECT exercise_id FROM `exercise_with_questions` WHERE question_id = ?d", $row->id);
         if (isset($fromExercise) || !is_object(@$objExercise) || !$objExercise->isInList($row->id)) {
             if ($row->type == 1) {
                 $answerType = $langUniqueSelect;
             } elseif ($row->type == 2) {
                 $answerType = $langMultipleSelect;
             } elseif ($row->type == 3) {
                 $answerType = $langFillBlanks;
             } elseif ($row->type == 4) {
                 $answerType = $langMatching;
             } elseif ($row->type == 5) {
                 $answerType = $langTrueFalse;
             } elseif ($row->type == 6) {
                 $answerType = $langFreeText;
             }
             $tool_content .= "<tr>";
             if (!isset($fromExercise)) {
开发者ID:kostastzo,项目名称:openeclass,代码行数:31,代码来源:question_pool.php


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