Skip to content

Commit

Permalink
Merge pull request #1 from fontinixxl/moodle27
Browse files Browse the repository at this point in the history
Moodle27
  • Loading branch information
fontinixxl committed Sep 17, 2014
2 parents b98ed65 + 40d0231 commit a072c1f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 22 deletions.
24 changes: 2 additions & 22 deletions behaviour.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
*/
defined('MOODLE_INTERNAL') || die();

class qbehaviour_extquiz extends question_behaviour_with_save {

const IS_ARCHETYPAL = true;
class qbehaviour_extquiz extends question_behaviour_with_multiple_tries {

/**
* Special value used for {@link question_display_options::$readonly when
Expand Down Expand Up @@ -95,7 +93,6 @@ public function get_state_string($showcorrectness) {
}

$remainingattempts = $this->get_remaining_attempts();
//debugging('get_state_string: remainingattempts = ' . $remainingattempts);
return get_string('triesremaining', 'qbehaviour_interactive', $remainingattempts);
}

Expand Down Expand Up @@ -183,34 +180,17 @@ public function process_finish(question_attempt_pending_step $pendingstep) {
return question_attempt::KEEP;
}

//NOT USED

public function process_save(question_attempt_pending_step $pendingstep) {

//$status = parent::process_save($pendingstep);
//debugging("in proces saveeeeeeee!!, question = ".$this->question->name." state = ".$pendingstep->get_state());
$prevgrade = $this->qa->get_fraction();
//si la pregunta no estava puntuada (next)
if(is_null($prevgrade)){
//debugging("previous graded NULL");
$this->process_next_without_answer($pendingstep);
}else{
//list($fraction, $state) = $this->question->grade_response($prevgrade);
//die();
$pendingstep->set_fraction($prevgrade);
$pendingstep->set_state($this->qa->get_state());
}
//$pendingstep->set_state(question_state::$todo);
/*
$prevgrade = $this->qa->get_fraction();
if (!is_null($prevgrade)) { //ja ha estat puntuada
debugging("prevgraded: with grade = ".$prevgrade);
$pendingstep->set_fraction($prevgrade);
$pendingstep->set_state(question_state::$todo);
}else{
debugging("process without answer");
$this->process_next_without_answer($pendingstep);
}
*/
return question_attempt::KEEP;
}

Expand Down
43 changes: 43 additions & 0 deletions behaviourtype.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Question behaviour type for interactive behaviour.
*
* @package qbehaviour_extquiz
* @copyright 2014 Gerard Cuello <[email protected]>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/


defined('MOODLE_INTERNAL') || die();


/**
* Question behaviour type information for extquiz behaviour
*
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_extquiz_type extends question_behaviour_type {
public function is_archetypal() {
return true;
}
//New in Moodle 2.7
public function allows_multiple_submitted_responses() {
return true;
}
}

0 comments on commit a072c1f

Please sign in to comment.