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


PHP quiz_report_feedback_for_grade函數代碼示例

本文整理匯總了PHP中quiz_report_feedback_for_grade函數的典型用法代碼示例。如果您正苦於以下問題:PHP quiz_report_feedback_for_grade函數的具體用法?PHP quiz_report_feedback_for_grade怎麽用?PHP quiz_report_feedback_for_grade使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: add_average_row

 /**
  * Add an average grade over the attempts of a set of users.
  * @param string $label the title ot use for this row.
  * @param array $users the users to average over.
  */
 protected function add_average_row($label, $users)
 {
     global $DB;
     list($fields, $from, $where, $params) = $this->base_sql($users);
     $record = $DB->get_record_sql("\n                SELECT AVG(quiza.sumgrades) AS grade, COUNT(quiza.sumgrades) AS numaveraged\n                  FROM {$from}\n                 WHERE {$where}", $params);
     $record->grade = quiz_rescale_grade($record->grade, $this->quiz, false);
     if ($this->is_downloading()) {
         $namekey = 'lastname';
     } else {
         $namekey = 'fullname';
     }
     $averagerow = array($namekey => $label, 'sumgrades' => $this->format_average($record), 'feedbacktext' => strip_tags(quiz_report_feedback_for_grade($record->grade, $this->quiz->id, $this->context)));
     if ($this->options->slotmarks) {
         $dm = new question_engine_data_mapper();
         $qubaids = new qubaid_join($from, 'quiza.uniqueid', $where, $params);
         $avggradebyq = $dm->load_average_marks($qubaids, array_keys($this->questions));
         $averagerow += $this->format_average_grade_for_questions($avggradebyq);
     }
     $this->add_data_keyed($averagerow);
 }
開發者ID:MoodleMetaData,項目名稱:MoodleMetaData,代碼行數:25,代碼來源:overview_table.php

示例2: build_table

 public function build_table()
 {
     global $DB;
     if ($this->rawdata) {
         $this->strtimeformat = str_replace(',', '', get_string('strftimedatetime'));
         parent::build_table();
         //end of adding data from attempts data to table / download
         //now add averages at bottom of table :
         $params = array($this->quiz->id);
         $averagesql = '
                 SELECT AVG(qg.grade) AS grade, COUNT(qg.grade) AS numaveraged
                 FROM {quiz_grades} qg
                 WHERE quiz = ?';
         $this->add_separator();
         if ($this->is_downloading()) {
             $namekey = 'lastname';
         } else {
             $namekey = 'fullname';
         }
         if ($this->groupstudents) {
             list($usql, $uparams) = $DB->get_in_or_equal($this->groupstudents);
             $record = $DB->get_record_sql($averagesql . ' AND qg.userid ' . $usql, array_merge($params, $uparams));
             $groupaveragerow = array($namekey => get_string('groupavg', 'grades'), 'sumgrades' => $this->format_average($record), 'feedbacktext' => strip_tags(quiz_report_feedback_for_grade($record->grade, $this->quiz->id, $this->context)));
             if ($this->detailedmarks && ($this->quiz->attempts == 1 || $this->qmsubselect)) {
                 $avggradebyq = $this->load_average_question_grades($this->groupstudents);
                 $groupaveragerow += $this->format_average_grade_for_questions($avggradebyq);
             }
             $this->add_data_keyed($groupaveragerow);
         }
         if ($this->students) {
             list($usql, $uparams) = $DB->get_in_or_equal($this->students);
             $record = $DB->get_record_sql($averagesql . ' AND qg.userid ' . $usql, array_merge($params, $uparams));
             $overallaveragerow = array($namekey => get_string('overallaverage', 'grades'), 'sumgrades' => $this->format_average($record), 'feedbacktext' => strip_tags(quiz_report_feedback_for_grade($record->grade, $this->quiz->id, $this->context)));
             if ($this->detailedmarks && ($this->quiz->attempts == 1 || $this->qmsubselect)) {
                 $avggradebyq = $this->load_average_question_grades($this->students);
                 $overallaveragerow += $this->format_average_grade_for_questions($avggradebyq);
             }
             $this->add_data_keyed($overallaveragerow);
         }
     }
 }
開發者ID:sebastiansanio,項目名稱:tallerdeprogramacion2fiuba,代碼行數:41,代碼來源:overview_table.php

示例3: col_feedbacktext

 function col_feedbacktext($attempt)
 {
     if ($attempt->timefinish) {
         if (!$this->is_downloading()) {
             return quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz, false), $this->quiz->id);
         } else {
             return strip_tags(quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $this->quiz, false), $this->quiz->id));
         }
     } else {
         return '-';
     }
 }
開發者ID:ajv,項目名稱:Offline-Caching,代碼行數:12,代碼來源:responses_table.php

示例4: display


//.........這裏部分代碼省略.........
                             $row[] = $gradehtml;
                         } else {
                             $row[] = $grade;
                         }
                     } else {
                         $row[] = '-';
                     }
                 }
                 if ($detailedmarks) {
                     if (empty($attempt->attempt)) {
                         foreach ($questions as $question) {
                             $row[] = '-';
                         }
                     } else {
                         foreach ($questions as $questionid => $question) {
                             $stateforqinattempt = $gradedstatesbyattempt[$attempt->attemptuniqueid][$questionid];
                             if (question_state_is_graded($stateforqinattempt)) {
                                 $grade = quiz_rescale_grade($stateforqinattempt->grade, $quiz);
                             } else {
                                 $grade = '--';
                             }
                             if (!$download) {
                                 $grade = $grade . '/' . quiz_rescale_grade($question->grade, $quiz);
                                 $row[] = link_to_popup_window('/mod/quiz/reviewquestion.php?state=' . $stateforqinattempt->id . '&number=' . $question->number, 'reviewquestion', $grade, 450, 650, $strreviewquestion, 'none', true);
                             } else {
                                 $row[] = $grade;
                             }
                         }
                     }
                 }
                 // Feedback column.
                 if ($hasfeedback) {
                     if ($attempt->timefinish) {
                         $row[] = quiz_report_feedback_for_grade(quiz_rescale_grade($attempt->sumgrades, $quiz), $quiz->id);
                     } else {
                         $row[] = '-';
                     }
                 }
                 if (!$download) {
                     $table->add_data($row);
                 } else {
                     if ($download == 'Excel' or $download == 'ODS') {
                         $colnum = 0;
                         foreach ($row as $item) {
                             $myxls->write($rownum, $colnum, $item, $format);
                             $colnum++;
                         }
                         $rownum++;
                     } else {
                         if ($download == 'CSV') {
                             $text = implode("\t", $row);
                             echo $text . " \n";
                         }
                     }
                 }
             }
             //end of adding data from attempts data to table / download
             //now add averages :
             if (!$download && $attempts) {
                 $averagesql = "SELECT AVG(qg.grade) AS grade " . "FROM {$CFG->prefix}quiz_grades qg " . "WHERE quiz=" . $quiz->id;
                 $table->add_separator();
                 if ($groupstudentslist) {
                     $groupaveragesql = $averagesql . " AND qg.userid IN ({$groupstudentslist})";
                     $groupaverage = get_record_sql($groupaveragesql);
                     $groupaveragerow = array('fullname' => get_string('groupavg', 'grades'), 'sumgrades' => round($groupaverage->grade, $quiz->decimalpoints), 'feedbacktext' => quiz_report_feedback_for_grade($groupaverage->grade, $quiz->id));
                     if ($detailedmarks && $qmsubselect) {
開發者ID:arshanam,項目名稱:Moodle-ITScholars-LMS,代碼行數:67,代碼來源:report.php

示例5: col_feedbacktext

    /**
     * Generate the display of the feedback column.
     * @param object $attempt the table row being output.
     * @return string HTML content to go inside the td.
     */
    public function col_feedbacktext($attempt) {
        if ($attempt->state != quiz_attempt::FINISHED) {
            return '-';
        }

        $feedback = quiz_report_feedback_for_grade(
                quiz_rescale_grade($attempt->sumgrades, $this->quiz, false),
                $this->quiz->id, $this->context);

        if ($this->is_downloading()) {
            $feedback = strip_tags($feedback);
        }

        return $feedback;
    }
開發者ID:Jtgadbois,項目名稱:Pedadida,代碼行數:20,代碼來源:attemptsreport_table.php


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