当前位置: 首页>>代码示例>>PHP>>正文


PHP jsonRPCClient::activate_survey方法代码示例

本文整理汇总了PHP中jsonRPCClient::activate_survey方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::activate_survey方法的具体用法?PHP jsonRPCClient::activate_survey怎么用?PHP jsonRPCClient::activate_survey使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jsonRPCClient的用法示例。


在下文中一共展示了jsonRPCClient::activate_survey方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: test

 /**
  * Simple procedure to test most RPC functions
  *
  */
 public function test()
 {
     $sFileToImport = dirname(Yii::app()->basePath) . DIRECTORY_SEPARATOR . 'docs' . DIRECTORY_SEPARATOR . 'demosurveys' . DIRECTORY_SEPARATOR . 'limesurvey2_sample_survey_english.lss';
     //        $sFileToImport=dirname(Yii::app()->basePath).DIRECTORY_SEPARATOR.'docs'.DIRECTORY_SEPARATOR.'demosurveys'.DIRECTORY_SEPARATOR.'survey_archive_example_feedback_survey.zip';
     Yii::app()->loadLibrary('jsonRPCClient');
     $myJSONRPCClient = new jsonRPCClient(Yii::app()->getBaseUrl(true) . '/' . dirname(Yii::app()->request->getPathInfo()));
     $sSessionKey = $myJSONRPCClient->get_session_key('admin', 'password');
     if (is_array($sSessionKey)) {
         echo $sSessionKey['status'];
         die;
     } else {
         echo 'Retrieved session key' . '<br>';
     }
     $sLSSData = base64_encode(file_get_contents($sFileToImport));
     $iSurveyID = $myJSONRPCClient->import_survey($sSessionKey, $sLSSData, 'zip', 'Test import by JSON_RPC', 1000);
     echo 'Created new survey SID:' . $iSurveyID . '<br>';
     /*
             Very simple example to export responses as Excel file
             $aResult=$myJSONRPCClient->export_reponses($sSessionKey,$iSurveyID,'xls');
             file_put_contents('d:\test.xls',base64_decode(chunk_split($aResult)));
     */
     $aResult = $myJSONRPCClient->activate_survey($sSessionKey, $iSurveyID);
     if ($aResult['status'] == 'OK') {
         echo 'Survey ' . $iSurveyID . ' successfully activated.<br>';
     }
     $aResult = $myJSONRPCClient->activate_participant_tokens($sSessionKey, $iSurveyID, array(1, 2));
     if ($aResult['status'] == 'OK') {
         echo 'Tokens for Survey ID ' . $iSurveyID . ' successfully activated.<br>';
     }
     $aResult = $myJSONRPCClient->set_survey_properties($sSessionKey, $iSurveyID, array('faxto' => '0800-LIMESURVEY'));
     if ($aResult['status'] == 'OK') {
         echo 'Modified survey settings for survey ' . $iSurveyID . '<br>';
     }
     $aResult = $myJSONRPCClient->add_survey_language($sSessionKey, $iSurveyID, 'ar');
     if ($aResult['status'] == 'OK') {
         echo 'Added Arabian as additional language' . '<br>';
     }
     $aResult = $myJSONRPCClient->set_survey_language_properties($sSessionKey, $iSurveyID, array('surveyls_welcometext' => 'An Arabian welcome text!'), 'ar');
     if ($aResult['status'] == 'OK') {
         echo 'Modified survey locale setting welcometext for Arabian in survey ID ' . $iSurveyID . '<br>';
     }
     $aResult = $myJSONRPCClient->delete_survey_language($sSessionKey, $iSurveyID, 'ar');
     if ($aResult['status'] == 'OK') {
         echo 'Removed Arabian as additional language' . '<br>';
     }
     die;
     $aResult = $myJSONRPCClient->delete_survey($sSessionKey, $iSurveyID);
     echo 'Deleted survey SID:' . $iSurveyID . '-' . $aResult['status'] . '<br>';
     // Release the session key - close the session
     $Result = $myJSONRPCClient->release_session_key($sSessionKey);
     echo 'Closed the session' . '<br>';
 }
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:56,代码来源:remotecontrol.php


注:本文中的jsonRPCClient::activate_survey方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。