angular-ui-bootstrap uib-rating 星星评分,怎么统计多个题目的总分

根据uib文档 rating 实现简单的星星评分,页面上有多个rating的时候怎么统计总分呢??

clipboard.png
html部分:

 <table class="table table-striped table-bordered table-hover table-style">
                    <tr class="s-table-head">
                        <td class="modal-common-head">{{data1.module}}</td>
                        <td>得分</td>
                        <td><b>总分:{{}}/25</b></td>
                    </tr>
                    <tr ng-repeat="item in data1.options" class="s-table-body">
                        <td class="question">{{item.option}}</td>
                        <td>
                          <span uib-rating ng-model="rate" max="max" on-hover="hoveringOver(value)" on-leave="overStar = null" titles="['1分','2分','3分','4分','5分']" aria-labelledby="default-rating" ></span>
                        </td>
                        <td>{{rate}}</td>
                    </tr>
                </table>

js部分:

  $scope.rate = 0;
  $scope.max = 5;

   $scope.hoveringOver = function(value) {
         $scope.overStar = value;
         };
          $scope.data1 = {
                        module: "一般礼仪方面",
                        options: [{
                            option: "问题1",
                            score: ""
                        }, {
                            option: "问题2",
                            score: ""
                        }, {
                            option: "问题3",
                            score: ""
                        }, {
                            option: "问题4",
                            score: ""
                        }, {
                            option: "问题5",
                            score: ""
                        }]
                    };

附图:uib-rating参数说明

clipboard.png

阅读 1.9k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题