Add input to hilight texts in responses

This commit is contained in:
nemunaire 2020-09-13 19:12:21 +02:00
parent c351de26ea
commit 1176c52ae7
2 changed files with 15 additions and 1 deletions

View file

@ -287,6 +287,17 @@ angular.module("AtsebaytApp")
.controller("QuestionController", function($scope, Survey, SurveyQuest, SurveyQuest, AllResponses, CorrectionTemplate, $http, $routeParams) {
$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.$promise.then(function(survey) {
survey.start_availability = Date.parse(survey.start_availability)