hide map for Character groups Quest Stations when there are no stations
This commit is contained in:
commit
df14dfafc3
4371 changed files with 1220224 additions and 0 deletions
60
stationtypes/singlechoice/html/edittask.tpl
Normal file
60
stationtypes/singlechoice/html/edittask.tpl
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<form method="post">
|
||||
<fieldset>
|
||||
<legend><?=_('Question')?></legend>
|
||||
<?=$t->t($task)?>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend><?=_('Answers')?></legend>
|
||||
<ol id="answers">
|
||||
<?php foreach($answers as $answerIndex => &$answer) : ?>
|
||||
<li>
|
||||
<?=_('Answer')?>:<br />
|
||||
<label>
|
||||
<input id="answer-<?=$answerIndex?>-tick" type="radio" name="answer" value="<?=$answerIndex?>" <?php if($answer['id'] == $question['answer_id']) : ?>checked="checked"<?php endif ?> />
|
||||
<?=_('correct')?>
|
||||
</label>
|
||||
<textarea id="answer-<?=$answerIndex?>" name="answers[<?=$answerIndex?>][answer]" class="answer">
|
||||
<?=$answer['answer']?>
|
||||
</textarea>
|
||||
<button class="remove-answer" type="button">−</button>
|
||||
<hr />
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
<li>
|
||||
<button class="add-answer" type="button">+</button>
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<input type="submit" name="save" value="<?=_('save')?>" />
|
||||
</form>
|
||||
|
||||
<script>
|
||||
// Text editors
|
||||
$('textarea.answer').markItUp(mySettings);
|
||||
|
||||
// Answers
|
||||
var answerIndex = <?=count($answers)?>;
|
||||
var answerElement = '<label><input id="answer-ANSWERINDEX-tick" type="radio" name="answer" value="ANSWERINDEX" /> <?=_('correct answer')?></label>' +
|
||||
'<textarea id="answer-ANSWERINDEX" name="answers[ANSWERINDEX][answer]" class="answer"></textarea>' +
|
||||
'<button class="remove-answer" type="button">−</button>' +
|
||||
'<hr />';
|
||||
$(".add-answer").click(addAnswer);
|
||||
$(".remove-answer").click(removeAnswer);
|
||||
function addAnswer(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
|
||||
var parent = $(event.target).parent();
|
||||
var element = '<li>' + answerElement.replace(/ANSWERINDEX/g, answerIndex) + '</li>';
|
||||
parent.before(element);
|
||||
$("#answers li:nth-last-child(2) .remove-answer").click(removeAnswer);
|
||||
$('#answers li:nth-last-child(2) textarea.answer').markItUp(mySettings);
|
||||
|
||||
answerIndex++;
|
||||
}
|
||||
function removeAnswer(event)
|
||||
{
|
||||
event.preventDefault();
|
||||
$(event.target).parent().remove();
|
||||
}
|
||||
</script>
|
||||
13
stationtypes/singlechoice/html/quest.tpl
Normal file
13
stationtypes/singlechoice/html/quest.tpl
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<form method="post" class="multiplechoice">
|
||||
<ol class="mchoice">
|
||||
<?php foreach($answers as $i => &$answer) : ?>
|
||||
<li class="cf">
|
||||
<input type="radio" id="answer[<?=$i?>]" name="answer" value="<?=$answer['id']?>" <?php if(array_key_exists('submission', $question) && $question['submission'] === $answer['id']) : ?>checked="checked"<?php endif ?> <?php if($tried) : ?>disabled="disabled"<?php endif ?>/>
|
||||
<label for="answer[<?=$i?>]"><?=$t->t($answer['answer'])?></label>
|
||||
</li>
|
||||
<?php endforeach ?>
|
||||
</ol>
|
||||
<?php if(!$tried) : ?>
|
||||
<input type="submit" name="submit" value="<?=_('solve')?>" />
|
||||
<?php endif ?>
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue