Skip to content

Commit

Permalink
fix create_entry rule; various fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MerliX committed Nov 11, 2016
1 parent c89970d commit 2dc5a63
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions classes/condition.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ private static function delete_empty_entry($userid, $courseid, $cmid)
private static function examus_enabled_for($cm)
{
# XXX This may fall
return strpos($cm->availability, '"c":[{"type":"examus"}]') !== false;
return strpos($cm->availability, '"c":[{"type":"examus') !== false;
}

public static function has_examus_condition(cm_info $cm) {
Expand Down Expand Up @@ -92,7 +92,7 @@ private static function create_entry_if_not_exist($userid, $courseid, $cmid)
$sort='id');


if (count($entries) !== 0) {
if (count($entries) == 0) {
$timenow = time();
$entry = new stdClass();
$entry->userid = $userid;
Expand Down
2 changes: 1 addition & 1 deletion classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class frontend extends \core_availability\frontend {

protected function get_javascript_strings() {
return ['title', 'error_setduration', 'duration'];
return ['title', 'error_setduration', 'duration', 'link'];
}

protected function get_javascript_init_params($course, \cm_info $cm = null,
Expand Down
3 changes: 2 additions & 1 deletion entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
$entry = $DB->get_record('availability_examus', array('accesscode' => $accesscode));

if ($entry) {
$entry->status = 'started';
$entry->status = 'Started';
$entry->timemodified = time();
$DB->update_record('availability_examus', $entry);
$cmid = $entry->cmid;

Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
}


$entries = $DB->get_records('availability_examus');
$entries = $DB->get_records('availability_examus', array(), '-id');

if (!empty($entries)) {
$table = new flexible_table('availability_examus_table');
Expand Down
1 change: 1 addition & 0 deletions lang/en/availability_examus.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
$string['new_entry'] = 'New entry';
$string['error_setduration'] = 'Duration in minutes';
$string['duration'] = 'Duration in minutes';
$string['link'] = 'Logs and video';

$string[''] = '';
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'availability_examus';
$plugin->version = 2016103107;
$plugin->version = 2016103108;
$plugin->release = 'v3.1-r1';
$plugin->requires = 2016052300;
$plugin->maturity = MATURITY_STABLE;

0 comments on commit 2dc5a63

Please sign in to comment.