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


PHP question_utils::arrays_same_at_key_missing_is_blank方法代码示例

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


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

示例1: test_arrays_same_at_key_missing_is_blank

 public function test_arrays_same_at_key_missing_is_blank()
 {
     $this->assertTrue(question_utils::arrays_same_at_key_missing_is_blank(array(), array(), 'key'));
     $this->assertFalse(question_utils::arrays_same_at_key_missing_is_blank(array(), array('key' => 1), 'key'));
     $this->assertFalse(question_utils::arrays_same_at_key_missing_is_blank(array('key' => 1), array(), 'key'));
     $this->assertTrue(question_utils::arrays_same_at_key_missing_is_blank(array('key' => 1), array('key' => 1), 'key'));
     $this->assertFalse(question_utils::arrays_same_at_key_missing_is_blank(array('key' => 1), array('key' => 2), 'key'));
     $this->assertTrue(question_utils::arrays_same_at_key_missing_is_blank(array('key' => 1), array('key' => '1'), 'key'));
     $this->assertFalse(question_utils::arrays_same_at_key_missing_is_blank(array('key' => '0'), array('key' => ''), 'key'));
     $this->assertTrue(question_utils::arrays_same_at_key_missing_is_blank(array(), array('key' => ''), 'key'));
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:11,代码来源:questionutils_test.php

示例2: is_same_response

 public function is_same_response(array $prevresponse, array $newresponse)
 {
     if (array_key_exists('answer', $prevresponse) && $prevresponse['answer'] !== $this->responsetemplate) {
         $value1 = (string) $prevresponse['answer'];
     } else {
         $value1 = '';
     }
     if (array_key_exists('answer', $newresponse) && $newresponse['answer'] !== $this->responsetemplate) {
         $value2 = (string) $newresponse['answer'];
     } else {
         $value2 = '';
     }
     return $value1 === $value2 && ($this->attachments == 0 || question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'attachments'));
 }
开发者ID:evltuma,项目名称:moodle,代码行数:14,代码来源:question.php

示例3: is_same_response

 public function is_same_response(array $prevresponse, array $newresponse)
 {
     if (!question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer')) {
         return false;
     }
     if ($this->has_separate_unit_field()) {
         return question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'unit');
     }
     return true;
 }
开发者ID:tyleung,项目名称:CMPUT401MoodleExams,代码行数:10,代码来源:question.php

示例4: is_same_response

 public function is_same_response(array $prevresponse, array $newresponse)
 {
     return question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer') && ($this->attachments == 0 || question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'attachments'));
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:4,代码来源:question.php

示例5: is_same_prt_input

 protected function is_same_prt_input($index, $prtinput1, $prtinput2)
 {
     foreach ($this->prts[$index]->get_required_variables(array_keys($this->inputs)) as $name) {
         if (!question_utils::arrays_same_at_key_missing_is_blank($prtinput1, $prtinput2, $name)) {
             return false;
         }
     }
     return true;
 }
开发者ID:sowirepo,项目名称:moodle-qtype_stack,代码行数:9,代码来源:question.php

示例6: is_same_response

 public function is_same_response(array $prevresponse, array $newresponse)
 {
     foreach ($this->get_parameters() as $param) {
         if (!question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer_' . $param)) {
             return false;
         }
     }
     return true;
 }
开发者ID:ndunand,项目名称:moodle-qtype_multinumerical,代码行数:9,代码来源:question.php

示例7: is_same_response

    public function is_same_response(array $prevresponse, array $newresponse) {
        if (!question_utils::arrays_same_at_key_missing_is_blank(
                $prevresponse, $newresponse, 'answer')) {
            return false;
        }

        if ($this->unitdisplay == qtype_numerical::UNITSELECT) {
            return question_utils::arrays_same_at_key_missing_is_blank(
                $prevresponse, $newresponse, 'unit');
        }

        return false;
    }
开发者ID:nottmoo,项目名称:moodle,代码行数:13,代码来源:question.php

示例8: is_same_response

 /** This function is used by the question engine to prevent regrading of
  *  unchanged submissions.
  *
  * @param array $prevresponse
  * @param array $newresponse
  * @return boolean
  */
 public function is_same_response(array $prevresponse, array $newresponse)
 {
     if (!question_utils::arrays_same_at_key_missing_is_blank($prevresponse, $newresponse, 'answer') || !question_utils::arrays_same_at_key_integer($prevresponse, $newresponse, 'rating')) {
         return false;
     }
     return true;
 }
开发者ID:pac,项目名称:CodeRunner,代码行数:14,代码来源:question.php


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