A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::open($save_path, $name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 132

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 292

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 166

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 235

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 315

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: 8192

Message: Return type of CI_Session_files_driver::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Filename: drivers/Session_files_driver.php

Line Number: 356

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 282

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_cookie_params(): Session cookie parameters cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 294

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 304

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 314

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 315

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 316

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 317

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 375

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: ini_set(): Session ini settings cannot be changed after headers have already been sent

Filename: drivers/Session_files_driver.php

Line Number: 108

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent

Filename: Session/Session.php

Line Number: 110

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: session_start(): Session cannot be started after headers have already been sent

Filename: Session/Session.php

Line Number: 143

Backtrace:

File: /home/shevitza/public_html/index.php
Line: 315
Function: require_once

Angular test with three-part sentenses that can work without server
ПОЛИТИКА ЗА ПОВЕРИТЕЛНОСТ И ЗАЩИТА НА ЛИЧНИ ДАННИ

Interactive educational AngularJS test with three-part sentences without server

We can describe with several sentences the most important things in every tutorial. If after every lesson we try to write few sentences on the topic, this would help us learn the lesson better.

Demo Download GitHub

The proposed test allows to construct sentences of three parts - left, middle and right part. This test can help for better understanding and learning of every lesson.
This test is helpful for online learning eihter with video or only with texts.
For every student it is important to find the correct answers in this test. For the teacher it is important to see the wrong answers and change his way of teaching so that students can learn better.
The test is suitable for almost all topics, excluding those that require writing formulas or drawing.
This article is only "for students" and can work without server.

The solution uses two-way data binding in AngularJS.

	
  <-- The HTML pattern - left part	!-->		
  <label for="l1">
      <input type="radio" id="l1" name="leftRadios" value="Left1" ng-model="left" />
      Left1
  </label>  
  <label for="l3">
      <input type="radio" id="l3" name="leftRadios" value="Left3"  ng-model="left"/>
      Left3
  </label> 
  <label for="l4">
      <input type="radio" id="l4" name="leftRadios" value="Left4" ng-model="left"/>
      Left4
  </label>       
    
Middle and left part have a similar code. The selected values are displayed by using AngularJS $scope object in HTML code.
      {{left.value}},   {{middle.value}},   {{right.value}}
    
The result for one possible selection. There are 18 possible combination as answers in this case.

Checking for the correct answers

The next step is creating an array for correct answers and function for checking if the current selection is correct.
    var correctAnswers = ['Left1 Mid3 Right7', 'Left4 Mid4 Right8', 'Left3 Mid4 Right6'];
    $scope.checkResult = function () {
        var i;
        var checked = $scope.left + ' ' + $scope.middle + ' ' + $scope.right;
        if (correctAnswers.length === 0) {
            $scope.result = "No more sentences for guess.";
        } else {
            if (correctAnswers.indexOf(checked) === -1) {
                $scope.result = "Wrong answer!";
            } else {
                i = correctAnswers.indexOf(checked);
                correctAnswers.splice(i, 1);
                $scope.guess = $scope.guess + "-->" + checked;
                $scope.result = "Congratulations! Correct!!";
            }
        }
    }
    

Using AngularJS factory for real sentences data

It's time to create a factory and move all real data here. There is a problem: if we use a real part of sentence with several words, the radio-button value will be too long. To avoid this we can use a collection of key/value pairs with JavaScript Map() object.
        var list = new Map();
        list.set('l1', 'AngularJS ');
        list.set('l3', 'The dependency injection and  the services ');
        list.set('l4', 'The singleton pattern ');

        list.set('m4', 'use ');
        list.set('m3', 'restricts');
        list.set('m2', 'enables ');
        list.set('m1', 'comes ');

        list.set('r2', ' with a set of these directives built-in, like ngBind, ngModel, and ngClass.');
        list.set('r6', ' singleton pattern.');
        list.set('r8', ' the use of a class more than once.');
        list.set('r7', ' using HTML as template language.');     

        var answers = ['l1 m2 r7', 'l4 m3 r8', 'l3 m4 r6', 'l1 m1 r2'];
    

The final result

The teacher can give this test as folder with others files for the lessons to the students and they have already interactive lesson.
If the teacher wants to see the errors of students, it is necessary to use a server version. On this topic there will be a next post.