Add input to hilight texts in responses
This commit is contained in:
parent
c351de26ea
commit
1176c52ae7
@ -287,6 +287,17 @@ angular.module("AtsebaytApp")
|
|||||||
|
|
||||||
.controller("QuestionController", function($scope, Survey, SurveyQuest, SurveyQuest, AllResponses, CorrectionTemplate, $http, $routeParams) {
|
.controller("QuestionController", function($scope, Survey, SurveyQuest, SurveyQuest, AllResponses, CorrectionTemplate, $http, $routeParams) {
|
||||||
$scope.notCorrected = true
|
$scope.notCorrected = true
|
||||||
|
$scope.highlight = ''
|
||||||
|
|
||||||
|
$scope.chHilight = function () {
|
||||||
|
var words = $scope.highlight.split(',').join('|')
|
||||||
|
|
||||||
|
$('.card-text').each(function (k, i) {
|
||||||
|
var e = $(i)
|
||||||
|
e.html(e.text().replace(new RegExp('(' + words + ')', 'g'), '<span class="bg-warning">$1</span>'))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
$scope.survey = Survey.get({ surveyId: $routeParams.surveyId });
|
$scope.survey = Survey.get({ surveyId: $routeParams.surveyId });
|
||||||
$scope.survey.$promise.then(function(survey) {
|
$scope.survey.$promise.then(function(survey) {
|
||||||
survey.start_availability = Date.parse(survey.start_availability)
|
survey.start_availability = Date.parse(survey.start_availability)
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
<div class="btn-group-toggle float-right" data-toggle="buttons">
|
<div class="btn-group-toggle float-right ml-1" data-toggle="buttons">
|
||||||
<label class="btn btn-secondary active">
|
<label class="btn btn-secondary active">
|
||||||
<input type="checkbox" ng-model="notCorrected"> Pas corrigés
|
<input type="checkbox" ng-model="notCorrected"> Pas corrigés
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="float-right ml-1">
|
||||||
|
<input class="form-control" ng-model="highlight" placeholder="highlight1,highlight2,..." ng-change="chHilight()">
|
||||||
|
</div>
|
||||||
<h2>
|
<h2>
|
||||||
<span class="text-muted">{{ survey.title }}</span>
|
<span class="text-muted">{{ survey.title }}</span>
|
||||||
<small>
|
<small>
|
||||||
|
Reference in New Issue
Block a user