|
|
|
@ -519,7 +519,7 @@ if (!empty($exercise_list)) { |
|
|
|
|
|
|
|
|
|
// Teacher only |
|
|
|
|
if ($is_allowedToEdit) { |
|
|
|
|
$show_quiz_edition = true; |
|
|
|
|
$added_to_lp = false; |
|
|
|
|
|
|
|
|
|
$sql="SELECT max_score FROM $table_lp_item |
|
|
|
|
WHERE c_id = $course_id AND |
|
|
|
@ -527,11 +527,11 @@ if (!empty($exercise_list)) { |
|
|
|
|
path ='".Database::escape_string($row['id'])."'"; |
|
|
|
|
$result = Database::query($sql); |
|
|
|
|
if (Database::num_rows($result) > 0) { |
|
|
|
|
$show_quiz_edition = false; |
|
|
|
|
$added_to_lp = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$lp_blocked = ''; |
|
|
|
|
if (!$show_quiz_edition) { |
|
|
|
|
if ($added_to_lp) { |
|
|
|
|
$lp_blocked = Display::label(get_lang('AddedToALP'), 'info'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -582,12 +582,18 @@ if (!empty($exercise_list)) { |
|
|
|
|
} else { |
|
|
|
|
$actions .= Display::return_icon('clean_na.png', get_lang('ResourceLockedByGradebook'),'',ICON_SIZE_SMALL); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//Visible / invisible |
|
|
|
|
//Check if this exercise was added in a LP |
|
|
|
|
if ($added_to_lp) { |
|
|
|
|
$actions .= Display::return_icon('invisible.png', get_lang('AddedToLPCannotBeAccessed'),'',ICON_SIZE_SMALL); |
|
|
|
|
} else { |
|
|
|
|
if ($row['active']) { |
|
|
|
|
$actions .= Display::url(Display::return_icon('visible.png', get_lang('Deactivate'),'',ICON_SIZE_SMALL) , 'exercice.php?'.api_get_cidreq().'&choice=disable&sec_token='.$token.'&page='.$page.'&exerciseId='.$row['id']); |
|
|
|
|
} else { // else if not active |
|
|
|
|
$actions .= Display::url(Display::return_icon('invisible.png', get_lang('Activate'),'',ICON_SIZE_SMALL) , 'exercice.php?'.api_get_cidreq().'&choice=enable&sec_token='.$token.'&page='.$page.'&exerciseId='.$row['id']); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// Export qti ... |
|
|
|
|
$actions .= Display::url(Display::return_icon('export_qti2.png','IMS/QTI','',ICON_SIZE_SMALL), 'exercice.php?choice=exportqti2&exerciseId='.$row['id']); |
|
|
|
|
} else { |
|
|
|
|