You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
3.6 KiB
88 lines
3.6 KiB
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
/**
|
|
* Exercise list: This script shows the list of exercises for administrators and students.
|
|
* @package chamilo.exercise
|
|
* @author Olivier Brouckaert, original author
|
|
* @author Denes Nagy, HotPotatoes integration
|
|
* @author Wolfgang Schneider, code/html cleanup
|
|
*/
|
|
|
|
// name of the language file that needs to be included
|
|
$language_file='exercice';
|
|
|
|
require_once '../inc/global.inc.php';
|
|
$this_section=SECTION_COURSES;
|
|
api_protect_course_script(true);
|
|
|
|
$show=(isset($_GET['show']) && $_GET['show'] == 'result')?'result':'test'; // moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
|
|
|
|
/* Libraries */
|
|
|
|
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
|
|
//include(api_get_path(LIBRARY_PATH).'mail.lib.inc.php');
|
|
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
|
|
|
|
/* Constants and variables */
|
|
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
|
|
$is_tutor = api_is_allowed_to_edit(true);
|
|
|
|
if(!$is_allowedToEdit){
|
|
header('Location: /main/exercice/exercice.php?cidReq='.Security::remove_XSS($_GET['cidReq']));
|
|
exit;
|
|
}
|
|
|
|
$interbreadcrumb[]= array ('url' => 'exercice.php'.'?show=result','name' => get_lang('Exercices'));
|
|
$interbreadcrumb[]= array ('url' => 'exercice.php'.'?show=result&filter=2','name' => get_lang('StudentScore'));
|
|
$interbreadcrumb[]= array ('url' => 'exercice_history.php'.'?exe_id='.intval($_GET['exe_id']), 'name' => get_lang('Details'));
|
|
|
|
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
|
|
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
|
|
$TBL_EXERCICES_QUESTION = Database::get_course_table(TABLE_QUIZ_QUESTION);
|
|
$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
|
|
$TBL_TRACK_ATTEMPT_RECORDING= Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT_RECORDING);
|
|
Display::display_header($nameTools,get_lang('Exercise'));
|
|
|
|
if(isset($_GET['message'])) {
|
|
if (in_array($_GET['message'], array('ExerciseEdited'))) {
|
|
$my_message_history=Security::remove_XSS($_GET['message']);
|
|
Display::display_confirmation_message(get_lang($my_message_history));
|
|
}
|
|
}
|
|
|
|
//event_access_tool(TOOL_QUIZ);
|
|
|
|
?>
|
|
<div class="actions">
|
|
<a href="exercice.php?cidReq=<?php echo Security::remove_XSS($_GET['cidReq']) ?>&show=result&filter=2"><img src="../img/back.png"/><?php echo get_lang('BackToResultList') ?></a>
|
|
</div>
|
|
<table class="data_table">
|
|
<tr class="row_odd">
|
|
<th><?php echo get_lang('Question'); ?></th>
|
|
<th width="50px"><?php echo get_lang('Value'); ?></th>
|
|
<th><?php echo get_lang('Feedback'); ?></th>
|
|
<th ><?php echo get_lang('Author'); ?></th>
|
|
<th width="150px"><?php echo get_lang('Date'); ?></th>
|
|
</tr>
|
|
<?php
|
|
|
|
$sql = "SELECT *, quiz_question.question, firstname, lastname FROM $TBL_TRACK_ATTEMPT_RECORDING t,$TBL_USER,$TBL_EXERCICES_QUESTION quiz_question WHERE quiz_question.id = question_id AND user_id = author AND exe_id = '".(int)$_GET['exe_id']."' ORDER BY position";
|
|
$query = Database::query($sql);
|
|
while($row = Database::fetch_array($query)){
|
|
echo '<tr';
|
|
if($i%2==0) echo 'class="row_odd"'; else echo 'class="row_even"';
|
|
echo '>';
|
|
echo '<td>'.$row['question'].'</td>';
|
|
echo '<td>'.$row['marks'].'</td>';
|
|
if(!empty($row['teacher_comment'])){
|
|
echo '<td>'.$row['teacher_comment'].'</td>';
|
|
} else {
|
|
echo '<td>'.get_lang('WithoutComment').'</td>';
|
|
}
|
|
echo '<td>'.(empty($row['firstname']) && empty($row['lastname']) ? '<i>'.get_lang('OriginalValue').'</i>' : api_get_person_name($row['firstname'], $row['lastname'])).'</td>';
|
|
echo '<td>'.api_get_local_time($row['insert_date']).'</td>';
|
|
echo '</tr>';
|
|
}
|
|
echo '</table>';
|
|
Display::display_footer();
|
|
|