[svn r12645] fix some bugs when copying quiz from a course to another

skala
Eric Marguin 18 years ago
parent cbe71b4dea
commit fea0a07c2b
  1. 4
      main/coursecopy/classes/Course.class.php
  2. 28
      main/coursecopy/classes/CourseSelectForm.class.php

@ -1,4 +1,4 @@
<?php // $Id: Course.class.php 9246 2006-09-25 13:24:53Z bmol $
<?php // $Id: Course.class.php 12645 2007-06-18 20:46:16Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -61,7 +61,7 @@ class Course
return true;
}
}
if( $type == RESOURCE_LEARNPATH )
if( $type == RESOURCE_LEARNPATH && get_class($resource)=='Learnpath')
{
if($resource->has_item($resource_to_check))
{

@ -1,5 +1,5 @@
<?php
// $Id: CourseSelectForm.class.php 11786 2007-03-29 16:09:54Z elixir_inter $
// $Id: CourseSelectForm.class.php 12645 2007-06-18 20:46:16Z elixir_inter $
/*
==============================================================================
Dokeos - elearning and course management software
@ -130,9 +130,35 @@ class CourseSelectForm
}
}
echo '<br/><input type="submit" value="'.get_lang('Ok').'"/>';
CourseSelectForm :: display_hidden_quiz_questions($course);
echo '</form>';
echo '<div id="dynamic_div" style="display:block;margin-left:40%;margin-top:10px;height:50px;"></div>';
}
function display_hidden_quiz_questions($course)
{
foreach ($course->resources as $type => $resources)
{
if (count($resources) > 0)
{
switch ($type)
{
case RESOURCE_QUIZQUESTION:
foreach ($resources as $id => $resource)
{
echo '<input type="hidden" name="resource['.RESOURCE_QUIZQUESTION.']['.$id.'] id="resource['.RESOURCE_QUIZQUESTION.']['.$id.']" value="On" />';
}
break;
}
}
}
}
/**
* Get the posted course
* @return course The course-object with all resources selected by the user

Loading…
Cancel
Save