Beispiel #1
0
} elseif (preg_match('/audio.+/', $vars['entity']->get_quiz_mime())) {
    echo elgg_view(GLOBAL_IZAP_CONTEST_PLUGIN . '/quiz/audio_view', array('entity' => $vars['entity']));
} elseif (elgg_is_active_plugin(GLOBAL_IZAP_VIDEOS_PLUGIN) && preg_match('/video.+/', $vars['entity']->get_quiz_mime())) {
    echo elgg_view(GLOBAL_IZAP_CONTEST_PLUGIN . '/quiz/video_view', array('entity' => $vars['entity']));
} else {
    echo elgg_view(GLOBAL_IZAP_CONTEST_PLUGIN . '/quiz/simple_view', array('entity' => $vars['entity']));
}
?>
</div>
    <?php 
if ($vars['entity']->canEdit() && elgg_get_logged_in_user_guid() == $vars['entity']->owner_guid) {
    echo IzapBase::controlEntityMenu(array('entity' => $vars['entity'], 'handler' => GLOBAL_IZAP_CONTEST_QUIZ_PAGEHANDLER, 'vars' => array($vars['entity']->container_guid, $vars['entity']->getGUID(), elgg_get_friendly_title($vars['entity']->title))));
} else {
    if (!isset($quiz_metadata_array[$_SESSION['user']->username])) {
        echo izapbase::input('hidden', array('name' => 'quiz[guid]', 'value' => $vars['entity']->guid));
        echo izapbase::input('hidden', array('name' => 'quiz[container_guid]', 'value' => $vars['entity']->container_guid));
        ?>
        <p style="float:right;">
    <?php 
        echo elgg_view('input/submit', array('name' => 'quiz[answer]', 'value' => elgg_echo('izap-contest:quiz:answer')));
        // echo elgg_view('input/submit', array('name' => 'quiz[skip]', 'value' => elgg_echo('izap-contest:quiz:skip')));
        ?>
        </p>
      <?php 
    }
}
?>
    <div class="clearfloat"></div>
  </form>
</div>
Beispiel #2
0
        <?php 
//echo elgg_echo("tags");
//echo elgg_view("input/tags", array("name" => "attributes[tags]", "value" => $quiz_entity->tags))
?>
      </label>
    </p>


    <?php 
if ($vars['quiz_entity']) {
    echo elgg_view('input/hidden', array('name' => "attributes[guid]", "value" => $quiz_entity->getGUID()));
}
echo elgg_view('input/hidden', array('name' => "attributes[container_guid]", "value" => $vars['container_guid']));
echo elgg_view('input/hidden', array('name' => "attributes[qtype]", "value" => $vars['mtype'] == '' ? 'simple' : $vars['mtype']));
echo elgg_view('input/hidden', array('name' => 'attributes[plugin]', 'value' => GLOBAL_IZAP_CONTEST_PLUGIN));
echo izapbase::input('submit', array('name' => "Submit", "value" => elgg_echo('save')));
?>
  </form>
</div>
<script language="javascript" type="text/javascript">
  var counter=2;
  $('document').ready(function(){
    $("#addmore").click(function(){
      $("#option-array").append('<p id="option'+counter+'"><label><?php 
echo elgg_echo('izap-contest:quiz:option');
?>
<input onblur="leave_corresponding_option('+counter+')" onfocus="focus_corresponding_option('+counter+')" onkeyup="correct_option_label(this.value,'+counter+')" type="text" name="attributes[opt:'+counter+']" class="input-text"></label><a href="javascript:del_options(\''+counter+'\');">Eliminar</a></p>');
      $("#correct-option-array").append('<label id="correct'+counter+'"><input name="attributes[_correct_option]" value="opt:'+counter+'" class="input-radio" type="radio"><span class="izapRadio" id="rlabel'+counter+'">option 1</span> <br /></label>');
      counter++;
      return false;
    });