Skip to content

Commit

Permalink
Merge pull request #38 from srobotta/php_merged_versions
Browse files Browse the repository at this point in the history
Fixed Behat Tests
  • Loading branch information
lucaboesch authored Nov 27, 2023
2 parents 1cd223f + 97d6a07 commit 1574210
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 183 deletions.
2 changes: 1 addition & 1 deletion amd/build/questionnaire.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion amd/build/questionnaire.min.js.map

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions amd/build/report.min.js

This file was deleted.

17 changes: 0 additions & 17 deletions amd/src/report.js

This file was deleted.

10 changes: 5 additions & 5 deletions classes/forms/template_criterion_delete_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ public function definition() {

foreach ($languages as $l) {
$localizedstring = [];
$localizedstring[] =& $mform->createElement('hidden', 'id', 0);
$localizedstring[] =& $mform->createElement('hidden', 'language_id', $l->get_id());
$localizedstring[] = $mform->createElement('hidden', 'id', 0);
$localizedstring[] = $mform->createElement('hidden', 'language_id', $l->get_id());
$textfieldname = get_string('text', 'verbalfeedback') . ' - ' . $l->get_language();

$style = 'disabled="disabled" wrap="virtual" rows="5" cols="50"';
$localizedstring[] =& $mform->createElement('textarea', 'string', $textfieldname, $style);
$localizedstring[] = $mform->createElement('textarea', 'string', $textfieldname, ['style' => $style]);

$groupname = 'localized_strings[' . $l->get_id() .']';
$mform->addGroup($localizedstring, $groupname, $textfieldname, [''], true, 'disabled="disabled"');
$mform->addGroup($localizedstring, $groupname, $textfieldname, [''], true, ['disabled' => 'disabled']);

$mform->setType('localized_strings[' . $l->get_id() .'][id]', PARAM_INT);
$mform->setType('localized_strings[' . $l->get_id() .'][language_id]', PARAM_INT);
$mform->setType('localized_strings[' . $l->get_id() .'][string]', PARAM_TEXT);
}

$this->add_action_buttons($cancel = true, $submitlabel = get_string('delete'));
$this->add_action_buttons(true, get_string('delete'));
}

/**
Expand Down
5 changes: 4 additions & 1 deletion classes/forms/template_criterion_edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
* The template criterion edit form
*/
class template_criterion_edit_form extends \moodleform {

/** @var int */
public $subratingcount;

/**
* The class constructor
*
Expand All @@ -51,7 +55,6 @@ public function __construct($subratingcount = 0) {
* @throws \coding_exception
*/
public function definition() {
global $CFG;
$languagerepo = new language_repository();

$mform = $this->_form; // Don't forget the underscore!
Expand Down
2 changes: 2 additions & 0 deletions classes/model/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ class report {
private $reportcategories = [];
/** @var null The result */
private $result = null;
/** @var int The instance id */
public $instanceid = 0;

/**
* The report class constructor
Expand Down
2 changes: 2 additions & 0 deletions classes/output/model/report_category_view_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ class report_category_view_model {
public $percentage;
/** @var array The criteria */
public $criteria = [];
/** @var float */
public $weight;

/**
* The report category view model class constructor
Expand Down
2 changes: 2 additions & 0 deletions classes/output/model/report_view_model.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class report_view_model {
public $radar;
/** @var array The categories */
public $categories = [];
/** @var \lang_string|string */
public $resultvsmax;

/**
* The report view model class constructor
Expand Down
16 changes: 16 additions & 0 deletions classes/output/questionnaire.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
use dml_exception;
use mod_verbalfeedback\api;
use mod_verbalfeedback\helper;
use mod_verbalfeedback\model\instance;
use mod_verbalfeedback\model\submission;
use mod_verbalfeedback\model\submission_status;
use mod_verbalfeedback\repository\instance_repository;
Expand All @@ -50,6 +51,21 @@ class questionnaire implements renderable, templatable {
/** @var bool True, if the questionnaire is rendered for preview. */
private $preview;

/** @var int $contextid */
public $contextid;

/** @var instance|null Instance of language */
public $instance;

/** @var array List of categories */
public $categories;

/** @var int The id of the student */
public $touserid;

/** @var int The id of the teacher */
public $fromuserid;

/**
* questionnaire constructor.
*
Expand Down
6 changes: 6 additions & 0 deletions classes/output/report.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ class report implements renderable, templatable {
/** @var string $reportdownloadurl The report download url. */
protected $reportdownloadurl;

/** @var ModelReport */
public $report;

/** @var int */
public $touser;

/**
* report constructor.
*
Expand Down
6 changes: 4 additions & 2 deletions classes/output/template_category_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ public function export_for_template(renderer_base $output) {
class template_category_view_model {
/** @var int The category id */
public $id;
/** @var string The category name */
public $name;
/** @var string The category edit url */
public $editurl;
/** @var string The category delete url */
public $deleteurl;
/** @var string */
public $uniquename;
/** @var int|null Nomber of criterias. */
public $criteriacount;

/**
* The template category view model class constructor
Expand Down
18 changes: 5 additions & 13 deletions classes/output/template_criterion_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,11 @@ class template_criterion_list implements renderable, templatable {
* @var array
*/
protected $templatecriteria = [];

/**
* @var
*/
protected $templatelisturl;
/**
* @var
*/
protected $templatecategorylisturl;
/**
* @var
*/
protected $templatecriterialisturl;
/**
* @var
*/
protected $newtemplatecriteriaurl;
protected $newtemplatecriterionurl;

/**
* Verbal feedback admin settings constructor.
Expand Down Expand Up @@ -115,6 +104,9 @@ class template_criterion_view_model {
*/
public $deleteurl;

/** @var int */
public $subratingcount;

/**
* The template criterion view model class constructor
*
Expand Down
4 changes: 4 additions & 0 deletions classes/output/template_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,14 @@ class template_view_model {
public $name;
/** @var string The description */
public $description;
/** @var int Number of categories */
public $categorycount;
/** @var string The edit url */
public $editurl;
/** @var string The delete url */
public $deleteurl;
/** @var string The download url */
public $downloadurl;

/**
* The template view model class constructor
Expand Down
140 changes: 0 additions & 140 deletions classes/utils/calendar_utils.php

This file was deleted.

5 changes: 5 additions & 0 deletions classes/utils/instance_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public static function register_calendar_events(instance $verbalfeedback) {

$cm = get_coursemodule_from_instance('verbalfeedback', $verbalfeedback->get_id(), $verbalfeedback->get_course());

// Get CMID if not sent as part of $verbalfeedback.
if (!isset($instance->coursemodule)) {
$verbalfeedback->coursemodule = $cm->id;
}

// Common event parameters.
$instanceid = $verbalfeedback->get_id();
$courseid = $verbalfeedback->get_course();
Expand Down

0 comments on commit 1574210

Please sign in to comment.