Update of /cvsroot/stack/stack-dev/opaque/moodleModule/stack_diagnostic
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv28438/opaque/moodleModule/stack_diagnostic
Added Files:
block_stack_diagnostic.php styles.php readme.txt
config_global.html
Log Message:
Merging 2.2 branch
(with some additional fixes to ensure seamless updating for version lines)
--- NEW FILE: block_stack_diagnostic.php ---
<?php
class block_stack_diagnostic extends block_list {
function init() {
$this->title = get_string('title', 'block_stack_diagnostic');
$this->version = 2007090500;
}
function get_content() {
global $CFG;
$root = $CFG->wwwroot;
if ($this->content !== NULL) {
return $this->content;
}
$this->content = new stdClass;
$this->content->items = array();
$this->content->icons = array();
$this->content->footer = '';
//check STACK question type has been added.
$filename = $CFG->dirroot.'/question/type/opaque/stack/';
if (!empty($this->instance->pageid)) {
$context = get_context_instance(CONTEXT_COURSE, $this->instance->pageid);
}
if (empty($context)) {
$context = get_context_instance(CONTEXT_SYSTEM);
}
global $SESSION;
$SESSION->stackContext = $context;
if(file_exists($filename))
{
//$this->content->items[] = print_r($context,1);
//$this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />';
///*
if (has_capability('mod/quiz:attempt', $context)) {
$this->content->items[] = 'can attempt quiz ';
$this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />';
}
// if (has_capability('mod/quiz:viewreports', $context)) {
$this->content->items[] = 'can view <a href="'.$root.'/question/type/opaque/stack/soapPage.php?page=diagnostic">'.get_string('reports', 'block_stack_diagnostic').'</a>';
$this->content->icons[] = '<img src="'.$root.'/pix/i/outcomes.gif" class="icon" alt="Diagnostic Report" />';
//$this->content->items[] = ;
// }
//*/
}
else
{
$this->content->items[] = get_string('stack_not_installed', 'block_stack');
$this->content->icons[] = '<img src="'.$root.'/blocks/stack/images/warning.png" class="icon" alt="Warning" />';
}
return $this->content;
}
function has_config() {
return true;
}
/*function instance_allow_config() {
return true;
}*/
}
?>
--- NEW FILE: readme.txt ---
STACK Block
A simple block which allows displays links to access STACK server functions. (http://stack.bham.ac.uk)
Users are only shown links to parts they have access rights to.
Install
-------
To install, copy the stack folder into <moodle directory>/blocks/
Log into moodle and go to the admin page eg. www.yourmoodlesite.com/admin
Select a course and turn editing on. You can add then add the STACK Block to that course.
Icons
-----
Icons from Moodle and http://www.famfamfam.com/lab/icons/silk/
Version History
---------------
1.0 First Release (5th Sept 2007) Jonathan Hart, j.p...@bh...
--- NEW FILE: styles.php ---
/* We provide our own quiz buttons, one of which triggers a hidden button. */
.submitbtns {
display: none;
}
/* Ensures that elements generated by jsMath don't overlap and
thus disable buttons whilst enabling embedded input fields.
Workaround from http://www.math.union.edu/~dpvc/jsMath/bugs.html
STACK bug #2890734 */
input {
z-index: 2;
position: relative;
}
--- NEW FILE: config_global.html ---
<h3><?php echo get_string('settings', 'block_stack_diagnostic'); ?></h3>
<p><?php echo get_string('noSettings', 'block_stack_diagnostic'); ?></p>
<p>
<?php
$url = '../question/type/opaque/engines.php';
echo get_string('opaqueSettings', 'block_stack_diagnostic', $url);
?>
.</p>
|