Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portabilis patch 19/06/2024 #165

Merged
merged 94 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
edb1917
Corrige nomeclatura do parametro série
AnaPerola May 7, 2024
9ce3e82
Cria funções para impedir buscas de registros com datas invalidas
AnaPerola May 8, 2024
7d4f15a
Criado logica para filtrar as disciplinas de turmas multiseriadas
AnaPerola May 14, 2024
0d83d21
Cria cenários de teste para nova logica implementada
AnaPerola May 14, 2024
8aa9aec
Substitui valor fixo de série por parametro
AnaPerola May 14, 2024
9a5ce07
Altera map por any para melhorar performance
AnaPerola May 14, 2024
b699ae9
Filtra vinculos de disciplinas e séries com calendario escolar
AnaPerola May 14, 2024
6b77dcd
Cria novo parametro para filtrar disciplinas por ano
AnaPerola May 15, 2024
930e4c8
Corrige utilizações do escopo enviando o novo parametro de ano
AnaPerola May 15, 2024
6891ed4
Cria método para setar valor na variavel série
AnaPerola May 15, 2024
8d43ca9
Cria método para setar valor na variavel série
AnaPerola May 16, 2024
aee3266
Ajusta tamanho de campos para melhor leitura do usuário
AnaPerola May 16, 2024
675ba78
Ajusta template responsavel por renderizar turmas series e datas de a…
AnaPerola May 16, 2024
185145a
Ajusta mensagem de alerta para melhorar leitura para o usuário
AnaPerola May 16, 2024
17d642f
Remove classe não existente e invoca classe correta no campo série
AnaPerola May 16, 2024
070e564
Altera operador logico para corrigir a logica
AnaPerola May 16, 2024
9d06713
Merge pull request #4565 from portabilis/issue-4459
AnaPerola May 20, 2024
c804ccf
Merge pull request #4568 from portabilis/issue-4464
AnaPerola May 20, 2024
3b7cf32
Cria função js para buscar séries junto com as turmas
AnaPerola May 20, 2024
edb64b5
Ajusta valor de variaveis para setar a série corretamente
AnaPerola May 20, 2024
b19874b
Cria nova rota para retornar séries e turmas dentro de um array
AnaPerola May 20, 2024
181b9f7
Adiciona mensagens de erro no caso de falha de criação de usuario por…
Dmadaschi May 20, 2024
42f9d19
Não persiste usuario caso apenas o email ou o last_name tiverem sido …
Dmadaschi May 20, 2024
f7c7184
revert
Dmadaschi May 20, 2024
7a1b6ee
Ajusta função e método para fazer listar series multiseriadas
AnaPerola May 20, 2024
8c03f2d
Cria novo campo tipo hidden para enviar o id de serie como parametro
AnaPerola May 20, 2024
52138db
Merge pull request #4570 from portabilis/issue-4504
AnaPerola May 21, 2024
7ebbdba
Ajusta ordenação antes de capturar o ultimo elemento e ajusta nome do…
AnaPerola May 21, 2024
f6f93fd
Merge pull request #4572 from portabilis/test_create_users_by_csv
Dmadaschi May 21, 2024
2a2b358
Remove loop de séries da função
AnaPerola May 22, 2024
6143baa
Ajusta template de avaliações
AnaPerola May 22, 2024
19ad986
Insere comentario e abrevia método max para melhorar legibilidade
AnaPerola May 22, 2024
6245bc4
Merge branch 'issue-4503' into staging
AnaPerola May 22, 2024
8f2961c
Merge branch 'issue-4460' into staging
AnaPerola May 22, 2024
2e7217b
Corrige erro de cache na impressão de plano de aula
Dmadaschi May 22, 2024
67d75ec
Merge branch 'issue_4511' of github.com:portabilis/i-diario-portabili…
Dmadaschi May 22, 2024
b6344dc
Chama função para verificar se tem avaliações ao carregar a pagina
AnaPerola May 23, 2024
8ad93e9
Remove codigo inutilizado na rota show
Dmadaschi May 23, 2024
ecce85e
Seleciona apenas as enturmações sem data de saida
AnaPerola May 23, 2024
efb7c22
Merge branch 'issue-4503' into staging
AnaPerola May 23, 2024
2320448
Merge branch 'staging' of github.com:portabilis/i-diario-portabilis i…
AnaPerola May 23, 2024
7b39052
Remove parametro de multi da request
AnaPerola May 23, 2024
8a70e45
Merge branch 'issue-4460' into staging
AnaPerola May 23, 2024
6f5a2b9
Remove bloco de codigo e seleciona apenas enturmações ativas na turma
AnaPerola May 24, 2024
314d8a7
Merge branch 'issue-4503' into staging
AnaPerola May 24, 2024
a34b762
Remove bloco de codigo não necessario e busca apenas matriculas por s…
AnaPerola May 24, 2024
4980556
remove o status Reclassificado do filtro e ajusta retorno do servico …
AnaPerola May 24, 2024
0421e2a
Remove condicional para receber valores nil na regra diferenciada
AnaPerola May 27, 2024
c1918e8
Merge pull request #4573 from portabilis/issue-4503
AnaPerola May 27, 2024
5270777
Merge branch 'main' into issue-4460
AnaPerola May 27, 2024
c2417ba
Merge pull request #4569 from portabilis/issue-4460
AnaPerola May 27, 2024
ae60690
Verifica se a disciplina informada está vinculada na série
AnaPerola May 27, 2024
e253b04
Insere nova regra de negocio no cenário de teste
AnaPerola May 27, 2024
654ff17
Insere dica de depreciação do rails
AnaPerola May 27, 2024
435389b
Troca o serviço de listagem de alunos de matriculas por enturmação
AnaPerola May 28, 2024
8534044
resolve cahce da tela de plano de aula por area de conhecimento
Dmadaschi May 28, 2024
4074efc
Cria vinculo de series com disciplinas nos cenários de teste
AnaPerola May 28, 2024
b8c12b3
Merge pull request #4575 from portabilis/issue-4496
AnaPerola May 28, 2024
63c09c2
Merge pull request #4576 from portabilis/issue-4533
AnaPerola May 28, 2024
8d55728
Merge pull request #4574 from portabilis/issue_4511
Dmadaschi May 29, 2024
457fe16
Ajusta forma de criar e atualizar um registro com o novo campo de et…
AnaPerola May 29, 2024
88ffec8
Cria nova coluna de etapas na tabela SchoolCalendarDisciplineGrade
AnaPerola May 29, 2024
2f97164
Ajusta hash pra não duplicar valores e criar loop infinito
AnaPerola May 29, 2024
fd64252
Ajusta método utilizado nas condicionais
AnaPerola May 29, 2024
fc16a00
Verifica se a disciplina tem vinculo com a série e etapa selecionada
AnaPerola May 29, 2024
deddaa2
Merge pull request #4577 from portabilis/issue-4537
AnaPerola May 29, 2024
358c91a
Merge branch 'main' into issue-4513
AnaPerola May 29, 2024
8384532
Ajusta e implementa valor do campo periodo escolar
AnaPerola May 31, 2024
e959bee
Cria nova logica para criar avaliacoes conceituais com base na etapa …
AnaPerola Jun 3, 2024
255e440
Cria novas traduções para aparecer no historico
AnaPerola Jun 4, 2024
b651ddd
Informa paramatro de etapa para buscar as disciplinas
AnaPerola Jun 5, 2024
e4063ed
Altera present por any? para verificar se existe nil no array
AnaPerola Jun 6, 2024
d2f536c
Melhora condicional para pegar todos os casos de steps como nil ou vazio
AnaPerola Jun 6, 2024
95b3c93
Ajusta identação
AnaPerola Jun 6, 2024
aaef4c4
Merge pull request #4578 from portabilis/issue-4513
AnaPerola Jun 7, 2024
070509b
Merge branch 'main' into issue-4576
AnaPerola Jun 7, 2024
4fdd86b
Implementa logica caso disciplina não esteja vinculado a etapa especi…
AnaPerola Jun 7, 2024
d95fe13
Merge pull request #4580 from portabilis/issue-4576
AnaPerola Jun 7, 2024
3aa01e6
Insere o método exists? para forçar o método a retornar true or false
AnaPerola Jun 7, 2024
aedf05e
Ajusta busca de disciplinas caso steps for nil
AnaPerola Jun 12, 2024
7eb8aa7
Ajusta busca de disciplinas caso steps for nil ao usar show e edit
AnaPerola Jun 12, 2024
065f9b8
Cria else no if para executar outra query quando steps for nil
AnaPerola Jun 12, 2024
fd37447
Merge pull request #4579 from portabilis/issue-4548
AnaPerola Jun 12, 2024
7a0b2ed
Aplica scope active na query para buscar apenas frequencias ativas
AnaPerola Jun 12, 2024
7544e02
Captura apenas calendarios do ano da turma e ajusta condicional
AnaPerola Jun 17, 2024
9b7d3d6
Ajusta ordenação para executar os services durante a sincronização
AnaPerola Jun 17, 2024
6822110
Merge pull request #4585 from portabilis/issue-4560
AnaPerola Jun 17, 2024
63ece52
Merge pull request #4584 from portabilis/issue-4629
AnaPerola Jun 17, 2024
e239818
Padroniza configuração do Redis no modo standalone
tiagocamargo Jun 19, 2024
4ccff97
Ajusta testes para nova estrutura do Redis
tiagocamargo Jun 19, 2024
18d9d09
Ajusta valor de variável
tiagocamargo Jun 19, 2024
36e34f1
Merge pull request #4592 from portabilis/tc-fix-redis
edersoares Jun 19, 2024
7c91c6c
Merge branch 'main' into community-patch-2024-06-19
edersoares Jun 19, 2024
e4847fe
Merge pull request #4594 from portabilis/community-patch-2024-06-19
edersoares Jun 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ name: Tests

on:
push:
branches:
branches:
- main
- tc-gh-actions
pull_request:

jobs:
default:

name: Unit and Integration
if: '! github.event.pull_request.draft'

if: "! github.event.pull_request.draft"

runs-on: ubuntu-latest

env:
Expand All @@ -28,10 +27,9 @@ jobs:
POSTGRES_DB: idiario_test
ports:
- 5432:5432
options:
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
options: --health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 3

redis:
Expand All @@ -47,10 +45,10 @@ jobs:
- name: Setup Ruby and install gems
uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6.6'
bundler: '2.4.22'
ruby-version: "2.6.6"
bundler: "2.4.22"
bundler-cache: true
env:
env:
ImageOS: ubuntu20

- name: Configure database
Expand All @@ -61,7 +59,11 @@ jobs:
echo -e "
test:
secret_key_base: `bundle exec rake secret`
redis_url: redis://localhost:6379
REDIS_URL: 'redis://localhost:6379/'
REDIS_DB_CACHE: '0'
REDIS_DB_SESSION: '1'
REDIS_DB_SIDEKIQ: '2'
REDIS_MODE: 'standalone'
" > config/secrets.yml
- name: Migrate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,60 @@
<tr class="nested-fields dynamic">
<tr class='nested-fields dynamic'>
<td>
<div class="control-group boolean optional avaliation_multiple_creator_form_avaliations_include">
<div class="controls input"><input value="0" type="hidden" name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][include]">
<label class="checkbox"><input class="boolean optional" type="checkbox" value="1" name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][include]" id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_include"><i></i></label></div>
<div class='control-group boolean optional avaliation_multiple_creator_form_avaliations_include'>
<div class='controls input'>
<input value='0' type='hidden'
name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][include]"/>
<label class='checkbox'>
<input class='boolean optional' type='checkbox'
value='1' name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][include]"
id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_include"/>
<i></i>
</label>
</div>
</div>
<div class='control-group hidden avaliation_multiple_creator_form_avaliations_classroom_id'>
<div class='controls input'>
<input class='hidden' type='hidden'
value="<%= classroom_id %>"
name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][classroom_id]"
id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_classroom_id"/>
</div>
</div>
<div class="control-group hidden avaliation_multiple_creator_form_avaliations_classroom_id">
<div class="controls input"><input class="hidden" type="hidden" value="<%= classroom_id %>" name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][classroom_id]" id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_classroom_id"></div>
<div class='control-group select2 required avaliation_multiple_creator_form_avaliations_grade_ids'>
<div class='controls input'>
<input value='<%= grade_ids %>'
class='select2 required' tabindex="-1" type='hidden'
name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][grade_ids]"
id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_grade_ids" />
</div>
</div>
</td>
<td>
<div class="control-group string required disabled">
<div class="controls input">
<input class="form-control string disabled" disabled="disabled" type="text" value="<%= classroom_name %>" />
<div class='control-group string required disabled'>
<div class='controls input'>
<input class='form-control string disabled' disabled='disabled' type='text'
value="<%= classroom_name %>" style="width: 400px;"/>
</div>
</div>
</td>
<td>
<div class="control-group select2 required avaliation_multiple_creator_form_avaliations_classes">
<div class="controls input">
<input value="" data-without-json-parser="true" data-multiple="true" class="select2 required" type="hidden" style="width: 100%;" name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][classes]" id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_classes" tabindex="-1">
<div class='control-group string required disabled'>
<div class='controls input'>
<input class='select2 required'
readonly="true" value="<%= grade_name %>" style='width: 100%;'/>
</div>
</div>
</td>
<td>
<div class="control-group date required avaliation_multiple_creator_form_avaliations_test_date">
<div class="controls input">
<div class="icon-addon">
<label for="test_date" class="fa fa-calendar"></label>
<input class="string input-small form-control datepicker date required" size="10" type="text" data-mask="99/99/9999" name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][test_date]" id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_test_date"></div>
<div class='control-group date required avaliation_multiple_creator_form_avaliations_test_date'>
<div class='controls input'>
<div class='icon-addon'>
<label for='test_date' class='fa fa-calendar'></label>
<input class='string input-small form-control datepicker date required'
size='10' type='text' data-mask='99/99/9999' style='width: 250px;'
name="avaliation_multiple_creator_form[avaliations_attributes][<%= element_id %>][test_date]"
id="avaliation_multiple_creator_form_avaliations_attributes_<%= element_id %>_test_date"/>
</div>
</div>
</div>
</td>
Expand Down
22 changes: 14 additions & 8 deletions app/assets/javascripts/views/avaliations/multiple_classrooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,28 @@ $(function () {
find_by_current_year: true
};

$.getJSON(Routes.classrooms_pt_br_path(params)).always(function (data) {
if(data.length){
$.getJSON(Routes.classroom_grades_classrooms_pt_br_path(params)).always(function (data) {

var classrooms = data['classroom_grades'][0];
var grades = data['classroom_grades'][1];

if (classrooms.length) {
$("#avaliations tr td").hide();
}
$.each(data, function(i, classroom){

$.each(classrooms, function(i, classroom){
var element_id = new Date().getTime() + i;

var html = JST['templates/avaliations/avaliation_fields']({
classroom_id: classroom.id,
classroom_name: classroom.description,
element_id: element_id
});
classroom_id: classroom.id,
classroom_name: classroom.description,
grade_ids: grades.map(grade => grade.id),
grade_name: grades.map(grade => grade.description),
element_id: element_id,
});

$('#avaliations').append(html);
});
$(".avaliation_multiple_creator_form_avaliations_classes .select2").select2({ data: classes_data(), multiple: true });
$('.datepicker:not([readonly]):not([disabled])').datepicker();

$('input[data-mask]').on('focus', function () {
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/views/descriptive_exams/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,6 @@ $(function () {
$step.on('change', function () {
validateExistingExams();
})

validateExistingExams();
});
14 changes: 13 additions & 1 deletion app/assets/javascripts/views/discipline_lesson_plans/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ $(function () {
const copyFromObjectivesTeachingPlanAlert = document.getElementById(
'lesson_plan_copy_from_objectives_teaching_plan_alert'
);
const start_at = startAtInput.closest('div.control-group');
const end_at = endAtInput.closest('div.control-group');

$(".lesson_plan_attachment").on('change', onChangeFileElement);
$lesson_plan_attachment.on('change', onChangeFileElement);

function onChangeFileElement() {
// escopado para permitir arquivos menores que 3MB(3145728 bytes)
Expand Down Expand Up @@ -178,6 +180,11 @@ $(function () {

if (copyTeachingPlanLink) {
copyTeachingPlanLink.addEventListener('click', event => {
if (start_at.classList.contains('error') || end_at.classList.contains('error')){
flashMessages.error('É necessário preenchimento das datas válidas para realizar a cópia.');
return false;
}

event.preventDefault();
copyFromTeachingPlanAlert.style.display = 'none';

Expand Down Expand Up @@ -230,6 +237,11 @@ $(function () {

if (copyObjectivesTeachingPlanLink) {
copyObjectivesTeachingPlanLink.addEventListener('click', event => {
if (start_at.classList.contains('error') || end_at.classList.contains('error')){
flashMessages.error('É necessário preenchimento das datas válidas para realizar a cópia.');
return false;
}

event.preventDefault();
copyFromObjectivesTeachingPlanAlert.style.display = 'none';

Expand Down
12 changes: 12 additions & 0 deletions app/assets/javascripts/views/knowledge_area_lesson_plans/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ $(function () {
'lesson_plan_copy_from_objectives_teaching_plan_alert'
);
const flashMessages = new FlashMessages();
const start_at = startAtInput.closest('div.control-group');
const end_at = endAtInput.closest('div.control-group');

$('#knowledge_area_lesson_plan_lesson_plan_attributes_contents_tags').on('change', function (e) {
if (e.val.length) {
Expand Down Expand Up @@ -97,6 +99,11 @@ $(function () {

if (copyTeachingPlanLink) {
copyTeachingPlanLink.addEventListener('click', event => {
if (start_at.classList.contains('error') || end_at.classList.contains('error')){
flashMessages.error('É necessário preenchimento das datas válidas para realizar a cópia.');
return false;
}

event.preventDefault();
copyFromTeachingPlanAlert.style.display = 'none';

Expand Down Expand Up @@ -146,6 +153,11 @@ $(function () {

if (copyObjectivesTeachingPlanLink) {
copyObjectivesTeachingPlanLink.addEventListener('click', event => {
if (start_at.classList.contains('error') || end_at.classList.contains('error')){
flashMessages.error('É necessário preenchimento das datas válidas para realizar a cópia.');
return false;
}

event.preventDefault();
copyFromObjectivesTeachingPlanAlert.style.display = 'none';

Expand Down
27 changes: 19 additions & 8 deletions app/controllers/avaliations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ def new
return if not_allow_numerical_exam

fetch_linked_by_teacher unless current_user.current_role_is_admin_or_employee?
@grades = current_user_classroom.classrooms_grades
.by_score_type([ScoreTypes::NUMERIC, ScoreTypes::NUMERIC_AND_CONCEPT])
.map(&:grade)

grades
@avaliation = resource
@avaliation.school_calendar = current_school_calendar
@avaliation.classroom = current_user_classroom
Expand All @@ -60,6 +57,7 @@ def multiple_classrooms

fetch_linked_by_teacher unless current_user.current_role_is_admin_or_employee?

disciplines_for_multiple_classrooms
set_avaliation_multiple_creator_by_user

authorize Avaliation.new
Expand Down Expand Up @@ -104,9 +102,13 @@ def create
respond_to_save
else
@avaliation = resource
fetch_linked_by_teacher unless current_user.current_role_is_admin_or_employee?
fetch_disciplines_by_classroom

if current_user.current_role_is_admin_or_employee?
grades
else
fetch_linked_by_teacher
end
fetch_disciplines_by_classroom
test_settings

render :new
Expand Down Expand Up @@ -315,13 +317,15 @@ def respond_to_save

def disciplines_for_multiple_classrooms
if current_user.current_role_is_admin_or_employee?
return @disciplines ||= Discipline.by_unity_id(current_unity.id).by_teacher_id(current_teacher.id).ordered
return @disciplines ||= Discipline.by_unity_id(current_unity.id, current_school_year)
.by_teacher_id(current_teacher.id, current_school_year)
.ordered

end

fetch_linked_by_teacher
@disciplines
end
helper_method :disciplines_for_multiple_classrooms

def classrooms_for_multiple_classrooms
return [] if @avaliation_multiple_creator_form.discipline_id.blank?
Expand Down Expand Up @@ -471,4 +475,11 @@ def fetch_disciplines_by_classroom
@disciplines = @disciplines.by_classroom_id(classrooms.map(&:id)).not_descriptor
@grades = @classroom_grades.by_classroom_id(classrooms.map(&:id)).map(&:grade).uniq
end

def grades
@grades = current_user_classroom
.classrooms_grades
.by_score_type([ScoreTypes::NUMERIC, ScoreTypes::NUMERIC_AND_CONCEPT])
.map(&:grade)
end
end
23 changes: 19 additions & 4 deletions app/controllers/classrooms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,36 @@ def index
teacher_id = current_teacher.try(:id)
return unless teacher_id
end

if params[:find_by_current_year]
year = current_school_calendar.try(:year)
end

score_type = params[:score_type]

(params[:filter] || []).delete(:by_grade) if params.dig(:filter, :by_grade).blank?

@classrooms = apply_scopes(Classroom).ordered
if params[:include_unity]
@classrooms = @classrooms.includes(:unity)
end

@classrooms = @classrooms.includes(:unity) if params[:include_unity]
@classrooms = @classrooms.by_teacher_id(teacher_id) if teacher_id
@classrooms = @classrooms.by_score_type(ScoreTypes.value_for(score_type.upcase)) if score_type
@classrooms = @classrooms.by_year(year) if year
@classrooms = @classrooms.ordered.uniq
@classrooms = @classrooms.ordered.distinct
end

def classroom_grades
index

if @classrooms.any?
grades = @classrooms.flat_map(&:classrooms_grades).map(&:grade).uniq

render json: {
classroom_grades: [@classrooms, grades]
}
else
render json: { classroom_grades: [] }
end
end

def multi_grade
Expand Down
14 changes: 13 additions & 1 deletion app/controllers/conceptual_exams_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,19 @@ def add_missing_disciplines
def missing_disciplines
missing_disciplines = []

(@disciplines || []).each do |discipline|
grades = @classrooms.first.grades
current_step = [@conceptual_exam.step_number].to_s

disciplines_in_grade_ids = SchoolCalendarDisciplineGrade.where(
school_calendar: current_school_calendar,
grade: grades
).pluck(:discipline_id, :steps).flat_map do |discipline_id, steps|
discipline_id if steps.nil? || steps.include?([current_step].to_s)
end.compact

filter_discipline = @disciplines.select { |d| d.id.in?(disciplines_in_grade_ids) }

(filter_discipline || []).each do |discipline|
is_missing = @conceptual_exam.conceptual_exam_values.none? do |conceptual_exam_value|
conceptual_exam_value.discipline.id == discipline.id
end
Expand Down
Loading
Loading