Actualización

This commit is contained in:
Xes
2025-04-10 12:49:05 +02:00
parent 4aff98e77b
commit 1cdd00920f
9151 changed files with 1800913 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
<?php
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\TrackEExercises;
require_once __DIR__.'/../inc/global.inc.php';
api_protect_course_script(true);
if (!isset($_REQUEST['user'], $_REQUEST['exercise'], $_REQUEST['id'])) {
exit;
}
$isAllowedToEdit = api_is_allowed_to_edit(true, true);
if (!$isAllowedToEdit) {
exit;
}
$studentId = (int) $_REQUEST['user'];
$exerciseId = (int) $_REQUEST['exercise'];
$exeId = (int) $_REQUEST['id'];
/** @var TrackEExercises $trackedExercise */
$trackedExercise = ExerciseLib::recalculateResult(
$_REQUEST['id'],
$_REQUEST['user'],
$_REQUEST['exercise']
);
$totalScore = $trackedExercise->getExeResult();
$totalWeight = $trackedExercise->getExeWeighting();
echo $totalScore.'/'.$totalWeight;