Skip to content

Commit

Permalink
Bug #8, Fix User::UNDEF_INSTRUMENT in PHP; 2nd result link JS [iet:…
Browse files Browse the repository at this point in the history
…10328314]

* Plus, Javascript eslint / Travis-CI fix
  • Loading branch information
nfreear committed Apr 14, 2018
1 parent 963b5ae commit 359f835
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions db/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @package auth_ouopenid
* @author Nick Freear, 13-March-2017.
* @copyright (c) 2017 The Open University.
* @copyright © 2017 The Open University.
*
* @link https://docs.moodle.org/dev/Data_manipulation_API
* @link https://github.com/goodby/csv#import-to-database-via-pdo
Expand All @@ -29,7 +29,7 @@ class User extends base
const CSV_BATCH = 8; // Bug #5.

const PREFIX = 'ouop_';
const UNDEF_INSTRUMENT = 'kd'; // 'tpt';
const UNDEF_INSTRUMENT = 'fr'; // Was: 'kd', 'tpt';
const INSTRUMENT_REGEX = '/^(kd|tpt|fa|vr|fr)/';

const OUCU_REGEX = '@^[a-z]{2,4}\d{1,7}$@';
Expand Down
8 changes: 5 additions & 3 deletions js/src/local-fixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,14 @@ function course_add_tesla_result_links($, resp) {
var $cm_edit_menus = $('.path-course-view .section-cm-edit-actions[ data-owner ]');
var lti_res = resp.config.lti_results;

$cm_edit_menus.each(function (idx, el) {
$cm_edit_menus.each(function () { // Was: (idx, el)
var cmid = $(this).data('owner').replace(/#module-/, '');
var $link = $(this).find('a.editing_update.cm-edit-action');
var url = '/local/tesla/views/tesla_results.php?cmid=' + cmid + (lti_res ? '' : '&noredirect=1');
var url = '/local/tesla/views/tesla_results.php?cmid=%s'.replace(/%s/, cmid);

$link.after('<a href="%s" class="dropdown-item tesla-r">TeSLA results</a>'.replace(/%s/, url));
$link
.after('<a href="%s%f" class="dropdown-item tesla-r">TeSLA results</a>'.replace(/%s/, url).replace(/%f/, '&noredirect=1'))
.after('<a href="%s" class="dropdown-item tesla-r">TeSLA results (LTI)</a>'.replace(/%s/, url));

console.warn('course-add-tesla-result-links, cmid:', cmid, url, lti_res);
});
Expand Down

0 comments on commit 359f835

Please sign in to comment.