[svn r14761] Round of cleanups for the gradebook tool

skala
Yannick Warnier 18 years ago
parent 8207d77083
commit 6d58198276
  1. 36
      main/gradebook/gradebook.php
  2. 4
      main/gradebook/gradebook_view_result.php
  3. 2
      main/gradebook/lib/be.inc.php
  4. 4
      main/gradebook/lib/fe/catform.class.php
  5. 8
      main/gradebook/lib/fe/dataform.class.php
  6. 6
      main/gradebook/lib/fe/evalform.class.php
  7. 4
      main/gradebook/lib/fe/flatviewtable.class.php
  8. 4
      main/gradebook/lib/fe/gradebooktable.class.php
  9. 6
      main/gradebook/lib/fe/linkaddeditform.class.php
  10. 6
      main/gradebook/lib/fe/linkform.class.php
  11. 4
      main/gradebook/lib/fe/resulttable.class.php
  12. 25
      main/gradebook/lib/fe/scoredisplayform.class.php
  13. 6
      main/gradebook/lib/fe/userform.class.php
  14. 6
      main/gradebook/lib/fe/usertable.class.php

@ -49,6 +49,8 @@ function confirmation ()
}
</script>';
$filter_confirm_msg = true;
$filter_warning_msg = true;
// --------------------------------------------------------------------------------
// - ACTIONS -
// --------------------------------------------------------------------------------
@ -188,9 +190,15 @@ if (isset ($_GET['visiblecat']))
$cats[0]->apply_visibility_to_children();
unset ($cats);
if ($visibility_command)
{
$confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false;
}
else
{
$confirmation_message = get_lang('InViMod');
$filter_confirm_msg = false;
}
}
if (isset ($_GET['deletecat']))
{
@ -203,6 +211,7 @@ if (isset ($_GET['deletecat']))
$cats[0]->delete_all();
}
$confirmation_message = get_lang('CategoryDeleted');
$filter_confirm_msg = false;
}
//parameters for evaluations
if (isset ($_GET['visibleeval']))
@ -217,9 +226,15 @@ if (isset ($_GET['visibleeval']))
$eval[0]->save();
unset ($eval);
if ($visibility_command)
{
$confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false;
}
else
{
$confirmation_message = get_lang('InViMod');
$filter_confirm_msg = false;
}
}
if (isset ($_GET['deleteeval']))
{
@ -228,6 +243,7 @@ if (isset ($_GET['deleteeval']))
if ($eval[0] != null)
$eval[0]->delete_with_results();
$confirmation_message = get_lang('EvaluationDeleted');
$filter_confirm_msg = false;
}
//parameters for links
if (isset ($_GET['visiblelink']))
@ -242,9 +258,15 @@ if (isset ($_GET['visiblelink']))
$link[0]->save();
unset ($link);
if ($visibility_command)
{
$confirmation_message = get_lang('ViMod');
$filter_confirm_msg = false;
}
else
{
$confirmation_message = get_lang('InViMod');
$filter_confirm_msg = false;
}
}
if (isset ($_GET['deletelink']))
{
@ -254,6 +276,7 @@ if (isset ($_GET['deletelink']))
$link[0]->delete();
unset ($link);
$confirmation_message = get_lang('LinkDeleted');
$filter_confirm_msg = false;
}
if ($course_to_crsind && !isset($_GET['confirm']))
@ -273,6 +296,7 @@ if ($course_to_crsind && !isset($_GET['confirm']))
</form>';
$warning_message = get_lang('MoveWarning').'<br><br>'.$button;
$filter_warning_msg = false;
}
@ -282,7 +306,10 @@ if (isset ($_POST['action']))
block_students();
$number_of_selected_items= count($_POST['id']);
if ($number_of_selected_items == '0')
{
$warning_message = get_lang('NoItemsSelected');
$filter_warning_msg = false;
}
else
{
switch ($_POST['action'])
@ -315,7 +342,8 @@ if (isset ($_POST['action']))
$number_of_deleted_links++;
}
}
$confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br>' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br>' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br><br>' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>';
$confirmation_message = get_lang('DeletedCategories') . ' : <b>' . $number_of_deleted_categories . '</b><br />' . get_lang('DeletedEvaluations') . ' : <b>' . $number_of_deleted_evaluations . '</b><br />' . get_lang('DeletedLinks') . ' : <b>' . $number_of_deleted_links . '</b><br /><br />' . get_lang('TotalItems') . ' : <b>' . $number_of_selected_items . '</b>';
$filter_confirm_msg = false;
break;
case 'setvisible' :
foreach ($_POST['id'] as $indexstr)
@ -341,6 +369,7 @@ if (isset ($_POST['action']))
}
}
$confirmation_message = get_lang('ItemsVisible');
$filter_confirm_msg = false;
break;
case 'setinvisible' :
foreach ($_POST['id'] as $indexstr)
@ -366,6 +395,7 @@ if (isset ($_POST['action']))
}
}
$confirmation_message = get_lang('ItemsInVisible');
$filter_confirm_msg = false;
break;
}
}
@ -430,9 +460,9 @@ if (isset ($_GET['addallcat']))
Display :: display_normal_message(get_lang('AddAllCat'),false);
if (isset ($confirmation_message))
Display :: display_confirmation_message($confirmation_message);
Display :: display_confirmation_message($confirmation_message,$filter_confirm_msg);
if (isset ($warning_message))
Display :: display_warning_message($warning_message);
Display :: display_warning_message($warning_message,$filter_warning_msg);
if (isset ($move_form))
Display :: display_normal_message($move_form->toHtml(),false);

@ -22,7 +22,7 @@
Mail: info@dokeos.com
==============================================================================
*/
$language_file= 'gradebook';
$language_file[] = 'gradebook';
$cidReset= true;
include_once ('../inc/global.inc.php');
include_once ('lib/be.inc.php');
@ -160,7 +160,7 @@ if (isset ($_GET['import']))
'url' => 'gradebook_view_result.php?selecteval=' . $_GET['selecteval'],
'name' => get_lang('ViewResult'
));
$import_result_form= new DataForm(DataForm :: TYPE_IMPORT, 'import_result_form', null, api_get_self() . '?import=&selecteval=' . $_GET['selecteval']);
$import_result_form = new DataForm(DataForm :: TYPE_IMPORT, 'import_result_form', null, api_get_self() . '?import=&selecteval=' . $_GET['selecteval']);
if (!$import_result_form->validate())
Display :: display_header(get_lang('Import'));
if ($_POST['formSent'])

@ -1,7 +1,7 @@
<?php
// include this file to have access to all backend classes
// @author Bert Steppé
// @author Bert Steppé
include_once ('be/gradebookitem.class.php');
include_once ('be/category.class.php');

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
/**

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
@ -26,7 +26,7 @@ class DataForm extends FormValidator {
* @param method
* @param action
*/
function DataForm($form_type, $form_name, $method = 'post', $action = null,$target) {
function DataForm($form_type, $form_name, $method = 'post', $action = null,$target='') {
parent :: __construct($form_name, $method, $action,$target);
$this->form_type = $form_type;
if ($this->form_type == self :: TYPE_IMPORT) {

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
/**

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
define ('LIMIT',10);

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
/**
* Table to display categories, evaluations and links

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
/**
* Table to display results for an evaluation

@ -1,12 +1,12 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
/**
* Form for the score display dialog
* @author Stijn Konings
* @author Bert Steppé
* @author Bert Stepp<EFBFBD>
* @package dokeos.gradebook
*/
class ScoreDisplayForm extends FormValidator
@ -29,13 +29,16 @@ class ScoreDisplayForm extends FormValidator
//setting the default values
foreach ($customdisplays as $customdisplay)
if(is_array($customdisplays))
{
$this->setDefaults(array (
'endscore[' . $counter . ']' => $customdisplay['score'],
'displaytext[' . $counter . ']' => $customdisplay['display']
));
$counter++;
foreach ($customdisplays as $customdisplay)
{
$this->setDefaults(array (
'endscore[' . $counter . ']' => $customdisplay['score'],
'displaytext[' . $counter . ']' => $customdisplay['display']
));
$counter++;
}
}
$scorecol= array ();
@ -93,8 +96,8 @@ class ScoreDisplayForm extends FormValidator
$elementTemplateTwoLabel2 =
'<!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error -->&nbsp{element}
<a href="javascript:minItem(' . ($counter) . ')"><img style="display: '.(($counter>=$nr_items && $counter!=1)?'inline':'none').';" id="min-' . $counter . '" src="../img/gradebook_remove.gif"></img></a>
<a href="javascript:plusItem(' . ($counter+1) . ')"><img style="display: '.(($counter>=$nr_items)?'inline':'none').';" id="plus-' . ($counter+1) . '" src=../img/gradebook_add.gif></img></a>
<a href="javascript:minItem(' . ($counter) . ')"><img style="display: '.(($counter>=$nr_items && $counter!=1)?'inline':'none').';" id="min-' . $counter . '" src="../img/gradebook_remove.gif" alt="'.get_lang('Delete').'" title="'.get_lang('Delete').'"></img></a>
<a href="javascript:plusItem(' . ($counter+1) . ')"><img style="display: '.(($counter>=$nr_items)?'inline':'none').';" id="plus-' . ($counter+1) . '" src="../img/gradebook_add.gif" alt="'.get_lang('Add').'" title="'.get_lang('Add').'"></img></a>
</div></p></div>';
$scorebetw= array ();

@ -1,7 +1,7 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once ('../gradebook_functions.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
include_once (dirname(__FILE__).'/../gradebook_functions.inc.php');
include_once (api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
require_once (api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php');
/**

@ -1,12 +1,12 @@
<?php
include_once ('../../../inc/global.inc.php');
include_once ('../be.inc.php');
include_once (dirname(__FILE__).'/../../../inc/global.inc.php');
include_once (dirname(__FILE__).'/../be.inc.php');
/**
* Table to display flat view of a student's evaluations and links
* @author Stijn Konings
* @author Bert Steppé (refactored, optimised, use of caching, datagenerator class)
* @author Bert Stepp<EFBFBD> (refactored, optimised, use of caching, datagenerator class)
*/
class UserTable extends SortableTable
{

Loading…
Cancel
Save