Skip to content

Commit

Permalink
MDL-14889 - just removed the field count. I isn't more needed.
Browse files Browse the repository at this point in the history
additionaly fixed some notice messages on restore.lib
  • Loading branch information
agrabs committed May 18, 2008
1 parent b759531 commit 239ba4e
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 151 deletions.
1 change: 0 additions & 1 deletion mod/feedback/backuplib.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ function feedback_backup_data($bf, $preferences, $feedbackid) {
fwrite ($bf,full_tag("USERID",6,false,$feedbacktracking->userid));
fwrite ($bf,full_tag("FEEDBACK",6,false,$feedbacktracking->feedback));
fwrite ($bf,full_tag("COMPLETED",6,false,$feedbacktracking->completed));
fwrite ($bf,full_tag("COUNT",6,false,$feedbacktracking->count));

//End completed
$status =fwrite ($bf,end_tag("TRACKING",5,true));
Expand Down
11 changes: 5 additions & 6 deletions mod/feedback/complete.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,11 @@
feedback_send_email_anonym($cm, $feedback, $course, $userid);
}
//tracking the submit
$multiple_count = null;
$multiple_count->userid = $USER->id;
$multiple_count->feedback = $feedback->id;
$multiple_count->completed = $new_completed_id;
$multiple_count->count = 1;
insert_record('feedback_tracking', $multiple_count);
$tracking = null;
$tracking->userid = $USER->id;
$tracking->feedback = $feedback->id;
$tracking->completed = $new_completed_id;
insert_record('feedback_tracking', $tracking);
unset($SESSION->feedback->is_started);

}else {
Expand Down
3 changes: 1 addition & 2 deletions mod/feedback/db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="feedback"/>
<FIELD NAME="feedback" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="userid" NEXT="completed"/>
<FIELD NAME="completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="feedback" NEXT="tmp_completed"/>
<FIELD NAME="tmp_completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="completed" NEXT="count"/>
<FIELD NAME="count" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="tmp_completed"/>
<FIELD NAME="tmp_completed" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="completed"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for feedback_tracking" NEXT="feedback"/>
Expand Down
7 changes: 7 additions & 0 deletions mod/feedback/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ function xmldb_feedback_upgrade($oldversion=0) {
/// Launch add field2
$result = $result && $dbman->add_field($table, $field);
}

if ($result && $oldversion < 2008050105) {
//field count is not more needed
$table = new XMLDBTable('feedback_tracking');
$field = new XMLDBField('count');
$result = $result && $dbman->drop_field($table, $field);
}
return $result;
}

Expand Down
Loading

0 comments on commit 239ba4e

Please sign in to comment.