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


PHP progress_bar::update_full方法代码示例

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


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

示例1: round

    if (!($submission = $DB->get_record('emarking_submission', array('id' => $submissionid)))) {
        $totaldocumentsignored++;
        continue;
    }
    if (!($student = $DB->get_record('user', array('id' => $submission->student)))) {
        $totaldocumentsignored++;
        continue;
    }
    if (emarking_multi_create_response_pdf($submission, $student, $context, $cmid)) {
        $totaldocumentsprocessed++;
        $pbar->update($totaldocumentsprocessed, $totalsubmissions, get_string('publishinggrade', 'mod_emarking') . $submission->id);
        emarking_multi_publish_grade($submission);
    } else {
        $totaldocumentsignored++;
    }
}
$pbar->update_full(100, get_string('publishinggradesfinished', 'mod_emarking'));
$percentage = 0;
if ($totaldocumentsprocessed > 0) {
    $percentage = round(($totaldocumentsprocessed - $totaldocumentsignored) / $totaldocumentsprocessed * 100, 2);
}
$table = new html_table();
$table->attributes['style'] = "width: 500px; margin-left:auto; margin-right:auto;";
$table->head = array(get_string('results', 'mod_emarking'), ' ');
$table->data[] = array(get_string('publishedgrades', 'mod_emarking'), $totaldocumentsprocessed . " ({$percentage}%)");
$table->data[] = array(get_string('errors', 'mod_emarking'), $totaldocumentsignored);
echo "<br/>";
echo html_writer::table($table);
$continue_url = new moodle_url('/mod/emarking/view.php', array('id' => $cm->id));
echo $OUTPUT->continue_button($continue_url);
echo $OUTPUT->footer();
开发者ID:jorgecabane93,项目名称:eMarkingWeb,代码行数:31,代码来源:publish.php

示例2: attendanceregister__finalize_progress_bar

/**
 * Finalyze (push to 100%) the progressbar, if any, showing a message.
 * @param progress_bar $progressbar Progress Bar instance to update; if null do nothing
 * @param string $msg
 */
function attendanceregister__finalize_progress_bar($progressbar, $msg = '')
{
    if ($progressbar) {
        $progressbar->update_full(100, $msg);
    }
}
开发者ID:nicusX,项目名称:moodle-mod_attendanceregister,代码行数:11,代码来源:locallib.php

示例3: count

$users = emarking_get_enroled_students($course->id);
$pbar = new progress_bar();
$pbar->create();
if ($create) {
    quiz_delete_all_attempts($quiz);
}
$cur = 1;
$total = count($users);
// Insert answers or finish the attempt for each student
foreach ($users as $user) {
    $pbar->update($cur, $total, get_string('processing', 'mod_emarking') . $user->lastname . $user->firstname);
    flush();
    // Get the quiz instance for the specific student
    $quizobj = quiz::create($cm->instance, $user->id);
    // Get all the attempts
    $attempts = quiz_get_user_attempts($quizobj->get_quizid(), $user->id, 'all');
    if ($create) {
        emarking_add_user_attempt($cm, $user);
    } else {
        // For each attempt insert the answers or finish
        foreach ($attempts as $attempt) {
            if ($finish) {
                emarking_finish_user_attempt($attempt->id);
            }
        }
    }
    $cur++;
}
$pbar->update_full(100, get_string('finished', 'mod_emarking'));
echo $OUTPUT->single_button(new moodle_url('/mod/emarking/orm/quizzes.php', array('course' => $cm->course)), get_string('continue'));
echo $OUTPUT->footer();
开发者ID:hansnok,项目名称:emarking,代码行数:31,代码来源:processomr.php

示例4: emarking_create_quiz_pdf

/**
 * Crea un archivo PDF a partir de un quiz, agregando una hoja de respuestas de opción múltiple
 * 
 * @param unknown $cm
 * @param string $debug
 * @param string $context
 * @param string $course
 * @param string $logofilepath
 * @param boolean $answersheetsonly
 * @return void|NULL
 */
function emarking_create_quiz_pdf($cm, $debug = false, $context = null, $course = null, $answersheetsonly = false, $pbar = false)
{
    global $DB, $CFG, $OUTPUT;
    // Inclusión de librerías
    require_once $CFG->dirroot . '/mod/assign/feedback/editpdf/fpdi/fpdi2tcpdf_bridge.php';
    require_once $CFG->dirroot . '/mod/assign/feedback/editpdf/fpdi/fpdi.php';
    require_once $CFG->libdir . '/pdflib.php';
    require_once $CFG->dirroot . '/mod/quiz/locallib.php';
    require_once $CFG->dirroot . '/mod/emarking/print/locallib.php';
    $filedir = $CFG->dataroot . "/temp/emarking/{$context->id}";
    emarking_initialize_directory($filedir, true);
    $fileimg = $CFG->dataroot . "/temp/emarking/{$context->id}/qr";
    emarking_initialize_directory($fileimg, true);
    $userimgdir = $CFG->dataroot . "/temp/emarking/{$context->id}/u";
    emarking_initialize_directory($userimgdir, true);
    $logofile = emarking_get_logo_file();
    $logofilepath = $logofile ? emarking_get_path_from_hash($filedir, $logofile->get_pathnamehash()) : null;
    $fullhtml = array();
    $numanswers = array();
    $attemptids = array();
    $images = array();
    $imageshtml = array();
    $users = emarking_get_enroled_students($course->id);
    if ($pbar) {
        echo $OUTPUT->heading(get_string('loadingquestions', 'mod_emarking'), 3);
        $progressbar = new progress_bar();
        $progressbar->create();
        $progressbar->update(0, count($users), get_string('processing', 'mod_emarking'));
    }
    $current = 0;
    foreach ($users as $user) {
        $current++;
        if ($pbar) {
            $progressbar->update($current, count($users), "{$user->firstname}, {$user->lastname}");
        }
        // Get the quiz object
        $quizobj = quiz::create($cm->instance, $user->id);
        // Create the new attempt and initialize the question sessions
        $attemptnumber = 1;
        $lastattempt = null;
        $timenow = time();
        // Update time now, in case the server is running really slowly.
        $attempts = quiz_get_user_attempts($quizobj->get_quizid(), $user->id, 'all');
        $numattempts = count($attempts);
        foreach ($attempts as $attempt) {
            $attemptobj = quiz_attempt::create($attempt->id);
            $slots = $attemptobj->get_slots();
            foreach ($slots as $slot) {
                $qattempt = $attemptobj->get_question_attempt($slot);
                $question = $qattempt->get_question();
                if ($question->get_type_name() === 'multianswer') {
                    $q = $question->subquestions[1];
                    $numanswers[$user->id][] = count($q->answers);
                } else {
                    if ($question->get_type_name() === 'multichoice') {
                        $numanswers[$user->id][] = count($question->answers);
                    }
                }
                $attemptids[$user->id] = $attempt->id;
                $qhtml = $attemptobj->render_question($slot, false);
                $qhtml = emarking_clean_question_html($qhtml);
                $currentimages = emarking_extract_images_url($qhtml);
                $idx = 0;
                foreach ($currentimages[1] as $imageurl) {
                    if (!array_search($imageurl, $images)) {
                        $images[] = $imageurl;
                        $imageshtml[] = $currentimages[0][$idx];
                    }
                    $idx++;
                }
                $fullhtml[$user->id][] = $qhtml;
            }
            // One attempt per user
            break;
        }
    }
    $save_to = $CFG->tempdir . '/emarking/printquiz/' . $cm->id . '/';
    emarking_initialize_directory($save_to, true);
    // Bajar las imágenes del HTML a dibujar
    $search = array();
    $replace = array();
    $replaceweb = array();
    $imagesize = array();
    $idx = 0;
    if ($pbar) {
        $progressbar->update_full(100, get_string('finished', 'mod_emarking'));
        echo $OUTPUT->heading(get_string('downloadingimages', 'mod_emarking'), 3);
        $progressbar = new progress_bar();
        $progressbar->create();
//.........这里部分代码省略.........
开发者ID:hansnok,项目名称:emarking,代码行数:101,代码来源:locallib.php

示例5: array

$context = context_course::instance($course->id);
require_capability('moodle/course:update', $context);
require_capability('moodle/course:manageactivities', $context);
require_sesskey();
$course = course_get_format($course)->get_course();
$modinfo = get_fast_modinfo($course);
$sectioninfo = $modinfo->get_section_info($section);
$context = context_course::instance($course->id);
$num_newsection = null;
$PAGE->set_pagelayout('course');
$PAGE->set_heading($course->fullname);
$PAGE->set_title(get_string('coursetitle', 'moodle', array('course' => $course->fullname)));
echo $OUTPUT->header();
if (!empty($sectioninfo)) {
    $pbar = new progress_bar('onetopic_duplicate_bar', 500, true);
    $pbar->update_full(1, get_string('duplicating', 'format_onetopic'));
    $course_format = course_get_format($course);
    $last_section_num = $DB->get_field('course_sections', 'MAX(section)', array('course' => $courseid), MUST_EXIST);
    //$courseformatoptions = $course_format->get_format_options();
    //$courseformatoptions['numsections']++;
    $num_newsection = $last_section_num + 1;
    if (!$course_format->update_course_format_options(array('numsections' => $num_newsection))) {
        print_error('cantcreatesection', 'error', null, $course->fullname);
        return;
    }
    $pbar->update_full(5, get_string('creating_section', 'format_onetopic'));
    //Assign same section info
    $data = new stdClass();
    $data->course = $sectioninfo->course;
    $data->section = $num_newsection;
    //The name is not duplicated
开发者ID:dibarbado,项目名称:moodle,代码行数:31,代码来源:duplicate.php


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