[svn r17082] changes in logic - I added the sight of student for teacher -see(FS#3302)

skala
Isaac Flores 16 years ago
parent 18afcec1af
commit d1ca2585c7
  1. 9
      main/gradebook/gradebook_flatview.php
  2. 5
      main/gradebook/gradebook_scoring_system.php
  3. 35
      main/gradebook/index.php
  4. 2
      main/gradebook/lib/fe/displaygradebook.php
  5. 8
      main/gradebook/lib/fe/gradebooktable.class.php

@ -158,9 +158,12 @@ if (isset($_GET['exportpdf'])) {
} else {
Display :: display_header(get_lang('FlatView'));
}
if ( !isset($_GET['selectcat']) && ($_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') ) {
DisplayGradebook :: display_header_reduce_flatview($cat[0], $showeval, $showlink, $simple_search_form);
$flatviewtable->display();
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);
$flatviewtable->display();
}
Display :: display_footer();

@ -30,7 +30,7 @@ require_once ('lib/gradebook_functions.inc.php');
require_once ('lib/fe/scoredisplayform.class.php');
require_once ('lib/scoredisplay.class.php');
api_block_anonymous_users();
api_protect_admin_script();
//api_protect_admin_script();
$htmlHeadXtra[]= '
<script language="JavaScript">
@ -122,7 +122,8 @@ if ($scoreform->validate()) {
}
Display :: display_header(get_lang('ScoreEdit'));
if (!isset($_GET['selectcat']) && ($_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true')) {
if (((isset($_GET['isStudentView']) && $_GET['isStudentView']=='false') || (isset($_GET['selectcat']) && ($_SESSION['studentview']=='teacherview')))) {
if (isset ($_GET['scoringupdated'])) {
Display :: display_confirmation_message(get_lang('ScoringUpdated'),false);
}

@ -60,18 +60,35 @@ $tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$filter_confirm_msg = true;
$filter_warning_msg = true;
if ( !isset($_GET['selectcat']) && ($_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') ) {
Display :: display_header(get_lang('Gradebook'));
$cats = Category :: load (0, null, null, null, null, null, false);
$allcat= $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
$alleval= $cats[0]->get_evaluations($stud_id);
$alllink= $cats[0]->get_links($stud_id);
$gradebooktable= new GradebookTable($cats[0], $allcat, $alleval,$alllink, $addparams);
if ( (isset($_GET['selectcat']) && $_GET['selectcat']>0) && (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) {
$interbreadcrumb[]= array (
'url' => 'index.php'.'?selectcat=0&amp;isStudentView='.$_GET['isStudentView'],
'name' => get_lang('Gradebook')
);
}
if ( (isset($_GET['selectcat']) && $_GET['selectcat']>0) && (isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) {
Display :: display_header(get_lang('Details'));
$gradebooktable= new GradebookTable(null, $allcat, $alleval,$alllink, $addparams);
$gradebooktable->display();
Display :: display_footer();
exit;
}
} else {
if ( !isset($_GET['selectcat']) && ($_SESSION['studentview']=='studentview') || (isset($_GET['isStudentView']) && $_GET['isStudentView']=='true') ) {
Display :: display_header(get_lang('Gradebook'));
$stud_id=api_get_user_id();
$course_code=api_get_course_id();
$session_id=api_get_session_id();
$cats = Category :: load (0, null, null, null, null, null, false);
$allcat= $cats[0]->get_subcategories($stud_id, $course_code, $session_id);
$alleval= $cats[0]->get_evaluations($stud_id);
$alllink= $cats[0]->get_links($stud_id);
$gradebooktable= new GradebookTable($cats[0], $allcat, $alleval,$alllink, $addparams);
$gradebooktable->display();
Display :: display_footer();
exit;
}
}
// --------------------------------------------------------------------------------

@ -323,7 +323,7 @@ class DisplayGradebook
if ($is_course_admin) {
$header .= '<td style="vertical-align: top;"><a href="gradebook_flatview.php?'.api_get_cidreq().'&selectcat=' . $catobj->get_id() . '"><img src="../img/stats_access.gif" alt="' . get_lang('FlatView') . '" /> ' . get_lang('FlatView') . '</a>';
if ($is_platform_admin)
if ($is_platform_admin || $is_course_admin)
$header .= '<td style="vertical-align: top;"><a href="gradebook_scoring_system.php?'.api_get_cidreq().'&selectcat=' . $catobj->get_id() .'"><img src="../img/acces_tool.gif" alt="' . get_lang('ScoreEdit') . '" /> ' . get_lang('ScoreEdit') . '</a>';
} elseif (!(isset ($_GET['studentoverview']))) {
$header .= '<td style="vertical-align: top;"><a href="'.api_get_self().'?'.api_get_cidreq().'&studentoverview=&selectcat=' . $catobj->get_id() . '"><img src="../img/stats_access.gif" alt="' . get_lang('FlatView') . '" /> ' . get_lang('FlatView') . '</a>';

@ -152,7 +152,7 @@ class GradebookTable extends SortableTable
if (api_is_allowed_to_create_course()) {
$row[] = $invisibility_span_open . $data[3] . $invisibility_span_close;
} else {
if (!isset($_GET['selectcat']) && isset($certificate_min_score)) {
// generating the total score for a course
$stud_id= api_get_user_id();
@ -232,7 +232,11 @@ private function build_id_column ($item) {
switch ($item->get_item_type()) {
// category
case 'C' :
return '&nbsp;<a href="'.$_SESSION['gradebook_dest'].'?selectcat=' . $item->get_id() . '">'
$prms_uri='?selectcat=' . $item->get_id();
if ( isset($_GET['isStudentView']) || ( isset($_SESSION['studentview']) && $_SESSION['studentview']=='studentview') ) {
$prms_uri=$prms_uri.'&amp;isStudentView='.$_GET['isStudentView'];
}
return '&nbsp;<a href="'.$_SESSION['gradebook_dest'].$prms_uri.'">'
. $item->get_name()
. '</a>'
. ($item->is_course() ? ' &nbsp;[' . $item->get_course_code() . ']' : '');

Loading…
Cancel
Save