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


PHP ilLanguage::txtlng方法代码示例

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


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

示例1: calculateResultsFromSolution

 /**
  * Calculates the question results from a previously saved question solution
  *
  * @final
  * @global ilDB $ilDB
  * @global ilObjUser $ilUser
  * @param integer $active_id Active id of the user
  * @param integer $pass Test pass
  */
 public final function calculateResultsFromSolution($active_id, $pass = NULL, $obligationsEnabled = false)
 {
     global $ilDB, $ilUser;
     if (is_null($pass)) {
         include_once "./Modules/Test/classes/class.ilObjTest.php";
         $pass = ilObjTest::_getPass($active_id);
     }
     // determine reached points for submitted solution
     $reached_points = $this->calculateReachedPoints($active_id, $pass);
     // deduct points for requested hints from reached points
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
     $questionHintTracking = new ilAssQuestionHintTracking($this->getId(), $active_id, $pass);
     $requestsStatisticData = $questionHintTracking->getRequestStatisticDataByQuestionAndTestpass();
     $reached_points = $reached_points - $requestsStatisticData->getRequestsPoints();
     // adjust reached points regarding to tests scoring options
     $reached_points = $this->adjustReachedPointsByScoringOptions($reached_points, $active_id, $pass);
     if ($obligationsEnabled && ilObjTest::isQuestionObligatory($this->getId())) {
         $isAnswered = $this->isAnswered($active_id, $pass);
     } else {
         $isAnswered = true;
     }
     if (is_null($reached_points)) {
         $reached_points = 0;
     }
     $this->getProcessLocker()->requestUserQuestionResultUpdateLock();
     $query = "\n\t\t\tDELETE FROM\t\ttst_test_result\n\t\t\t\n\t\t\tWHERE\t\t\tactive_fi = %s\n\t\t\tAND\t\t\t\tquestion_fi = %s\n\t\t\tAND\t\t\t\tpass = %s\n\t\t";
     $types = array('integer', 'integer', 'integer');
     $values = array($active_id, $this->getId(), $pass);
     if ($this->getStep() !== NULL) {
         $query .= "\n\t\t\t\tAND\t\t\t\tstep = %s\n\t\t\t";
         $types[] = 'integer';
         $values[] = $this->getStep();
     }
     $affectedRows = $ilDB->manipulateF($query, $types, $values);
     $next_id = $ilDB->nextId("tst_test_result");
     $fieldData = array('test_result_id' => array('integer', $next_id), 'active_fi' => array('integer', $active_id), 'question_fi' => array('integer', $this->getId()), 'pass' => array('integer', $pass), 'points' => array('float', $reached_points), 'tstamp' => array('integer', time()), 'hint_count' => array('integer', $requestsStatisticData->getRequestsCount()), 'hint_points' => array('float', $requestsStatisticData->getRequestsPoints()), 'answered' => array('integer', $isAnswered));
     if ($this->getStep() !== NULL) {
         $fieldData['step'] = array('integer', $this->getStep());
     }
     $ilDB->insert('tst_test_result', $fieldData);
     $this->getProcessLocker()->releaseUserQuestionResultUpdateLock();
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     if (ilObjAssessmentFolder::_enabledAssessmentLogging()) {
         $this->logAction(sprintf($this->lng->txtlng("assessment", "log_user_answered_question", ilObjAssessmentFolder::_getLogLanguage()), $reached_points), $active_id, $this->getId());
     }
     // update test pass results
     $this->_updateTestPassResults($active_id, $pass, $obligationsEnabled, $this->getProcessLocker());
     // Update objective status
     include_once 'Modules/Course/classes/class.ilCourseObjectiveResult.php';
     ilCourseObjectiveResult::_updateObjectiveResult($ilUser->getId(), $active_id, $this->getId());
 }
开发者ID:bheyser,项目名称:qplskl,代码行数:60,代码来源:class.assQuestion.php


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