當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WooThemes_Sensei_Utils::sensei_get_user_question_grade方法代碼示例

本文整理匯總了PHP中WooThemes_Sensei_Utils::sensei_get_user_question_grade方法的典型用法代碼示例。如果您正苦於以下問題:PHP WooThemes_Sensei_Utils::sensei_get_user_question_grade方法的具體用法?PHP WooThemes_Sensei_Utils::sensei_get_user_question_grade怎麽用?PHP WooThemes_Sensei_Utils::sensei_get_user_question_grade使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WooThemes_Sensei_Utils的用法示例。


在下文中一共展示了WooThemes_Sensei_Utils::sensei_get_user_question_grade方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_post_meta

$lesson_complete = $woothemes_sensei->frontend->data->user_lesson_complete;
$reset_quiz_allowed = $woothemes_sensei->frontend->data->reset_quiz_allowed;
// Question Meta
$question_id = $question_item->ID;
$question_right_answer = get_post_meta($question_id, '_question_right_answer', true);
$question_wrong_answers = get_post_meta($question_id, '_question_wrong_answers', true);
$question_helptext = '';
if (isset($question_wrong_answers[0])) {
    $question_helptext = $question_wrong_answers[0];
}
$question_grade = get_post_meta($question_id, '_question_grade', true);
if (!$question_grade || $question_grade == '') {
    $question_grade = 1;
}
$user_answer_entry = WooThemes_Sensei_Utils::sensei_check_for_activity(array('post_id' => $question_id, 'user_id' => $current_user->ID, 'type' => 'sensei_user_answer'), true);
$user_question_grade = WooThemes_Sensei_Utils::sensei_get_user_question_grade($user_answer_entry);
// Get uploaded file
$attachment_id = $user_quizzes[$question_id];
$answer_media_url = $answer_media_filename = '';
if (0 < intval($attachment_id)) {
    $answer_media_url = wp_get_attachment_url($attachment_id);
    $answer_media_filename = basename($answer_media_url);
}
// Get max upload file size, formatted for display
// Code copied from wp-admin/includes/media.php:1515
$upload_size_unit = $max_upload_size = wp_max_upload_size();
$sizes = array('KB', 'MB', 'GB');
for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) {
    $upload_size_unit /= 1024;
}
if ($u < 0) {
開發者ID:AlecBeltrami,項目名稱:sensei,代碼行數:31,代碼來源:question_type-file-upload.php


注:本文中的WooThemes_Sensei_Utils::sensei_get_user_question_grade方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。