Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

teacher can now choose if glossary concept is displayed are not

  • Loading branch information...
commit 837a0fe2580090dced5f0aa0e4d92cc0a95dcd39 1 parent 05753d2
jpuntd authored
View
14 blocks/glossary_random/block_glossary_random.php
@@ -8,7 +8,7 @@ class block_glossary_random extends block_base {
function init() {
$this->title = get_string('blockname','block_glossary_random');
- $this->version = 2005010300;
+ $this->version = 2005040500;
}
@@ -75,7 +75,11 @@ function specialization() {
' AND approved = 1 '.
'ORDER BY timemodified '.$SORT.' '.$LIMIT)) {
- $text = "<b>$entry->concept</b><br />";
+ if ($this->config->showconcept) {
+ $text = "<b>$entry->concept</b><br />";
+ } else {
+ $text = '';
+ }
$text .= format_text($entry->definition, $entry->format);
$this->config->nexttime = usergetmidnight(time()) + DAYSECS * $this->config->refresh;
@@ -103,7 +107,7 @@ function instance_config_print() {
// ... teacher has not yet configured the block, let's put some default values here to explain things
$this->config->title = get_string('blockname','block_glossary_random');
$this->config->refresh = 0;
-
+ $this->config->showconcept = 1;
$this->config->cache= get_string('notyetconfigured','block_glossary_random');
$this->config->addentry=get_string('addentry', 'block_glossary_random');
$this->config->viewglossary=get_string('viewglossary', 'block_glossary_random');
@@ -170,7 +174,9 @@ function get_content() {
$this->content->footer = '<a href="'.$CFG->wwwroot.'/mod/glossary/edit.php?id='.$cm->id
.'" title="'.$this->config->addentry.'">'.$this->config->addentry.'</a><br />';
- }
+ } else {
+ $this->content->footer ='';
+ }
$this->content->footer .= '<a href="'.$CFG->wwwroot.'/mod/glossary/view.php?id='.$cm->id
.'" title="'.$this->config->viewglossary.'">'.$this->config->viewglossary.'</a>';
View
7 blocks/glossary_random/config_instance.html
@@ -30,6 +30,13 @@
?></td>
</tr>
+<tr valign=top>
+<td align=right>
+<input type="hidden" name="showconcept" value="0" />
+<input type="checkbox" name="showconcept" value="1" <?php if(!empty($this->config->showconcept)) echo 'checked="checked"'; ?> /></td>
+<td>
+<?php print_string('showconcept', 'block_glossary_random'); ?></td></tr>
+
<tr>
<td colspan="2">
<b><?php print_string("whichfooter","block_glossary_random") ?></b></td></tr>
Please sign in to comment.
Something went wrong with that request. Please try again.