$forumId, 'action' => 'liststd', 'content' => 'thread', 'id' => $threadId, 'list' => 'qualify' ]) ); exit; } Display::addFlash( Display::return_message(get_lang('QualificationCanNotBeGreaterThanMaxScore'), 'error') ); } /* Including necessary files */ $htmlHeadXtra[] = ''; $currentForumCategory = get_forumcategory_information( $currentForum['forum_category'] ); $groupId = api_get_group_id(); /* Header and Breadcrumbs */ if (isset($_SESSION['gradebook'])) { $gradebook = $_SESSION['gradebook']; } if (!empty($gradebook) && $gradebook == 'view') { $interbreadcrumb[] = array( 'url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook') ); } if ($origin == 'learnpath') { Display::display_reduced_header(); } else { if (!empty($groupId)) { $group_properties = GroupManager::get_group_properties($groupId); $interbreadcrumb[] = array( "url" => "../group/group.php?".api_get_cidreq(), "name" => get_lang('Groups') ); $interbreadcrumb[] = array( "url" => "../group/group_space.php?".api_get_cidreq(), "name" => get_lang('GroupSpace').' ('.$group_properties['name'].')' ); $interbreadcrumb[] = array( "url" => "viewforum.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&search=".Security::remove_XSS(urlencode($_GET['search'])), "name" => prepare4display($currentForum['forum_title']) ); if ($message <> 'PostDeletedSpecial') { $interbreadcrumb[] = array( "url" => "viewthread.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&gradebook=".$gradebook."&thread=".intval($_GET['thread']), "name" => prepare4display($currentThread['thread_title']) ); } $interbreadcrumb[] = array( "url" => "#", "name" => get_lang('QualifyThread') ); // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string Display::display_header(''); api_display_tool_title($nameTools); } else { $search = isset($_GET['search']) ? Security::remove_XSS(urlencode($_GET['search'])) : ''; $info_thread = get_thread_information($currentForum['forum_id'], $_GET['thread']); $interbreadcrumb[] = array( "url" => "index.php?".api_get_cidreq()."&search=".$search, "name" => $nameTools ); $interbreadcrumb[] = array( "url" => "viewforumcategory.php?".api_get_cidreq()."&forumcategory=".$currentForumCategory['cat_id']."&search=".$search, "name" => prepare4display($currentForumCategory['cat_title']) ); $interbreadcrumb[] = array( "url" => "viewforum.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&search=".$search, "name" => prepare4display($currentForum['forum_title']) ); if ($message <> 'PostDeletedSpecial') { if (isset($_GET['gradebook']) && $_GET['gradebook'] == 'view') { $info_thread = get_thread_information($currentForum['forum_id'], $_GET['thread']); $interbreadcrumb[] = array( "url" => "viewthread.php?".api_get_cidreq()."&forum=".$info_thread['forum_id']."&thread=".intval($_GET['thread']), "name" => prepare4display($currentThread['thread_title']) ); } else { $interbreadcrumb[] = array( "url" => "viewthread.php?".api_get_cidreq()."&forum=".intval($_GET['forum'])."&thread=".intval($_GET['thread']), "name" => prepare4display($currentThread['thread_title']) ); } } // the last element of the breadcrumb navigation is already set in interbreadcrumb, so give empty string $interbreadcrumb[] = array("url" => "#", "name" => get_lang('QualifyThread')); Display::display_header(''); } } /* Actions */ $action = isset($_GET['action']) ? $_GET['action'] : ''; if ($action == 'delete' && isset($_GET['content']) && isset($_GET['id']) && api_is_allowed_to_edit(false, true) ) { $message = delete_post($_GET['id']); } if (($action == 'invisible' || $action == 'visible') && isset($_GET['id']) && api_is_allowed_to_edit(false, true) ) { $message = approve_post($_GET['id'], $action); } if ($action == 'move' && isset($_GET['post'])) { $message = move_post_form(); } /* Display the action messages */ if (!empty($message)) { echo Display::return_message(get_lang($message), 'confirm'); } // show qualifications history $type = isset($_GET['type']) ? $_GET['type'] : ''; $historyList = getThreadScoreHistory( $userIdToQualify, $threadId, $type ); $counter = count($historyList); // Show current qualify in my form $qualify = current_qualify_of_thread( $threadId, api_get_session_id(), $_GET['user'] ); $result = get_statistical_information( $threadId, $_GET['user_id'], api_get_course_int_id() ); $url = api_get_path(WEB_CODE_PATH).'forum/forumqualify.php?'. api_get_cidreq().'&forum='.intval($_GET['forum']).'&thread='.$threadId.'&user='.intval($_GET['user']).'&user_id='.intval($_GET['user']); $userToQualifyInfo = api_get_user_info($userIdToQualify); $form = new FormValidator('forum-thread-qualify', 'post', $url); $form->addHeader($userToQualifyInfo['complete_name']); $form->addLabel(get_lang('Thread'), $currentThread['thread_title']); $form->addLabel(get_lang('CourseUsers'), $result['user_course']); $form->addLabel(get_lang('PostsNumber'), $result['post']); $form->addLabel(get_lang('NumberOfPostsForThisUser'), $result['user_post']); $form->addLabel( get_lang('AveragePostPerUser'), round($result['user_post'] / $result['post'], 2) ); $form->addText( 'idtextqualify', array(get_lang('Qualification'), get_lang('MaxScore').' '.$maxQualify), $qualify ); $course = api_get_course_info(); $rows = get_thread_user_post($course['code'], $currentThread['thread_id'], $_GET['user']); if (isset($rows)) { $counter = 1; foreach ($rows as $row) { if ($row['status'] == '0') { $style = " id = 'post".$post_en."' class=\"hide-me\" style=\"border:1px solid red; display:none; background-color:#F7F7F7; width:95%; margin: 0px 0px 4px 40px; \" "; } else { $style = ''; $post_en = $row['post_parent_id']; } if ($row['user_id'] == '0') { $name = prepare4display($row['poster_name']); } else { $name = api_get_person_name($row['firstname'], $row['lastname']); } if ($counter == 1) { echo Display::page_subheader($name); } echo "
";
echo ' '.api_convert_and_format_date($row['post_date'], DATE_TIME_FORMAT_LONG).' '; echo " | ";
// The post title
echo "".prepare4display($row['post_title'])." | "; echo "
';
$realname = $attachment_list['path'];
$user_filename = $attachment_list['filename'];
echo Display::return_icon('attachment.gif', get_lang('Attachment'));
echo ' '.$user_filename.' ';
echo ''.$attachment_list['comment'].' '; echo ' |
'.get_lang('WhoChanged').' | '; $table_list .= ''.get_lang('NoteChanged').' | '; $table_list .= ''.get_lang('DateChanged').' | '; $table_list .= '
---|---|---|
'.$userInfo['complete_name'].' | '; $table_list .= ''.$historyList[$i]['qualify'].' | '; $table_list .= ''.api_convert_and_format_date( $historyList[$i]['qualify_time'], DATE_TIME_FORMAT_LONG ); $table_list .= ' |