• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP feedback_get_group_values函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中feedback_get_group_values函数的典型用法代码示例。如果您正苦于以下问题:PHP feedback_get_group_values函数的具体用法?PHP feedback_get_group_values怎么用?PHP feedback_get_group_values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: get_analysed

 function get_analysed($item, $groupid = false, $courseid = false)
 {
     global $DB;
     $analysed = null;
     $analysed->data = array();
     $analysed->name = $item->name;
     //$values = $DB->get_records('feedback_value', array('item'=>$item->id));
     $values = feedback_get_group_values($item, $groupid, $courseid);
     $avg = 0.0;
     $counter = 0;
     if ($values) {
         $data = array();
         foreach ($values as $value) {
             if (is_numeric($value->value)) {
                 $data[] = $value->value;
                 $avg += $value->value;
                 $counter++;
             }
         }
         $avg = $counter > 0 ? $avg / $counter : 0;
         $analysed->data = $data;
         $analysed->avg = $avg;
     }
     return $analysed;
 }
开发者ID:ajv,项目名称:Offline-Caching,代码行数:25,代码来源:lib.php


示例2: get_analysed

 function get_analysed($item, $groupid = false, $courseid = false)
 {
     $presentation = $item->presentation;
     $aVal = null;
     $aVal->data = null;
     $aVal->name = $item->name;
     //$values = get_records('feedback_value', 'item', $item->id);
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         $data = array();
         $datavalue = new object();
         foreach ($values as $value) {
             switch ($presentation) {
                 case 1:
                     $datavalue->value = $value->value;
                     $datavalue->show = UserDate($datavalue->value);
                     break;
                 case 2:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
                 case 3:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
             }
             $data[] = $datavalue;
         }
         $aVal->data = $data;
     }
     return $aVal;
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:32,代码来源:lib.php


示例3: get_analysed

 function get_analysed($item, $groupid = false, $courseid = false)
 {
     $info = $this->get_info($item);
     $analysedItem = array();
     $analysedItem[] = $item->typ;
     $analysedItem[] = $item->name;
     //die moeglichen Antworten extrahieren
     $answers = null;
     // $presentation = '';
     // @list($presentation) = explode(FEEDBACK_RADIO_ADJUST_SEP, $item->presentation); //remove the adjustment-info
     $answers = explode(FEEDBACK_MULTICHOICE_LINE_SEP, stripslashes_safe($info->presentation));
     if (!is_array($answers)) {
         return null;
     }
     //die Werte holen
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if (!$values) {
         return null;
     }
     //schleife ueber den Werten und ueber die Antwortmoeglichkeiten
     $analysedAnswer = array();
     if ($info->subtype == 'c') {
         for ($i = 1; $i <= sizeof($answers); $i++) {
             $ans = null;
             $ans->answertext = $answers[$i - 1];
             $ans->answercount = 0;
             foreach ($values as $value) {
                 //ist die Antwort gleich dem index der Antworten + 1?
                 $vallist = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $value->value);
                 foreach ($vallist as $val) {
                     if ($val == $i) {
                         $ans->answercount++;
                     }
                 }
             }
             $ans->quotient = $ans->answercount / sizeof($values);
             $analysedAnswer[] = $ans;
         }
     } else {
         for ($i = 1; $i <= sizeof($answers); $i++) {
             $ans = null;
             $ans->answertext = $answers[$i - 1];
             $ans->answercount = 0;
             foreach ($values as $value) {
                 //ist die Antwort gleich dem index der Antworten + 1?
                 if ($value->value == $i) {
                     $ans->answercount++;
                 }
             }
             $ans->quotient = $ans->answercount / sizeof($values);
             $analysedAnswer[] = $ans;
         }
     }
     $analysedItem[] = $analysedAnswer;
     return $analysedItem;
 }
开发者ID:nadavkav,项目名称:MoodleTAO,代码行数:56,代码来源:lib.php


示例4: print_analysed

 function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false)
 {
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         //echo '<table>';2
         // $itemnr++;
         echo '<tr><th colspan="2" align="left">' . $itemnr . '&nbsp;(' . $item->label . ') ' . $item->name . '</th></tr>';
         foreach ($values as $value) {
             echo '<tr><td valign="top" align="left">-&nbsp;&nbsp;</td><td align="left" valign="top">' . str_replace("\n", '<br />', $value->value) . '</td></tr>';
         }
         //echo '</table>';
     }
     // return $itemnr;
 }
开发者ID:nicolasconnault,项目名称:moodle2.0,代码行数:14,代码来源:lib.php


示例5: get_analysed

 function get_analysed($item, $groupid = false, $courseid = false)
 {
     $analysedItem = array();
     $analysedItem[] = $item->typ;
     $analysedItem[] = $item->name;
     //die moeglichen Antworten extrahieren
     $info = $this->get_info($item);
     $lines = null;
     $lines = explode(FEEDBACK_MULTICHOICERATED_LINE_SEP, stripslashes_safe($info->presentation));
     if (!is_array($lines)) {
         return null;
     }
     //die Werte holen
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if (!$values) {
         return null;
     }
     //schleife ueber den Werten und ueber die Antwortmoeglichkeiten
     $analysedAnswer = array();
     for ($i = 1; $i <= sizeof($lines); $i++) {
         $item_values = explode(FEEDBACK_MULTICHOICERATED_VALUE_SEP, $lines[$i - 1]);
         $ans = null;
         $ans->answertext = $item_values[1];
         $avg = 0.0;
         $anscount = 0;
         foreach ($values as $value) {
             //ist die Antwort gleich dem index der Antworten + 1?
             if ($value->value == $i) {
                 $avg += $item_values[0];
                 //erst alle Werte aufsummieren
                 $anscount++;
             }
         }
         $ans->answercount = $anscount;
         $ans->avg = doubleval($avg) / doubleval(sizeof($values));
         $ans->value = $item_values[0];
         $ans->quotient = $ans->answercount / sizeof($values);
         $analysedAnswer[] = $ans;
     }
     $analysedItem[] = $analysedAnswer;
     return $analysedItem;
 }
开发者ID:kai707,项目名称:ITSA-backup,代码行数:42,代码来源:lib.php


示例6: print_analysed

 public function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false)
 {
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         echo "<table class=\"analysis itemtype_{$item->typ}\">";
         echo '<tr><th colspan="2" align="left">';
         echo $itemnr . ' ';
         if (strval($item->label) !== '') {
             echo '(' . format_string($item->label) . ') ';
         }
         echo format_text($item->name, FORMAT_HTML, array('noclean' => true, 'para' => false));
         echo '</th></tr>';
         foreach ($values as $value) {
             $class = strlen(trim($value->value)) ? '' : ' class="isempty"';
             echo '<tr' . $class . '>';
             echo '<td colspan="2" class="singlevalue">';
             echo str_replace("\n", '<br />', $value->value);
             echo '</td>';
             echo '</tr>';
         }
         echo '</table>';
     }
 }
开发者ID:evltuma,项目名称:moodle,代码行数:23,代码来源:lib.php


示例7: get_analysed

 public function get_analysed($item, $groupid = false, $courseid = false)
 {
     $info = $this->get_info($item);
     $analysed_item = array();
     $analysed_item[] = $item->typ;
     $analysed_item[] = $item->name;
     //get the possible answers
     $answers = null;
     $answers = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $info->presentation);
     if (!is_array($answers)) {
         return null;
     }
     //get the values
     $values = feedback_get_group_values($item, $groupid, $courseid, $this->ignoreempty($item));
     if (!$values) {
         return null;
     }
     //get answertext, answercount and quotient for each answer
     $analysed_answer = array();
     if ($info->subtype == 'c') {
         $sizeofanswers = count($answers);
         for ($i = 1; $i <= $sizeofanswers; $i++) {
             $ans = new stdClass();
             $ans->answertext = $answers[$i - 1];
             $ans->answercount = 0;
             foreach ($values as $value) {
                 //ist die Antwort gleich dem index der Antworten + 1?
                 $vallist = explode(FEEDBACK_MULTICHOICE_LINE_SEP, $value->value);
                 foreach ($vallist as $val) {
                     if ($val == $i) {
                         $ans->answercount++;
                     }
                 }
             }
             $ans->quotient = $ans->answercount / count($values);
             $analysed_answer[] = $ans;
         }
     } else {
         $sizeofanswers = count($answers);
         for ($i = 1; $i <= $sizeofanswers; $i++) {
             $ans = new stdClass();
             $ans->answertext = $answers[$i - 1];
             $ans->answercount = 0;
             foreach ($values as $value) {
                 //ist die Antwort gleich dem index der Antworten + 1?
                 if ($value->value == $i) {
                     $ans->answercount++;
                 }
             }
             $ans->quotient = $ans->answercount / count($values);
             $analysed_answer[] = $ans;
         }
     }
     $analysed_item[] = $analysed_answer;
     return $analysed_item;
 }
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:56,代码来源:lib.php


示例8: print_analysed

 public function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false)
 {
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         echo '<tr><th colspan="2" align="left">';
         echo $itemnr . '&nbsp;(' . $item->label . ') ' . $item->name;
         echo '</th></tr>';
         foreach ($values as $value) {
             echo '<tr>';
             echo '<td colspan="2" valign="top" align="left">';
             echo '-&nbsp;&nbsp;';
             echo str_replace("\n", '<br />', $value->value);
             echo '</td>';
             echo '</tr>';
         }
     }
 }
开发者ID:rushi963,项目名称:moodle,代码行数:17,代码来源:lib.php


示例9: get_analysed

 public function get_analysed($item, $groupid = false, $courseid = false)
 {
     $presentation = $item->presentation;
     $analysed_val = new stdClass();
     $analysed_val->data = null;
     $analysed_val->name = $item->name;
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         $data = array();
         foreach ($values as $value) {
             $datavalue = new stdClass();
             switch ($presentation) {
                 case 1:
                     $datavalue->value = $value->value;
                     $datavalue->show = userdate($datavalue->value);
                     break;
                 case 2:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
                 case 3:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
             }
             $data[] = $datavalue;
         }
         $analysed_val->data = $data;
     }
     return $analysed_val;
 }
开发者ID:pzhu2004,项目名称:moodle,代码行数:31,代码来源:lib.php


示例10: get_analysed

 public function get_analysed($item, $groupid = false, $courseid = false)
 {
     global $DB;
     $analysed = new stdClass();
     $analysed->data = array();
     $analysed->name = $item->name;
     $values = feedback_get_group_values($item, $groupid, $courseid);
     $avg = 0.0;
     $counter = 0;
     if ($values) {
         $data = array();
         foreach ($values as $value) {
             if (is_numeric($value->value)) {
                 $data[] = $value->value;
                 $avg += $value->value;
                 $counter++;
             }
         }
         $avg = $counter > 0 ? $avg / $counter : 0;
         $analysed->data = $data;
         $analysed->avg = $avg;
     }
     return $analysed;
 }
开发者ID:nmicha,项目名称:moodle,代码行数:24,代码来源:lib.php


示例11: print_analysed

 public function print_analysed($item, $itemnr = '', $groupid = false, $courseid = false)
 {
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         echo '<tr><th colspan="2" align="left">';
         echo $itemnr . ' ';
         if (strval($item->label) !== '') {
             echo '(' . format_string($item->label) . ') ';
         }
         echo $this->get_display_name($item);
         echo '</th></tr>';
         foreach ($values as $value) {
             $class = strlen(trim($value->value)) ? '' : ' class="isempty"';
             echo '<tr' . $class . '><td colspan="2" class="singlevalue">';
             echo str_replace("\n", '<br />', $value->value);
             echo '</td></tr>';
         }
     }
 }
开发者ID:IFPBMoodle,项目名称:moodle,代码行数:19,代码来源:lib.php


示例12: get_analysed

 /**
  * Helper function for collected data, both for analysis page and export to excel
  *
  * @param stdClass $item the db-object from feedback_item
  * @param int|false $groupid
  * @param int $courseid
  * @return stdClass
  */
 protected function get_analysed($item, $groupid = false, $courseid = false)
 {
     $presentation = $item->presentation;
     $analysed_val = new stdClass();
     $analysed_val->data = null;
     $analysed_val->name = $item->name;
     $values = feedback_get_group_values($item, $groupid, $courseid);
     if ($values) {
         $data = array();
         foreach ($values as $value) {
             $datavalue = new stdClass();
             switch ($presentation) {
                 case self::MODE_RESPONSETIME:
                     $datavalue->value = $value->value;
                     $datavalue->show = $value->value ? userdate($datavalue->value) : '';
                     break;
                 case self::MODE_COURSE:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
                 case self::MODE_CATEGORY:
                     $datavalue->value = $value->value;
                     $datavalue->show = $datavalue->value;
                     break;
             }
             $data[] = $datavalue;
         }
         $analysed_val->data = $data;
     }
     return $analysed_val;
 }
开发者ID:IFPBMoodle,项目名称:moodle,代码行数:39,代码来源:lib.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP feedback_get_incomplete_users函数代码示例发布时间:2022-05-15
下一篇:
PHP feedback_get_depend_candidates_for_item函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap