Exercise: Fix page of attempt results - refs BT#21045

pull/4918/head
christian 2 years ago
parent d9435bfdfa
commit 97a9365684
  1. 27
      public/main/exercise/exercise_report.php
  2. 2
      public/main/exercise/exercise_show.php
  3. 7
      public/main/inc/lib/exercise.lib.php
  4. 8
      public/main/inc/lib/pdf.lib.php

@ -18,6 +18,7 @@ require_once __DIR__.'/../inc/global.inc.php';
$this_section = SECTION_COURSES;
$htmlHeadXtra[] = api_get_asset('js-cookie/src/js.cookie.js');
$htmlHeadXtra[] = api_get_jqgrid_js();
$filter_user = isset($_REQUEST['filter_by_user']) ? (int) $_REQUEST['filter_by_user'] : null;
@ -670,11 +671,11 @@ if ($is_allowedToEdit || $is_tutor) {
// Column config
$column_model = [
['name' => 'firstname', 'index' => 'firstname', 'width' => '50', 'align' => 'left', 'search' => 'true'],
['name' => 'firstname', 'index' => 'firstname', 'width' => '150', 'align' => 'left', 'search' => 'true'],
[
'name' => 'lastname',
'index' => 'lastname',
'width' => '50',
'width' => '150',
'align' => 'left',
'formatter' => 'action_formatter',
'search' => 'true',
@ -682,7 +683,7 @@ if ($is_allowedToEdit || $is_tutor) {
[
'name' => 'login',
'index' => 'username',
'width' => '40',
'width' => '150',
'align' => 'left',
'search' => 'true',
'hidden' => ('true' === api_get_setting('exercise.exercise_attempts_report_show_username')) ? 'false' : 'true',
@ -690,7 +691,7 @@ if ($is_allowedToEdit || $is_tutor) {
[
'name' => 'group_name',
'index' => 'group_id',
'width' => '40',
'width' => '150',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
@ -702,15 +703,15 @@ if ($is_allowedToEdit || $is_tutor) {
//for the top bar
'editoptions' => ['value' => $group_parameters],
],
['name' => 'duration', 'index' => 'exe_duration', 'width' => '30', 'align' => 'left', 'search' => 'true'],
['name' => 'start_date', 'index' => 'start_date', 'width' => '60', 'align' => 'left', 'search' => 'true'],
['name' => 'exe_date', 'index' => 'exe_date', 'width' => '60', 'align' => 'left', 'search' => 'true'],
['name' => 'score', 'index' => 'score', 'width' => '50', 'align' => 'center', 'search' => 'true'],
['name' => 'ip', 'index' => 'user_ip', 'width' => '40', 'align' => 'center', 'search' => 'true'],
['name' => 'duration', 'index' => 'exe_duration', 'width' => '150', 'align' => 'left', 'search' => 'true'],
['name' => 'start_date', 'index' => 'start_date', 'width' => '150', 'align' => 'left', 'search' => 'true'],
['name' => 'exe_date', 'index' => 'exe_date', 'width' => '150', 'align' => 'left', 'search' => 'true'],
['name' => 'score', 'index' => 'score', 'width' => '100', 'align' => 'center', 'search' => 'true'],
['name' => 'ip', 'index' => 'user_ip', 'width' => '120', 'align' => 'center', 'search' => 'true'],
[
'name' => 'status',
'index' => 'revised',
'width' => '40',
'width' => '130',
'align' => 'left',
'search' => 'true',
'stype' => 'select',
@ -726,12 +727,12 @@ if ($is_allowedToEdit || $is_tutor) {
),
],
],
['name' => 'lp', 'index' => 'orig_lp_id', 'width' => '60', 'align' => 'left', 'search' => 'false'],
['name' => 'actions', 'index' => 'actions', 'width' => '60', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'],
['name' => 'lp', 'index' => 'orig_lp_id', 'width' => '150', 'align' => 'left', 'search' => 'false'],
['name' => 'actions', 'index' => 'actions', 'width' => '120', 'align' => 'left', 'search' => 'false', 'sortable' => 'false'],
];
if ('true' === $officialCodeInList) {
$officialCodeRow = ['name' => 'official_code', 'index' => 'official_code', 'width' => '50', 'align' => 'left', 'search' => 'true'];
$officialCodeRow = ['name' => 'official_code', 'index' => 'official_code', 'width' => '100', 'align' => 'left', 'search' => 'true'];
$column_model = array_merge([$officialCodeRow], $column_model);
}

@ -668,7 +668,7 @@ foreach ($questionList as $questionId) {
if ($allowRecordAudio && $allowTeacherCommentAudio) {
echo '<div class="col-sm-5">';
echo ExerciseLib::getOralFeedbackForm($id, $questionId, $student_id);
echo ExerciseLib::getOralFeedbackForm($id, $questionId, $exercise_id);
echo '</div>';
}
echo '</div>';

@ -5092,17 +5092,18 @@ EOT;
*
* @param int $attemptId
* @param int $questionId
* @param int $userId
* @param int $exerciseId
*
* @return string
*/
public static function getOralFeedbackForm($attemptId, $questionId, $userId)
public static function getOralFeedbackForm($attemptId, $questionId, $exerciseId)
{
$view = new Template('', false, false, false, false, false, false);
$view->assign('type', Asset::EXERCISE_FEEDBACK);
$view->assign('question_id', $questionId);
$view->assign('attempt', $attemptId);
$template = $view->get_template('exercise/oral_expression.tpl');
$view->assign('t_exercise_id', $exerciseId);
$template = $view->get_template('exercise/oral_expression.html.twig');
return $view->fetch($template);
}

@ -475,17 +475,17 @@ class PDF
if ($addDefaultCss) {
$basicStyles = [
api_get_bootstrap_and_font_awesome(true, true),
api_get_path(SYS_PUBLIC_PATH).'build/css/app.css',
//api_get_bootstrap_and_font_awesome(true, true),
//api_get_path(SYS_PUBLIC_PATH).'build/css/app.css',
api_get_path(SYS_PUBLIC_PATH).'build/css/themes/'.api_get_visual_theme().'/default.css',
];
foreach ($basicStyles as $style) {
$cssContent = file_get_contents($style);
$this->pdf->WriteHTML($cssContent, 1);
@$this->pdf->WriteHTML($cssContent, 1);
}
}
$this->pdf->WriteHTML($document_html);
@$this->pdf->WriteHTML($document_html);
if (empty($pdf_name)) {
$output_file = 'pdf_'.date('Y-m-d-his').'.pdf';

Loading…
Cancel
Save