Skip to content

Instantly share code, notes, and snippets.

View marinaglancy's full-sized avatar

Marina Glancy marinaglancy

View GitHub Profile
diff --git a/grade/grading/form/lib.php b/grade/grading/form/lib.php
index 21d1f3f..1dcb67e 100644
--- a/grade/grading/form/lib.php
+++ b/grade/grading/form/lib.php
@@ -78,6 +78,27 @@ abstract class gradingform_controller {
return true; // todo make this dependent on grading_definitions existence and its status
}
+ public function to_html($userid, $assignmentid) { // TODO submissionid may not exist, need userid + assignmentid
+ $output = '';
@marinaglancy
marinaglancy / convert_subpackages.php
Created January 9, 2012 07:13
Script to get rid of @subpackage token in phpdocs
<?php
/**
* This script will go through specified directory (recoursively), search for all .php and .inc files and analyze phpdocs.
* It will try to locate file-level phpdocs and sometimes display errors (this analysis is not complete at the moment).
* Also it will replace \package XXX \subpackage YYY with \package XXX_YYY
*
* @copyright Marina Glancy
*/
diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js
index 881d181..1281751 100644
--- a/lib/form/filemanager.js
+++ b/lib/form/filemanager.js
@@ -100,9 +100,8 @@ M.form_filemanager.init = function(Y, options) {
this.pathbar.removeChild(this.pathnode);
}
// initialize 'select file' panel
- this.selectnode = Y.Node.create(M.form_filemanager.templates.fileselectlayout);
+ this.selectnode = Y.Node.createWithFilesSkin(M.form_filemanager.templates.fileselectlayout);
@marinaglancy
marinaglancy / teststyle.htm
Created May 28, 2012 02:26
Test style overwriting
<html>
<head>
<style>
#myid .myclass {background: yellow;}
.myclass {background: red;}
</style>
</head>
<body>
<div id="myid">
<div class="myclass">HELLO, I am [#myid .myclass], I am supposed to be yellow!</div>
@marinaglancy
marinaglancy / icons23.html
Created May 28, 2012 07:46
Icons and stings in Moodle 2.3
<!-- saved from url=(0047)http://marina.moodle.local/master/testicons.php -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><style>
table {border-collapse: collapse;}
.row {}
.icon90 {vertical-align: top;padding-top:5px;}
.icon24 {vertical-align: top;padding-top:25px;}
.extension {}
.mimetype {}
.badtype {color:#666;}
@marinaglancy
marinaglancy / icons23.html
Created May 28, 2012 07:47
Icons and stings in Moodle 2.3
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><style>
table {border-collapse: collapse;}
.row {}
.icon90 {vertical-align: top;padding-top:5px;}
.icon24 {vertical-align: top;padding-top:25px;}
.extension {}
.mimetype {}
.badtype {color:#666;}
.goodtype {}
td {border-bottom: 1px solid #666; padding-left:2px;padding-right:2px;}
@marinaglancy
marinaglancy / testicons.php
Created May 28, 2012 07:49
Script to test icons and mimetype stings in Moodle 2.3
<?php
require_once('config.php');
require_once($CFG->libdir .'/filelib.php');
$PAGE->set_context(get_system_context());
$mimeicons = get_mimetypes_array();
?>
<style>
diff --git a/lib/filebrowser/file_info_context_module.php b/lib/filebrowser/file_info_context_module.php
index 0357ee3..0189e7c 100644
--- a/lib/filebrowser/file_info_context_module.php
+++ b/lib/filebrowser/file_info_context_module.php
@@ -244,6 +244,63 @@ class file_info_context_module extends file_info {
}
/**
+ * Checks if the module has any files inside that match specified extensions
+ *
@marinaglancy
marinaglancy / get_coursemodule_from_id.php
Created July 9, 2012 08:53
lib/datalib.php, function get_coursemodule_from_id()
<?php
/**
* Given an id of a course module, finds the coursemodule description
*
* @global object
* @param string $modulename name of module type, eg. resource, assignment,... (optional, slower and less safe if not specified)
* @param int $cmid course module id (id in course_modules table)
* @param int $courseid optional course id for extra validation
* @param bool $sectionnum include relative section number (0,1,2 ...)
* @param int $strictness IGNORE_MISSING means compatible mode, false returned if record not found, debug message if more found;
@marinaglancy
marinaglancy / repository_github.diff
Created August 1, 2012 02:55
repository_github fix to test download error on moodle.org
diff --git a/lib.php b/lib.php
index ca85b5f..8e1f0ed 100644
--- a/lib.php
+++ b/lib.php
@@ -257,14 +257,12 @@ class repository_github extends repository {
$fp = fopen($path, 'w');
$c = new curl();
- $c->setopt(array('CURLOPT_FOLLOWLOCATION' => true, 'CURLOPT_MAXREDIRS' => 3));
- $result = $c->download(array(array('url' => $url, 'file'=> $fp)));