More visual changes in Gradebook tool, "Weight in Report" page, task #1740.

skala
Ivan Tcholakov 15 years ago
parent 3d0cae12a7
commit 01368d1d6b
  1. 21
      main/gradebook/gradebook_edit_all.php
  2. 11
      main/gradebook/lib/be.inc.php
  3. 29
      main/gradebook/lib/be/linkfactory.class.php
  4. 7
      main/gradebook/lib/gradebook_functions.inc.php

@ -74,12 +74,13 @@ define('LINK_STUDENTPUBLICATION',3);
define('LINK_LEARNPATH',4);
define('LINK_FORUM_THREAD',5);
*/
$table_evaluated[1] = array(TABLE_QUIZ_TEST, 'title', 'id', get_lang('Exercise'));
$table_evaluated[2] = array(TABLE_DROPBOX_FILE, 'name','id', get_lang('Dropbox'));
$table_evaluated[3] = array(TABLE_STUDENT_PUBLICATION, 'url','id', get_lang('Student_publication'));
$table_evaluated[4] = array(TABLE_LP_MAIN, 'name','id', get_lang('Learnpath'));
$table_evaluated[5] = array(TABLE_FORUM_THREAD, 'thread_title_qualify', 'thread_id', get_lang('Forum'));
$table_evaluated[7] = array(TABLE_ATTENDANCE, 'attendance_title_qualify', 'id', get_lang('Attendance'));
$table_evaluated[LINK_EXERCISE] = array(TABLE_QUIZ_TEST, 'title', 'id', get_lang('Exercise'));
$table_evaluated[LINK_DROPBOX] = array(TABLE_DROPBOX_FILE, 'name','id', get_lang('Dropbox'));
$table_evaluated[LINK_STUDENTPUBLICATION] = array(TABLE_STUDENT_PUBLICATION, 'url','id', get_lang('Student_publication'));
$table_evaluated[LINK_LEARNPATH] = array(TABLE_LP_MAIN, 'name','id', get_lang('Learnpath'));
$table_evaluated[LINK_FORUM_THREAD] = array(TABLE_FORUM_THREAD, 'thread_title_qualify', 'thread_id', get_lang('Forum'));
$table_evaluated[LINK_ATTENDANCE] = array(TABLE_ATTENDANCE, 'attendance_title_qualify', 'id', get_lang('Attendance'));
$table_evaluated[LINK_SURVEY] = array(TABLE_SURVEY, 'code', 'survey_id', get_lang('Survey'));
$submitted=isset($_POST['submitted'])?$_POST['submitted']:'';
if($submitted==1) {
@ -132,7 +133,7 @@ $result = Database::query($sql);
} else {
$resource_name=$resource_name[1];
}
$output.= '<tr><td> [ '.$table_evaluated[$row['type']][3].' ] '.$resource_name.'</td><td><input type="hidden" name="link_'.$row['id'].'" value="'.$resource_name.'" /><input size="10" type="text" name="link['.$row['id'].']" value="'.$row['weight'].'"/></td></tr>';
$output.= '<tr><td>'.build_type_icon_tag($row['type']).'</td><td> [ '.$table_evaluated[$row['type']][3].' ] '.$resource_name.'</td><td><input type="hidden" name="link_'.$row['id'].'" value="'.$resource_name.'" /><input size="10" type="text" name="link['.$row['id'].']" value="'.$row['weight'].'"/></td></tr>';
}
$sql = Database::query('SELECT * FROM '.$table_evaluation.' WHERE category_id = '.$category_id);
@ -145,7 +146,7 @@ $result = Database::query($sql);
$row['weight'] = trim($_POST['evaluation'][$row['id']]);
}
$type_evaluated = isset($row['type']) ? $table_evaluated[$type_evaluated][3] : null;
$output.= '<tr><td> [ '.get_lang('Evaluation').$type_evaluated.' ] '.$row['name'].'</td><td><input type="hidden" name="eval_'.$row['id'].'" value="'.$row['name'].'" /><input type="text" size="10" name="evaluation['.$row['id'].']" value="'.$row['weight'].'"/></td></tr>';
$output.= '<tr><td>'.build_type_icon_tag('evalnotempty').'</td><td> [ '.get_lang('Evaluation').$type_evaluated.' ] '.$row['name'].'</td><td><input type="hidden" name="eval_'.$row['id'].'" value="'.$row['name'].'" /><input type="text" size="10" name="evaluation['.$row['id'].']" value="'.$row['weight'].'"/></td></tr>';
}
//by iflorespaz
$my_category=array();
@ -162,12 +163,14 @@ if ($my_api_cidreq=='') {
<form method="post" action="gradebook_edit_all.php?id_session=<?php echo $_SESSION['id_session'].'&amp;'.$my_api_cidreq ?>&selectcat=<?php echo $category_id?>">
<table class="data_table">
<tr class="row_odd">
<th style="width: 35px;"><?php echo get_lang('Type'); ?></th>
<th><?php echo get_lang('Resource'); ?></th>
<th><?php echo get_lang('Weight'); ?></th>
</tr>
<?php echo $output ?>
<?php echo $output; ?>
</table>
<input type="hidden" name="submitted" value="1" />
<br />
<button class="save" type="submit" name="name" value="<?php echo get_lang('Save') ?>"><?php echo get_lang('SaveScoringRules') ?></button>
</form>
<?php

@ -3,10 +3,9 @@
// include this file to have access to all backend classes
// @author Bert Steppé
require_once api_get_path(LIBRARY_PATH).'sortabletable.class.php';
require_once ('be/gradebookitem.class.php');
require_once ('be/category.class.php');
require_once ('be/evaluation.class.php');
require_once ('be/result.class.php');
require_once ('be/linkfactory.class.php'); // this contains the include declarations
require_once 'be/gradebookitem.class.php';
require_once 'be/category.class.php';
require_once 'be/evaluation.class.php';
require_once 'be/result.class.php';
require_once 'be/linkfactory.class.php'; // this contains the include declarations
// to all link classes

@ -13,6 +13,7 @@ define('LINK_LEARNPATH', 4);
define('LINK_FORUM_THREAD', 5);
//define('LINK_WORK',6);
define('LINK_ATTENDANCE', 7);
define('LINK_SURVEY', 8);
require_once 'gradebookitem.class.php';
require_once 'abstractlink.class.php';
@ -74,21 +75,21 @@ class LinkFactory
* @param $type link type
*/
public function create ($type) {
if ($type == LINK_EXERCISE ) {
return new ExerciseLink();
} elseif ($type == LINK_DROPBOX ) {
return new DropboxLink();
} elseif ($type == LINK_STUDENTPUBLICATION ) {
return new StudentPublicationLink();
} elseif ($type == LINK_LEARNPATH ) {
return new LearnpathLink();
} elseif ($type == LINK_FORUM_THREAD ) {
return new ForumThreadLink();
} elseif ($type == LINK_ATTENDANCE ) {
return new AttendanceLink();
} else {
return null;
switch ($type) {
case LINK_EXERCISE:
return new ExerciseLink();
case LINK_DROPBOX:
return new DropboxLink();
case LINK_STUDENTPUBLICATION:
return new StudentPublicationLink();
case LINK_LEARNPATH:
return new LearnpathLink();
case LINK_FORUM_THREAD:
return new ForumThreadLink();
case LINK_ATTENDANCE:
return new AttendanceLink();
}
return null;
}
/**

@ -150,27 +150,34 @@ function get_icon_file_name ($type) {
$icon = 'gradebook_eval_not_empty.gif';
break;
case 'exercise':
case LINK_EXERCISE:
$icon = 'quiz.gif';
break;
case 'learnpath':
case LINK_LEARNPATH:
$icon = 'scorm.gif';
break;
case 'studentpublication':
case LINK_STUDENTPUBLICATION:
$icon = 'works.gif';
break;
case 'link':
$icon = 'link.gif';
break;
case 'forum':
case LINK_FORUM_THREAD:
$icon = 'forum.gif';
break;
case 'attendance':
case LINK_ATTENDANCE:
$icon = 'attendance.gif';
break;
case 'survey':
case LINK_SURVEY:
$icon = 'survey.gif';
break;
case 'dropbox':
case LINK_DROPBOX:
$icon = 'dropbox.gif';
break;
default:

Loading…
Cancel
Save