WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

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

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.

2 participants