当前位置: 首页>>代码示例>>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;未经允许,请勿转载。