Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 19... Línea 19...
19
 * @module    gradereport_singleview/grade
19
 * @module    gradereport_singleview/grade
20
 * @copyright 2023 Mathew May <mathew.solutions>
20
 * @copyright 2023 Mathew May <mathew.solutions>
21
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
21
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
22
 */
22
 */
23
import GradeItemSearch from 'core_grades/comboboxsearch/grade';
23
import GradeItemSearch from 'core_grades/comboboxsearch/grade';
24
import Url from 'core/url';
-
 
Línea 25... Línea 24...
25
 
24
 
26
// Define our standard lookups.
25
// Define our standard lookups.
27
const selectors = {
26
const selectors = {
28
    component: '.grade-search',
27
    component: '.grade-search',
Línea 32... Línea 31...
32
 
31
 
Línea 33... Línea 32...
33
export default class GradeItems extends GradeItemSearch {
32
export default class GradeItems extends GradeItemSearch {
Línea -... Línea 33...
-
 
33
 
-
 
34
    courseID = component.querySelector(selectors.courseid).dataset.courseid;
-
 
35
 
-
 
36
    /**
-
 
37
     * Construct the class.
34
 
38
     *
35
    courseID = component.querySelector(selectors.courseid).dataset.courseid;
39
     * @param {string} baseUrl The base URL for the page.
-
 
40
     */
36
 
41
    constructor(baseUrl) {
Línea 37... Línea 42...
37
    constructor() {
42
        super();
38
        super();
43
        this.baseUrl = baseUrl;
39
    }
44
    }
Línea 40... Línea 45...
40
 
45
 
41
    static init() {
46
    static init(baseUrl) {
42
        return new GradeItems();
47
        return new GradeItems(baseUrl);
43
    }
48
    }
44
 
49
 
45
    /**
50
    /**
46
     * Build up the link that is dedicated to a particular result.
51
     * Build up the link that is dedicated to a particular result.
47
     *
-
 
48
     * @param {Number} gradeID The ID of the grade item selected.
52
     *
49
     * @returns {string|*}
53
     * @param {Number} gradeID The ID of the grade item selected.
50
     */
54
     * @returns {string|*}
51
    selectOneLink(gradeID) {
55
     */
52
        return Url.relativeUrl('/grade/report/singleview/index.php', {
56
    selectOneLink(gradeID) {
53
            id: this.courseID,
57
        const url = new URL(this.baseUrl);
54
            gradesearchvalue: this.getSearchTerm(),
58
        url.searchParams.set('gradesearchvalue', this.getSearchTerm());