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


PHP Exercise::getDBPrimaryKey方法代码示例

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


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

示例1: ExtractProcess

 public static function ExtractProcess($data, $singleResult = false, $ProcessExtension = '', $ComponentExtension = '', $ExerciseExtension = '', $isResult = true)
 {
     // generates an assoc array of processes by using a defined list of
     // its attributes
     $process = DBJson::getObjectsByAttributes($data, Process::getDBPrimaryKey(), Process::getDBConvert(), $ProcessExtension);
     // generates an assoc array of components by using a defined
     // list of its attributes
     $component = DBJson::getObjectsByAttributes($data, Component::getDBPrimaryKey(), Component::getDBConvert(), $ComponentExtension);
     // generates an assoc array of exercises by using a defined
     // list of its attributes
     $exercise = DBJson::getObjectsByAttributes($data, Exercise::getDBPrimaryKey(), Exercise::getDBConvert(), $ExerciseExtension);
     $attachment = Attachment::extractAttachment($data, false, '_PRO1', '_PRO1', false);
     $workFiles = Attachment::extractAttachment($data, false, '_PRO2', '_PRO2', false);
     // concatenates the processes and the associated attachments
     $process = DBJson::concatObjectListResult($data, $process, Process::getDBPrimaryKey(), Process::getDBConvert()['A_attachment'], $attachment, Attachment::getDBPrimaryKey(), '_PRO1', $ProcessExtension);
     // concatenates the processes and the associated attachments
     $process = DBJson::concatObjectListResult($data, $process, Process::getDBPrimaryKey(), Process::getDBConvert()['A_workFiles'], $workFiles, Attachment::getDBPrimaryKey(), '_PRO2', $ProcessExtension);
     // concatenates the processes and the associated components
     $process = DBJson::concatObjectListsSingleResult($data, $process, Process::getDBPrimaryKey(), Process::getDBConvert()['E_exercise'], $exercise, Exercise::getDBPrimaryKey(), $ExerciseExtension, $ProcessExtension);
     $res = DBJson::concatObjectListsSingleResult($data, $process, Process::getDBPrimaryKey(), Process::getDBConvert()['CO_target'], $component, Component::getDBPrimaryKey(), $ComponentExtension, $ProcessExtension);
     if ($isResult) {
         // to reindex
         $res = array_values($res);
         $res = Process::decodeProcess($res, false);
         if ($singleResult == true) {
             // only one object as result
             if (count($res) > 0) {
                 $res = $res[0];
             }
         }
     }
     return $res;
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:33,代码来源:Process.php

示例2: getCourseSheets

 public function getCourseSheets($callName, $input, $params = array())
 {
     $getSheets = function ($input, $courseid, $exercise = null) {
         $getExercises = function ($input, $sheet) {
             $result = Model::isEmpty();
             $result['content'] = array();
             $data = array();
             foreach ($input as $inp) {
                 if ($inp->getNumRows() > 0) {
                     // extract Course data from db answer
                     $result['content'] = Exercise::ExtractExercise($inp->getResponse(), false, '', '', '', '', false);
                     $data = array_merge($data, $inp->getResponse());
                     $result['status'] = 200;
                 }
             }
             $result['content'] = DBJson::concatResultObjectLists($data, $sheet, ExerciseSheet::getDBPrimaryKey(), ExerciseSheet::getDBConvert()['ES_exercises'], $result['content'], Exercise::getDBPrimaryKey());
             $result['content'] = array_merge($result['content']);
             return self::finalizeSheets($result);
         };
         $result = Model::isEmpty();
         $result['content'] = array();
         foreach ($input as $inp) {
             if ($inp->getNumRows() > 0) {
                 $result['content'] = ExerciseSheet::ExtractExerciseSheet($inp->getResponse(), false, '', '', '', $exercise !== null ? false : true);
                 $result['status'] = 200;
             }
         }
         if ($exercise === null) {
             return self::finalizeSheets($result);
         }
         return $this->_component->call('getCourseExercises', array("courseid" => $courseid), '', 200, $getExercises, array("sheet" => $result['content']), 'Model::isProblem', array(), 'Query');
     };
     $params = DBJson::mysql_real_escape_string($params);
     return $this->_component->call('getCourseSheets', $params, '', 200, $getSheets, $params, 'Model::isProblem', array(), 'Query');
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:35,代码来源:DBExerciseSheet.php

示例3: ExtractExercise

 public static function ExtractExercise($data, $singleResult = false, $ExerciseExtension = '', $AttachmentExtension = '', $SubmissionExtension = '', $FileTypeExtension = '', $isResult = true)
 {
     // generates an assoc array of an exercise by using a defined
     // list of its attributes
     $exercise = DBJson::getObjectsByAttributes($data, Exercise::getDBPrimaryKey(), Exercise::getDBConvert(), $ExerciseExtension);
     // generates an assoc array of files by using a defined
     // list of its attributes
     $attachments = DBJson::getObjectsByAttributes($data, File::getDBPrimaryKey(), File::getDBConvert(), $AttachmentExtension);
     // generates an assoc array of submissions by using a defined
     // list of its attributes
     $submissions = DBJson::getObjectsByAttributes($data, Submission::getDBPrimaryKey(), Submission::getDBConvert(), $SubmissionExtension . '2');
     // generates an assoc array of exercise file types by using a defined
     // list of its attributes
     $fileTypes = DBJson::getObjectsByAttributes($data, ExerciseFileType::getDBPrimaryKey(), ExerciseFileType::getDBConvert(), $FileTypeExtension);
     // sets the selectedForGroup attribute
     foreach ($submissions as &$submission) {
         if (isset($submission['selectedForGroup'])) {
             if (isset($submission['id']) && $submission['id'] == $submission['selectedForGroup']) {
                 $submission['selectedForGroup'] = (string) 1;
             } else {
                 unset($submission['selectedForGroup']);
             }
         }
     }
     // concatenates the exercise and the associated filetypes
     $exercise = DBJson::concatObjectListResult($data, $exercise, Exercise::getDBPrimaryKey(), Exercise::getDBConvert()['E_fileTypes'], $fileTypes, ExerciseFileType::getDBPrimaryKey(), $FileTypeExtension, $ExerciseExtension);
     // concatenates the exercise and the associated attachments
     $res = DBJson::concatObjectListResult($data, $exercise, Exercise::getDBPrimaryKey(), Exercise::getDBConvert()['E_attachments'], $attachments, File::getDBPrimaryKey(), $AttachmentExtension, $ExerciseExtension);
     // concatenates the exercise and the associated submissions
     $res = DBJson::concatObjectLists($data, $res, Exercise::getDBPrimaryKey(), Exercise::getDBConvert()['E_submissions'], $submissions, Submission::getDBPrimaryKey(), $SubmissionExtension . '2', $ExerciseExtension);
     if ($isResult) {
         // to reindex
         $res = array_values($res);
         $res = Exercise::decodeExercise($res, false);
         if ($singleResult) {
             // only one object as result
             if (count($res) > 0) {
                 $res = $res[0];
             }
         }
     }
     return $res;
 }
开发者ID:sawh,项目名称:ostepu-system,代码行数:43,代码来源:Exercise.php


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