Fixing work bug when deleting a student assignment the score was still there see BT#4131

skala
Julio Montoya 13 years ago
parent ad46240e0f
commit e9316a8bac
  1. 4
      main/gradebook/lib/be/linkfactory.class.php
  2. 3
      main/gradebook/lib/be/studentpublicationlink.class.php
  3. 2
      main/gradebook/lib/flatview_data_generator.class.php
  4. 7
      main/work/work.lib.php

@ -116,4 +116,8 @@ class LinkFactory
);
}
public function delete() {
}
}

@ -147,13 +147,14 @@ class StudentPublicationLink extends AbstractLink
$v_assigment_id = $assignment['id'];
}
$sql = 'SELECT * FROM '.$tbl_stats.'
WHERE c_id = '.$this->course_id.' AND parent_id ="'.$v_assigment_id.'" AND session_id='.api_get_session_id().'';
WHERE c_id = '.$this->course_id.' AND active = 1 AND parent_id ="'.$v_assigment_id.'" AND session_id='.api_get_session_id().'';
if (!empty($stud_id)) {
$sql .= " AND user_id = $stud_id ";
}
// order by id, that way the student's first attempt is accessed first
$sql .= ' ORDER BY id';
$scores = Database::query($sql);
// for 1 student

@ -263,8 +263,6 @@ class FlatViewDataGenerator
$item_total = round($item_total);
$total_score = array($item_value_total, $item_total);
if (!$show_all) {
$row[] = $scoredisplay->display_score($total_score);
} else {

@ -507,7 +507,7 @@ function display_student_publications_list($id, $link_target_parameter, $dateFor
list($d_hour, $d_minute) = explode(':', $parts[1]);
$qualification_input[] = FormValidator :: createElement('text', 'qualification');
$form_folder -> addGroup($qualification_input, 'qualification', get_lang('QualificationNumeric'), 'size="10"');
$form_folder -> addGroup($qualification_input, 'qualification', get_lang('QualificationNumeric'));
if ((int)$row['weight'] == 0) {
$form_folder -> addElement('checkbox', 'make_calification', null, get_lang('MakeQualifiable'), 'onclick="javascript: if(this.checked){document.getElementById(\'option3\').style.display = \'block\';}else{document.getElementById(\'option3\').style.display = \'none\';}"');
@ -765,7 +765,7 @@ function display_student_publications_list($id, $link_target_parameter, $dateFor
$count = $gradebook_data['weight'];
}
if ($count > 0) {
$add_to_name = ' / <span style="color:blue">'.get_lang('IncludedInEvaluation').'</span>';
$add_to_name = Display::label(get_lang('IncludedInEvaluation'), 'info');
} else {
$add_to_name = '';
}
@ -779,8 +779,7 @@ function display_student_publications_list($id, $link_target_parameter, $dateFor
}
//}
$url = $zip.'<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.Security::remove_XSS($_GET['gradebook']).'&id='.$work_data['id'].'"'.$class.'>'.
$work_title.'</a>'.
$add_to_name.'<br />'.$cant_files.' '.$text_file.$dirtext;
$work_title.'</a> '.$add_to_name.'<br />'.$cant_files.' '.$text_file.$dirtext;
$row[] = $url;
}
if ($count_files != 0) {

Loading…
Cancel
Save