unserver-unify
Version:
115 lines • 4.79 kB
HTML
<div class="mbl_survey" ng-controller="surveyDetailCtrl as ctrl">
<div class="news-v3 bg-color-white ">
<div class="news-v3-in survey_container">
<!-- <h3>
{{ ctrl.item.name }}
</h3> -->
<p style="font-size: 16px; border-bottom: solid 3px #72c02c; padding-bottom: 10px;">
{{ ctrl.item.description }}
</p>
<div ng-if="(ctrl.item.public&&!ctrl.forceResult)|| (!ctrl.resultFlag&&!ctrl.item.public)">
<h2 ng-if="ctrl.item.public" style="font-size: 15px;margin-bottom:25px;">
{{'User Name'|translate}}
<input class="item item-input" ng-model="ctrl.item.username" placeholder="Name" type="text"/>
</h2>
<div ng-repeat="q in ctrl.item.questions">
<div class="headline" ng-if="q.type=='heading'">
<h4 translate="">
{{q.content}}
</h4>
</div>
<div ng-if="q.type!='heading'">
<div class="tag-box tag-box-v2 adjust">
<div class="pull-left">
<b>
Q{{ q.index }}.
</b>
</div>
<div ng-bind-html="q.content">
</div>
</div>
</div>
<!-- SCQ -->
<table class="margin-bottom-20 survey_ans" ng-if="!q.type||q.type=='single'">
<!-- radio SCQ-->
<tr ng-repeat="opt in q.options">
<td align="center" width="30">
{{ numToLetters($index ) }}.
</td>
<td for="opt{{ $index }}">
<input id="opt{{ $index }}" ng-model="q.selection" type="radio" value="{{ opt.text }}"/>
{{ opt.text }}
</td>
</tr>
</table>
<!-- MCQ -->
<table ng-if="q.type=='multiple'">
<!-- checkbox MCQ-->
<tr ng-repeat="opt in q.options">
<td align="center" width="30">
{{ numToLetters($index ) }}.
</td>
<td for="opt{{ $index }}">
<input ng-model="opt.selection" type="checkbox" value="{{ opt.text }}"/>
{{ opt.text }}
</td>
</tr>
</table>
<!-- FILL -->
<div class="col-md-6" ng-if="q.type=='fill'">
<input class="form-control" ng-model="q.selection" style="margin-top:15px;" type="text"/>
</div>
<div class="clearfix margin-bottom-20">
</div>
</div>
<div class="clearfix">
</div>
<button class="btn btn-u" ng-click="ctrl.submit()" style="padding:5px 20px" translate="">
Submit
</button>
<button class="btn btn-info" ng-click="ctrl.showresult()" ng-if="ctrl.item.public" style="padding:5px 20px" translate="">
Result
</button>
<div class="clearfix">
</div>
</div>
<!-- result -->
<div class="survey_result" ng-if="ctrl.forceResult||(ctrl.resultFlag&&ctrl.item.result&& !ctrl.item.public)">
<!--div class="survey_result" ng-if="(ctrl.answered )"-->
<div class="row" ng-repeat="(key,val) in ctrl.summary">
<div class="col-md-12 col-xs-12 margin-bottom-30">
<h2>
Q{{ $index+1 }}. {{ key }}
</h2>
<p class="totalresult" style="margin-bottom:30px">
{{ val._total }}
<span translate="">
People Answered
</span>
</p>
<div class="col-md-4 col-xs-12">
<canvas chart-data="val.data" chart-legend="legend" chart-options="options" tc-chartjs-doughnut="">
</canvas>
</div>
<div chart-legend="legend" style="margin-top:20px; float:left;" tc-chartjs-legend="">
</div>
</div>
</div>
<div ng-if="!ctrl.summary">
<div class="alert alert-success">
<strong translate="">Success</strong> {{'Please wait for the result !'| translate}}
</div>
</div>
<div class="clearfix"></div>
</div>
<div class="survey_result" ng-if="ctrl.resultFlag&&!ctrl.item.result">
<div class="alert alert-info">
<strong translate="">Info</strong> {{'Survey result submited!'| translate}}
</div>
<div class="clearfix"></div>
</div>
<div class="clearfix">
</div>
</div>
</div>
</div>