';
+ }
+ }
+ }
+ function wrap_html_finish(){
+ if (!$this->is_downloading()) {
+ if ($this->showcheckboxes) {
// Close form
echo '
';
echo '';
@@ -108,7 +110,7 @@
function col_checkbox($attempt){
- if ($attempt->attempt){
+ if ($attempt->attempt && $this->showcheckboxes){
return '';
} else {
return '';
Index: theme/standard/styles_layout.css
===================================================================
RCS file: /cvsroot/moodle/moodle/theme/standard/styles_layout.css,v
retrieving revision 1.646
diff -u -r1.646 styles_layout.css
--- theme/standard/styles_layout.css 26 Nov 2008 04:03:45 -0000 1.646
+++ theme/standard/styles_layout.css 26 Nov 2008 07:49:24 -0000
@@ -4252,12 +4252,33 @@
.quizquestionlistcontrols {
text-align: center;
}
-
+#mod-quiz-report div.allcoursegrades {
+ width: auto;
+ float: right;
+ padding: 0.3em 0;
+ margin: 0;
+}
+#mod-quiz-report div.groupselector {
+ float: left;
+ padding: 0.3em 0;
+ margin: 0;
+}
+#mod-quiz-report div.quizattemptcounts {
+ text-align: center;
+ padding: 0.3em 0;
+ margin: 0;
+ clear: none;
+}
+#mod-quiz-report div.quizattemptcounts p {
+ margin: 0;
+}
+#mod-quiz-report div#commands {
+ text-align: center;
+}
#mod-quiz-report table#attempts,
-#mod-quiz-report div#commands,
#mod-quiz-report table#itemanalysis
{
- width: 80%;
+ width: 100%;
margin: auto;
}
#mod-quiz-report table.titlesleft td.c0
@@ -4274,14 +4295,19 @@
#mod-quiz-report table#attempts .header,
#mod-quiz-report table#attempts .cell
{
- padding: 4px;
-}
-#mod-quiz-report table#attempts .header .commands {
- display: inline;
+ padding: 1px 4px;
}
#mod-quiz-report table#attempts .picture {
width: 40px;
}
+#mod-quiz-report table#attempts .picture img.userpicture {
+ width: 20px;
+ height: 20px;
+}
+#mod-quiz-report table#attempts p,
+#mod-quiz-report table#attempts .que {
+ margin: 0;
+}
#mod-quiz-report table#attempts td {
border-left-width: 1px;
border-right-width: 1px;
@@ -4307,9 +4333,6 @@
{
padding: 4px;
}
-#mod-quiz-report table#itemanalysis .header .commands {
- display: inline;
-}
#mod-quiz-report table#itemanalysis td {
border-width: 1px;
border-style: solid;
@@ -4357,10 +4380,6 @@
padding: 4px;
}
-#mod-quiz-grading table#grading .header .commands
-{
- display: inline;
-}
#mod-quiz-grading table#grading .picture
{
Index: lib/tablelib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/tablelib.php,v
retrieving revision 1.39
diff -u -r1.39 tablelib.php
--- lib/tablelib.php 14 Oct 2008 15:00:26 -0000 1.39
+++ lib/tablelib.php 26 Nov 2008 07:49:22 -0000
@@ -7,8 +7,8 @@
define('TABLE_VAR_ILAST', 5);
define('TABLE_VAR_PAGE', 6);
-define('TABLE_P_TOP', 1);
-define('TABLE_P_BOTTOM', 2);
+define('TABLE_P_TOP', 1);
+define('TABLE_P_BOTTOM', 2);
class flexible_table {
@@ -94,23 +94,33 @@
}
/**
- * Call this to pass the download type. Use :
- * $download = optional_param('download', '', PARAM_ALPHA);
- * To get the download type. We assume that if you call this function with
+ * Call this to pass the download type. It is recommended that you just pass
+ * true, then the format will be determined automatically from the form
+ * controls ouput by download_buttons or download_form_controls.
+ *
+ * We assume that if you call this function with
* params that this table's data is downloadable, so we call is_downloadable
- * for you (even if the param is '', which means no download this time.
- * Also you can call this method with no params to get the current set
- * download type.
- * @param string $download download type. One of csv, tsv, xhtml, ods, etc
+ * for you (even if the type is '', which means no download this time.
+ * Also you can call this method with no params to get the download type.
+ * @param mixed $download Either a specific type 'csv', 'tsv', 'xhtml', 'ods',
+ * to force download in this type, or true to initialise from submitted params 'downloadtable' and 'downloadtabletype'
* @param string $filename filename for downloads without file extension.
* @param string $sheettitle title for downloaded data.
* @return string download type. One of csv, tsv, xhtml, ods, etc
*/
- function is_downloading($download = null, $filename='', $sheettitle=''){
- if ($download!==null){
+ function is_downloading($type = null, $filename='', $sheettitle=''){
+ if (!is_null($type)) {
$this->sheettitle = $sheettitle;
$this->is_downloadable(true);
- $this->download = $download;
+ if ($type === true) {
+ if (optional_param('downloadtable', false, PARAM_BOOL)) {
+ $this->download = optional_param('downloadtableformat', '', PARAM_ALPHA);
+ } else {
+ $this->download = '';
+ }
+ } else {
+ $this->download = $type;
+ }
$this->filename = clean_filename($filename);
$this->export_class_instance();
}
@@ -856,32 +866,48 @@
}
return $row;
}
+
/**
* This function is not part of the public api.
*/
- function get_download_menu(){
- $allclasses= get_declared_classes();
+ static function get_download_menu() {
+ $allclasses = get_declared_classes();
$exportclasses = array();
foreach ($allclasses as $class){
$matches = array();
if (preg_match('/^table\_([a-z]+)\_export\_format$/', $class, $matches)){
$type = $matches[1];
- $exportclasses[$type]= get_string("download$type", 'table');
+ $exportclasses[$type] = get_string("download$type", 'table');
}
}
return $exportclasses;
}
/**
- * This function is not part of the public api.
+ * Return a group of form controls that can be added to $mform to control
+ * downloading of this report.
+ *
+ * @param object $mform a Moodle form.
+ * @return array an array of form controls that can be added to $mform.
+ */
+ static function download_form_controls($mform) {
+ $downloadgrp = array();
+ $downloadgrp[] =& $mform->createElement('select', 'downloadtableformat', null, flexible_table::get_download_menu());
+ $mform->setDefault('downloadtableformat', 'csv');
+ $downloadgrp[] =& $mform->createElement('submit', 'downloadtable', get_string('download', 'table'));
+ return $downloadgrp;
+ }
+
+ /**
+ * @return string HTML for a simple form to let people download this table in a variety of formats.
*/
function download_buttons(){
if ($this->is_downloadable() && !$this->is_downloading()){
$downloadoptions = $this->get_download_menu();
$html = '';