Dokeos PHP Cross Reference Learning Management Systems

Source: /main/exercice/exercise_admin.php - 553 lines - 22008 bytes - Summary - Text - Print

Description: Exercise Administration

   1  <?php
   2  
   3  /* For licensing terms, see /dokeos_license.txt */
   4  
   5  /**
   6  ==============================================================================
   7  *     Exercise Administration
   8  *    @package dokeos.exercise
   9  ==============================================================================
  10  */
  11  
  12  define('DOKEOS_EXERCISE', true);
  13  
  14  // Language files that should be included
  15  $language_file = array('exercice','admin');
  16  // setting the help
  17  $help_content = 'exerciselist';
  18  
  19  // including the global library
  20  require_once  '../inc/global.inc.php';
  21  
  22  // including additional libraries
  23  include ('exercise.class.php');
  24  include ('question.class.php');
  25  include ('answer.class.php');
  26  include ('exercise.lib.php');
  27  include_once(api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php');
  28  require_once  '../newscorm/learnpath.class.php';
  29  require_once  '../newscorm/learnpathItem.class.php';
  30  // setting the tabs
  31  $this_section=SECTION_COURSES;
  32  
  33  if(!api_is_allowed_to_edit()) {
  34      api_not_allowed(true);
  35  }
  36  
  37  // Add additional javascript, css
  38  $htmlHeadXtra[] = '<script type="text/javascript" src="'.api_get_path(WEB_LIBRARY_PATH).'javascript/jquery-1.4.2.min.js" language="javascript"></script>';
  39  $htmlHeadXtra[] = '<style> .media { display:none;}</style>';        // to hide the exercise description     
  40  $htmlHeadXtra[] = '<script>
  41  		function advanced_parameters() {
  42              if(document.getElementById(\'options\').style.display == \'none\') {
  43                  document.getElementById(\'options\').style.display = \'block\';
  44                  document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
  45  
  46              } else {
  47  
  48                  document.getElementById(\'options\').style.display = \'none\';
  49                  document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
  50              }
  51          }
  52  
  53  
  54  		function FCKeditor_OnComplete( editorInstance )
  55              {
  56                 if (document.getElementById ( \'HiddenFCK\' + editorInstance.Name )) {
  57                    HideFCKEditorByInstanceName (editorInstance.Name);
  58                 }
  59              }
  60  
  61  			function HideFCKEditorByInstanceName ( editorInstanceName ) {
  62                 if (document.getElementById ( \'HiddenFCK\' + editorInstanceName ).className == "HideFCKEditor" ) {
  63                    document.getElementById ( \'HiddenFCK\' + editorInstanceName ).className = "media";
  64                    }
  65              }
  66  		function show_media() {
  67              var my_display = document.getElementById(\'HiddenFCKexerciseDescription\').style.display;
  68                  if(my_display== \'none\' || my_display == \'\') {
  69                  document.getElementById(\'HiddenFCKexerciseDescription\').style.display = \'block\';
  70                  document.getElementById(\'media_icon\').innerHTML=\'&nbsp;<img src="../img/looknfeelna.png" alt="" />&nbsp;'.get_lang('ExerciseDescription').'\';
  71              } else {
  72                  document.getElementById(\'HiddenFCKexerciseDescription\').style.display = \'none\';
  73                  document.getElementById(\'media_icon\').innerHTML=\'&nbsp;<img src="../img/looknfeel.png" alt="" />&nbsp;'.get_lang('ExerciseDescription').'\';
  74  
  75              }
  76          }
  77  
  78  		function timelimit() {
  79              if(document.getElementById(\'options2\').style.display == \'none\') {
  80                  document.getElementById(\'options2\').style.display = \'block\';
  81              } else {
  82                  document.getElementById(\'options2\').style.display = \'none\';
  83              }
  84          }
  85  
  86  		function feedbackselection()
  87          {
  88              var index = document.exercise_admin.exerciseFeedbackType.selectedIndex;
  89  
  90              if (index == \'1\') {
  91                  document.exercise_admin.exerciseType[1].checked=true;
  92                  document.exercise_admin.exerciseType[0].disabled=true;
  93  
  94              } else {
  95                  document.exercise_admin.exerciseType[0].disabled=false;
  96              }
  97          }
  98  
  99  		function option_time_expired()
 100          {
 101              if(document.getElementById(\'timercontrol\').style.display == \'none\')
 102              {
 103                document.getElementById(\'timercontrol\').style.display = \'block\';
 104              } else {
 105                document.getElementById(\'timercontrol\').style.display = \'none\';
 106              }
 107          }
 108  
 109       	function check_per_page_one()
 110           {
 111               if (document.getElementById(\'divtimecontrol\').style.display==\'none\')
 112               {
 113                   document.getElementById(\'divtimecontrol\').style.display=\'block\';
 114                   document.getElementById(\'divtimecontrol\').display=block;
 115                   document.getElementById(\'timecontrol\').display=none;
 116               }
 117          }
 118  
 119  		function check_per_page_all()
 120           {
 121              if (document.getElementById(\'divtimecontrol\').style.display==\'block\')
 122              {
 123                  document.getElementById(\'divtimecontrol\').style.display=\'none\';
 124                  document.getElementById(\'enabletimercontroltotalminutes\').value=\'\';
 125              }
 126          }
 127          </script>';
 128  
 129  $htmlHeadXtra[] = '<script>
 130    $(document).ready(function (){
 131      $(".save").attr("style","float:right;margin-right:350px");
 132    });
 133  </script>';
 134  
 135  $htmlHeadXtra[] = '<script>
 136    $(document).ready(function (){
 137      $("div.label").attr("style","width: 100%;text-align:left;padding-bottom:2px;");
 138      $("div.row").attr("style","width: 100%;");
 139      $("div.formw").attr("style","width: 100%;");
 140    });
 141  </script>';
 142  
 143  $htmlHeadXtra[] = '<script>
 144    $(document).ready(function (){
 145         $("#addButton_1").click(function () {           
 146             var counter = $("input[name=\'counter_1\']").attr("value");           
 147             var quizcategory = $("input[name=\'quizcategory_1\']").attr("value");
 148             var quizcategory_id = $("input[name=\'quizcategory_id_1\']").attr("value");
 149             var quiz_level = $("input[name=\'quiz_level_1\']").attr("value");
 150             var quiz_level_id = $("input[name=\'quiz_level_id_1\']").attr("value");
 151             var quizCategoryArray = quizcategory.split(",");    
 152             var quizCategoryIdArray = quizcategory_id.split(",");
 153             var quizlevelArray = quiz_level.split(",");
 154             var quizlevelIdArray = quiz_level_id.split(",");
 155             counter = (counter*1) + 1;           
 156             var newTextBoxDiv = $(document.createElement("div")).attr("id", "TextBoxDiv"+counter+"_1");           
 157             var str = "<br/><table width=\"100%\" border=\"0\" cellspacing=\"2\"><tr><td width=\"45%\">";
 158             str = str + "<select name=\"quizcategory_"+counter+"_1\">";
 159             var str1 = "";           
 160             if(quizCategoryArray.length == 1)
 161             {
 162                 str1 = str1 + "<option value=\"0\">Select</option>";
 163             }
 164             for(var i=0;i<quizCategoryArray.length;i++)
 165             {
 166                 str1 = str1 + "<option value="+quizCategoryIdArray[i]+">"+quizCategoryArray[i]+"</option>";
 167             }
 168             str = str + str1;
 169             str = str + "</select></td><td width=\"25%\">";
 170             str = str + "<select name=\"quizlevel_"+counter+"_1\">";
 171             var str2 = "";           
 172             for(var i=0;i<quizlevelArray.length;i++)
 173             {
 174                 str2 = str2 + "<option value="+quizlevelIdArray[i]+">"+quizlevelArray[i]+"</option>";
 175             }
 176             str = str + str2;
 177             str = str + "</select></td><td width=\"30%\">";
 178             str = str + "<select name=\"numberofquestion_"+counter+"_1\" size=\"1\">";
 179             var str3 = "";
 180             str3 = str3 + "<option value=\"0\">Select</option>";
 181             for(var i=1;i<=10;i++)
 182             {
 183                 str3 = str3 + "<option value="+i+">"+i+"</option>";
 184             }
 185             str = str + str3;
 186             str = str + "</select></td></tr></table>";           
 187             newTextBoxDiv.html(str);
 188             $("input[name=counter_1]").val(counter);    
 189             newTextBoxDiv.appendTo("#TextBoxesGroup_1");
 190         });
 191  
 192         $("#addButton_2").click(function () {               
 193             var counter = $("input[name=\'counter_2\']").attr("value");           
 194             var quizcategory = $("input[name=\'quizcategory_2\']").attr("value");
 195             var quizcategory_id = $("input[name=\'quizcategory_id_2\']").attr("value");
 196             var quiz_level = $("input[name=\'quiz_level_2\']").attr("value");
 197             var quiz_level_id = $("input[name=\'quiz_level_id_2\']").attr("value");
 198             var quizCategoryArray = quizcategory.split(",");    
 199             var quizCategoryIdArray = quizcategory_id.split(",");
 200             var quizlevelArray = quiz_level.split(",");
 201             var quizlevelIdArray = quiz_level_id.split(",");
 202             counter = (counter*1) + 1;           
 203             var newTextBoxDiv = $(document.createElement("div")).attr("id", "TextBoxDiv"+counter+"_2");           
 204             var str = "<br/><table width=\"100%\" border=\"0\" cellspacing=\"2\"><tr><td width=\"45%\">";
 205             str = str + "<select name=\"quizcategory_"+counter+"_2\">";
 206             var str1 = "";           
 207             if(quizCategoryArray.length == 1)
 208             {
 209                 str1 = str1 + "<option value=\"0\">Select</option>";
 210             }
 211             for(var i=0;i<quizCategoryArray.length;i++)
 212             {
 213                 str1 = str1 + "<option value="+quizCategoryIdArray[i]+">"+quizCategoryArray[i]+"</option>";
 214             }
 215             str = str + str1;
 216             str = str + "</select></td><td width=\"25%\">";
 217             str = str + "<select name=\"quizlevel_"+counter+"_2\">";
 218             var str2 = "";
 219             for(var i=0;i<quizlevelArray.length;i++)
 220             {
 221                 str2 = str2 + "<option value="+quizlevelIdArray[i]+">"+quizlevelArray[i]+"</option>";
 222             }
 223             str = str + str2;
 224             str = str + "</select></td><td width=\"30%\">";
 225             str = str + "<select name=\"numberofquestion_"+counter+"_2\" size=\"1\">";
 226             var str3 = "";
 227             str3 = str3 + "<option value=\"0\">Select</option>";
 228             for(var i=1;i<=10;i++)
 229             {
 230                 str3 = str3 + "<option value="+i+">"+i+"</option>";
 231             }
 232             str = str + str3;
 233             str = str + "</select></td></tr></table>";           
 234             newTextBoxDiv.html(str);
 235             $("input[name=counter_2]").val(counter);    
 236             newTextBoxDiv.appendTo("#TextBoxesGroup_2");
 237         });
 238  
 239         $("#removeButton_1").click(function () {               
 240             var counter = $("input[name=\'counter_1\']").attr("value");           
 241             $("#TextBoxDiv" + counter+"_1").remove();
 242             counter--;    
 243             $("input[name=counter_1]").val(counter);    
 244         });
 245  
 246          $("#removeButton_2").click(function () {               
 247             var counter = $("input[name=\'counter_2\']").attr("value");           
 248             $("#TextBoxDiv" + counter+"_2").remove();
 249             counter--;    
 250             $("input[name=counter_2]").val(counter);    
 251         });
 252    });
 253  </script>';
 254  
 255  // Add the lp_id parameter to all links if the lp_id is defined in the uri
 256  if (isset($_GET['lp_id']) && $_GET['lp_id'] > 0) {
 257    $lp_id = Security::remove_XSS($_GET['lp_id']);
 258   $htmlHeadXtra[] = '<script>
 259      $(document).ready(function (){
 260        $("a[href]").attr("href", function(index, href) {
 261            var param = "lp_id=' . $lp_id . '";
 262             var is_javascript_link = false;
 263             var info = href.split("javascript");
 264  
 265             if (info.length >= 2) {
 266               is_javascript_link = true;
 267             }
 268             if ($(this).attr("class") == "course_main_home_button" || $(this).attr("class") == "course_menu_button"  || $(this).attr("class") == "next_button"  || $(this).attr("class") == "prev_button" || is_javascript_link) {
 269               return href;
 270             } else {
 271               if (href.charAt(href.length - 1) === "?")
 272                   return href + param;
 273               else if (href.indexOf("?") > 0)
 274                   return href + "&" + param;
 275               else
 276                   return href + "?" + param;
 277             }
 278        });
 279      });
 280    </script>';
 281  }
 282  
 283  // Variable
 284  $learnpath_id = Security::remove_XSS($_GET['lp_id']);
 285  // Lp object
 286  if (isset($_SESSION['lpobject'])) {
 287   if ($debug > 0)
 288    error_log('New LP - SESSION[lpobject] is defined', 0);
 289   $oLP = unserialize($_SESSION['lpobject']);
 290   if (is_object($oLP)) {
 291    if ($debug > 0)
 292     error_log('New LP - oLP is object', 0);
 293    if ($myrefresh == 1 OR (empty($oLP->cc)) OR $oLP->cc != api_get_course_id()) {
 294     if ($debug > 0)
 295      error_log('New LP - Course has changed, discard lp object', 0);
 296     if ($myrefresh == 1) {
 297      $myrefresh_id = $oLP->get_id();
 298     }
 299     $oLP = null;
 300     api_session_unregister('oLP');
 301     api_session_unregister('lpobject');
 302    } else {
 303     $_SESSION['oLP'] = $oLP;
 304     $lp_found = true;
 305    }
 306   }
 307  }
 308  
 309  // Add the extra lp_id parameter to some links
 310  $add_params_for_lp = '';
 311  if (isset($_GET['lp_id'])) {
 312    $add_params_for_lp = "&lp_id=".$learnpath_id;
 313  }
 314  /*********************
 315   * INIT EXERCISE
 316   *********************/
 317  
 318  // Scenario 1
 319  $objExercise = new Exercise(1);
 320  /*if (isset($_REQUEST['scenario'])) {
 321      // Scenario 2
 322      $objExercise_s2 = new Exercise(2);
 323  }*/
 324  
 325  /*********************
 326   * INIT FORM
 327   *********************/
 328  if(isset($_GET['exerciseId'])) {
 329   // Scenario 1
 330      $form = new FormValidator('exercise_admin1', 'post', api_get_self().'?exerciseId='.Security::remove_XSS($_GET['exerciseId']).'&'.api_get_cidreq(), null, array('style' => 'width: 100%; border: 0px'));
 331      $objExercise -> read (intval($_GET['exerciseId']));
 332      $form -> addElement ('hidden','edit','true');
 333  
 334   /*if (isset($_REQUEST['scenario'])) {
 335     // Scenario 2
 336        $form_s2 = new FormValidator('exercise_admin2', 'post', api_get_self().'?exerciseId='.Security::remove_XSS($_GET['exerciseId']).'&'.api_get_cidreq(), null, array('style' => 'width: 100%; border: 0px'));
 337        $objExercise_s2 -> read (intval($_GET['exerciseId']));
 338        $form_s2 -> addElement ('hidden','edit','true');
 339   }*/
 340  
 341  } else {
 342    $add_params_for_lp = '';
 343    if (isset($_GET['lp_id'])) {
 344      $add_params_for_lp = "&lp_id=".Security::remove_XSS($_GET['lp_id']);
 345    }
 346    // Scenario 1
 347    $form = new FormValidator('exercise_admin1', null,  api_get_self().'?'.  api_get_cidreq().$add_params_for_lp, null, array('style' => 'width: 100%; border: 0px'));
 348    $form -> addElement ('hidden','edit','false');
 349  
 350  /* if (isset($_REQUEST['scenario'])) {
 351      // Add Scenario 2
 352      $form_s2 = new FormValidator('exercise_admin2', null, api_get_self().'?'.  api_get_cidreq().$add_params_for_lp, null, array('style' => 'width: 100%; border: 0px'));
 353      $form_s2 -> addElement ('hidden','edit','false');
 354    }*/
 355  }
 356  
 357  // Scenario 1
 358  $objExercise -> createForm($form);
 359  // Add Scenario 2
 360  /*if (isset($_REQUEST['scenario'])) {
 361    $objExercise_s2 -> createForm($form_s2);
 362  }*/
 363  
 364  
 365  /*********************
 366   * VALIDATE FORM
 367   *********************/
 368  // Validation for the scenario feature.
 369  $no_validate = false;
 370  if (isset($_REQUEST['scenario'])) {
 371  /* if ($form_s2 -> validate()) {
 372      if ($form_s2 -> validate()) {
 373        $objExercise_s2 -> processCreation($form_s2);
 374      }
 375  
 376      if ($form_s2 -> getSubmitValue('edit') == 'true') {
 377        if(isset($_SESSION['fromlp'])) {
 378         header('Location:exercice.php?message=ExerciseEdited&'.api_get_cidreq().'&fromlp='.$_SESSION['fromlp']);
 379        } else {
 380         header('Location:exercice.php?message=ExerciseEdited&'.api_get_cidreq());
 381        }
 382      } else {
 383        $my_quiz_id = $objExercise_s2->id;
 384        if(isset($_SESSION['fromlp'])) {
 385         header('Location:admin.php?message=ExerciseAdded&exerciseId='.$my_quiz_id.'&fromlp='.$_SESSION['fromlp']);
 386        } else {
 387         header('Location:admin.php?message=ExerciseAdded&exerciseId='.$my_quiz_id);
 388        }
 389      }
 390    } else {
 391      $no_validate = true;
 392    }*/
 393  }
 394  
 395  if ($form -> validate()) {
 396    if ($form -> validate()) {
 397      $objExercise -> processCreation($form);
 398    }
 399  
 400    if ($form -> getSubmitValue('edit') == 'true') {
 401      if(isset($_SESSION['fromlp'])) {
 402        header('Location:exercice.php?message=ExerciseEdited&'.api_get_cidreq().'&fromlp='.$_SESSION['fromlp']);
 403      } else {
 404        header('Location:exercice.php?message=ExerciseEdited&'.api_get_cidreq());
 405      }
 406     } else {
 407       $my_quiz_id = $objExercise->id;
 408       /*if(isset($_SESSION['fromlp'])) {
 409          header('Location:admin.php?message=ExerciseAdded&exerciseId='.$my_quiz_id.'&fromlp='.$_SESSION['fromlp']);
 410        } else {*/
 411          header('Location:admin.php?'.api_get_cidreq().'&message=ExerciseAdded&exerciseId='.$my_quiz_id.$add_params_for_lp);
 412        //}
 413      }
 414   } else {
 415    $no_validate = true;
 416   }
 417  
 418  
 419   if ($no_validate === true) {
 420      /*********************
 421       * DISPLAY FORM
 422       *********************/
 423      if (isset($_SESSION['gradebook'])) {
 424          $gradebook=    $_SESSION['gradebook'];
 425      }
 426  
 427      if (!empty($gradebook) && $gradebook=='view') {
 428          $interbreadcrumb[]= array (
 429                  'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
 430                  'name' => get_lang('Gradebook')
 431              );
 432      }
 433      
 434      $nameTools=get_lang('ExerciseManagement');
 435      $interbreadcrumb[] = array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
 436      
 437  //    Display::display_header($nameTools,'Exercise');
 438      Display :: display_tool_header();
 439      
 440      if ($objExercise->feedbacktype==1 || $objExercise_s2->feedbacktype==1) {
 441          Display::display_normal_message(get_lang("DirectFeedbackCantModifyTypeQuestion"));
 442      }
 443      
 444      if(api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) {
 445          echo '<div class="confirmation-message">'.get_lang('SearchXapianModuleNotInstaled').'</div>';
 446      }
 447      ?>
 448      
 449      <div class="actions">
 450    <?php
 451     if (isset($_GET['lp_id']) && $_GET['lp_id'] > 0) {
 452       
 453      //$lp_id = Security::remove_XSS($_GET['lp_id']);
 454      // The lp_id parameter will be added by javascript
 455       $return = "";
 456       $return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '">' . Display::return_icon('pixel.gif', get_lang("Author"), array('class' => 'toolactionplaceholdericon toolactionauthor')).get_lang("Author") . '</a>';
 457       $return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '&action=add_item&type=step">' . Display::return_icon('pixel.gif', get_lang("Content"), array('class' => 'toolactionplaceholdericon toolactionauthorcontent')).get_lang("Content") . '</a>';
 458       $return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '&gradebook=&action=view&lp_id='.$_GET['lp_id'].'">' . Display::return_icon('pixel.gif', get_lang("ViewRight"), array('class' => 'toolactionplaceholdericon toolactionauthorpreview')).get_lang("ViewRight") . '</a>';
 459       echo $return;
 460     }
 461     if (!isset($_GET['lp_id'])) {
 462    ?>
 463          <a href="exercice.php?<?php echo api_get_cidreq()?>"><?php echo Display::return_icon('pixel.gif', get_lang('List'), array('class' => 'toolactionplaceholdericon toolactionback')) . get_lang('List')?></a>
 464    <?php
 465     }
 466    ?>        
 467    <?php if (!isset($_GET['lp_id'])) {?>
 468          <a href="exercise_admin.php?<?php echo api_get_cidreq()?>"><?php echo Display::return_icon('pixel.gif', get_lang('NewEx'), array('class' => 'toolactionplaceholdericon toolactionnewquiz')) . get_lang('NewEx')?></a>    
 469  <!--    <a href="upload_exercise.php?<?php echo api_get_cidreq()?>"><?php echo Display::return_icon('pixel.gif', get_lang('UploadQuiz'), array('class' => 'toolactionplaceholdericon toolactionexportcourse')) . get_lang('UploadQuiz')?></a>-->
 470    <?php } ?>
 471    <?php
 472     if (isset($_GET['exerciseId']) && $_GET['exerciseId'] > 0) {
 473    ?>
 474    <a href="admin.php?<?php echo  api_get_cidreq() . '&exerciseId='.Security::remove_XSS($_GET['exerciseId']); ?>"><?php echo Display::return_icon('pixel.gif', get_lang('Questions'), array('class' => 'toolactionplaceholdericon toolactionquestion')) . get_lang('Questions'); ?></a>
 475    <a href="exercise_admin.php?<?php echo 'scenario=yes&modifyExercise=yes&' . api_get_cidreq() . '&exerciseId='.Security::remove_XSS($_GET['exerciseId']); ?>"><?php echo Display::return_icon('pixel.gif', get_lang('Scenario'), array('class' => 'toolactionplaceholdericon toolactionscenario')). get_lang('Scenario'); ?></a>
 476    <a href="exercice_submit.php?<?php echo api_get_cidreq() . '&exerciseId='.Security::remove_XSS($_GET['exerciseId']); ?>"><?php echo Display::return_icon('pixel.gif', get_lang('ViewRight'), array('class' => 'toolactionplaceholdericon toolactionsearch')) . get_lang('ViewRight'); ?></a> 
 477          <?php }
 478    ?>
 479      </div>
 480  
 481  <?php
 482      // start the content div
 483      echo '<div id="content_with_secondary_actions">';
 484  
 485    if (isset($_GET['modifyExercise'])) {
 486     $widht = '46%';
 487   //  $height = '550px';
 488     $height = '600px';
 489     $widht_right = $widht;
 490     $container_class = "";
 491     $sub_container_class = "quiz_scenario_squarebox";
 492    } else {
 493     $container_class = "";
 494     $sub_container_class = "";
 495  /*   $widht = '500px';
 496     $widht_right = '';*/
 497     $widht = '370px';
 498     $widht_right = '400px';
 499     $height = '320px';
 500    }
 501  ?>
 502  <!--<div id ="exercise_admin_container" class="<?php echo $container_class; ?>" style="height: <?php echo $height; ?>">-->
 503  <div id ="exercise_admin_container" class="<?php echo $container_class; ?>">
 504  <table cellpadding="5" width="100%"><tr><td width="100%" valign="top">
 505  <div id="exercise_admin_left_container" class="<?php echo $sub_container_class; ?>" >
 506          <?php $form -> display (); ?>
 507      </div></td>
 508  <!--<td width="50%">
 509      <div id="exercise_admin_right_container" class="<?php echo $sub_container_class; ?>">
 510          <?php
 511     /*if (!isset($_GET['scenario'])) {
 512       Display::display_icon('instructor-faq.png', get_lang('Teacher'));
 513     } elseif (isset($_GET['scenario']) && isset($_GET['modifyExercise'])) {
 514       $form_s2 -> display ();
 515     }*/
 516    ?>
 517      </div></td>-->
 518      </tr></table></div>
 519  
 520      <?php
 521      // close the content div
 522      echo '</div>';
 523      ?>
 524  
 525      <div class="actions">
 526   <?php
 527      if(api_get_setting('show_quizcategory') == 'true'){
 528      echo '<a href="exercise_category.php?<?php echo api_get_cidreq()?>&action=add_category">'.Display :: return_icon("category_22.png", get_lang("Categories")) . get_lang("Categories").'</a>';
 529      }
 530     if (isset($_GET['lp_id']) && $_GET['lp_id'] > 0) {
 531       $return = '';
 532       // The lp_id parameter will be added by Javascript
 533  //     $return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '&action=build">' . Display::return_icon('build.png', get_lang('Build')).get_lang("Build") . '</a>';
 534   //    $return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '&gradebook=&action=admin_view">' . Display::return_icon('organize.png', get_lang('Organize')).get_lang("Organize") . '</a>';
 535       //$return.= '<a href="../newscorm/lp_controller.php?' . api_get_cidreq() . '&gradebook=&action=view">' . Display::return_icon('view.png', get_lang('ViewRight')).get_lang("ViewRight") . '</a>';
 536       echo $return;
 537     } else {
 538    ?>
 539      <!--    <a href="<?php echo api_add_url_param($_SERVER['REQUEST_URI'], 'show=result')?>"><?php echo Display :: return_icon('reporting22.png', get_lang('Tracking')) . get_lang('Tracking')?></a>-->
 540      <?php
 541    }
 542    ?>
 543    <?php if (!isset($_GET['lp_id'])) {?>        
 544          <a href="upload_exercise.php?<?php echo api_get_cidreq()?>"><?php echo Display::return_icon('pixel.gif', get_lang('UploadQuiz'), array('class' => 'actionplaceholdericon actionuploadquiz')) . get_lang('UploadQuiz')?></a>
 545    <?php } ?>
 546      </div>
 547      <div style="clear:both"></div>
 548   <?php
 549  }
 550  
 551  // display footer
 552  Display::display_footer();
 553  ?>

title

Description

title

Description

title

Description

title

title

Body