Merge branch '1.11.x' of github.com:chamilo/chamilo-lms into 1.11.x

pull/2487/head
jmontoyaa 8 years ago
commit 4a8870e9d0
  1. 17
      plugin/grading_electronic/generate.php

@ -99,12 +99,12 @@ try {
/** @var \Category $gradebook */
$gradebook = $cats[0];
/** @var \ExerciseLink $exerciseLink */
/** commented until we get clear understanding of how to use the dates refs BT#12404
$exerciseLink = $gradebook->get_links()[0];
$exerciseId = $exerciseLink->get_ref_id();
$exerciseInfo = ExerciseLib::get_exercise_by_id($exerciseId, $course->getId());
*/
$dateStart = new DateTime($values['range_start'].' 00:00:00', new DateTimeZone('UTC'));
$dateEnd = new DateTime($values['range_end'].' 23:59:59', new DateTimeZone('UTC'));
@ -126,6 +126,7 @@ try {
if (!$userFinishedCourse) {
continue;
}
/** commented until we get clear understanding of how to use the dates refs BT#12404
$exerciseResult = Event::get_best_exercise_results_by_user(
$exerciseId,
$course->getId(),
@ -144,18 +145,26 @@ try {
if (!$dateEnd) {
continue;
}
*/
$fieldStudent = $uFieldValue->get_values_by_handler_and_field_variable(
$student->getId(),
GradingElectronicPlugin::EXTRAFIELD_STUDENT_ID
);
$scoretotal = $gradebook->calc_score($student->getId());
$scoredisplay = ScoreDisplay::instance();
$score = $scoredisplay->display_score(
$scoretotal,
SCORE_SIMPLE
);
/** old method to get the score
$score = Category::getCurrentScore(
$student->getId(),
$gradebook,
true
);
*/
$fileData[] = sprintf(
"2 %sPASS%s %s %s",
$fieldStudent ? $fieldStudent['value'] : null,

Loading…
Cancel
Save