|
|
@ -327,23 +327,18 @@ if (!$inATest) { |
|
|
|
['class' => 'btn btn-default btn-sm'] |
|
|
|
['class' => 'btn btn-default btn-sm'] |
|
|
|
); |
|
|
|
); |
|
|
|
$delete_link = null; |
|
|
|
$delete_link = null; |
|
|
|
if ($objExercise->edit_exercise_in_lp == true) { |
|
|
|
if ($objExercise->edit_exercise_in_lp) { |
|
|
|
$delete = false; |
|
|
|
$delete = true; |
|
|
|
$questionInOtherQuizs = true; |
|
|
|
$questionInOtherQuizs = true; |
|
|
|
$results = Question::countQuizzesUsingQuestion($id); |
|
|
|
$results = Question::countQuizzesUsingQuestion($id); |
|
|
|
|
|
|
|
|
|
|
|
if ($results > 1) { |
|
|
|
if ($results > 1) { |
|
|
|
$masterExerciseId = Question::getMasterQuizForQuestion($id); |
|
|
|
$masterExerciseId = Question::getMasterQuizForQuestion($id); |
|
|
|
if ($masterExerciseId == $exerciseId) { |
|
|
|
if ($masterExerciseId !== $exerciseId) { |
|
|
|
$delete = true; |
|
|
|
|
|
|
|
$questionInOtherQuizs = true; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$questionInOtherQuizs = false; |
|
|
|
$questionInOtherQuizs = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
|
|
|
|
$delete = true; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if ($delete) { |
|
|
|
|
|
|
|
$delete_link = Display::url( |
|
|
|
$delete_link = Display::url( |
|
|
|
Display::return_icon( |
|
|
|
Display::return_icon( |
|
|
|
'delete.png', |
|
|
|
'delete.png', |
|
|
@ -364,7 +359,6 @@ if (!$inATest) { |
|
|
|
] |
|
|
|
] |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($limitTeacherAccess && !api_is_platform_admin()) { |
|
|
|
if ($limitTeacherAccess && !api_is_platform_admin()) { |
|
|
|
$delete_link = ''; |
|
|
|
$delete_link = ''; |
|
|
|