diff --git a/src/app/Infrastructure/InMemory/games-example.json b/src/app/Infrastructure/InMemory/games-example.json new file mode 100644 index 0000000..00dae0b --- /dev/null +++ b/src/app/Infrastructure/InMemory/games-example.json @@ -0,0 +1,534 @@ +[ + { + "id": 1, + "description": "Básico", + "author": "william@phpcomrapadura.org.br", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "questions": [ + { + "id": 5, + "text": "Com relação as funções `str_replace()`, `str_ireplace()` e `str_casereplace()`, marque a alternativa correta?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Não há diferença entre elas" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`str_ireplace` e `str_casereplace` não existem" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`str_ireplace` e `str_casereplace` são para substituir caracteres em strings com case insensitive" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`str_ireplace` é para substituir caracteres em strings com case insensitive e `str_casereplace` não existe" + } + ] + }, + { + "id": 13, + "text": "Indique o resultado da seguinte expressão: \n\n block```$var = '2015PHPinga'; echo $var == 2015 ? 'Igual' : 'Diferente';```block", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Dá erro: String to Integer convertion error" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'Igual'`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'Diferente'`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'2015PHPinga'`" + } + ] + } + ] + }, + { + "id": 2, + "description": "Avançado", + "author": "william@phpcomrapadura.org.br", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "questions": [ + { + "id": 1, + "text": "Qual das funções pode ser usada para verificar se um número é inteiro?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`int`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`is_interger`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`is_int`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`isInt`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`isInteger`" + } + ] + }, + { + "id": 12, + "text": "Indique o resultado da seguinte expressão: \n\n block```$var = '0'; echo empty($var) ? 'Vazio' : 'Tem conteúdo';```block", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Dá erro: String to Integer convertion error" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'Tem conteúdo'`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'Vazio'`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`'0'`" + } + ] + }, + { + "id": 2, + "text": "Qual método pode-se usar como construtor de uma classe?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__construct()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`contruct__()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__constructor()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`construtor__`" + } + ] + }, + { + "id": 3, + "text": "Utilizando banco de dados MySQL, qual a função para enviar uma consulta SQL ao banco de dados ativo?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`mysql_free_result()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`mysql_stmt_start()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`mysql_fetch_array()`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`mysql_query()`" + } + ] + }, + { + "id": 4, + "text": "Qual função compara duas strings de forma case insensitive?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`strcmp()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`str_cmp()`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`strcasecmp()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`stricmp()`" + } + ] + }, + { + "id": 6, + "text": "Qual é o resultado da variável `$a`, dado que: \n\n`$a = '1 gato' + '2 cachorros' == '3 mamíferos';` ?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`false`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`null`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`true`" + } + ] + }, + { + "id": 7, + "text": "Qual é o valor da variável `$a`, dado que: \n\n`$a = stristr('ElePHPant', 'p', true)`", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "PHP" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Ele" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "ElePHPant" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "php" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "PHPAnt" + } + ] + }, + { + "id": 8, + "text": "Em qual versão o PHP ganhou uma API de hashing de senhas?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "5.3" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "5.4" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "5.5" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "5.6" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "7" + } + ] + }, + { + "id": 9, + "text": "Quais são, respectivamente, os métodos mágicos chamados antes de `serialize()` e depois de `unserialize()`?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__serialize()` e `__unserialize()`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__sleep()` e `__wakeup()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__begin()` e `__end()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`__construct()` e `__destruct()`" + } + ] + }, + { + "id": 10, + "text": "O que a keyword `final` faz?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Impede que uma classe ou método seja sobrescrito" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Encerra o script PHP" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Indica o final do programa" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Nada, pois keyword 'final' não existe" + } + ] + }, + { + "id": 11, + "text": "Zivinho quer que seu sistema PHP funcione com qualquer banco de dados sem depender de funções específicas (como mysql_* para MySQL). Como ele pode fazer isso?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Não pode" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Com PDO" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Com ADODB" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Com PHP Global Databases" + } + ] + }, + { + "id": 14, + "text": "O que originalmente significava PHP antes de significar 'PHP: Hypertext Preprocessor'?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Personal Home Page" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Preprocessor for Huge Parallelization" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Packaged Hints for Programming" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Program for High Problems" + } + ] + }, + { + "id": 15, + "text": "Escolha a resposta correta", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`(1 | 2) == 1`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`(1 ^ 3) == 2`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`(2 ^ 3) == 8`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`(2 & 3) == 6`" + } + ] + }, + { + "id": 16, + "text": "Dado que `strtolower()` é usado para aplicar lower case a strings, que função é usada para first case em cada palavra (ex.: _\"First Case Em Palavras\"_)?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`strtofirst()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`firstcharupper()`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`ucwords()`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`firstcase()`" + } + ] + }, + { + "id": 17, + "text": "Qual comando para iniciar o PHP em modo interativo (REPL - Read-Eval-Print-Delete loop)?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`php --repl`" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`php -a`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`php -i`" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "`php -r`" + } + ] + }, + { + "id": 18, + "text": "Espaços após tags de fechamento (`?>`) ao final de um arquivo `*.php` costumam causar problemas em aplicações PHP. Por quê?", + "createdAt": "2024-04-05 04:14:13.951247+00", + "updatedAt": "2024-04-05 04:14:13.951247+00", + "answers": [ + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Espaços após `?>` ocasionam erros de execução" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Espaços após `?>` iniciam o envio de cabeçalhos da requisição" + }, + { + "correct": true, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Espaços após `?>` iniciam o envio do corpo da requisição" + }, + { + "correct": false, + "createdAt": "2024-04-05 04:14:13.951247+00", + "text": "Espaços após `?>` encerram o envio do corpo da requisição" + } + ] + } + ] + } +] \ No newline at end of file