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


PHP Exercise::getQuestionOrderedListByName方法代码示例

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


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

示例1: getListOfCategoriesIDForTestObject

 public static function getListOfCategoriesIDForTestObject(Exercise $exercise_obj)
 {
     // parcourir les questions d'un test, recup les categories uniques dans un tableau
     $categories_in_exercise = array();
     // $question_list = $exercise_obj->getQuestionList();
     $question_list = $exercise_obj->getQuestionOrderedListByName();
     // the array given by selectQuestionList start at indice 1 and not at indice 0 !!! ???
     foreach ($question_list as $questionInfo) {
         $question_id = $questionInfo['question_id'];
         $category_list = Testcategory::getCategoryForQuestion($question_id);
         if (!empty($category_list)) {
             $categories_in_exercise = array_merge($categories_in_exercise, $category_list);
         }
     }
     if (!empty($categories_in_exercise)) {
         $categories_in_exercise = array_unique(array_filter($categories_in_exercise));
     }
     return $categories_in_exercise;
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:19,代码来源:testcategory.class.php

示例2: isset

require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$exercise_id = isset($_GET['exerciseId']) && !empty($_GET['exerciseId']) ? intval($_GET['exerciseId']) : 0;
$objExercise = new Exercise();
$result = $objExercise->read($exercise_id);
if (!$result) {
    api_not_allowed(true);
}
$session_id = api_get_session_id();
if (empty($session_id)) {
    $students = CourseManager::get_student_list_from_course_code(api_get_course_int_id(), false);
} else {
    $students = CourseManager::get_student_list_from_course_code(api_get_course_int_id(), true, $session_id);
}
$count_students = count($students);
$question_list = $objExercise->getQuestionOrderedListByName();
$data = array();
//Question title 	# of students who tool it 	Lowest score 	Average 	Highest score 	Maximum score
$headers = array(get_lang('Question'), get_lang('QuestionType'), get_lang('NumberStudentWhoSelectedIt'), get_lang('LowestScore'), get_lang('AverageScore'), get_lang('HighestScore'), get_lang('Weighting'));
if (!empty($question_list)) {
    foreach ($question_list as $row) {
        $question_id = $row['question_id'];
        $question_obj = Question::read($question_id);
        $exercise_stats = ExerciseLib::get_student_stats_by_question($question_id, $exercise_id, api_get_course_int_id(), api_get_session_id());
        $count_users = ExerciseLib::get_number_students_question_with_answer_count($question_id, $exercise_id, api_get_course_int_id(), api_get_session_id());
        $data[$question_id]['name'] = Text::cut($question_obj->question, 100);
        $data[$question_id]['type'] = $question_obj->get_question_type_name();
        $percentage = 0;
        if ($count_students) {
            $percentage = $count_users / $count_students * 100;
        }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:stats.php


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