Skip to content

Fix Error PreRequisitos evaluación#7196

Closed
contidos wants to merge 1 commit intochamilo:1.11.xfrom
contidos:fix/mejorresultado
Closed

Fix Error PreRequisitos evaluación#7196
contidos wants to merge 1 commit intochamilo:1.11.xfrom
contidos:fix/mejorresultado

Conversation

@contidos
Copy link

Problemática:

Un usuario entra en un ejercicio de evaluación, responde bien y aprueba.
El mismo usuario, sin finalizar el curso, repite el ejercicio y en esta ocasión suspende.
El curso no deja avanzar ya que no está tomando en cuenta el ejercicio aprobado.

El problema está en el método parse_prereq() de learnpathItem.class.php

Línea 2349-2350: Se establece $returnstatus inicial

$status = $itemToCheck->get_status(true);
$returnstatus = $status == $this->possible_status[2] || $status == $this->possible_status[3];

¿De dónde viene $status?

  • get_status() consulta la tabla c_lp_item_view
  • Lee el campo status del item
  • Este campo se actualiza con el último intento del quiz

En este caso:

Usuario hace intento 1 -> 100% -> c_lp_item_view.status = 'completed'
Usuario hace intento 2 -> 0% → c_lp_item_view.status = 'failed' (se sobrescribe)

get_status() devuelve 'failed'
$returnstatus = false ❌ (incorrecto)

Al estar a false, el método no consulta los resultados para comprobar cual es el mejor resultado, no dejando avanzar.

Esto ocurre en la línea 2370 donde tenemos este if

// 2. If is completed we check the results in the DB of the quiz.
if ($returnstatus) { ... }

Eliminado ese if se resolvería el problema

ywarnier added a commit to ywarnier/chamilo-lms that referenced this pull request Feb 24, 2026
…student takes a test multiple times and the last time is not a success - refs chamilo#7196
ywarnier added a commit to ywarnier/chamilo-lms that referenced this pull request Feb 24, 2026
ywarnier added a commit that referenced this pull request Feb 24, 2026
…student takes a test multiple times and the last time is not a success - refs #7196

Co-authored-by: @robertosuarezcinfo
@ywarnier
Copy link
Member

Integrado a través de #7575

@ywarnier ywarnier closed this Feb 24, 2026
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