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