Skip to content

Issue 587#607

Open
jjoaopb wants to merge 10 commits into
mainfrom
issue_587
Open

Issue 587#607
jjoaopb wants to merge 10 commits into
mainfrom
issue_587

Conversation

@jjoaopb

@jjoaopb jjoaopb commented May 11, 2026

Copy link
Copy Markdown

No description provided.

Comment thread app/controllers/concerns/shared_xls_concern.rb Fixed

@JoaoFelipe JoaoFelipe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adicionei comentários com sugestões de mudanças. A funcionalidade de upload de xlsx não funcionou pra mim e não consegui identificar o motivo.

$(document).on('as:action_success', function() {
$('.class_enrollments-sub-form').each(function() {
var subform = $(this);
if (subform.find('[course_has_grade="false"]').length>0){

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que seria melhor esconder o campo pelo helper do rails, ao invés de javascript. Tenho a impressão de que ficaria mais consistente com outras configurações semelhantes no projeto e com mais garantia de esconder em todo lugar que venha a incluir subform class_enrollment.

(mas não vejo problema manter aqui, se for complicado fazer por lá)

if (digits === '') return;
var number = parseInt(digits, 10);
var formatted = (number / 10).toFixed(1).replace('.', ',');
$(this).val(formatted);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O cursor na nota está um pouco estranho: se você começa a digitar um valor (exemplo 6,5) e percebe que errou o primeiro dígito, ao apagar o primeiro dígito (por exemplo, pra digitar 7,5), o cursor é movido para o fim (nesse exemplo, a nota fica 5,7).

Imagino que o motivo seja essa linha substituindo o valor pelo valor formatado sem considerar a posição do cursor

class_enrollment.save
end
end
flash[:info] = "Notas importadas com sucesso!"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Olhando o código, não vejo nada errado, mas a funcionalidade de upload de xlsx em turma não funcionou para mim. Aparece a mensagem dizendo que foi carregado, mas as notas não alteraram.

Além disso, poderia ser interessante ter uma tela mostrando as alterações que foram feitas com o upload. Ajudaria tanto nesse debug quanto como feedback pro professor saber que funcionou

class_enrollment = @course_class.class_enrollments.find_by(enrollment: enrollment)
if class_enrollment
class_enrollment.grade = grade
if class_enrollment.grade.to_i >= minimum_grade_for_approval

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nesse if só está considerando a nota para definir Aprovado/Reprovado, mas seria bom considerar Freq S/I para reprovação por falta também.

No caso de reprovação por falta, se a nota final > nota configurada para reprovação por falta, a nota deveria ser alterada e isso deveria ficar evidente na tela sugerida no comentário a seguir.
Se for menor ou igual, mantenha a nota digitada.

page: true,
type: :member,
parameters: { format: :xlsx }
config.action_links.add "import_grades_xls",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essa ação deveria entrar no ability para permitir que professor use a funcionalidade também. Por enquanto, só está habilitada pra admin

ns = "http://schemas.openxmlformats.org/spreadsheetml/2006/main"
xml.xpath("//xmlns:row", "xmlns" => ns).each_with_index do |row, index|
next if index == 0
enrollment_number = row.at_xpath('xmlns:c[@r[starts-with(., "B")]]//xmlns:v', "xmlns" => ns)&.text

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Será que não tem uma forma mais legível de definir quais são as colunas usadas?

display: none !important;
}
.grade-input{
text-align: right;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Não sei se o motivo é esse e é detalhe, mas o campo de Nota na tela de Inscrições ficou com o valor ligeiramente cortado:
image

Acredito que precise adicionar algum padding pra resolver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants