[svn r19356] logic changes -hiden date when user is student - (partial FS#3914)

skala
Isaac Flores 17 years ago
parent fbbba2bc26
commit 5eff922bd6
  1. 4
      main/gradebook/lib/be/exerciselink.class.php
  2. 4
      main/gradebook/lib/be/learnpathlink.class.php
  3. 4
      main/gradebook/lib/be/studentpublicationlink.class.php
  4. 9
      main/gradebook/lib/gradebook_data_generator.class.php
  5. 1
      main/gradebook/lib/user_data_generator.class.php

@ -118,7 +118,9 @@ class ExerciseLink extends AbstractLink
$sql = 'SELECT * FROM '.$tbl_stats.' WHERE exe_exo_id = '.$this->get_ref_id().' AND orig_lp_id = 0 AND orig_lp_item_id = 0';
if (isset($stud_id)){
$sql .= ' AND exe_cours_id="'.api_get_course_id().'" AND exe_user_id = '."'".$stud_id."'";
$currect_course=api_get_course_id();
$course_code_exe=(strlen($currect_course)===0) ? $this->get_course_code() : api_get_course_id();
$sql .= ' AND exe_cours_id="'.$course_code_exe.'" AND exe_user_id = '."'".$stud_id."'";
}
$sql .= ' ORDER BY exe_id DESC';

@ -103,6 +103,7 @@ class LearnpathLink extends AbstractLink
*/
public function has_results()
{
error_log('demo');
$course_info = api_get_course_info($this->get_course_code());
$tbl_stats = Database::get_course_table(TABLE_LP_VIEW,$course_info['dbName']);
$sql = 'SELECT count(id) AS number FROM '.$tbl_stats
@ -123,7 +124,7 @@ class LearnpathLink extends AbstractLink
{
$course_info = api_get_course_info($this->get_course_code());
$tbl_stats = Database::get_course_table(TABLE_LP_VIEW,$course_info['dbName']);
if (is_null($course_info['db_name'])) {
if (is_null($course_info['dbName'])===true) {
return false;
}
$sql = 'SELECT * FROM '.$tbl_stats
@ -135,7 +136,6 @@ class LearnpathLink extends AbstractLink
// order by id, that way the student's first attempt is accessed first
$sql .= ' ORDER BY view_count DESC';
$scores = api_sql_query($sql, __FILE__, __LINE__);
// for 1 student
if (isset($stud_id))
{

@ -24,7 +24,7 @@
*/
/**
* Gradebook link to student publication item
* @author Bert Stepp<EFBFBD>
* @author Bert Steppé
* @package dokeos.gradebook
*/
class StudentPublicationLink extends AbstractLink
@ -150,7 +150,7 @@ class StudentPublicationLink extends AbstractLink
$course_info = Database :: get_course_info($this->get_course_code());
$database_name = (empty($course_info['db_name']))?$course_info['dbName']:$course_info['db_name'];
$tbl_stats = Database :: get_course_table(TABLE_STUDENT_PUBLICATION, $database_name);
if (is_null($course_info['db_name'])) {
if (is_null($database_name)===true) {
return false;
}
$sql = 'SELECT * FROM '.$tbl_stats." WHERE id = '".$this->get_ref_id()."'";

@ -74,7 +74,8 @@ class GradebookDataGenerator
* 4: date
* 5: student's score (if student logged in)
*/
public function get_data ($sorting = 0, $start = 0, $count = null, $ignore_score_color = false) {
public function get_data ($sorting = 0, $start = 0, $count = null, $ignore_score_color = false) {
$status=CourseManager::get_user_in_course_status(api_get_user_id(), api_get_course_id());
// do some checks on count, redefine if invalid value
if (!isset($count)) {
$count = count ($this->items) - $start;
@ -112,10 +113,12 @@ class GradebookDataGenerator
$row[] = $item->get_name();
$row[] = $item->get_description();
$row[] = $item->get_weight();
$row[] = $this->build_date_column ($item);
if (($status==1 || is_null($status)) && api_is_allowed_to_create_course()) {
$row[] = $this->build_date_column ($item);
}
if(count($this->evals_links)>0)
if (!api_is_allowed_to_create_course() || $status_user!=1)
$row[] = $this->build_result_column ($item, $ignore_score_color);
//$row[] = $this->get_certificate_link ($item);
$data[] = $row;

@ -84,7 +84,6 @@ class UserDataGenerator
* 6: student's score as custom display (only if custom scoring enabled)
*/
public function get_data ($sorting = 0, $start = 0, $count = null, $ignore_score_color = false) {
// do some checks on count, redefine if invalid value
if (!isset($count)) {
$count = count ($this->items) - $start;

Loading…
Cancel
Save