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


PHP Display::display_normal_message方法代码示例

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


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

示例1: send_invitation

 public function send_invitation($username, $password, $userfriend_id, $content_message = '')
 {
     global $charset;
     if ($this->verifyUserPass($username, $password) == "valid") {
         $user_id = UserManager::get_user_id_from_username($username);
         $message_title = get_lang('Invitation');
         $count_is_true = SocialManager::send_invitation_friend($user_id, $userfriend_id, $message_title, $content_message);
         if ($count_is_true) {
             return Display::display_normal_message(api_htmlentities(get_lang('InvitationHasBeenSent'), ENT_QUOTES, $charset), false);
         } else {
             return Display::display_error_message(api_htmlentities(get_lang('YouAlreadySentAnInvitation'), ENT_QUOTES, $charset), false);
         }
     }
     return get_lang('InvalidId');
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:15,代码来源:cm_webservice_user.php

示例2: display_survey_list_for_coach

 function display_survey_list_for_coach()
 {
     $parameters = array();
     $parameters['cidReq'] = api_get_course_id();
     if (isset($_GET['do_search'])) {
         $message = get_lang('DisplaySearchResults') . '<br />';
         $message .= '<a href="' . api_get_self() . '?' . api_get_cidreq() . '">' . get_lang('DisplayAll') . '</a>';
         Display::display_normal_message($message, false);
     }
     // Create a sortable table with survey-data
     $table = new SortableTable('surveys_coach', 'get_number_of_surveys_for_coach', 'get_survey_data_for_coach', 2);
     $table->set_additional_parameters($parameters);
     $table->set_header(0, '', false);
     $table->set_header(1, get_lang('SurveyName'));
     $table->set_header(2, get_lang('SurveyCode'));
     $table->set_header(3, get_lang('NumberOfQuestions'));
     $table->set_header(4, get_lang('Author'));
     //$table->set_header(5, get_lang('Language'));
     //$table->set_header(6, get_lang('Shared'));
     $table->set_header(5, get_lang('AvailableFrom'));
     $table->set_header(6, get_lang('AvailableUntil'));
     $table->set_header(7, get_lang('Invite'));
     $table->set_header(8, get_lang('Anonymous'));
     $table->set_header(9, get_lang('Modify'), false, 'width="130"');
     $table->set_column_filter(8, 'anonymous_filter');
     $table->set_column_filter(9, 'modify_filter_for_coach');
     $table->display();
 }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:28,代码来源:survey.lib.php

示例3: explode

        Display::display_header($nameTools, 'Doc');
        Display::display_error_message(get_lang('Impossible'));
        Display::display_footer();
    }
} else {
    // Interbreadcrumb for the current directory root path
    // Copied from document.php
    $dir_array = explode('/', $dir);
    $array_len = count($dir_array);
    // Interbreadcrumb for the current directory root path
    if (empty($document_data['parents'])) {
        $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
    } else {
        foreach ($document_data['parents'] as $document_sub_data) {
            $interbreadcrumb[] = array('url' => $document_sub_data['document_url'], 'name' => $document_sub_data['title']);
        }
    }
    $interbreadcrumb[] = array('url' => '#', 'name' => $nameTools);
    Display::display_header($nameTools, "Doc");
    if ($is_certificate_mode) {
        $all_information_by_create_certificate = DocumentManager::get_all_info_to_certificate(api_get_user_id(), api_get_course_id());
        $str_info = '';
        foreach ($all_information_by_create_certificate[0] as $info_value) {
            $str_info .= $info_value . '<br/>';
        }
        $create_certificate = get_lang('CreateCertificateWithTags');
        Display::display_normal_message($create_certificate . ': <br /><br/>' . $str_info, false);
    }
    echo $form->return_form();
    Display::display_footer();
}
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:create_document.php

示例4: array

    $attempt_count = Event::get_attempt_count(api_get_user_id(), $objExercise->id, $learnpath_id, $learnpath_item_id, $learnpath_item_view_id);
    if ($attempt_count >= $objExercise->selectAttempts()) {
        Display::display_warning_message(sprintf(get_lang('ReachedMaxAttempts'), $objExercise->selectTitle(), $objExercise->selectAttempts()), false);
        if ($origin != 'learnpath') {
            //we are not in learnpath tool
            Display::display_footer();
        }
        exit;
    }
}
$total_score = 0;
if (!empty($exercise_stat_info)) {
    $total_score = $exercise_stat_info['exe_result'];
}
$max_score = $objExercise->get_max_score();
Display::display_normal_message(get_lang('Saved') . '<br />', false);
// Display and save questions
ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true);
//Unset session for clock time
ExerciseLib::exercise_time_control_delete($objExercise->id, $learnpath_id, $learnpath_item_id);
ExerciseLib::delete_chat_exercise_session($exe_id);
if ($origin != 'learnpath') {
    echo '<hr>';
    echo Display::url(get_lang('ReturnToCourseHomepage'), api_get_course_url(), array('class' => 'btn btn-primary'));
    if (api_is_allowed_to_session_edit()) {
        Session::erase('objExercise');
        Session::erase('exe_id');
    }
    Display::display_footer();
} else {
    $lp_mode = Session::read('lp_mode');
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:exercise_result.php

示例5: api_get_access_url

        				if ($access_url_id != -1) {
        					$url = api_get_access_url($access_url_id);
        					$emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".get_lang('YouAreReg')." ".api_get_setting('siteName') ." ".get_lang('WithTheFollowingSettings')."\n\n".get_lang('Username')." : ". $username ."\n". get_lang('Pass')." : ".stripslashes($password)."\n\n" .get_lang('Address') ." ". api_get_setting('siteName') ." ". get_lang('Is') ." : ". $url['url'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('SignatureFormula').",\n\n".api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
        				}
        			}
        			else {
        				$emailbody = get_lang('Dear')." ".stripslashes(api_get_person_name($firstname, $lastname)).",\n\n".get_lang('YouAreReg')." ".api_get_setting('siteName') ." ".get_lang('WithTheFollowingSettings')."\n\n".get_lang('Username')." : ". $username ."\n". get_lang('Pass')." : ".stripslashes($password)."\n\n" .get_lang('Address') ." ". api_get_setting('siteName') ." ". get_lang('Is') ." : ". $_configuration['root_web'] ."\n\n". get_lang('Problem'). "\n\n". get_lang('SignatureFormula').",\n\n".api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'))."\n". get_lang('Manager'). " ".api_get_setting('siteName')."\nT. ".api_get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".api_get_setting('emailAdministrator');
        			}
        			@api_mail_html($recipient_name, $email, $emailsubject, $emailbody, $sender_name, $email_admin);
        		}*/
        Security::clear_token();
        $tok = Security::get_token();
        header('Location: group_list.php?action=show_message&message=' . urlencode(get_lang('GroupAdded')) . '&sec_token=' . $tok);
        exit;
    }
} else {
    if (isset($_POST['submit'])) {
        Security::clear_token();
    }
    $token = Security::get_token();
    $form->addElement('hidden', 'sec_token');
    $form->setConstants(array('sec_token' => $token));
}
// Display form
Display::display_header($tool_name);
if (!empty($message)) {
    Display::display_normal_message(stripslashes($message));
}
$form->display();
// Footer
Display::display_footer();
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:group_add.php

示例6: get_lang

        $_SESSION['session_message_import_skills'] = $warning_message;
        $warning_message = 'session_message';
    }
    if ($error_kind_file) {
        $error_message = get_lang('YouMustImportAFileAccordingToSelectedOption');
    } else {
        //header('Location: '.api_get_path(WEB_CODE_PATH).'admin/skills_import.php?action=show_message&warn='.urlencode($warning_message).'&message='.urlencode($see_message_import).'&sec_token='.$tok);
        //exit;
    }
}
Display::display_header($tool_name);
if (!empty($error_message)) {
    Display::display_error_message($error_message);
}
if (!empty($see_message_import)) {
    Display::display_normal_message($see_message_import);
}
$form = new FormValidator('user_import', 'post', 'skills_import.php');
$form->addElement('header', '', $tool_name);
$form->addElement('hidden', 'formSent');
$form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
$group = array();
$group[] = $form->createElement('radio', 'file_type', '', 'CSV (<a href="skill_example.csv" target="_blank">' . get_lang('ExampleCSVFile') . '</a>)', 'csv');
//$group[] = $form->createElement('radio', 'file_type', null, 'XML (<a href="skill_example.xml" target="_blank">'.get_lang('ExampleXMLFile').'</a>)', 'xml');
$form->addGroup($group, '', get_lang('FileType'), '<br/>');
$form->addElement('style_submit_button', 'submit', get_lang('Import'), 'class="save"');
$defaults['formSent'] = 1;
$defaults['sendMail'] = 0;
$defaults['file_type'] = 'csv';
$form->setDefaults($defaults);
$form->display();
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:skills_import.php

示例7: foreach

                foreach ($classes as $class_id) {
                    ClassManager::unsubscribe_from_course($class_id, $course_code);
                }
            }
            Display::display_normal_message(get_lang('ClassesUnSubscribed'));
        }
    }
}
$sql = "SELECT id,name FROM {$tbl_class} WHERE name LIKE '" . $first_letter_class . "%' ORDER BY " . (count($classes) > 0 ? "(id IN('" . implode("','", $classes) . "')) DESC," : "") . " name";
$result = Database::query($sql);
$db_classes = Database::store_result($result);
$sql = "SELECT code,visual_code,title FROM {$tbl_course} WHERE visual_code LIKE '" . $first_letter_course . "%' ORDER BY " . (count($courses) > 0 ? "(code IN('" . implode("','", $courses) . "')) DESC," : "") . " visual_code";
$result = Database::query($sql);
$db_courses = Database::store_result($result);
if (!empty($error_message)) {
    Display::display_normal_message($error_message);
}
?>
<form name="formulaire" method="post" action="<?php 
echo api_get_self();
?>
" style="margin:0px;">
 <input type="hidden" name="formSent" value="1"/>
 <table border="0" cellpadding="5" cellspacing="0" width="100%">
  <tr>
   <td width="40%" align="center">
    <b><?php 
echo get_lang('ClassList');
?>
</b>
    <br/><br/>
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:subscribe_class2course.php

示例8: foreach

}
// Displaying the header
Display::display_header($nameTools);
$result = '';
if (count($output) > 0) {
    $result = '<div class="filler-report">' . "\n";
    $result .= '<h3>' . $output[0]['title'] . '</h3>' . "\n";
    $result .= '<table>';
    foreach ($output as $line) {
        $result .= '<tr>';
        $result .= '<td class="filler-report-data-init">' . $line['line-init'] . ' </td><td class="filler-report-data">' . $line['line-info'] . '</td>';
        $result .= '</tr>';
    }
    $result .= '</table>';
    $result .= '</div>';
    Display::display_normal_message($result, false);
}
?>
<div id="datafiller" class="actions">
  <h4><?php 
echo Display::return_icon('bug.png', get_lang('DataFiller'), null, ICON_SIZE_MEDIUM) . ' ' . get_lang('DataFiller');
?>
</h4>
  <div class="description"><?php 
echo get_lang('ThisSectionIsOnlyVisibleOnSourceInstalls');
?>
</div>
  <ul class="fillers">
    <li><a href="filler.php?fill=users"><?php 
echo Display::return_icon('user.png', get_lang('FillUsers'), null, ICON_SIZE_SMALL) . ' ' . get_lang('FillUsers');
?>
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:31,代码来源:filler.php

示例9: get_lang

?>
" type="text" id="audio_title"><br/>
<button type="button" value="" onclick="setupRecorder()" id="audio_button" /><?php 
echo get_lang('Activate');
?>
</button>
<button type="button" value="" onclick="newNameRecord()" id="new_name" /><?php 
echo get_lang('Reload');
?>
</button>
<?php 
echo Display::return_icon('info3.gif', get_lang('WamiNeedFilename') . ' ' . get_lang('WamiFlashDialog'), array('align' => 'absmiddle', 'hspace' => '3px'), false);
?>
</form>
</div>
<div align="center" id="audio_message_1" style="display:inline">
<?php 
Display::display_normal_message(get_lang('WamiNeedFilename') . ' ' . get_lang('WamiStartRecorder'), false);
?>
</div>

<script>
if (navigator.appName == 'Microsoft Internet Explorer') {
	document.getElementById('wami').style.marginLeft='400px';
}else{
	document.getElementById('wami').style.marginLeft='510px';
}
</script>

<?php 
Display::display_footer();
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:record_audio_wami.php

示例10: import_exercise

        //include needed librabries for treatment
        $result_log = import_exercise($_FILES['uploadedExercise']['name']);
        //display the result message (fail or success)
        $dialogBox = '';
        foreach ($result_log as $log) {
            $dialogBox .= $log . '<br>';
        }
        break;
}
//----------------------------------
// FIND INFORMATION
//----------------------------------
//empty!
//----------------------------------
// DISPLAY
//----------------------------------
include api_get_path(INCLUDE_PATH) . '/header.inc.php';
//display title
// Tool introduction
// TODO: These settings to be checked when it is possible.
Display::display_introduction_section(TOOL_QUIZ, array('CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/document/', 'CreateDocumentDir' => '../../../courses/' . api_get_course_path() . '/document/', 'BaseHref' => api_get_path(WEB_COURSE_PATH) . api_get_course_path() . '/'));
//Display Forms or dialog box(if needed)
if (isset($dialogBox)) {
    echo Display::display_normal_message($dialogBox, false);
}
//display content
if (isset($display)) {
    echo $display;
}
//footer display
include api_get_path(INCLUDE_PATH) . '/footer.inc.php';
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:31,代码来源:exercise_import.php

示例11: delete_inactive_student

 /**
  *
  * @param int   student id
  * @param int   years
  * @param bool  show warning_message
  * @param bool  return_timestamp
  */
 public static function delete_inactive_student($student_id, $years = 2, $warning_message = false, $return_timestamp = false)
 {
     $tbl_track_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
     $sql = 'SELECT login_date FROM ' . $tbl_track_login . '
             WHERE login_user_id = ' . intval($student_id) . '
             ORDER BY login_date DESC LIMIT 0,1';
     if (empty($years)) {
         $years = 1;
     }
     $inactive_time = $years * 31536000;
     //1 year
     $rs = Database::query($sql);
     if (Database::num_rows($rs) > 0) {
         if ($last_login_date = Database::result($rs, 0, 0)) {
             $last_login_date = api_get_local_time($last_login_date, null, date_default_timezone_get());
             if ($return_timestamp) {
                 return api_strtotime($last_login_date);
             } else {
                 if (!$warning_message) {
                     return api_format_date($last_login_date, DATE_FORMAT_SHORT);
                 } else {
                     $timestamp = api_strtotime($last_login_date);
                     $currentTimestamp = time();
                     //If the last connection is > than 7 days, the text is red
                     //345600 = 7 days in seconds 63072000= 2 ans
                     // if ($currentTimestamp - $timestamp > 184590 )
                     if ($currentTimestamp - $timestamp > $inactive_time && UserManager::delete_user($student_id)) {
                         Display::display_normal_message(get_lang('UserDeleted'));
                         echo '<p>', 'id', $student_id, ':', $last_login_date, '</p>';
                     }
                 }
             }
         }
     }
     return false;
 }
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:43,代码来源:usermanager.lib.php

示例12: display_resources

 /**
  * Function that displays a list with al the resources that could be added to the learning path
  * @return string
  */
 public function display_resources()
 {
     $_course = api_get_course_info();
     // TODO: Don't use globals.
     $course_code = api_get_course_id();
     //Get all the docs
     $documents = $this->get_documents();
     //Get all the exercises
     $exercises = $this->get_exercises();
     // Get all the links
     $links = $this->get_links();
     //Get al the student publications
     $works = $this->get_student_publications();
     //Get al the forums
     $forums = $this->get_forums(null, $course_code);
     $headers = array(Display::return_icon('folder_document.png', get_lang('Documents'), array(), 64), Display::return_icon('quiz.png', get_lang('Quiz'), array(), 64), Display::return_icon('links.png', get_lang('Links'), array(), 64), Display::return_icon('works.png', get_lang('Works'), array(), 64), Display::return_icon('forum.png', get_lang('Forums'), array(), 64), Display::return_icon('add_learnpath_section.png', get_lang('NewChapter'), array(), 64));
     echo Display::display_normal_message(get_lang('ClickOnTheLearnerViewToSeeYourLearningPath'));
     $chapter = $_SESSION['oLP']->display_item_form('chapter', get_lang('EnterDataNewChapter'), 'add_item');
     echo Display::tabs($headers, array($documents, $exercises, $links, $works, $forums, $chapter), 'resource_tab');
     return true;
 }
开发者ID:ragebat,项目名称:chamilo-lms,代码行数:25,代码来源:learnpath.class.php

示例13: FormValidator

    Display::display_normal_message($error_message, false);
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));
$form->addElement('hidden', 'formSent', 1);
$form->addElement('file', 'import_file', get_lang('ImportFileLocation'));
$form->addElement('radio', 'file_type', array(get_lang('FileType'), '<a href="example_session.csv" target="_blank">' . get_lang('ExampleCSVFile') . '</a>'), 'CSV', 'csv');
$form->addElement('radio', 'file_type', array(null, '<a href="example_session.xml" target="_blank">' . get_lang('ExampleXMLFile') . '</a>'), 'XML', 'xml');
$form->addElement('checkbox', 'overwrite', null, get_lang('IfSessionExistsUpdate'));
$form->addElement('checkbox', 'delete_users_not_in_list', null, get_lang('DeleteUsersNotInList'));
$form->addElement('checkbox', 'update_course_coaches', null, get_lang('CleanAndUpdateCourseCoaches'));
$form->addElement('checkbox', 'add_me_as_coach', null, get_lang('AddMeAsCoach'));
$form->addElement('checkbox', 'sendMail', null, get_lang('SendMailToUsers'));
$form->addElement('button', 'submit', get_lang('ImportSession'));
$defaults = array('sendMail' => 'true', 'file_type' => 'csv');
$form->setDefaults($defaults);
Display::display_normal_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));
$form->display();
?>
<p><?php 
echo get_lang('CSVMustLookLike') . ' (' . get_lang('MandatoryFields') . ')';
?>
 :</p>
<blockquote>
<pre>
<strong>SessionName</strong>;Coach;<strong>DateStart</strong>;<strong>DateEnd</strong>;Users;Courses;VisibilityAfterExpiration
<strong>Example 1</strong>;username;<strong>yyyy/mm/dd;yyyy/mm/dd</strong>;username1|username2;course1[coach1][username1,username2,...]|course2[coach1][username1,username2,...];read_only
<strong>Example 2</strong>;username;<strong>yyyy/mm/dd;yyyy/mm/dd</strong>;username1|username2;course1[coach1][username1,username2,...]|course2[coach1][username1,username2,...];accessible
<strong>Example 3</strong>;username;<strong>yyyy/mm/dd;yyyy/mm/dd</strong>;username1|username2;course1[coach1][username1,username2,...]|course2[coach1][username1,username2,...];not_accessible
</pre>
</blockquote>
<p><?php 
开发者ID:annickvdp,项目名称:Chamilo1.9.10,代码行数:31,代码来源:session_import.php

示例14: show_block

}
</script>
<?php 
/* DISPLAY SECTION */
echo $_SESSION['oLP']->build_action_menu();
echo '<div class="row-fluid">';
echo '<div class="span4">';
// Build the tree with the menu items in it.
echo $_SESSION['oLP']->return_new_tree();
echo '</div>';
echo '<div class="span8">';
if (isset($is_success) && $is_success === true) {
    Display::display_confirmation_message(get_lang('ItemRemoved'));
} else {
    if ($is_new) {
        Display::display_normal_message(get_lang('LearnpathAdded'), false);
    }
    // Display::display_normal_message(get_lang('LPCreatedAddChapterStep'), false);
    $gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;
    echo Display::page_subheader(get_lang('LearnPathAddedTitle'));
    echo '<ul id="lp_overview" class="thumbnails">';
    echo show_block('lp_controller.php?' . api_get_cidreq() . '&amp;gradebook=' . $gradebook . '&amp;action=add_item&amp;type=step&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("NewStep"), get_lang('NewStepComment'), 'tools.png');
    //    echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=admin_view&amp;updateaudio=true&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("BasicOverview"), get_lang('BasicOverviewComment'), 'audio.png');
    echo show_block('lp_controller.php?' . api_get_cidreq() . '&amp;gradebook=' . $gradebook . '&amp;action=view&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Display"), get_lang('DisplayComment'), 'view.png');
    //echo show_block('lp_controller.php?'.api_get_cidreq().'&amp;gradebook='.$gradebook.'&amp;action=edit&amp;lp_id=' . $_SESSION['oLP']->lp_id, get_lang("Settings"), null, 'reference.png');
    echo '</ul>';
}
echo '</div>';
echo '</div>';
function show_block($link, $title, $subtitle, $icon)
{
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:31,代码来源:lp_build.php

示例15: display_question_list_by_attempt

 /**
  * Display the exercise results
  * @param Exercise $objExercise
  * @param int $exe_id
  * @param bool $save_user_result save users results (true) or just show the results (false)
  */
 public static function display_question_list_by_attempt($objExercise, $exe_id, $save_user_result = false)
 {
     global $origin;
     // Getting attempt info
     $exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
     // Getting question list
     $question_list = array();
     if (!empty($exercise_stat_info['data_tracking'])) {
         $question_list = explode(',', $exercise_stat_info['data_tracking']);
     } else {
         // Try getting the question list only if save result is off
         if ($save_user_result == false) {
             $question_list = $objExercise->get_validated_question_list();
         }
     }
     $counter = 1;
     $total_score = $total_weight = 0;
     $exercise_content = null;
     // Hide results
     $show_results = false;
     $show_only_score = false;
     if ($objExercise->results_disabled == RESULT_DISABLE_SHOW_SCORE_AND_EXPECTED_ANSWERS) {
         $show_results = true;
     }
     if (in_array($objExercise->results_disabled, array(RESULT_DISABLE_SHOW_SCORE_ONLY, RESULT_DISABLE_SHOW_FINAL_SCORE_ONLY_WITH_CATEGORIES))) {
         $show_only_score = true;
     }
     // Not display expected answer, but score, and feedback
     $show_all_but_expected_answer = false;
     if ($objExercise->results_disabled == RESULT_DISABLE_SHOW_SCORE_ONLY && $objExercise->feedback_type == EXERCISE_FEEDBACK_TYPE_END) {
         $show_all_but_expected_answer = true;
         $show_results = true;
         $show_only_score = false;
     }
     if ($show_results || $show_only_score) {
         $user_info = api_get_user_info($exercise_stat_info['exe_user_id']);
         //Shows exercise header
         echo $objExercise->show_exercise_result_header($user_info, api_convert_and_format_date($exercise_stat_info['start_date'], DATE_TIME_FORMAT_LONG), $exercise_stat_info['duration'], $exercise_stat_info['user_ip']);
     }
     // Display text when test is finished #4074 and for LP #4227
     $end_of_message = $objExercise->selectTextWhenFinished();
     if (!empty($end_of_message)) {
         Display::display_normal_message($end_of_message, false);
         echo "<div class='clear'>&nbsp;</div>";
     }
     $question_list_answers = array();
     $media_list = array();
     $category_list = array();
     // Loop over all question to show results for each of them, one by one
     if (!empty($question_list)) {
         foreach ($question_list as $questionId) {
             // creates a temporary Question object
             $objQuestionTmp = Question::read($questionId);
             // This variable came from exercise_submit_modal.php
             ob_start();
             // We're inside *one* question. Go through each possible answer for this question
             $result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null, 'exercise_result', array(), $save_user_result, true, $show_results, $objExercise->selectPropagateNeg(), array());
             if (empty($result)) {
                 continue;
             }
             // In case of global score, make sure the calculated total score is integer
             /*if (!is_int($result['score'])) {
                   $result['score'] = round($result['score']);
               }*/
             $total_score += $result['score'];
             $total_weight += $result['weight'];
             $question_list_answers[] = array('question' => $result['open_question'], 'answer' => $result['open_answer'], 'answer_type' => $result['answer_type']);
             $my_total_score = $result['score'];
             $my_total_weight = $result['weight'];
             // Category report
             $category_was_added_for_this_test = false;
             if (isset($objQuestionTmp->category) && !empty($objQuestionTmp->category)) {
                 if (!isset($category_list[$objQuestionTmp->category]['score'])) {
                     $category_list[$objQuestionTmp->category]['score'] = 0;
                 }
                 if (!isset($category_list[$objQuestionTmp->category]['total'])) {
                     $category_list[$objQuestionTmp->category]['total'] = 0;
                 }
                 $category_list[$objQuestionTmp->category]['score'] += $my_total_score;
                 $category_list[$objQuestionTmp->category]['total'] += $my_total_weight;
                 $category_was_added_for_this_test = true;
             }
             if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
                 foreach ($objQuestionTmp->category_list as $category_id) {
                     $category_list[$category_id]['score'] += $my_total_score;
                     $category_list[$category_id]['total'] += $my_total_weight;
                     $category_was_added_for_this_test = true;
                 }
             }
             // No category for this question!
             if ($category_was_added_for_this_test == false) {
                 if (!isset($category_list['none']['score'])) {
                     $category_list['none']['score'] = 0;
                 }
//.........这里部分代码省略.........
开发者ID:feroli1000,项目名称:chamilo-lms,代码行数:101,代码来源:exercise.lib.php


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