Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 869ed502dc
commit 08bd418c55
  1. 26
      main/exercise/exercise_report.php
  2. 16
      main/inc/lib/exercise.lib.php
  3. 5
      main/session/index.php

@ -36,7 +36,6 @@ $path = isset($_GET['path']) ? Security::remove_XSS($_GET['path']) : null;
$is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh() || api_is_student_boss();
$is_tutor = api_is_allowed_to_edit(true);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCISES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT_RECORDING = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
@ -256,7 +255,8 @@ if (isset($_REQUEST['comments']) &&
// Updating LP score here
if (in_array($origin, array('tracking_course', 'user_course', 'correct_exercise_in_lp'))
) {
$sql = "UPDATE $TBL_LP_ITEM_VIEW SET score = '".floatval($tot)."'
$sql = "UPDATE $TBL_LP_ITEM_VIEW
SET score = '".floatval($tot)."'
WHERE c_id = ".$course_id." AND id = ".$lp_item_view_id;
Database::query($sql);
if ($origin == 'tracking_course') {
@ -398,13 +398,13 @@ $form->addElement('radio', 'export_format', null, get_lang('ExportAsXLS'), 'xls'
$form->addElement('checkbox', 'load_extra_data', null, get_lang('LoadExtraData'), '0', array('id' => 'export_format_xls_label'));
$form->addElement('checkbox', 'include_all_users', null, get_lang('IncludeAllUsers'), '0');
$form->addElement('checkbox', 'only_best_attempts', null, get_lang('OnlyBestAttempts'), '0');
$form->setDefaults(array('export_format' => 'csv'));
$extra .= $form->return_form();
$extra .= $form->returnForm();
$extra .= '</div>';
if ($is_allowedToEdit)
if ($is_allowedToEdit) {
echo $extra;
}
echo $actions;
@ -427,9 +427,7 @@ if (!empty($group_parameters)) {
$officialCodeInList = api_get_setting('show_official_code_exercise_result_list');
if ($is_allowedToEdit || $is_tutor) {
// The order is important you need to check the the $column variable in the model.ajax.php file
$columns = array(
get_lang('FirstName'),
get_lang('LastName'),
@ -544,7 +542,16 @@ $extra_params['height'] = 'auto';
$(function() {
<?php
echo Display::grid_js('results', $url, $columns, $column_model, $extra_params, array(), $action_links, true);
echo Display::grid_js(
'results',
$url,
$columns,
$column_model,
$extra_params,
array(),
$action_links,
true
);
if ($is_allowedToEdit || $is_tutor) {
?>
@ -590,13 +597,10 @@ $extra_params['height'] = 'auto';
$('#results').on('click', 'a.exercise-recalculate', function (e) {
e.preventDefault();
if (!$(this).data('user') || !$(this).data('exercise') || !$(this).data('id')) {
return;
}
var url = '<?php echo api_get_path(WEB_CODE_PATH) ?>exercise/recalculate.php?<?php echo api_get_cidreq() ?>';
var recalculateXhr = $.post(url, $(this).data());
$.when(recalculateXhr).done(function (response) {

@ -1594,10 +1594,8 @@ HOTSPOT;
if ($is_allowedToEdit) {
//@todo fix to work with COURSE_RELATION_TYPE_RRHH in both queries
// Hack in order to filter groups
$sql_inner_join_tbl_user = '';
if (strpos($extra_where_conditions, 'group_id')) {
$sql_inner_join_tbl_user = "
(
@ -1817,7 +1815,6 @@ HOTSPOT;
$lp_list = $lp_list_obj->get_flat_list();
if (is_array($results)) {
$users_array_id = array();
$from_gradebook = false;
if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') {
@ -1849,9 +1846,7 @@ HOTSPOT;
$lp_name = null;
if ($lp_obj) {
$url = api_get_path(
WEB_CODE_PATH
) . 'lp/lp_controller.php?' . api_get_cidreq() . '&action=view&lp_id=' . $results[$i]['orig_lp_id'];
$url = api_get_path(WEB_CODE_PATH) . 'lp/lp_controller.php?' . api_get_cidreq() . '&action=view&lp_id=' . $results[$i]['orig_lp_id'];
$lp_name = Display::url(
$lp_obj['lp_name'],
$url,
@ -1874,16 +1869,11 @@ HOTSPOT;
$results[$i]['group_name'] = $group_name_list;
}
$results[$i]['exe_duration'] = !empty($results[$i]['exe_duration']) ? round(
$results[$i]['exe_duration'] / 60
) : 0;
$results[$i]['exe_duration'] = !empty($results[$i]['exe_duration']) ? round($results[$i]['exe_duration'] / 60) : 0;
$user_list_id[] = $results[$i]['exe_user_id'];
$id = $results[$i]['exe_id'];
$dt = api_convert_and_format_date(
$results[$i]['exe_weighting']
);
$dt = api_convert_and_format_date($results[$i]['exe_weighting']);
// we filter the results if we have the permission to
if (isset($results[$i]['results_disabled'])) {

@ -18,7 +18,10 @@ if (empty($_GET['session_id'])) {
$session_id = isset($_GET['session_id']) ? intval($_GET['session_id']): null;
$sessionField = new ExtraFieldValue('session');
$valueAllowVisitors = $sessionField->get_values_by_handler_and_field_variable($session_id, 'allow_visitors');
$valueAllowVisitors = $sessionField->get_values_by_handler_and_field_variable(
$session_id,
'allow_visitors'
);
$allowVisitors = $valueAllowVisitors != false;
if (!$allowVisitors) {

Loading…
Cancel
Save