本文整理匯總了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) {