Minor forum and exercise changes

skala
Julio Montoya 14 years ago
parent 3be7af9158
commit a4a20586c2
  1. 11
      main/exercice/upload_exercise.php
  2. 6
      main/forum/forumbody.inc.php
  3. 6
      main/forum/forumqualify.php
  4. 2
      main/forum/viewpost.inc.php

@ -3,6 +3,7 @@
/**
* Upload quiz: This script shows the upload quiz feature
* Initial work by Isaac flores on Nov 4 of 2010
* Encoding fixes Julio Montoya
* @package chamilo.exercise
*/
// Language files that should be included
@ -25,7 +26,7 @@ require_once '../newscorm/learnpathItem.class.php';
// Security check
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
if (!$is_allowed_to_edit) {
api_not_allowed(true);
api_not_allowed(true);
}
// setting the tabs
@ -88,11 +89,12 @@ function lp_upload_quiz_main() {
$lp_id = Security::remove_XSS($_GET['lp_id']);
$form = new FormValidator('upload', 'POST', api_get_self() . '?' . api_get_cidreq() . '&lp_id=' . $lp_id, '', 'enctype="multipart/form-data"');
$form->addElement('html', '<div><h3>' .Display::return_icon('import_excel.png', get_lang('ImportExcelQuiz'), array('style'=>'margin-bottom:-2px;'),32). get_lang('ImportExcelQuiz') . '</h3><div><input type="file" name="user_upload_quiz" id="user_upload_quiz_id" size="20" /></div></div>');
$form->addElement('html', '<div><h3>' .Display::return_icon('import_excel.png', get_lang('ImportExcelQuiz'), array('style'=>'margin-bottom:-2px;'),32). get_lang('ImportExcelQuiz') . '</h3></div>');
$form->addElement('file', 'user_upload_quiz', '');
//button send document
$form->addElement('style_submit_button', 'submit_upload_quiz', get_lang('Send'), 'class="upload"');
$form->setDefaults($defaults);
// Display the upload field
echo '<table style="text-align: left; width: 100%;" border="0" cellpadding="2"cellspacing="2"><tbody><tr>';
echo '<td style="vertical-align: top; width: 25%;">';
@ -283,6 +285,7 @@ function lp_upload_quiz_action_handling() {
$_SESSION['oLP']->add_item($parent, $previous, TOOL_QUIZ, $quiz_id, utf8_encode($quiz_title), '');
// Redirect to home page for add more content
header('location: ../newscorm/lp_controller.php?' . api_get_cidreq() . '&action=add_item&type=step&lp_id=' . Security::remove_XSS($_GET['lp_id']).'&session_id='.api_get_session_id());
exit;
} else {
// header('location: exercice.php?' . api_get_cidreq());
echo '<script>window.location.href = "admin.php?'.api_get_cidReq().'&exerciseId='.$quiz_id.'&session_id='.api_get_session_id().'"</script>';

@ -24,11 +24,7 @@ $output = <<<EOF
<tr>
EOF;
$output .= '
<td width="40%" class="forum-thread-header">'.get_lang('User').'&nbsp;:</td >
<td width="60%" class="forum-thread-body"><div align="left">'.get_name_user_by_id($userid).'</div></td>
</tr>
<tr>
$output .= '
<td width="40%" class="forum-thread-header">'.get_lang('Thread').'&nbsp;:</td >
<td width="60%" class="forum-thread-body">
<div align="left">'.$current_thread['thread_title'].'</div>

@ -3,6 +3,7 @@
/**
* @package chamilo.forum
* @todo fix all this qualify files avoid including files, use classes POO jmontoya
*/
// name of the language file that needs to be included
@ -221,13 +222,11 @@ if ($message<>'PostDeletedSpecial') {// in this case the first and only post of
$userinf=api_get_user_info(api_get_user_id());
if ($allowed_to_edit) {
//echo "<strong>".get_lang('QualifyThread')."</strong>";
//echo "<br />";
$current_thread=get_thread_information($_GET['thread']);
$userid=(int)$_GET['user_id'];
$threadid=$current_thread['thread_id'];
//show current qualify in my form
$qualify=current_qualify_of_thread($threadid,api_get_session_id());
$qualify=current_qualify_of_thread($threadid, api_get_session_id());
//show max qualify in my form
$max_qualify=show_qualify('2',$_GET['cidReq'],$_GET['forum'],$userid,$threadid);
require_once 'forumbody.inc.php';
@ -248,6 +247,7 @@ if ($allowed_to_edit) {
$user_id_thread = (int)$_GET['user_id'];
$opt=Database::escape_string($_GET['type']);
$qualify_historic = get_historical_qualify($user_id_thread, $threadid, $opt);
$counter= count($qualify_historic);
$act_qualify = $_REQUEST['idtextqualify'];
if ($counter>0) {

@ -16,7 +16,7 @@ if (isset($rows)){
} else {
$style = "";
$post_en = $row['post_parent_id'];
$url_post = '<a href="javascript:;" onclick="javascript:hidecontent(\'#post'.$row['post_parent_id'].'\')"> '.get_lang('ViewComentPost').'</a> ';
//$url_post = '<a href="javascript:;" onclick="javascript:hidecontent(\'#post'.$row['post_parent_id'].'\')"> '.get_lang('ViewComentPost').'</a> ';
}
if ($row['user_id']=='0') {

Loading…
Cancel
Save