$string['cannotaddcoursemodule'] = 'Could not add a new course module';
$string['cannotaddcmtosection'] = 'Could not add the new course module to that section';
$string['cannotsaveconfig'] = 'Problem saving config \"$a[0]\" as \"$a[1]\" for plugin \"$a[2]\"';
+$string['cannotsavecomment'] = 'Cannot save comment';
$string['cannotsavefile'] = 'Cannot save the file\"$a[0]\/$a[1]\"!';
$string['cannotcreatebackupdir'] = 'Could not create backupdata folder. The site administrator needs to fix the file permissions';
+$string['cannotcreatedefaultcat'] = 'Error creating a default category for context $a';
$string['cannotcreategroup'] = 'Error creating group';
$string['cannotcreatelangdir'] = 'Cannot create lang dir.';
$string['cannotcreatelangbase'] = 'Error: Could not create base lang directory.';
$string['cannotfindsite'] = 'Cannot find site-level course';
$string['cannotimportgrade'] = 'Grade import error';
$string['cannotnetgeo'] = 'Can not connect to NetGeo server at http://netgeo.caida.org, please check proxy settings or better install MaxMind GeoLite City data file.';
+$string['cannotgetcats'] = 'error getting category record';
$string['cannotgradeuser'] = 'Can not grade this user';
$string['cannotmapfield'] = 'mapping collision detected, 2 fields maps to the same grade item $a';
$string['cannotmarktopic'] = 'Could not mark that topic for this course';
$string['adminreport'] = 'Report on possible problems in your question database.';
$string['broken'] = 'This is a \"broken link\", it points to a nonexistent file.';
$string['byandon'] = 'by <em>$a->user</em> on <em>$a->time</em>';
+$string['cannotinsert'] = 'Could not insert entry in question_sessions';
+$string['cannotcreate'] = 'Could not create new entry in question_attempts table';
+$string['cannotsavequiz'] = 'Failed to save the current quiz attempt!';
$string['categorydoesnotexist'] = 'This category does not exist';
$string['categorycurrent'] = 'Current Category';
$string['categorycurrentuse'] = 'Use This Category';
$string['filesareasite']= 'the site files area';
$string['filesareacourse']= 'the course files area';
$string['filestomove']= 'Move / copy files to $a?';
+$string['formquestionnotinids'] = 'Form contained question that is not in questionids';
$string['fractionsnomax'] = 'One of the answers should have a score of 100%% so it is possible to get full marks for this question.';
$string['getcategoryfromfile'] = 'Get category from file';
$string['getcontextfromfile'] = 'Get context from file';
$session->sumpenalty = $state->sumpenalty;
$session->manualcomment = $state->manualcomment;
if (!insert_record('question_sessions', $session)) {
- print_error('Could not insert entry in question_sessions');
+ print_error('cannotinsert', 'question');
}
} else {
$session->newest = $state->id;
if (false !== ($quid = question_get_id_from_name_prefix($key))) {
// check if this is a valid id
if (!isset($questions[$quid])) {
- print_error('Form contained question that is not in questionids');
+ print_error('formquestionnotinids', 'question');
}
// Remove the name prefix from the name
$img = '';
if (!$category = get_record('question_categories', 'id', $question->category)){
- print_error('invalid category id '.$question->category);
+ print_error('invalidcategory');
}
$coursefilesdir = get_filesdir_from_context(get_context_instance_by_id($category->contextid));
$comment = trim($comment);
$state->manualcomment = $comment;
if (!set_field('question_sessions', 'manualcomment', $comment, 'attemptid', $attempt->uniqueid, 'questionid', $question->id)) {
- print_error("Cannot save comment");
+ print_error('cannotsavecomment');
}
// Update the attempt if the score has changed.
$attempt->sumgrades = $attempt->sumgrades - $state->last_graded->grade + $grade;
$attempt->timemodified = time();
if (!update_record('quiz_attempts', $attempt)) {
- print_error('Failed to save the current quiz attempt!');
+ print_error('cannotsavequiz');
}
}
$attempt = new stdClass;
$attempt->modulename = $modulename;
if (!$id = insert_record('question_attempts', $attempt)) {
- print_error('Could not create new entry in question_attempts table');
+ print_error('cannotcreate', 'question');
}
return $id;
}
// If it already exists, just return it.
foreach ($contexts as $key => $context) {
if (!$categoryrs = get_recordset_select("question_categories", "contextid = '{$context->id}'", 'sortorder, name', '*', '', 1)) {
- print_error('error getting category record');
+ print_error('cannotgetcats');
} else {
if (!$category = rs_fetch_record($categoryrs)){
// Otherwise, we need to make one
$category->sortorder = 999; // By default, all categories get this number, and are sorted alphabetically.
$category->stamp = make_unique_id_code();
if (!$category->id = insert_record('question_categories', $category)) {
- print_error('Error creating a default category for context '.print_context_name($context));
+ print_error('cannotcreatedefaultcat', '', '', print_context_name($context));
}
}
}
$courseid = SITEID;
break;
default :
- print_error('Unsupported contextlevel in category record!');
+ print_error('invalidcontext');
}
return $courseid;
}