Skip to content

Commit

Permalink
Fix clone question in question pool see BT#16660
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Jan 28, 2020
1 parent d828199 commit 5b64a6a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions main/exercise/question_pool.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
* This script allows administrators to manage questions and add them into their exercises.
* One question can be in several exercises.
*
* @package chamilo.exercise
*
* @author Olivier Brouckaert
* @author Julio Montoya adding support to query all questions from all session, courses, exercises
* @author Modify by hubert borderiou 2011-10-21 Question's category
Expand Down Expand Up @@ -68,7 +66,7 @@
if ($is_allowedToEdit) {
// Duplicating a Question
if (!isset($_POST['recup']) && $question_copy != 0 && isset($fromExercise)) {
$origin_course_id = (int) $_GET['course_id'];
$origin_course_id = (int) $_GET['course_id'];
$origin_course_info = api_get_course_info_by_id($origin_course_id);
$current_course = api_get_course_info();
$old_question_id = $question_copy;
Expand Down Expand Up @@ -254,10 +252,8 @@ function confirm_your_choice() {
case 'clone':
if (!empty($_REQUEST['questions']) && !empty($fromExercise)) {
$questions = $_REQUEST['questions'];
$objExercise = new Exercise();
$objExercise->read($fromExercise, false);

$origin_course_id = (int) $_GET['course_id'];

$origin_course_info = api_get_course_info_by_id($origin_course_id);
$current_course = api_get_course_info();

Expand All @@ -275,7 +271,7 @@ function confirm_your_choice() {
$new_question_obj = Question::read($new_id);
$new_question_obj->addToList($fromExercise);
//Reading Answers obj of the current course
$new_answer_obj = new Answer($old_question_id, $origin_course_id);
$new_answer_obj = new Answer($questionId, $origin_course_id);
$new_answer_obj->read();
//Duplicating the Answers in the current course
$new_answer_obj->duplicate($new_question_obj, $current_course);
Expand Down

0 comments on commit 5b64a6a

Please sign in to comment.