Skip to content

Instantly share code, notes, and snippets.

View ankitagarwal's full-sized avatar

Ankit Agarwal ankitagarwal

View GitHub Profile
function Button(props) {
return (
<button onClick={() => props.onclick_function(props.increment)}>
{props.increment}
</button>
);
}
function Display(props) {
return (
<div>{props.message}</div>
@ankitagarwal
ankitagarwal / subtree-merge
Created August 19, 2014 08:45
Subtree merge with history rewrite
git filter-branch --index-filter \
'git ls-files -s | sed "s-\t\"*-&grade\/report\/history/-" |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new \
git update-index --index-info &&
mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"
' HEAD
@mod @mod_choice
Feature: Limit choice responses
In order to restrict students from selecting a response more than a specified number of times
As a teacher
I need to limit the choice responses
@javascript
Scenario: Limit the number of responses allowed for a choice activity and verify the result as students
Given the following "users" exists:
| username | firstname | lastname | email |
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
print_object($cm);
$context = context_module::instance($cm->id);
$aag = has_capability('moodle/site:accessallgroups', $context);
if ($groupmode == VISIBLEGROUPS or $aag) {
$allowedgroups = groups_get_all_groups($cm->course, 0, $cm->groupingid); // any group in grouping
} else {
$allowedgroups = groups_get_all_groups($cm->course, $USER->id, $cm->groupingid); // only assigned groups
}
print_object($allowedgroups);
$activegroup = groups_get_activity_group($cm, true, $allowedgroups);
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
diff --git a/calendar/classes/type_base.php b/calendar/classes/type_b
new file mode 100644
index 0000000..2ffd17c
--- /dev/null
+++ b/calendar/classes/type_base.php
@@ -0,0 +1,7 @@
+<?php
+namespace core_calendar;
+class type_base {
+ function __construct() {