Permalink
Browse files

Merge branch 'MDL-29339_b_21' of git://github.com/timhunt/moodle into…

… MOODLE_21_STABLE
  • Loading branch information...
2 parents 35e2ec4 + 8c7d603 commit 9ee2ba4676b605e35e13b5dd506c2e77fe74b83b @stronk7 stronk7 committed Oct 24, 2011
Showing with 11 additions and 10 deletions.
  1. +11 −10 question/engine/datalib.php
@@ -111,7 +111,7 @@ public function insert_question_attempt_step(question_attempt_step $step,
$record = new stdClass();
$record->questionattemptid = $questionattemptid;
$record->sequencenumber = $seq;
- $record->state = '' . $step->get_state();
+ $record->state = (string) $step->get_state();
$record->fraction = $step->get_fraction();
$record->timecreated = $step->get_timecreated();
$record->userid = $step->get_user_id();
@@ -505,14 +505,14 @@ public function load_average_marks(qubaid_condition $qubaids, $slots = null) {
}
list($statetest, $stateparams) = $this->db->get_in_or_equal(array(
- question_state::$gaveup,
- question_state::$gradedwrong,
- question_state::$gradedpartial,
- question_state::$gradedright,
- question_state::$mangaveup,
- question_state::$mangrwrong,
- question_state::$mangrpartial,
- question_state::$mangrright), SQL_PARAMS_NAMED, 'st');
+ (string) question_state::$gaveup,
+ (string) question_state::$gradedwrong,
+ (string) question_state::$gradedpartial,
+ (string) question_state::$gradedright,
+ (string) question_state::$mangaveup,
+ (string) question_state::$mangrwrong,
+ (string) question_state::$mangrpartial,
+ (string) question_state::$mangrright), SQL_PARAMS_NAMED, 'st');
return $this->db->get_records_sql("
SELECT
@@ -818,7 +818,8 @@ protected function full_states_to_summary_state_sql() {
*/
public function in_summary_state_test($summarystate, $equal = true, $prefix = 'summarystates') {
$states = question_state::get_all_for_summary_state($summarystate);
- return $this->db->get_in_or_equal($states, SQL_PARAMS_NAMED, $prefix, $equal);
+ return $this->db->get_in_or_equal(array_map('strval', $states),
+ SQL_PARAMS_NAMED, $prefix, $equal);
}
/**

0 comments on commit 9ee2ba4

Please sign in to comment.