The Elearning Community • Test feedback not behaving as expected
Page 1 of 1

Test feedback not behaving as expected

Posted: Tue Sep 15, 2020 2:00 pm
by jamesd
Hi, this is the last thing that i'm confused about right now hopefully the community have seen it before or can help?

On a test I can configure Feedback in Feedback management.

We've set up messages for the following scores: 0-30, 31-49 and 50-100 and the test is set to express the score as a percentage.

When someone finishes the test they are shown the appropriate message but for some reason they are also always shown the message for 0-30 as well (see second attachment).

Any ideas anyone?

Re: Test feedback not behaving as expected

Posted: Tue Sep 15, 2020 3:01 pm
by alfa24
In /appLms/lib/lib.assessment_rule.php

find:

Code: Select all

function  __construct($test_id) {
		$this->test_id =(int)$test_id;
		$this->db =DbConn::getInstance();
	}
replace with:

Code: Select all

function  __construct($test_id) {
		$this->test_id =(int)$test_id;
		require_once(_lms_.'/lib/lib.test.php' );
		$test_man       = new TestManagement($this->test_id);
		$this->test_info = $test_man->getTestAllInfo();
		$this->db =DbConn::getInstance();
	}
find:

Code: Select all

public function setRulesFromScore($score_arr) {
		require_once(_base_.'/lib/lib.json.php');
		require_once(_lms_.'/lib/lib.subscribe.php');

		$res =true;

		$where_score_arr =array();
		foreach($score_arr as $val) {
			$where_score_arr[]="(category_id = '".(int)$val['category_id']."' ".
				"AND from_score <= '".(int)$val['score']."' AND to_score >= '".(int)$val['score']."')";
		}
replace with:

Code: Select all

public function setRulesFromScore($score_arr) {
		require_once(_base_.'/lib/lib.json.php');
		require_once(_lms_.'/lib/lib.subscribe.php');

		$res =true;

		$where_score_arr =array();
		$where_score_arr[]="(category_id = '".(int)$score_arr[$this->test_info['point_type']]['category_id']."' ".
					"AND from_score <= '".(int)$score_arr[$this->test_info['point_type']]['score']."' AND to_score >= '".(int)$score_arr[$this->test_info['point_type']]['score']."')";

Re: Test feedback not behaving as expected

Posted: Tue Sep 15, 2020 5:04 pm
by jamesd
Yay! That worked perfectly. Thank you.

This site uses cookies.

Some of the cookies we use are essential for parts of the site to operate and have already been set. We also use Google Analytics scripts, which all use cookies.
You may delete or block all cookies from this site in your browser options.