[opw-web] Remove 'complete' and 'passed' from the user interface



commit af2571441525669cc870f2fe12a29ab6e5b8a381
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Apr 30 23:07:22 2017 -0400

    Remove 'complete' and 'passed' from the user interface
    
    Outreachy doesn't use the 'complete' and 'passed' fields at the moment.
    To avoid confusing mentors and scaring students, remove the ability to
    set these fields and view their current status from the user interface.

 modules/mod_view_projects.php                      |   45 --------------------
 skins/easterngreen/html/tpl_view_project.html      |   10 ----
 .../html/tpl_view_projects_editor.html             |   27 ------------
 3 files changed, 0 insertions(+), 82 deletions(-)
---
diff --git a/modules/mod_view_projects.php b/modules/mod_view_projects.php
index a983aba..47bd2fe 100644
--- a/modules/mod_view_projects.php
+++ b/modules/mod_view_projects.php
@@ -18,9 +18,7 @@ $description = $core->variable('description', '', false, true);
 $new_student = $core->variable('new_student', '', false, true);
 $new_mentor = $core->variable('new_mentor', '', false, true);
 $return_url = $core->variable('r', '');
-$is_passed = $core->variable('passed', 0);
 $late_edit = $core->variable('late_edit', '') == 'on' ? 1 : 0;
-$is_complete = $core->variable('complete', '') == 'on' ? 1 : 0;
 $page = $core->variable('pg', 1);
 $limit_start = ($page - 1) * $config->per_page;
 
@@ -70,9 +68,6 @@ if ($action == 'editor')
 {
     $page_title = $project_id == 0 ? $lang->get('submit_proposal') : $lang->get('edit_project');
 
-    // Validate pass status of student (should be 1, 0 or -1)
-    $user->restrict(in_array($is_passed, array(1, 0, -1)));
-
     if ($project_id == 0)
         $user->restrict($project_permissions->can_submit, true);
     else
@@ -94,9 +89,7 @@ if ($action == 'editor')
             $title = $project_data['title'];
             $description = $project_data['description'];
             $organization_id = $project_data['organization_id'];
-            $is_passed = $row['passed'];
             $late_edit = $project_data['late_edit'];
-            $is_complete = $project_data['is_complete'];
         }
 
         if ($organization_id != $project_data['organization_id'])
@@ -129,9 +122,6 @@ if ($action == 'editor')
     if ($description == '')
       $description = $program_data['application_prefill'];
 
-    // Only mentor/admins can mark project as complete and pass a student
-    $can_decide = ($role == 'm' && $is_owner) || $user->is_admin;
-
     // Only admins can mark a project as able to be edited late
     $can_set_late_edit = $user->is_admin;
 
@@ -152,7 +142,6 @@ if ($action == 'editor')
                             'title' => $title,
                             'description' => $description,
                             'organization_id' => $organization_id > 0 ? $organization_id : null,
-                            'is_complete' => $is_complete,
                             'is_passed' => $is_passed,
                             'new_student' => $new_student,
                             'new_mentor' => $new_mentor,
@@ -166,21 +155,10 @@ if ($action == 'editor')
                        "SET title = :title, " .
                        "    description = :description, " .
                        "    organization_id = :organization_id, " .
-                       "    is_complete = " . ($can_decide ? ":is_complete, " : "is_complete, ") .
                        "    late_edit = " . ($can_set_late_edit ? ":late_edit " : "late_edit ") .
                        "WHERE id = :project_id";
                 $db->query($sql, $params);
 
-                // Update student pass status
-                if ($can_decide)
-                {
-                    $sql = "UPDATE {$db->prefix}participants " .
-                           "SET passed = :is_passed " .
-                           "WHERE project_id = :project_id " .
-                           "AND role = 's'";
-                    $db->query($sql, $params);
-                }
-
                 // Update student name
                 if ($user->is_admin && !empty($new_student))
                 {
@@ -370,10 +348,6 @@ if ($action == 'editor')
         'subscribe_visibility'  => $skin->visibility(isset($show_subscribe)),
         'newuser_visibility'    => $skin->visibility($project_id > 0 && $user->is_admin),
         'late_edit_checked'     => $skin->checked($late_edit == 1),
-        'complete_checked'      => $skin->checked($is_complete == 1),
-        'pass_checked'          => $skin->checked($is_passed == 1),
-        'fail_checked'          => $skin->checked($is_passed == 0),
-        'undecided_checked'     => $skin->checked($is_passed == -1),
         'cancel_url'            => $cancel_url,
     ));
 
@@ -506,9 +480,6 @@ else if ($action == 'view')
         }
     }
 
-    // Convert complete indicator to yes/no
-    $complete = $project_data['is_complete'] == 1 ? $lang->get('yes') : $lang->get('no');
-
     // Convert accepted indicator to yes/no/undecided
     if ($project_data['is_accepted'] == 1)
     {
@@ -523,20 +494,6 @@ else if ($action == 'view')
         $accepted = $lang->get('undecided');
     }
 
-    // Convert passed indicator to yes/no/undecided
-    if ($passed == 1)
-    {
-        $result = $lang->get('passed');
-    }
-    else if ($passed == 0)
-    {
-        $result = $lang->get('failed');
-    }
-    else if ($passed == -1)
-    {
-        $result = $lang->get('undecided');
-    }
-
     // Only mentors and admins can view proposal status before mentor deadline
     if ($role != 'm' && !$user->is_admin && $core->timestamp < $program_data['dl_mentor'])
     {
@@ -686,8 +643,6 @@ else if ($action == 'view')
         'mentor_label'              => $mentor_label,
         'project_mentor'            => $mentor_string,
         'project_accepted'          => $accepted,
-        'project_complete'          => $complete,
-        'project_result'            => $result,
         'return_url'                => $return_url,
         'attachments_list'          => $attachments_list,
         'success_message'           => isset($success_message) ? $success_message : '',
diff --git a/skins/easterngreen/html/tpl_view_project.html b/skins/easterngreen/html/tpl_view_project.html
index f4cfefc..c55cb88 100644
--- a/skins/easterngreen/html/tpl_view_project.html
+++ b/skins/easterngreen/html/tpl_view_project.html
@@ -51,16 +51,6 @@
         <div class="span8">[[project_accepted]]</div>
     </div>
 
-    <div class="row">
-        <div class="span2">{{project_complete}}</div>
-        <div class="span8">[[project_complete]]</div>
-    </div>
-
-    <div class="row">
-        <div class="span2">{{student_result}}</div>
-        <div class="span8">[[project_result]]</div>
-    </div>
-
     <h4 class="[[attachments_visibility]]">{{attachments}}</h4>
 
     <table class="table">
diff --git a/skins/easterngreen/html/tpl_view_projects_editor.html 
b/skins/easterngreen/html/tpl_view_projects_editor.html
index d39055e..73b89e6 100644
--- a/skins/easterngreen/html/tpl_view_projects_editor.html
+++ b/skins/easterngreen/html/tpl_view_projects_editor.html
@@ -62,33 +62,6 @@
     </div>
 </div>
 
-<div class="control-group [[decision_visibility]]">
-    <label class="control-label">{{project_complete}}</label>
-    <div class="controls">
-        <input type="checkbox" name="complete" [[complete_checked]] />
-    </div>
-</div>
-
-<div class="control-group [[decision_visibility]]">
-    <label class="control-label">{{student_result}}</label>
-    <div class="controls">
-        <label class="radio">
-            <input type="radio" name="passed" value="1" [[pass_checked]] />
-            {{passed}}
-        </label>
-
-        <label class="radio">
-            <input type="radio" name="passed" value="0" [[failed_checked]] />
-            {{failed}}
-        </label>
-
-        <label class="radio">
-            <input type="radio" name="passed" value="-1" [[undecided_checked]] />
-            {{undecided}}
-        </label>
-    </div>
-</div>
-
 <div class="control-group [[newuser_visibility]]">
     <label class="control-label">{{new_student}}</label>
     <div class="controls">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]