Note, that this recipe is not updated long time and could be outdated!
Got it.

Limesurvey aptauju sistēma

Limesurvey ir atvērtā pirmkoda aptauju sistēma. Šajā lapā ir aprakstīts, kā to uzstādīt Ubuntu serverī.

Saturs

Uzstādīšana

  1. Uzstāda nepieciešamās papildu bibliotēkas Apache serverim bibliotēkas:

    sudo apt-get install php libapache2-mod-php php-gd php-mcrypt php-mysql php-mbstring php-xml php-zip
  2. Atver MySQL konsoli

    mysql -uroot -p

    un ievada MySQL root lietotāja paroli

  3. Izveido Limesurvey datu bāzi, ievadot SQL komandas

    CREATE DATABASE limesurvey;
    GRANT ALL PRIVILEGES ON limesurvey.* TO 'limesurvey'@'localhost' IDENTIFIED BY 'limesurvey';
    FLUSH PRIVILEGES;
    1. No https://community.limesurvey.org/downloads/ lejuplādē arhīva failu, piemēram, limesurvey2.52+160920.tar.gz
    2. Atarhivē arhīvu mapē:

      sudo tar xzf limesurvey2.52+160920.tar.gz /var/www/html/
    3. Iestata failu tiesības:

      chown www-data:www-data -R /var/www/html/limesurvey
    4. Pārstartē Apache serveri:

      sudo systemctl restart apache2
    5. Atver saiti http://localhost/limesurvey/ un izpilda uzstādīšanas vedņu norādījumus.

    Saites

    Aptauju importēšana

    1. Lai importētu aptaujas, kuru eksporta dati pārsniedz 2MB, izmaina failu /etc/php/7.0/apache2/php.ini faila rindu, uz, piemēram:

      upload_max_filesize = 20M
    2. Pārstartē Apache serveri:

      sudo systemctl restart apache2

    Sesijas noildzes palielināšana

    Failā /etc/php/7.0/apache2/php.ini izmaina rindu:

    ; !!! set gc lifetime to 8 hours
    session.gc_maxlifetime = 28800
    ...
    ; !!! set cache time to 1 week
    session.cache_expire = 10080
    ...

    Jaunu aptauju izveides aizliegšana

    Failā ../limesurvey/application/controllers/survey/index.php izmaina rindas:

    ...
    if ( $this->_isClientTokenDifferentFromSessionToken($clienttoken,$surveyid) )
            {
                $sReloadUrl=$this->getController()->createUrl("/survey/index/sid/{$surveyid}",array('token'=>$clienttoken,'lang'=>App()->language,'newtest'=>'Y'));
                $asMessage = array(
                gT('Token mismatch'),
                gT('The token you provided doesn\'t match the one in your session.'),
                "Lūdzu aizveriet pārlūkprogrammu (pārliecinieties, ka ir aizvērti visi pārlūkprogrammas logi) un sāciet no jauna.");
                // !!! Don't allow to make new empty session
                //"<a class='reloadlink newsurvey' href={$sReloadUrl}>".gT("Click here to start the survey.")."</a>"
                //);
                //$this->_createNewUserSessionAndRedirect($surveyid, $redata, __LINE__, $asMessage);
                $this->_niceExit($redata, $iDebugLine, $templatename, $asMessage);
            }
    ...

    Intevijas atvēršana ar unikālu adresi

    Šī iespēja noder, lai atvērtās aptaujas varētu izsekot Apache žurnālā.

    Failā limesurvey/application/views/survey/frontpage/enterToken.php izmaina rindu:

    <?php echo CHtml::beginForm(array("/survey/index/sid/{$iSurveyId}"), 'post', array(
    ...

    uz

    <?php echo CHtml::beginForm(array("/survey/index/sid/{$iSurveyId}"), 'get', array(
    ...
    <?php if(!isset($token)): ?>
    ...
    <?php echo CHtml::hiddenField('ctime', time(), array(
    'class'=>$sKpClass,
    'id' => 'ctime',
    'data-value' => time(),
    'value' => time()));
    ?>
    ...

    Atcelt tekošo dienu kā noklusēto kalendāra laukam

    Failā .../tmp/assets/.../js/bootstrap-datetimepicker.js izmaina useCurrent: true, uz useCurrent: false,:

        /********************************************************************************
         *
         * jQuery plugin constructor and defaults object
         *
         ********************************************************************************/

        $.fn.datetimepicker = function (options) {
            return this.each(function () {
                var $this = $(this);
                if (!$this.data('DateTimePicker')) {
                    // create a private copy of the defaults object
                    options = $.extend(true, {}, $.fn.datetimepicker.defaults, options);
                    $this.data('DateTimePicker', dateTimePicker($this, options));
                }
            });
        };

        $.fn.datetimepicker.defaults = {
            timeZone: 'Etc/UTC',
            format: false,
            dayViewHeaderFormat: 'MMMM YYYY',
            extraFormats: false,
            stepping: 1,
            minDate: false,
            maxDate: false,
            useCurrent: false,
    ...

    Latviskošana


  
Tags Serveris Tīmeklis
Created by Valdis Vītoliņš on 2016-09-27 09:34
Last modified by Valdis Vītoliņš on 2021-05-09 15:40
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License