Showing posts with label research. Show all posts
Showing posts with label research. Show all posts

Friday, December 6, 2013

Merge items for review and survey tabs in MY Survey in research projects




Items for review and survey side by side, not in different tabs, and  move the question by scrolling. File
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\research\projects\review_survey.php
Modify
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\_templates\rp_review_survey.tmpl.php
line 29  change
<div class="row">Please refer to the tabs below and to the right to view the <?php echo($asset_string); ?> and applicable survey.</div>
to
<div class="row">Please refer to below to view the <?php echo($asset_string); ?> and applicable survey.</div>
Remove line 38-39
   <div id="project-survey" onclick="set_mod_filter('survey');">Survey</div>
   <div id="project-asset" onclick="set_mod_filter('asset');"><?php echo( ucwords($asset_string)); ?></div>

line 41 change
<div id="project-group-asset" style="display:none;">
to
<div id="project-group-asset" style="display:block; width:48%;  overflow:auto;float: left;" >
<h2><?php echo( ucwords($asset_string)); ?></h2>

line 67 change
<div id="project-group-survey" style="display:none;">
to
<div id="project-group-survey" style="display:block; width:48%; height: 800px; overflow:auto; float: right;" >
<h2>Survey</h2> <br />



In Canhealth, still keep 60% and 35%.

Under my survey, remove, video link
 http://dev.cesei.org:8080/research/projects/view_project.php?pid=48
rp_view_project.tmpl.php
rp_reviewer_details.tmpl.php
line 115 change
  echo('<a href="'.$asset_props['link'].'" class="review-item">'.$asset_props['file_name'].'</a>');
to
   echo($asset_props['file_name']);

Friday, November 29, 2013

Reviewer bug in research portal




When admin assign himself as reviewer, view_project.php hanged.
This is due to that
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\research\projects\view_project.php
line49
   $reviewer = get_reviewer($_SESSION['member_id']);
call get_reviewers function in 
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\research\_lib\projects\reviewer_tools.inc.php
get_reviewers function is very complicated to make system hanged.
Solution:
1. Reduce research database.
2.  CESEI PHP error log need to be cleaned often
C:\php5.3.1\error.log, around 9GB. Difficult to open and write.
3. Think about new algorithm to write function 
get_reviewers
Use  $start=microtime(true); $end=microtime(true); 
$end-start to get processing time in seconds in get_reviewers function.
or try
echo  date('h:i:s') . "\n";
to see time difference.
Find
  $sql = "SELECT subject_id,study_code,active,reminders FROM subjects WHERE subject_id IN(
               SELECT subject_id FROM review_slot_subjects WHERE review_slot_id
                  IN (SELECT review_slot_id FROM review_slots WHERE project_id=$pid AND review_slot_id
                     IN (SELECT review_slot_id FROM review_slot_reviewers WHERE member_id=$rid))) ORDER BY study_code";
      $result = mysql_query($sql, $db);

take about 2 minutes.
change the statement into two steps:
//step 1
$sql = "SELECT subject_id FROM review_slot_subjects WHERE review_slot_id
                  IN (SELECT review_slot_id FROM review_slots WHERE project_id=$pid AND review_slot_id
                     IN (SELECT review_slot_id FROM review_slot_reviewers WHERE member_id=$rid))";
        $result = mysql_query($sql, $db);
       $subject_id_array=array();
    while($row = mysql_fetch_assoc($result))  $subject_id_array[]=$row['subject_id'];
   //step 2
    $matches = implode(',',$subject_id_array);        
    $sql = "SELECT subject_id,study_code,active,reminders FROM subjects WHERE subject_id IN(
               $matches) ORDER BY study_code";
      $result = mysql_query($sql, $db);


The MySQl execution time is reduced to few seconds.

Thursday, November 28, 2013

Research Portal Improvements





1) Side by side video and questionnaire.  Reviewers through North America definitely want the ability to watch videos and do questionnaires side by side.  Some groups have already started using SurveyMonkey or GoogleDocs to host the surveys so they can watch the videos and do the surveys at the same time: 
Answer: check code:
http://localhost/research/projects/review_survey.php?mid=1&rid=103&sid=74&iid=132
Project: 500 test


2) Import Reviewers.  Currently, reviewers for research project needs to be added one by one.  If a user already has Research Portal membership, they still need to be added from the research membership into the research project.  After working with customers for several years, they would really like the ability to import users via CSV directly into a project.  Note: some reviewers might be reviewers in several projects.  
Answer: This will add burden of the user member database. CSV file is needed in right format. Need to think more.

3) Import tests for subjects and reviewers.  Currently each question needs to be type one by one or cut and past one by one.  It would be a lot better for CESEI admin and for Research Portal customers if we can import tests via CSV in the same way as the education portal.
Answer: This was already  done. Under test schedule, Add New Questions, upload questions tab.


4) Import Custom Study Codes.  Currently, if there are 500 subjects, and if there are unique study code chosen by the Principal Investigator for each subject, then each study code needs to be manually assigned.  Import through CSV would save a lot of time.
Answer: This was already done.  Under upload data, click subject information.



5) Cloning/copying projects. 
Answer: done, still verifying.


Customer Complaints


1.  The most frequently heard customer complaint was the load times in a research project, regardless if videos were involved or not.  We already tried reducing the bit rate and the total size of each video, and although this helps in reducing the time to stream and playback videos, it doesn’t affect the slow load times in other areas of the research portal.

Answer: OK

Wednesday, November 13, 2013

Copy research projects and permission note




Borrow the ideas to copy modules
http://localhost/admin/edu/copy_module/
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\_templates\cesei_nav.tmpl.php
line 84 add:
    <li><a href="/admin/research_projects/copy_research_projects.php">Copy Research Projects</a></li>
create research_projects under admin
create files: copy_research_projects.php, copy_rp_files.php and copy_rp.php
 Permission: (only accessed by admin, project owner and administrator. admin and owner can edit and delete the project. project administrator can only view project if project end date not expired)
http://localhost/research/projects/my_projects.php

Then Reviewer Subject Assignments, assign reviewers a subject code. Reviewers go to following address and enter study code and password
http://localhost/research/projects/take_test.php
cp*
return (hint)
Current system  is modified and  used generic code and same password, without distinguish between reviewers.
This is due to staff member manually input the test from reviewer paper result.
To do test, project end date should not be expired.
member_id in research database reviewers is connected to main database cesei_members
Only cesei member and research member can see the research tab.