3v4l.org

run code in 500+ PHP versions simultaneously
<?php abstract class Question { public $text; // текст вопроса public $points = 5; // число баллов, по умолчанию 5 public $hint; // подсказка abstract function checkAnswers($questions, $answers); } class ChoiceQuestion extends Question { public $options; // варианты ответа public $correctOption; // правильный вариант public function checkAnswers($questions, $answers) { // Проверим, что число ответов равно числу вопросов (защищаемся от ошибки) if (count($questions) != count($answers)) { die("Число ответов и вопросов не совпадает\n"); } $pointsTotal = 0; // сколько набрано баллов // сколько можно набрать баллов при всех правильных ответах $pointsMax = 0; // сколько отвечено верно $correctAnswers = 0; $totalQuestions = count($questions); // Сколько всего вопросов // Цикл для обхода вопросов и ответов for ($i = 0; $i < count($questions); $i++) { $question = $questions[$i]; // Текущий вопрос $answer = $answers[$i]; // текущий ответ // Считаем максимальную сумму баллов $pointsMax += $question->points; // Проверяем ответ if ($answer == $question->correctOption) { // Добавляем баллы $correctAnswers ++; $pointsTotal += $question->points; } else { // Неправильный ответ $number = $i + 1; echo "Неправильный ответ на вопрос №{$number} ({$question->text})\n"; echo "Подсказка: {$question->hint}\n"; } } // Выведем итог echo "Правильных ответов: {$correctAnswers} из {$totalQuestions}, баллов набрано: {$pointsTotal} из {$pointsMax}\n"; } } class NumericQuestion extends Question { public $correctAnswer; // правильный ответ //public $deviation; // допустимая погрешность public function checkAnswers($questions, $answers) { // Проверим, что число ответов равно числу вопросов (защищаемся от ошибки) if (count($questions) != count($answers)) { die("Число ответов и вопросов не совпадает\n"); } $pointsTotal = 0; // сколько набрано баллов // сколько можно набрать баллов при всех правильных ответах $pointsMax = 0; // сколько отвечено верно $correctAnswers = 0; $totalQuestions = count($questions); // Сколько всего вопросов // Цикл для обхода вопросов и ответов for ($i = 0; $i < count($questions); $i++) { $question = $questions[$i]; // Текущий вопрос $answer = $answers[$i]; // текущий ответ // Считаем максимальную сумму баллов $pointsMax += $question->points; // Проверяем ответ if ($answer == $question->correctAnswer) { // Добавляем баллы $correctAnswers ++; $pointsTotal += $question->points; } else { // Неправильный ответ $number = $i + 1; echo "Неправильный ответ на вопрос №{$number} ({$question->text})\n"; echo "Подсказка: {$question->hint}\n"; } } // Выведем итог echo "Правильных ответов: {$correctAnswers} из {$totalQuestions}, баллов набрано: {$pointsTotal} из {$pointsMax}\n"; } } // Функция, создающая массив с вопросами: function createQuestions() { // Создаем пустой массив $questions = []; // Вопрос 1 $q1 = new ChoiceQuestion; $q1->text = "Какая планета располагается четвертой по счету от Солнца?"; $q1->points = 10; // 10 баллов за ответ $q1->options = array('a' => 'Венера', 'b' => 'Марс', 'c' => 'Юпитер', 'd' => 'Меркурий'); // Варианты ответа $q1->correctOption = 'b'; // Правильный ответ $q1->hint = 'Сникерс'; // Подсказка $questions[] = $q1; // Вопрос 2 $q2 = new ChoiceQuestion; $q2->text = 'Какой город является столицей Великобритании?'; $q2->points = 5; $q2->options = array('a' => 'Париж', 'b' => 'Москва', 'c' => 'Нью-Йорк', 'd' => 'Лондон'); $q2->correctOption = 'd'; $q2->hint = 'London is the capital of Great Britain'; // Подсказка $questions[] = $q2; // Вопрос 3 $q3 = new ChoiceQuestion; $q3->text = 'Кто придумал теорию относительности?'; $q3->points = 30; $q3->options = array('a' => 'Джон Леннон', 'b' => 'Джим Моррисон', 'c' => 'Альберт Эйнштейн', 'd' => 'Исаак Ньютон'); $q3->correctOption = 'c'; $q3->hint = 'Какой-то еврей... Подождите... Ох, нет...'; // Подсказка $questions[] = $q3; // Вопрос 4 - с выбором цифры $q4 = new NumericQuestion; $q4->text = 'Напишите число Пи до тысячных или хотя бы сотых.'; $q4->points = 30; $q4->correctAnswer = 3.14; $q4->hint = 'Это 3,14здец какой-то...'; // Подсказка $questions[] = $q4; return $questions; } function printQuestions($questions) { $number = 1; // номер вопроса foreach ($questions as $question) { echo "\n{$number}. {$question->text}\n\n"; if (isset($question->options)) { echo "Варианты ответов:\n"; foreach ($question->options as $letter => $answer) { echo " {$letter}. {$answer}\n"; } } $number++; } } $questions = createQuestions(); $answers = array('b', 'd', 'a', 1); printQuestions($questions); $questions[0]->checkAnswers($questions, $answers);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bIDqI
function name:  (null)
number of ops:  13
compiled vars:  !0 = $questions, !1 = $answers
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  162     0  E >   INIT_FCALL                                                   'createquestions'
          1        DO_FCALL                                          0  $2      
          2        ASSIGN                                                       !0, $2
  163     3        ASSIGN                                                       !1, <array>
  164     4        INIT_FCALL                                                   'printquestions'
          5        SEND_VAR                                                     !0
          6        DO_FCALL                                          0          
  166     7        FETCH_DIM_R                                          ~6      !0, 0
          8        INIT_METHOD_CALL                                             ~6, 'checkAnswers'
          9        SEND_VAR_EX                                                  !0
         10        SEND_VAR_EX                                                  !1
         11        DO_FCALL                                          0          
         12      > RETURN                                                       1

Function createquestions:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bIDqI
function name:  createQuestions
number of ops:  61
compiled vars:  !0 = $questions, !1 = $q1, !2 = $q2, !3 = $q3, !4 = $q4
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  110     0  E >   ASSIGN                                                       !0, <array>
  112     1        NEW                                                  $6      'ChoiceQuestion'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !1, $6
  113     4        ASSIGN_OBJ                                                   !1, 'text'
          5        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%B0%D1%8F+%D0%BF%D0%BB%D0%B0%D0%BD%D0%B5%D1%82%D0%B0+%D1%80%D0%B0%D1%81%D0%BF%D0%BE%D0%BB%D0%B0%D0%B3%D0%B0%D0%B5%D1%82%D1%81%D1%8F+%D1%87%D0%B5%D1%82%D0%B2%D0%B5%D1%80%D1%82%D0%BE%D0%B9+%D0%BF%D0%BE+%D1%81%D1%87%D0%B5%D1%82%D1%83+%D0%BE%D1%82+%D0%A1%D0%BE%D0%BB%D0%BD%D1%86%D0%B0%3F'
  114     6        ASSIGN_OBJ                                                   !1, 'points'
          7        OP_DATA                                                      10
  115     8        ASSIGN_OBJ                                                   !1, 'options'
          9        OP_DATA                                                      <array>
  116    10        ASSIGN_OBJ                                                   !1, 'correctOption'
         11        OP_DATA                                                      'b'
  117    12        ASSIGN_OBJ                                                   !1, 'hint'
         13        OP_DATA                                                      '%D0%A1%D0%BD%D0%B8%D0%BA%D0%B5%D1%80%D1%81'
  118    14        ASSIGN_DIM                                                   !0
         15        OP_DATA                                                      !1
  120    16        NEW                                                  $15     'ChoiceQuestion'
         17        DO_FCALL                                          0          
         18        ASSIGN                                                       !2, $15
  121    19        ASSIGN_OBJ                                                   !2, 'text'
         20        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%BE%D0%B9+%D0%B3%D0%BE%D1%80%D0%BE%D0%B4+%D1%8F%D0%B2%D0%BB%D1%8F%D0%B5%D1%82%D1%81%D1%8F+%D1%81%D1%82%D0%BE%D0%BB%D0%B8%D1%86%D0%B5%D0%B9+%D0%92%D0%B5%D0%BB%D0%B8%D0%BA%D0%BE%D0%B1%D1%80%D0%B8%D1%82%D0%B0%D0%BD%D0%B8%D0%B8%3F'
  122    21        ASSIGN_OBJ                                                   !2, 'points'
         22        OP_DATA                                                      5
  123    23        ASSIGN_OBJ                                                   !2, 'options'
         24        OP_DATA                                                      <array>
  124    25        ASSIGN_OBJ                                                   !2, 'correctOption'
         26        OP_DATA                                                      'd'
  125    27        ASSIGN_OBJ                                                   !2, 'hint'
         28        OP_DATA                                                      'London+is+the+capital+of+Great+Britain'
  126    29        ASSIGN_DIM                                                   !0
         30        OP_DATA                                                      !2
  128    31        NEW                                                  $24     'ChoiceQuestion'
         32        DO_FCALL                                          0          
         33        ASSIGN                                                       !3, $24
  129    34        ASSIGN_OBJ                                                   !3, 'text'
         35        OP_DATA                                                      '%D0%9A%D1%82%D0%BE+%D0%BF%D1%80%D0%B8%D0%B4%D1%83%D0%BC%D0%B0%D0%BB+%D1%82%D0%B5%D0%BE%D1%80%D0%B8%D1%8E+%D0%BE%D1%82%D0%BD%D0%BE%D1%81%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D1%81%D1%82%D0%B8%3F'
  130    36        ASSIGN_OBJ                                                   !3, 'points'
         37        OP_DATA                                                      30
  131    38        ASSIGN_OBJ                                                   !3, 'options'
         39        OP_DATA                                                      <array>
  132    40        ASSIGN_OBJ                                                   !3, 'correctOption'
         41        OP_DATA                                                      'c'
  133    42        ASSIGN_OBJ                                                   !3, 'hint'
         43        OP_DATA                                                      '%D0%9A%D0%B0%D0%BA%D0%BE%D0%B9-%D1%82%D0%BE+%D0%B5%D0%B2%D1%80%D0%B5%D0%B9...+%D0%9F%D0%BE%D0%B4%D0%BE%D0%B6%D0%B4%D0%B8%D1%82%D0%B5...+%D0%9E%D1%85%2C+%D0%BD%D0%B5%D1%82...'
  134    44        ASSIGN_DIM                                                   !0
         45        OP_DATA                                                      !3
  136    46        NEW                                                  $33     'NumericQuestion'
         47        DO_FCALL                                          0          
         48        ASSIGN                                                       !4, $33
  137    49        ASSIGN_OBJ                                                   !4, 'text'
         50        OP_DATA                                                      '%D0%9D%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5+%D1%87%D0%B8%D1%81%D0%BB%D0%BE+%D0%9F%D0%B8+%D0%B4%D0%BE+%D1%82%D1%8B%D1%81%D1%8F%D1%87%D0%BD%D1%8B%D1%85+%D0%B8%D0%BB%D0%B8+%D1%85%D0%BE%D1%82%D1%8F+%D0%B1%D1%8B+%D1%81%D0%BE%D1%82%D1%8B%D1%85.'
  138    51        ASSIGN_OBJ                                                   !4, 'points'
         52        OP_DATA                                                      30
  139    53        ASSIGN_OBJ                                                   !4, 'correctAnswer'
         54        OP_DATA                                                      3.14
  140    55        ASSIGN_OBJ                                                   !4, 'hint'
         56        OP_DATA                                                      '%D0%AD%D1%82%D0%BE+3%2C14%D0%B7%D0%B4%D0%B5%D1%86+%D0%BA%D0%B0%D0%BA%D0%BE%D0%B9-%D1%82%D0%BE...'
  141    57        ASSIGN_DIM                                                   !0
         58        OP_DATA                                                      !4
  142    59      > RETURN                                                       !0
  143    60*     > RETURN                                                       null

End of function createquestions

Function printquestions:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 28
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 28
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 26
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 25
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 25
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 25
Branch analysis from position: 26
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/bIDqI
function name:  printQuestions
number of ops:  30
compiled vars:  !0 = $questions, !1 = $number, !2 = $question, !3 = $answer, !4 = $letter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
  145     0  E >   RECV                                                 !0      
  147     1        ASSIGN                                                       !1, 1
  149     2      > FE_RESET_R                                           $6      !0, ->28
          3    > > FE_FETCH_R                                                   $6, !2, ->28
  150     4    >   ROPE_INIT                                         5  ~9      '%0A'
          5        ROPE_ADD                                          1  ~9      ~9, !1
          6        ROPE_ADD                                          2  ~9      ~9, '.+'
          7        FETCH_OBJ_R                                          ~7      !2, 'text'
          8        ROPE_ADD                                          3  ~9      ~9, ~7
          9        ROPE_END                                          4  ~8      ~9, '%0A%0A'
         10        ECHO                                                         ~8
  151    11        ISSET_ISEMPTY_PROP_OBJ                                       !2, 'options'
         12      > JMPZ                                                         ~12, ->26
  152    13    >   ECHO                                                         '%D0%92%D0%B0%D1%80%D0%B8%D0%B0%D0%BD%D1%82%D1%8B+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%3A%0A'
  154    14        FETCH_OBJ_R                                          ~13     !2, 'options'
         15      > FE_RESET_R                                           $14     ~13, ->25
         16    > > FE_FETCH_R                                           ~15     $14, !3, ->25
         17    >   ASSIGN                                                       !4, ~15
  155    18        ROPE_INIT                                         5  ~18     '++'
         19        ROPE_ADD                                          1  ~18     ~18, !4
         20        ROPE_ADD                                          2  ~18     ~18, '.+'
         21        ROPE_ADD                                          3  ~18     ~18, !3
         22        ROPE_END                                          4  ~17     ~18, '%0A'
         23        ECHO                                                         ~17
  154    24      > JMP                                                          ->16
         25    >   FE_FREE                                                      $14
  158    26    >   PRE_INC                                                      !1
  149    27      > JMP                                                          ->3
         28    >   FE_FREE                                                      $6
  160    29      > RETURN                                                       null

End of function printquestions

Class Question:
Function checkanswers:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/bIDqI
function name:  checkAnswers
number of ops:  3
compiled vars:  !0 = $questions, !1 = $answers
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2      > RETURN                                                       null

End of function checkanswers

End of class Question.

Class ChoiceQuestion:
Function checkanswers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
Branch analysis from position: 16
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
Branch analysis from position: 16
filename:       /in/bIDqI
function name:  checkAnswers
number of ops:  58
compiled vars:  !0 = $questions, !1 = $answers, !2 = $pointsTotal, !3 = $pointsMax, !4 = $correctAnswers, !5 = $totalQuestions, !6 = $i, !7 = $question, !8 = $answer, !9 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   16     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   19     2        COUNT                                                ~10     !0
          3        COUNT                                                ~11     !1
          4        IS_NOT_EQUAL                                                 ~10, ~11
          5      > JMPZ                                                         ~12, ->9
   20     6    > > INIT_FCALL                                                   'exit'
          7*       SEND_VAL                                                     '%D0%A7%D0%B8%D1%81%D0%BB%D0%BE+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2+%D0%B8+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B2+%D0%BD%D0%B5+%D1%81%D0%BE%D0%B2%D0%BF%D0%B0%D0%B4%D0%B0%D0%B5%D1%82%0A'
          8*       DO_ICALL                                                     
   23     9    >   ASSIGN                                                       !2, 0
   26    10        ASSIGN                                                       !3, 0
   28    11        ASSIGN                                                       !4, 0
   30    12        COUNT                                                ~17     !0
         13        ASSIGN                                                       !5, ~17
   33    14        ASSIGN                                                       !6, 0
         15      > JMP                                                          ->44
   34    16    >   FETCH_DIM_R                                          ~20     !0, !6
         17        ASSIGN                                                       !7, ~20
   35    18        FETCH_DIM_R                                          ~22     !1, !6
         19        ASSIGN                                                       !8, ~22
   38    20        FETCH_OBJ_R                                          ~24     !7, 'points'
         21        ASSIGN_OP                                         1          !3, ~24
   41    22        FETCH_OBJ_R                                          ~26     !7, 'correctOption'
         23        IS_EQUAL                                                     !8, ~26
         24      > JMPZ                                                         ~27, ->29
   43    25    >   PRE_INC                                                      !4
   44    26        FETCH_OBJ_R                                          ~29     !7, 'points'
         27        ASSIGN_OP                                         1          !2, ~29
   41    28      > JMP                                                          ->43
   47    29    >   ADD                                                  ~31     !6, 1
         30        ASSIGN                                                       !9, ~31
   48    31        ROPE_INIT                                         5  ~35     '%D0%9D%D0%B5%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9+%D0%BE%D1%82%D0%B2%D0%B5%D1%82+%D0%BD%D0%B0+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81+%E2%84%96'
         32        ROPE_ADD                                          1  ~35     ~35, !9
         33        ROPE_ADD                                          2  ~35     ~35, '+%28'
         34        FETCH_OBJ_R                                          ~33     !7, 'text'
         35        ROPE_ADD                                          3  ~35     ~35, ~33
         36        ROPE_END                                          4  ~34     ~35, '%29%0A'
         37        ECHO                                                         ~34
   49    38        ROPE_INIT                                         3  ~40     '%D0%9F%D0%BE%D0%B4%D1%81%D0%BA%D0%B0%D0%B7%D0%BA%D0%B0%3A+'
         39        FETCH_OBJ_R                                          ~38     !7, 'hint'
         40        ROPE_ADD                                          1  ~40     ~40, ~38
         41        ROPE_END                                          2  ~39     ~40, '%0A'
         42        ECHO                                                         ~39
   33    43    >   PRE_INC                                                      !6
         44    >   COUNT                                                ~43     !0
         45        IS_SMALLER                                                   !6, ~43
         46      > JMPNZ                                                        ~44, ->16
   55    47    >   ROPE_INIT                                         9  ~46     '%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D1%85+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%3A+'
         48        ROPE_ADD                                          1  ~46     ~46, !4
         49        ROPE_ADD                                          2  ~46     ~46, '+%D0%B8%D0%B7+'
         50        ROPE_ADD                                          3  ~46     ~46, !5
         51        ROPE_ADD                                          4  ~46     ~46, '%2C+%D0%B1%D0%B0%D0%BB%D0%BB%D0%BE%D0%B2+%D0%BD%D0%B0%D0%B1%D1%80%D0%B0%D0%BD%D0%BE%3A+'
         52        ROPE_ADD                                          5  ~46     ~46, !2
         53        ROPE_ADD                                          6  ~46     ~46, '+%D0%B8%D0%B7+'
         54        ROPE_ADD                                          7  ~46     ~46, !3
         55        ROPE_END                                          8  ~45     ~46, '%0A'
         56        ECHO                                                         ~45
   56    57      > RETURN                                                       null

End of function checkanswers

End of class ChoiceQuestion.

Class NumericQuestion:
Function checkanswers:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 9
Branch analysis from position: 6
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 44
Branch analysis from position: 44
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 29
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
Branch analysis from position: 16
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 47, Position 2 = 16
Branch analysis from position: 47
Branch analysis from position: 16
filename:       /in/bIDqI
function name:  checkAnswers
number of ops:  58
compiled vars:  !0 = $questions, !1 = $answers, !2 = $pointsTotal, !3 = $pointsMax, !4 = $correctAnswers, !5 = $totalQuestions, !6 = $i, !7 = $question, !8 = $answer, !9 = $number
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   65     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
   68     2        COUNT                                                ~10     !0
          3        COUNT                                                ~11     !1
          4        IS_NOT_EQUAL                                                 ~10, ~11
          5      > JMPZ                                                         ~12, ->9
   69     6    > > INIT_FCALL                                                   'exit'
          7*       SEND_VAL                                                     '%D0%A7%D0%B8%D1%81%D0%BB%D0%BE+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2+%D0%B8+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81%D0%BE%D0%B2+%D0%BD%D0%B5+%D1%81%D0%BE%D0%B2%D0%BF%D0%B0%D0%B4%D0%B0%D0%B5%D1%82%0A'
          8*       DO_ICALL                                                     
   72     9    >   ASSIGN                                                       !2, 0
   75    10        ASSIGN                                                       !3, 0
   77    11        ASSIGN                                                       !4, 0
   79    12        COUNT                                                ~17     !0
         13        ASSIGN                                                       !5, ~17
   82    14        ASSIGN                                                       !6, 0
         15      > JMP                                                          ->44
   83    16    >   FETCH_DIM_R                                          ~20     !0, !6
         17        ASSIGN                                                       !7, ~20
   84    18        FETCH_DIM_R                                          ~22     !1, !6
         19        ASSIGN                                                       !8, ~22
   87    20        FETCH_OBJ_R                                          ~24     !7, 'points'
         21        ASSIGN_OP                                         1          !3, ~24
   90    22        FETCH_OBJ_R                                          ~26     !7, 'correctAnswer'
         23        IS_EQUAL                                                     !8, ~26
         24      > JMPZ                                                         ~27, ->29
   92    25    >   PRE_INC                                                      !4
   93    26        FETCH_OBJ_R                                          ~29     !7, 'points'
         27        ASSIGN_OP                                         1          !2, ~29
   90    28      > JMP                                                          ->43
   96    29    >   ADD                                                  ~31     !6, 1
         30        ASSIGN                                                       !9, ~31
   97    31        ROPE_INIT                                         5  ~35     '%D0%9D%D0%B5%D0%BF%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D0%B9+%D0%BE%D1%82%D0%B2%D0%B5%D1%82+%D0%BD%D0%B0+%D0%B2%D0%BE%D0%BF%D1%80%D0%BE%D1%81+%E2%84%96'
         32        ROPE_ADD                                          1  ~35     ~35, !9
         33        ROPE_ADD                                          2  ~35     ~35, '+%28'
         34        FETCH_OBJ_R                                          ~33     !7, 'text'
         35        ROPE_ADD                                          3  ~35     ~35, ~33
         36        ROPE_END                                          4  ~34     ~35, '%29%0A'
         37        ECHO                                                         ~34
   98    38        ROPE_INIT                                         3  ~40     '%D0%9F%D0%BE%D0%B4%D1%81%D0%BA%D0%B0%D0%B7%D0%BA%D0%B0%3A+'
         39        FETCH_OBJ_R                                          ~38     !7, 'hint'
         40        ROPE_ADD                                          1  ~40     ~40, ~38
         41        ROPE_END                                          2  ~39     ~40, '%0A'
         42        ECHO                                                         ~39
   82    43    >   PRE_INC                                                      !6
         44    >   COUNT                                                ~43     !0
         45        IS_SMALLER                                                   !6, ~43
         46      > JMPNZ                                                        ~44, ->16
  103    47    >   ROPE_INIT                                         9  ~46     '%D0%9F%D1%80%D0%B0%D0%B2%D0%B8%D0%BB%D1%8C%D0%BD%D1%8B%D1%85+%D0%BE%D1%82%D0%B2%D0%B5%D1%82%D0%BE%D0%B2%3A+'
         48        ROPE_ADD                                          1  ~46     ~46, !4
         49        ROPE_ADD                                          2  ~46     ~46, '+%D0%B8%D0%B7+'
         50        ROPE_ADD                                          3  ~46     ~46, !5
         51        ROPE_ADD                                          4  ~46     ~46, '%2C+%D0%B1%D0%B0%D0%BB%D0%BB%D0%BE%D0%B2+%D0%BD%D0%B0%D0%B1%D1%80%D0%B0%D0%BD%D0%BE%3A+'
         52        ROPE_ADD                                          5  ~46     ~46, !2
         53        ROPE_ADD                                          6  ~46     ~46, '+%D0%B8%D0%B7+'
         54        ROPE_ADD                                          7  ~46     ~46, !3
         55        ROPE_END                                          8  ~45     ~46, '%0A'
         56        ECHO                                                         ~45
  104    57      > RETURN                                                       null

End of function checkanswers

End of class NumericQuestion.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.41 ms | 2648 KiB | 16 Q