Fix create course with exemplary content #2845

pull/2874/head
Angel Fernando Quiroz Campos 7 years ago
parent 0cfc01a3bd
commit 7c222659db
  1. 3
      main/exercise/question.class.php

@ -1264,7 +1264,8 @@ abstract class Question
// checks if the exercise ID is not in the list // checks if the exercise ID is not in the list
if (!in_array($exerciseId, $this->exerciseList)) { if (!in_array($exerciseId, $this->exerciseList)) {
$this->exerciseList[] = $exerciseId; $this->exerciseList[] = $exerciseId;
$newExercise = new Exercise(); $courseId = isset($this->course['real_id']) ? $this->course['real_id'] : 0;
$newExercise = new Exercise($courseId);
$newExercise->read($exerciseId, false); $newExercise->read($exerciseId, false);
$count = $newExercise->getQuestionCount(); $count = $newExercise->getQuestionCount();
$count++; $count++;

Loading…
Cancel
Save