Ejemplo n.º 1
0
    $cats = Category::load($category);
    $stud_id = api_is_allowed_to_edit() ? null : api_get_user_id();
    $allcat = $cats[0]->get_subcategories($stud_id);
    $alleval = $cats[0]->get_evaluations($stud_id);
    $alllink = $cats[0]->get_links($stud_id);
}
$addparams = array('selectcat' => $cats[0]->get_id());
if (isset($_GET['search'])) {
    $addparams['search'] = $keyword;
}
if (isset($_GET['studentoverview'])) {
    $addparams['studentoverview'] = '';
}
if (isset($allcat_info) && count($allcat_info) >= 0 && (isset($_GET['selectcat']) && $_GET['selectcat'] == 0) && isset($_GET['search']) && strlen(trim($_GET['search'])) > 0) {
    $allcat = $allcat_info;
} else {
    $allcat = $allcat;
}
$gradebooktable = new GradebookTable($cats[0], $allcat, $alleval, $alllink, $addparams);
if (empty($allcat) && empty($alleval) && empty($alllink) && !$is_platform_admin && $is_course_admin && !isset($_GET['selectcat']) && api_is_course_tutor()) {
    Display::display_normal_message(get_lang('GradebookWelcomeMessage') . '<br /><br /><form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1"><input type="submit" value="' . get_lang('CreateAllCat') . '"></form>', false);
}
// Here we are in a sub category
if ($category != '0') {
    DisplayGradebook::header($cats[0], 1, $_GET['selectcat'], $is_course_admin, $is_platform_admin, $simple_search_form);
} else {
    // This is the root category
    DisplayGradebook::header($cats[0], count($allcat) == '0' && !isset($_GET['search']) ? 0 : 1, 0, $is_course_admin, $is_platform_admin, $simple_search_form);
}
$gradebooktable->display();
Display::display_footer();
Ejemplo n.º 2
0
                break;
            case 'csv':
            default:
                $export = new GradeBookResult();
                $export->exportCompleteReportCSV($printable_data);
                exit;
                break;
        }
    } else {
        api_not_allowed(true);
    }
}
$this_section = SECTION_COURSES;
if (isset($_GET['exportpdf'])) {
    $export_pdf_form->display();
} else {
    Display::display_header(get_lang('FlatView'));
}
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'false') {
    DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
    $flatviewtable->display();
} elseif (isset($_GET['selectcat']) && $_SESSION['studentview'] == 'teacherview') {
    DisplayGradebook::display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
    // Table
    $flatviewtable->display();
    //@todo load images with jquery
    echo '<div id="contentArea" style="text-align: center;" >';
    $flatviewtable->display_graph_by_resource();
    echo '</div>';
}
Display::display_footer();
    if (count($users) == 0) {
        header('Location: ' . api_get_self() . '?erroroneuser=&selecteval=' . Security::remove_XSS($_GET['selecteval']));
        exit;
    } else {
        foreach ($users as $user_id) {
            $result = new Result();
            $result->set_user_id($user_id);
            $result->set_evaluation_id($_GET['selecteval']);
            $result->add();
        }
    }
    header('Location: gradebook_view_result.php?adduser=&selecteval=' . Security::remove_XSS($_GET['selecteval']));
    exit;
} elseif ($_POST['firstLetterUser']) {
    $firstletter = $_POST['firstLetterUser'];
    if (!empty($firstletter)) {
        header('Location: ' . api_get_self() . '?firstletter=' . Security::remove_XSS($firstletter) . '&selecteval=' . Security::remove_XSS($_GET['selecteval']));
        exit;
    }
}
$interbreadcrumb[] = array('url' => Security::remove_XSS($_SESSION['gradebook_dest']), 'name' => get_lang('Gradebook'));
$interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult'));
Display::display_header(get_lang('AddUserToEval'));
if (isset($_GET['erroroneuser'])) {
    Display::display_warning_message(get_lang('AtLeastOneUser'), false);
}
DisplayGradebook::display_header_result($evaluation[0], null, 0, 0);
echo '<div class="main">';
echo $add_user_form->toHtml();
echo '</div>';
Display::display_footer();
Ejemplo n.º 4
0
    Display::display_confirmation_message(get_lang('ImportOverWriteScore') . ' ' . $_GET['importoverwritescore']);
}
if (isset($_GET['import_user_error'])) {
    $userinfo = api_get_user_info($_GET['import_user_error']);
    Display::display_warning_message(get_lang('UserInfoDoesNotMatch') . ' ' . api_get_person_name($userinfo['firstname'], $userinfo['lastname']));
}
if (isset($_GET['allresdeleted'])) {
    Display::display_confirmation_message(get_lang('AllResultDeleted'));
}
if (isset($_GET['import_score_error'])) {
    $userinfo = api_get_user_info($_GET['import_score_error']);
    Display::display_warning_message(get_lang('ScoreDoesNotMatch') . ' ' . api_get_person_name($userinfo['firstname'], $userinfo['lastname']));
}
if ($file_type == null) {
    //show the result header
    if (isset($export_result_form) && !isset($edit_res_form)) {
        echo $export_result_form->display();
        DisplayGradebook::display_header_result($eval[0], $currentcat[0]->get_id(), 1);
    } else {
        if (isset($import_result_form)) {
            echo $import_result_form->display();
        }
        if (isset($edit_res_form)) {
            echo $edit_res_form->toHtml();
        }
        DisplayGradebook::display_header_result($eval[0], $currentcat[0]->get_id(), 1);
    }
    // Letter-based scores are built from lib/results_data_generator.class.php::get_score_display()
    $resulttable->display();
    Display::display_footer();
}
Ejemplo n.º 5
0
        foreach ($newarray as $data) {
            $column = 0;
            $table->setCellContents($row, $column, $data);
            $table->updateCellAttributes($row, $column, 'align="center"');
            $column++;
            $row++;
        }
    }
    $html .= $table->toHtml();
    $pdf = new PDF();
    $pdf->content_to_pdf($html);
    exit;
}
$actions = '<div class="actions">';
if (isset($_GET['selectcat'])) {
    $interbreadcrumb[] = array('url' => 'gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']), 'name' => get_lang('FlatView'));
    $actions .= '<a href=gradebook_flatview.php?selectcat=' . Security::remove_XSS($_GET['selectcat']) . '>' . Display::return_icon('back.png', get_lang('BackTo') . ' ' . get_lang('FlatView'), '', ICON_SIZE_MEDIUM) . '</a>';
}
if (isset($_GET['selecteval'])) {
    $interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult'));
    $actions .= '<a href=gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']) . '>
	' . Display::return_icon('back.png', get_lang('BackToEvaluation'), '', ICON_SIZE_MEDIUM) . '</a>';
}
$actions .= '<a href="' . api_get_self() . '?exportpdf=&userid=' . Security::remove_XSS($_GET['userid']) . '&selectcat=' . $category[0]->get_id() . '" target="_blank">
' . Display::return_icon('pdf.png', get_lang('ExportPDF'), '', ICON_SIZE_MEDIUM) . '</a>';
$actions .= '</div>';
Display::display_header(get_lang('ResultsPerUser'));
echo $actions;
DisplayGradebook::display_header_user($_GET['userid']);
$user_table->display();
Display::display_footer();
api_block_anonymous_users();
$eval = Evaluation::load($_GET['selecteval']);
if ($eval[0]->get_category_id() < 0) {
    // if category id is negative, then the evaluation's origin is a link
    $link = LinkFactory::get_evaluation_link($eval[0]->get_id());
    $currentcat = Category::load($link->get_category_id());
} else {
    $currentcat = Category::load($eval[0]->get_category_id());
}
$interbreadcrumb[] = array('url' => $_SESSION['gradebook_dest'] . '?selectcat=' . $currentcat[0]->get_id(), 'name' => get_lang('ToolGradebook'));
if (api_is_allowed_to_edit()) {
    $interbreadcrumb[] = array('url' => 'gradebook_view_result.php?selecteval=' . Security::remove_XSS($_GET['selecteval']), 'name' => get_lang('ViewResult'));
}
$displayscore = ScoreDisplay::instance();
Display::display_header(get_lang('EvaluationStatistics'));
DisplayGradebook::display_header_result($eval[0], $currentcat[0]->get_id(), 0, 'statistics');
//Bad, Regular, Good  - User definitions
$displays = $displayscore->get_custom_score_display_settings();
if (!$displayscore->is_custom() || empty($displays)) {
    if (api_is_platform_admin() || api_is_course_admin()) {
        Display::display_error_message(get_lang('PleaseEnableScoringSystem'), false);
    }
} else {
    $allresults = Result::load(null, null, $eval[0]->get_id());
    $nr_items = array();
    foreach ($displays as $itemsdisplay) {
        $nr_items[$itemsdisplay['display']] = 0;
    }
    $resultcount = 0;
    foreach ($allresults as $result) {
        $score = $result->get_score();
Ejemplo n.º 7
0
         }
     }
 }
 $i = 0;
 $allcat = array();
 /** @var Category $cat */
 foreach ($cats as $cat) {
     $allcat = $cat->get_subcategories($stud_id, $course_code, $session_id);
     $alleval = $cat->get_evaluations($stud_id);
     $alllink = $cat->get_links($stud_id, true);
     if ($cat->get_parent_id() != 0) {
         $i++;
     } else {
         // This is the father
         // Create gradebook/add gradebook links.
         DisplayGradebook::header($cat, 0, $cat->get_id(), $is_course_admin, $is_platform_admin, $simple_search_form, false, true, $certificate);
         if (api_is_allowed_to_edit(null, true) && api_get_setting('gradebook.gradebook_enable_grade_model') == 'true') {
             //Showing the grading system
             if (!empty($grade_models[$grade_model_id])) {
                 Display::display_normal_message(get_lang('GradeModel') . ': ' . $grade_models[$grade_model_id]['name']);
             }
         }
         $exportToPdf = false;
         if ($action == 'export_table') {
             $exportToPdf = true;
         }
         $gradebooktable = new GradebookTable($cat, $allcat, $alleval, $alllink, $addparams, $exportToPdf);
         if (api_is_allowed_to_edit()) {
             $gradebooktable->td_attributes = [4 => 'class=centered'];
         } else {
             $gradebooktable->td_attributes = [3 => 'class=centered', 4 => 'class=centered', 5 => 'class=centered', 6 => 'class=centered', 7 => 'class=centered'];
Ejemplo n.º 8
0
                        $cats = Category::load(null, null, $course_code, null, null, $session_id, false);
                    } else {
                        $form_grade->display();
                    }
                }
            }
        }
        $i = 0;
        foreach ($cats as $cat) {
            $allcat = $cat->get_subcategories($stud_id, $course_code, $session_id);
            $alleval = $cat->get_evaluations($stud_id);
            $alllink = $cat->get_links($stud_id, true);
            if ($cat->get_parent_id() != 0) {
                $i++;
            } else {
                //This is the father
                //Create gradebook/add gradebook links
                DisplayGradebook::display_header_gradebook($cat, 0, $cat->get_id(), $is_course_admin, $is_platform_admin, $simple_search_form, false, true);
                if (api_is_allowed_to_edit(null, true) && api_get_setting('gradebook_enable_grade_model') == 'true') {
                    //Showing the grading system
                    if (!empty($grade_models[$grade_model_id])) {
                        Display::display_normal_message(get_lang('GradeModel') . ': ' . $grade_models[$grade_model_id]['name']);
                    }
                }
                $gradebooktable = new GradebookTable($cat, $allcat, $alleval, $alllink, $addparams);
                $gradebooktable->display();
            }
        }
    }
}
Display::display_footer();